2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								#!/usr/bin/env bash
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-01 13:37:29 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Copyright (c) 2021-2025 tteck 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# Author: tteck (tteckster) 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:46:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Co-Author: michelroegl-brunner 
							 
						 
					
						
							
								
									
										
										
										
											2025-03-04 17:54:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Source: https://stonith404.github.io/pingvin-share/introduction 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-01 10:25:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								source  /dev/stdin <<< " $FUNCTIONS_FILE_PATH " 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								color
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								verb_ip6
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								catch_errors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								setting_up_container
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								network_check
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								update_os
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								msg_info "Installing Dependencies" 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:46:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								$STD  apt-get install -y \
 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-27 13:48:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  git
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								msg_ok "Installed Dependencies" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-05-27 13:48:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								NODE_VERSION = "22"  NODE_MODULE = "pm2"  install_node_and_modules
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								msg_info "Installing Pingvin Share (Patience)" 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:46:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								cd  /opt
							 
						 
					
						
							
								
									
										
										
										
											2025-04-01 10:25:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								RELEASE = $( curl -fsSL https://api.github.com/repos/stonith404/pingvin-share/releases/latest |  grep "tag_name"  |  awk '{print substr($2, 3, length($2)-4) }' ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-28 14:45:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								curl -fsSL " https://github.com/stonith404/pingvin-share/archive/refs/tags/v ${ RELEASE } .zip "  -o " v ${ RELEASE } .zip " 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-28 11:25:13 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								$STD  unzip v${ RELEASE } .zip
							 
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:46:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								echo  " ${ RELEASE } "  >"/opt/pingvin_version.txt" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mv pingvin-share-${ RELEASE }  /opt/pingvin-share
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								cd  /opt/pingvin-share/backend
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								$STD  npm install
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$STD  npm run build
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$STD  pm2 start --name= "pingvin-share-backend"  npm -- run prod
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								cd  ../frontend
							 
						 
					
						
							
								
									
										
										
										
											2024-07-13 13:28:19 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								sed -i '/"admin.config.smtp.allow-unauthorized-certificates":\|admin.config.smtp.allow-unauthorized-certificates.description":/,+1d'  ./src/i18n/translations/fr-FR.ts
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								$STD  npm install
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$STD  npm run build
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$STD  pm2 start --name= "pingvin-share-frontend"  npm -- run start
							 
						 
					
						
							
								
									
										
										
										
											2025-04-01 10:25:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								$STD  pm2 startup systemd
							 
						 
					
						
							
								
									
										
										
										
											2024-10-20 23:03:21 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								$STD  pm2 save
							 
						 
					
						
							
								
									
										
										
										
											2025-05-27 13:48:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								echo  " ${ RELEASE } "  >" /opt/ ${ APPLICATION } _version.txt " 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								msg_ok "Installed Pingvin Share" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								motd_ssh
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								customize
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								msg_info "Cleaning up" 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:46:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								rm -rf /opt/v${ RELEASE } .zip
							 
						 
					
						
							
								
									
										
										
										
											2024-05-02 13:26:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								$STD  apt-get -y autoremove
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$STD  apt-get -y autoclean
							 
						 
					
						
							
								
									
										
										
										
											2023-10-05 01:15:20 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								msg_ok "Cleaned"