mirror of
				https://gitlab.com/octospacc/Configs.git
				synced 2025-06-05 21:59:36 +02:00 
			
		
		
		
	Update Server
This commit is contained in:
		| @@ -3,7 +3,11 @@ cd "$( dirname "$( realpath "$0" )" )" | |||||||
| cd ./Root | cd ./Root | ||||||
|  |  | ||||||
| cp -v /etc/diycron ./etc/diycron | cp -v /etc/diycron ./etc/diycron | ||||||
| # nginx was done manually |  | ||||||
|  |  | ||||||
| cp -v /Server/Scripts/Backup/*.sh ./Server/Scripts/Backup/ | cp -v \ | ||||||
| cp -v /Server/Scripts/Backup/*.cfg ./Server/Scripts/Backup/ | 	/etc/nginx/sites-available/*.conf /etc/nginx/sites-available/*.old \ | ||||||
|  | 	./etc/nginx/sites-available/ | ||||||
|  |  | ||||||
|  | cp -v \ | ||||||
|  | 	/Server/Scripts/Backup/*.sh /Server/Scripts/Backup/*.cfg \ | ||||||
|  | 	./Server/Scripts/Backup/ | ||||||
|   | |||||||
| @@ -5,11 +5,13 @@ BackupsBase="/media/Disk/Backup" | |||||||
| # ScriptDir="$( dirname "$( realpath "$0" )" )" | # ScriptDir="$( dirname "$( realpath "$0" )" )" | ||||||
| # cd "$ScriptDir" | # cd "$ScriptDir" | ||||||
|  |  | ||||||
| RunDate="$(date +%F)" | RunDate="$(date +%F)" # Current date in YYYY-MM-DD format | ||||||
| cd "${BackupsBase}" | cd "${BackupsBase}" | ||||||
|  |  | ||||||
| . ./.BackupSecrects.sec | . ./.BackupSecrects.sec | ||||||
|  |  | ||||||
|  | # Generate a good key for encrypting files, based on a primary secret key and a secondary string | ||||||
|  | # NOTE to self: Use this same function to get decryption key, plugging the YYYY-MM-DD date of the Git commit as $2 | ||||||
| Hash2() { | Hash2() { | ||||||
| 	BaseKey="$1" | 	BaseKey="$1" | ||||||
| 	SecStr="$2" | 	SecStr="$2" | ||||||
|   | |||||||
| @@ -14,14 +14,34 @@ GitPullPushPath() { | |||||||
| 	cd "${BackPath}" | 	cd "${BackPath}" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | BackPathCrypt() { | ||||||
|  | 	Folder="$1" | ||||||
|  | 	Key="$2" | ||||||
|  | 	Ext="$([ -z "$3" ] && echo ".tar.xz" || echo "$3")" | ||||||
|  | 	cp "../${Folder}/Latest${Ext}" "./${Folder}${Ext}" && \ | ||||||
|  | 	ccencryptNow "./${Folder}${Ext}" "${Key}" | ||||||
|  | } | ||||||
|  |  | ||||||
| cd ./Server-Backup-Limited | cd ./Server-Backup-Limited | ||||||
| Item="Invidious-User" && cp "../${Item}/Latest.7z" "./${Item}.7z" && ccencryptNow "./${Item}.7z" "${BackupKey_Git_Invidious}" | BackPathCrypt "Invidious-User" "${BackupKey_Git_Invidious}" ".7z" | ||||||
| Item="wallabag-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_wallabag}" | #BackPathCrypt "wallabag-data" "${BackupKey_Git_wallabag}" | ||||||
| Item="FreshRSS-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_FreshRSS}" | BackPathCrypt "FreshRSS-data" "${BackupKey_Git_FreshRSS}" | ||||||
|  | #BackPathCrypt "shiori-data" "${BackupKey_Git_Shiori}" | ||||||
|  | #Item="Invidious-User" && cp "../${Item}/Latest.7z" "./${Item}.7z" && ccencryptNow "./${Item}.7z" "${BackupKey_Git_Invidious}" | ||||||
|  | #Item="wallabag-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_wallabag}" | ||||||
|  | #Item="FreshRSS-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_FreshRSS}" | ||||||
|  | #Item="shiori-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_Shiori}" | ||||||
|  | GitPush | ||||||
|  | cd .. | ||||||
|  |  | ||||||
|  | cd ./Articles-Backup-Private | ||||||
|  | rm -rf ./shiori-data | ||||||
|  | cp -r "../shiori-data/Latest.d" "./shiori-data" | ||||||
| GitPush | GitPush | ||||||
| cd .. | cd .. | ||||||
|  |  | ||||||
| GitPullPushPath "/Cloud/Repos/Personal-Game-Saves" | GitPullPushPath "/Cloud/Repos/Personal-Game-Saves" | ||||||
|  | #GitPullPushPath "/media/Disk/Configs" | ||||||
|  |  | ||||||
| #CloudDir="/home/octo/Cloud" | #CloudDir="/home/octo/Cloud" | ||||||
| #cd "$CloudDir" | #cd "$CloudDir" | ||||||
|   | |||||||
| @@ -4,13 +4,18 @@ | |||||||
| . "$(dirname "$(realpath "$0")")/BackupGlobals.cfg" | . "$(dirname "$(realpath "$0")")/BackupGlobals.cfg" | ||||||
|  |  | ||||||
| SimpleBackup() { | SimpleBackup() { | ||||||
|  | 	# $1: Folder | ||||||
|  | 	# $2: Optional prefix in /Server path | ||||||
| 	mkdir -p "./$1" | 	mkdir -p "./$1" | ||||||
| 	tar cvJSf "./$1/${RunDate}.tar.xz" "/Server/$1" && \ | 	tar cvJSf "./$1/${RunDate}.tar.xz" "/Server/$2/$1" && \ | ||||||
| 	cp "./$1/${RunDate}.tar.xz" "./$1/Latest.tar.xz" | 	cp "./$1/${RunDate}.tar.xz" "./$1/Latest.tar.xz" | ||||||
|  | 	rm -rf "./$1/Latest.d" | ||||||
|  | 	cp -r "/Server/$2/$1" "./$1/Latest.d" | ||||||
| } | } | ||||||
|  |  | ||||||
| SimpleBackup "wallabag-data" | #SimpleBackup "wallabag-data" | ||||||
| SimpleBackup "FreshRSS-data" | SimpleBackup "FreshRSS-data" | ||||||
|  | SimpleBackup "shiori-data" "Shiori" | ||||||
|  |  | ||||||
| # GoToSocial | # GoToSocial | ||||||
| #Name="GoToSocial" | #Name="GoToSocial" | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ do | |||||||
| 	# Declaration of all cronjobs like they are normal shell commands, made easy thanks to integrated functions. | 	# Declaration of all cronjobs like they are normal shell commands, made easy thanks to integrated functions. | ||||||
|  |  | ||||||
| 	# Daily checking for if the script is working | 	# Daily checking for if the script is working | ||||||
| 		Ifn $Job1 && If $(IsDayMin $(hm2s 5 30)) && date > /tmp/CronTest.log && Job1=1 | 		Ifn $Job1 && If $(IsDayMin $(hm2s 5 30)) && date > /tmp/CronTest.log && journalctl -u diycron >> /tmp/CronTest.log && Job1=1 | ||||||
| 	# RSS to Misskey at HH:15 and HH:45 | 	# RSS to Misskey at HH:15 and HH:45 | ||||||
| 	#	If $(IsHourMin 15) || If $(IsHourMin 45) && sudo -u pi /Server/Bots/RSSToMisskey/Run.RSSToMisskey | 	#	If $(IsHourMin 15) || If $(IsHourMin 45) && sudo -u pi /Server/Bots/RSSToMisskey/Run.RSSToMisskey | ||||||
| 	# Downsync updated content to the sitoctt and push | 	# Downsync updated content to the sitoctt and push | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								Server/Root/etc/nginx/sites-available/analytics.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Server/Root/etc/nginx/sites-available/analytics.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | server { | ||||||
|  | 	listen 443 ssl; | ||||||
|  | 	server_name private-analytics-not-for-public-use.octt.eu.org; | ||||||
|  | 	ssl_certificate /etc/letsencrypt/live/private-analytics-not-for-public-use.octt.eu.org/fullchain.pem; | ||||||
|  | 	ssl_certificate_key /etc/letsencrypt/live/private-analytics-not-for-public-use.octt.eu.org/privkey.pem; | ||||||
|  | 	ssl_prefer_server_ciphers on; | ||||||
|  | 	location /octtkb/ { | ||||||
|  | 		#resolver 9.9.9.9; | ||||||
|  | 		proxy_http_version 1.1; | ||||||
|  | 		proxy_pass https://octtkb.goatcounter.com/; | ||||||
|  | 		proxy_set_header Host "octtkb.goatcounter.com"; | ||||||
|  | 		proxy_set_header X-Real-IP $remote_addr; | ||||||
|  | 		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
|  | 		proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|  | 		proxy_set_header Upgrade $http_upgrade; | ||||||
|  | 		proxy_set_header Connection "upgrade"; | ||||||
|  | 	} | ||||||
|  | } | ||||||
							
								
								
									
										33
									
								
								Server/Root/etc/nginx/sites-available/articles.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								Server/Root/etc/nginx/sites-available/articles.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | |||||||
|  | server { | ||||||
|  | 	listen 443 ssl; | ||||||
|  | 	server_name articles.octt.eu.org; | ||||||
|  | 	ssl_certificate /etc/letsencrypt/live/articles.octt.eu.org/fullchain.pem; | ||||||
|  | 	ssl_certificate_key /etc/letsencrypt/live/articles.octt.eu.org/privkey.pem; | ||||||
|  | 	ssl_prefer_server_ciphers on; | ||||||
|  | 	location / { | ||||||
|  | 		proxy_http_version 1.1; | ||||||
|  | 		proxy_pass http://localhost:8076; | ||||||
|  | 		proxy_set_header X-Real-IP $remote_addr; | ||||||
|  | 		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
|  | 		proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|  | 		proxy_set_header Upgrade $http_upgrade; | ||||||
|  | 		proxy_set_header Connection "upgrade"; | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | server { | ||||||
|  | 	listen 443 ssl; | ||||||
|  | 	server_name ShioriFeed.octt.eu.org; | ||||||
|  | 	ssl_certificate /etc/letsencrypt/live/shiorifeed.octt.eu.org/fullchain.pem; | ||||||
|  | 	ssl_certificate_key /etc/letsencrypt/live/shiorifeed.octt.eu.org/privkey.pem; | ||||||
|  | 	ssl_prefer_server_ciphers on; | ||||||
|  | 	location / { | ||||||
|  | 		proxy_http_version 1.1; | ||||||
|  | 		proxy_pass http://localhost:8176; | ||||||
|  | 		proxy_set_header X-Real-IP $remote_addr; | ||||||
|  | 		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
|  | 		proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|  | 		proxy_set_header Upgrade $http_upgrade; | ||||||
|  | 		proxy_set_header Connection "upgrade"; | ||||||
|  | 	} | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user