mirror of
				https://gitlab.com/octospacc/Configs.git
				synced 2025-06-05 21:59:36 +02:00 
			
		
		
		
	.
This commit is contained in:
		| @@ -35,6 +35,7 @@ const ccencryptNow = async (File, BaseKey) => { | |||||||
| //}; | //}; | ||||||
|  |  | ||||||
| //const GitPullPush = async (user) => await ExecAs(`git pull; git add . && git commit -m "Auto-Backup ${Time}" && git push || true`, user); | //const GitPullPush = async (user) => await ExecAs(`git pull; git add . && git commit -m "Auto-Backup ${Time}" && git push || true`, user); | ||||||
|  | const GitReclone = async (path, url) => await $`rm -rf ${path}.old || true; mv ${path} ${path}.old; git clone --depth 1 ${url}`; | ||||||
| const GitPullPush = async () => await $`git pull; git add .; git commit -m "Auto-Backup ${Time}" || true; git push || true`; | const GitPullPush = async () => await $`git pull; git add .; git commit -m "Auto-Backup ${Time}" || true; git push || true`; | ||||||
|  |  | ||||||
| const BackPathCrypt = async (Folder, Key, Ext) => { | const BackPathCrypt = async (Folder, Key, Ext) => { | ||||||
| @@ -44,7 +45,7 @@ const BackPathCrypt = async (Folder, Key, Ext) => { | |||||||
| 	await ccencryptNow(`./${File}`, Key); | 	await ccencryptNow(`./${File}`, Key); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const SimpleCompress = async (Dst, Src) => await $`rm ${Dst}.tar.xz || true; tar cJSf "${Dst}.tar.xz" ${Src}`; | const SimpleCompress = async (dst, src) => await $`rm ${dst}.tar.xz || true; tar cJSf "${dst}.tar.xz" ${dst || src}`; | ||||||
|  |  | ||||||
| const SimpleBackup = async (Folder, Prefix) => { | const SimpleBackup = async (Folder, Prefix) => { | ||||||
| 	await $`mkdir -vp ./${Folder}`; | 	await $`mkdir -vp ./${Folder}`; | ||||||
| @@ -55,7 +56,23 @@ const SimpleBackup = async (Folder, Prefix) => { | |||||||
| 	await $`ln -s ./${Time.Stamp}.tar.xz ./${Folder}/Latest.tar.xz`; | 	await $`ln -s ./${Time.Stamp}.tar.xz ./${Folder}/Latest.tar.xz`; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const Work = async (Job) => await within(Jobs[Job]); | const AltervistaFullBackup = async (domain) => { | ||||||
|  | 	const [user, pass, key] = Secrets[`${domain.replaceAll('.', '_')}_Backup_Tokens`].split(':'); | ||||||
|  | 	cd(`./${domain}-Git`); | ||||||
|  | 	await $`rclone sync ${domain}:/ ./www/wp-content/ --progress || true`; | ||||||
|  | 	await $`curl -u ${user}:${pass} https://${domain}/wp-json/octt-export-rest/v1/xrss-export?token=${key} > ./WordPress.xml || true`; | ||||||
|  | 	await GitPullPush(); | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | const LampBackup = async (folder, table) => { | ||||||
|  | 	await SimpleBackup(folder, 'www'); | ||||||
|  | 	await $`lxc-attach Debian2023 -- mariadb-dump ${table || folder} > ./${folder}/Db.Latest.sql`; | ||||||
|  | 	await SimpleCompress(`./${folder}/Db.${Time.Stamp}.sql`, `./${folder}/Db.Latest.sql`); | ||||||
|  | 	await $`rm ./${folder}/Db.Latest.sql.tar.xz || true`; | ||||||
|  | 	await $`ln -s "./Db.${Time.Stamp}.sql.tar.xz" ./${folder}/Db.Latest.sql.tar.xz`; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | const Work = async (job) => await within(Jobs[job]); | ||||||
|  |  | ||||||
| //////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// | ||||||
|  |  | ||||||
| @@ -72,6 +89,7 @@ Jobs.Local_Shiori = async()=>{ | |||||||
| }; | }; | ||||||
|  |  | ||||||
| Jobs.Local_SpaccBBS = async()=>{ | Jobs.Local_SpaccBBS = async()=>{ | ||||||
|  | 	// ... await LampBackup('SpaccBBS', 'phpBB'); | ||||||
| 	await SimpleBackup('SpaccBBS', 'www'); | 	await SimpleBackup('SpaccBBS', 'www'); | ||||||
| 	await $`lxc-attach Debian2023 -- mariadb-dump phpBB > ./SpaccBBS/Db.Latest.sql`; | 	await $`lxc-attach Debian2023 -- mariadb-dump phpBB > ./SpaccBBS/Db.Latest.sql`; | ||||||
| 	await SimpleCompress(`./SpaccBBS/Db.${Time.Stamp}.sql`, './SpaccBBS/Db.Latest.sql'); | 	await SimpleCompress(`./SpaccBBS/Db.${Time.Stamp}.sql`, './SpaccBBS/Db.Latest.sql'); | ||||||
| @@ -79,31 +97,26 @@ Jobs.Local_SpaccBBS = async()=>{ | |||||||
| 	await $`ln -s "./Db.${Time.Stamp}.sql.tar.xz" ./SpaccBBS/Db.Latest.sql.tar.xz`; | 	await $`ln -s "./Db.${Time.Stamp}.sql.tar.xz" ./SpaccBBS/Db.Latest.sql.tar.xz`; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | Jobs.Local_liminalgici = async()=>{ | ||||||
|  | 	await LampBackup('pixelfed_liminalgici'); | ||||||
|  | }; | ||||||
|  |  | ||||||
| Jobs.Mixed_OctospaccAltervista = async()=>{ | Jobs.Mixed_OctospaccAltervista = async()=>{ | ||||||
| 	const Domain = 'octospacc.altervista.org'; | 	await AltervistaFullBackup('octospacc.altervista.org'); | ||||||
| 	cd(`./${Domain}-Git`); |  | ||||||
| 	await $`rclone sync ${Domain}:/ ./www/wp-content/ --progress`; |  | ||||||
| 	//await $`curl 'https://${Domain}/wp-admin/export.php?download=true&content=all&cat=0&post_author=0&post_start_date=0&post_end_date=0&post_status=0&page_author=0&page_start_date=0&page_end_date=0&page_status=0&attachment_start_date=0&attachment_end_date=0&submit=Scarica+il+file+di+esportazione' -H 'User-Agent: ${GenericBrowserUserAgent}' -H 'Referer: https://${Domain}/wp-admin/export.php' -H 'Connection: keep-alive' -H 'Cookie: ${Secrets.OctospaccAltervista_Backup_Cookie}' > ./WordPress.xml`; |  | ||||||
| 	const args = [ |  | ||||||
| 		`https://${Domain}/wp-admin/export.php?download=true&content=all&cat=0&post_author=0&post_start_date=0&post_end_date=0&post_status=0&page_author=0&page_start_date=0&page_end_date=0&page_status=0&attachment_start_date=0&attachment_end_date=0&submit=Scarica+il+file+di+esportazione`, |  | ||||||
| 		'-H', 'Connection: keep-alive', |  | ||||||
| 		'-H', `User-Agent: ${GenericBrowserUserAgent}`, |  | ||||||
| 		'-H', `Referer: https://${Domain}/wp-admin/export.php`, |  | ||||||
| 		'-H', `Cookie: ${Secrets.OctospaccAltervista_Backup_Cookie}`, |  | ||||||
| 	]; |  | ||||||
| 	await $`curl ${args} > ./WordPress.xml`; |  | ||||||
| 	await GitPullPush(); |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | // TODO: setup FTP access and Cookie | ||||||
| Jobs.Mixed_SpacccraftAltervista = async()=>{ | Jobs.Mixed_SpacccraftAltervista = async()=>{ | ||||||
| 	// ... | 	await AltervistaFullBackup('spacccraft.altervista.org', Secrets.SpacccraftAltervista_Backup_Cookie); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | // TODO: everything | ||||||
| Jobs.Exter_WikiSpacc = async()=>{ | Jobs.Exter_WikiSpacc = async()=>{ | ||||||
| 	// ... | 	// ... | ||||||
| }; | }; | ||||||
|  |  | ||||||
| Jobs.Cloud_ServerBackupLimited = async()=>{ | Jobs.Cloud_ServerBackupLimited = async()=>{ | ||||||
|  | 	await GitReclone('Server-Backup-Limited', 'https://gitlab.com/octospacc/Server-Backup-Limited/'); | ||||||
| 	cd('./Server-Backup-Limited'); | 	cd('./Server-Backup-Limited'); | ||||||
| 	await BackPathCrypt('FreshRSS', Secrets.BackupKey_Git_FreshRSS); | 	await BackPathCrypt('FreshRSS', Secrets.BackupKey_Git_FreshRSS); | ||||||
| 	await BackPathCrypt('n8n-data', Secrets.BackupKey_Git_n8n); | 	await BackPathCrypt('n8n-data', Secrets.BackupKey_Git_n8n); | ||||||
| @@ -130,6 +143,19 @@ Jobs.Cloud_SpaccBBS = async()=>{ | |||||||
| 	await GitPullPush(); | 	await GitPullPush(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | Jobs.Cloud_liminalgici = async()=>{ | ||||||
|  | 	cd('./liminalgici.spacc.eu.org-Git'); | ||||||
|  | 	await $`rm -rf ./pixelfed_liminalgici || true`; | ||||||
|  | 	await $`cp -rp ../pixelfed_liminalgici/Latest.d ./pixelfed_liminalgici`; | ||||||
|  | 	await $`cp ../pixelfed_liminalgici/Db.Latest.sql.tar.xz ./Db.sql.tar.xz`; | ||||||
|  | 	await SimpleCompress('./pixelfed_liminalgici/config'); | ||||||
|  | 	await $`rm -rf ./pixelfed_liminalgici/config || true`; | ||||||
|  | 	for (let File of ['Db.sql.tar.xz', './pixelfed_liminalgici/.env', './pixelfed_liminalgici/config.tar.xz']) { | ||||||
|  | 		await ccencryptNow(`./${File}`, Secrets.BackupKey_Git_liminalgici); | ||||||
|  | 	}; | ||||||
|  | 	await GitPullPush(); | ||||||
|  | }; | ||||||
|  |  | ||||||
| Jobs.Cloud_SpaccCraft = async()=>{ | Jobs.Cloud_SpaccCraft = async()=>{ | ||||||
| 	const McServer="SpaccCraft"; | 	const McServer="SpaccCraft"; | ||||||
| 	const McEdition="Beta-1.7.3"; | 	const McEdition="Beta-1.7.3"; | ||||||
| @@ -152,14 +178,18 @@ Jobs.Cloud_Private = async()=> await $`sudo -u tux rclone sync /Main/Clouds/octt | |||||||
| await Work('Local_MiscSimpleBackups'); | await Work('Local_MiscSimpleBackups'); | ||||||
| await Work('Local_Shiori'); | await Work('Local_Shiori'); | ||||||
| await Work('Local_SpaccBBS'); | await Work('Local_SpaccBBS'); | ||||||
|  | await Work('Local_liminalgici'); | ||||||
|  | //await Work('Local_Doku'); | ||||||
|  |  | ||||||
| await Work('Mixed_OctospaccAltervista'); | await Work('Mixed_OctospaccAltervista'); | ||||||
| await Work('Mixed_SpacccraftAltervista'); | //await Work('Mixed_SpacccraftAltervista'); | ||||||
| await Work('Exter_WikiSpacc'); | //await Work('Exter_WikiSpacc'); | ||||||
|  |  | ||||||
| await Work('Cloud_ServerBackupLimited'); | await Work('Cloud_ServerBackupLimited'); | ||||||
| await Work('Cloud_ArticlesBackupPrivate'); | await Work('Cloud_ArticlesBackupPrivate'); | ||||||
| await Work('Cloud_SpaccBBS'); | await Work('Cloud_SpaccBBS'); | ||||||
|  | await Work('Cloud_liminalgici'); | ||||||
|  | //await Work('Cloud_Doku'); | ||||||
| await Work('Cloud_SpaccCraft'); | await Work('Cloud_SpaccCraft'); | ||||||
| await Work('Cloud_Private'); | await Work('Cloud_Private'); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,7 +20,9 @@ for Dir in \ | |||||||
| done | done | ||||||
|  |  | ||||||
| chown -R 100033:100033 /Main/Server/www | chown -R 100033:100033 /Main/Server/www | ||||||
| #chmod -R 775 /Main/Server/www |  | ||||||
| chmod -R 777 /Main/Server/www | chmod -R 777 /Main/Server/www | ||||||
|  |  | ||||||
|  | chmod -R 777 /Main/Server/WuppiMini | ||||||
|  |  | ||||||
|  | chown -R tux:tux /Main/Backup/ | ||||||
| chown -R tux:tux /Main/Clouds/octt/ | chown -R tux:tux /Main/Clouds/octt/ | ||||||
|   | |||||||
| @@ -39,9 +39,9 @@ T.is = (question) => { | |||||||
| 		}[word]; | 		}[word]; | ||||||
| 		if (predicate.endsWith('_') && predicate.startsWith('_')) { | 		if (predicate.endsWith('_') && predicate.startsWith('_')) { | ||||||
| 			!((oracle % question[predicate]) == 0) && (allTrue = false); | 			!((oracle % question[predicate]) == 0) && (allTrue = false); | ||||||
| 		} else if (predicate.endsWith('_')) { | 		} else if (predicate.endsWith('_')) {   // w_ | ||||||
| 			!(oracle <= question[predicate]) && (allTrue = false); | 			!(oracle <= question[predicate]) && (allTrue = false); | ||||||
| 		} else if (predicate.startsWith('_')) { | 		} else if (predicate.startsWith('_')) { // _w | ||||||
| 			!(oracle >= question[predicate]) && (allTrue = false); | 			!(oracle >= question[predicate]) && (allTrue = false); | ||||||
| 		} else { | 		} else { | ||||||
| 			!(oracle == question[predicate]) && (allTrue = false); | 			!(oracle == question[predicate]) && (allTrue = false); | ||||||
| @@ -52,8 +52,11 @@ T.is = (question) => { | |||||||
|  |  | ||||||
| /////////////////////////////////////// | /////////////////////////////////////// | ||||||
|  |  | ||||||
| T.is({ _D_:'2', h:'03', m_:'10' }) |  | ||||||
| 	&& Work('Backup', ()=>{ $`zx /Main/Server/Scripts/BackupAll.zx.mjs` }); | //T.is({ /*_D_:'2',*/ h:'03', m_:'10' }) && (T.D % 2 === 0) | ||||||
|  | //T.is({ _D_:'3', h:'12', m:'00' }) | ||||||
|  | //T.is({ h:'03', m_:'10' }) && (T.D % 3 === 0) | ||||||
|  | //	&& Work('Backup', ()=>{ $`zx /Main/Server/Scripts/BackupAll.zx.mjs` }); | ||||||
|  |  | ||||||
| T.is({ _D_:'9', h:'02', m_:'30' }) | T.is({ _D_:'9', h:'02', m_:'30' }) | ||||||
| 	&& Work('Certs', ()=>{ $`sh /Main/Server/Scripts/RenewCerts.sh` }); | 	&& Work('Certs', ()=>{ $`sh /Main/Server/Scripts/RenewCerts.sh` }); | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								Server/Root/etc/nginx/sites-available/Wuppi.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								Server/Root/etc/nginx/sites-available/Wuppi.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | server { | ||||||
|  | 	listen 80; | ||||||
|  | 	listen 443 ssl; | ||||||
|  | 	server_name WuppiMini.octt.eu.org WuppiMini.spaccsoj3trhzowrrblzb5m6hgkwu6syghnmhett7gvxbrz5zhsrs4ad.onion; | ||||||
|  | 	ssl_certificate /etc/letsencrypt/live/wuppimini.octt.eu.org/fullchain.pem; | ||||||
|  | 	ssl_certificate_key /etc/letsencrypt/live/wuppimini.octt.eu.org/privkey.pem; | ||||||
|  | 	ssl_prefer_server_ciphers on; | ||||||
|  | 	error_log /var/log/nginx/Wuppi.error.log; | ||||||
|  | 	access_log /var/log/nginx/Wuppi.access.log; | ||||||
|  | 	location / { | ||||||
|  | 		proxy_http_version 1.1; | ||||||
|  | 		proxy_pass http://localhost:8135; | ||||||
|  | 		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"; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -13,6 +13,10 @@ server { | |||||||
| 	#	proxy_set_header Upgrade $http_upgrade; | 	#	proxy_set_header Upgrade $http_upgrade; | ||||||
| 	#} | 	#} | ||||||
|  |  | ||||||
|  | 	location / { | ||||||
|  | 		root /Main/Server/www/root-private; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	location /phpmyadmin/ { | 	location /phpmyadmin/ { | ||||||
| 		root /usr/share; | 		root /usr/share; | ||||||
| 		try_files $uri $uri/; | 		try_files $uri $uri/; | ||||||
|   | |||||||
							
								
								
									
										42
									
								
								Server/Root/etc/nginx/sites-available/doku.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								Server/Root/etc/nginx/sites-available/doku.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | |||||||
|  | server { | ||||||
|  | 	listen 80; | ||||||
|  | 	listen 443 ssl; | ||||||
|  | 	server_name doku.spacc.eu.org; | ||||||
|  | 	ssl_certificate /etc/letsencrypt/live/doku.spacc.eu.org/fullchain.pem; | ||||||
|  | 	ssl_certificate_key /etc/letsencrypt/live/doku.spacc.eu.org/privkey.pem; | ||||||
|  | 	ssl_prefer_server_ciphers on; | ||||||
|  | 	root /Main/Server/www/dokuwiki; | ||||||
|  | 	index doku.php; | ||||||
|  |  | ||||||
|  | 	# Loggers | ||||||
|  | 	error_log /var/log/nginx/Doku.error.log; | ||||||
|  | 	access_log /var/log/nginx/Doku.access.log; | ||||||
|  |  | ||||||
|  | 	#Remember to comment the below out when you're installing, and uncomment it when done. | ||||||
|  | 	#location ~ /(conf/|bin/|inc/|vendor/|install.php) { deny all; } | ||||||
|  |  | ||||||
|  | 	#Support for X-Accel-Redirect | ||||||
|  | 	location ~ ^/data/ { internal ; } | ||||||
|  |  | ||||||
|  | 	location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$ { | ||||||
|  | 		expires 365d; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	location / { try_files $uri $uri/ @dokuwiki; } | ||||||
|  |  | ||||||
|  | 	location @dokuwiki { | ||||||
|  | 		# rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki config page | ||||||
|  | 		rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; | ||||||
|  | 		rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; | ||||||
|  | 		rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; | ||||||
|  | 		rewrite ^/(.*) /doku.php?id=$1&$args last; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	location ~ \.php$ { | ||||||
|  | 		try_files $uri $uri/ /doku.php; | ||||||
|  | 		include fastcgi_params; | ||||||
|  | 		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||||||
|  | 		fastcgi_param REDIRECT_STATUS 200; | ||||||
|  | 		fastcgi_pass php; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -39,12 +39,25 @@ server { | |||||||
| 		fastcgi_param PATH_INFO $path_info; | 		fastcgi_param PATH_INFO $path_info; | ||||||
| 		include fastcgi_params; | 		include fastcgi_params; | ||||||
| 		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | 		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||||||
| 	} | 		sub_filter '</body>' '<link rel="stylesheet" href="/user.css"/><script src="/Res/User/FreshRSS/Tweaks.js"></script></body>'; | ||||||
|  |  | ||||||
| 	location / { |  | ||||||
| 		try_files $uri $uri/ index.php; |  | ||||||
| 		sub_filter '</body>' '<script> function ForceUpdateFeeds(){ var Count = 0; Array.from(document.querySelectorAll(atob("KltpZF49ImZfIl0uaXRlbS5mZWVk"))).forEach(function(El){ Count++; fetch(location.origin + "/i/?c=feed&a=actualize&id=" + El.id.split("_")[1]); }); setTimeout(function(){ location.reload(); }, Count * 4000); }; </script></body>'; |  | ||||||
| 		sub_filter '<a id="actualize"' '<a class="btn" href="#" title="Force update feeds" onclick="javascript:ForceUpdateFeeds();">Force update feeds</a><a id="actualize"'; | 		sub_filter '<a id="actualize"' '<a class="btn" href="#" title="Force update feeds" onclick="javascript:ForceUpdateFeeds();">Force update feeds</a><a id="actualize"'; | ||||||
| 		sub_filter_once on; | 		sub_filter_once on; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	location /Res/User/FreshRSS/ { | ||||||
|  | 		proxy_pass http://127.0.0.1/Res/User/FreshRSS/; | ||||||
|  | 		proxy_set_header Host hlb0.octt.eu.org; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	location /user.css { | ||||||
|  | 		add_header Content-Type text/css; | ||||||
|  | 		return 200 ".flux .item > a, .flux .flux_header .item { white-space: normal !important; } .state_unread .category:not(.active)[data-unread='0'], .state_unread .feed:not(.active)[data-unread='0'] { display: revert; }"; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	#location / { | ||||||
|  | 	#	try_files $uri $uri/ index.php; | ||||||
|  | 	#	sub_filter '</body>' '<style> .flux .item > a { white-space: normal; } </style><script> function ForceUpdateFeeds(){ var Count = 0; Array.from(document.querySelectorAll(atob("KltpZF49ImZfIl0uaXRlbS5mZWVk"))).forEach(function(El){ Count++; fetch(location.origin + "/i/?c=feed&a=actualize&id=" + El.id.split("_")[1]); }); setTimeout(function(){ location.reload(); }, Count * 4000); }; </script></body>'; | ||||||
|  | 	#	sub_filter '<a id="actualize"' '<a class="btn" href="#" title="Force update feeds" onclick="javascript:ForceUpdateFeeds();">Force update feeds</a><a id="actualize"'; | ||||||
|  | 	#	sub_filter_once on; | ||||||
|  | 	#} | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										67
									
								
								Server/Root/etc/nginx/sites-available/liminalgici.conf
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										67
									
								
								Server/Root/etc/nginx/sites-available/liminalgici.conf
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,67 @@ | |||||||
|  | server { | ||||||
|  |     listen 443 ssl http2; | ||||||
|  |     listen [::]:443 ssl http2; | ||||||
|  |     server_name liminalgici.spacc.eu.org liminalgici.spaccsoj3trhzowrrblzb5m6hgkwu6syghnmhett7gvxbrz5zhsrs4ad.onion; | ||||||
|  |     root /Main/Server/www/pixelfed_liminalgici/public;                      # path to repo/public | ||||||
|  |     ssl_certificate /etc/letsencrypt/live/liminalgici.spacc.eu.org/fullchain.pem; | ||||||
|  |     ssl_certificate_key /etc/letsencrypt/live/liminalgici.spacc.eu.org/privkey.pem; | ||||||
|  |     ssl_protocols TLSv1.2; | ||||||
|  |     ssl_ciphers EECDH+AESGCM:EECDH+CHACHA20:EECDH+AES; | ||||||
|  |     ssl_prefer_server_ciphers on; | ||||||
|  |     error_log /var/log/nginx/liminalgici.error.log warn; | ||||||
|  |     access_log /var/log/nginx/liminalgici.access.log; | ||||||
|  |  | ||||||
|  |     #add_header X-Frame-Options "SAMEORIGIN"; | ||||||
|  |     add_header X-XSS-Protection "1; mode=block"; | ||||||
|  |     add_header X-Content-Type-Options "nosniff"; | ||||||
|  |  | ||||||
|  |     index index.php; | ||||||
|  |  | ||||||
|  |     charset utf-8; | ||||||
|  |     client_max_body_size 15M; | ||||||
|  |  | ||||||
|  |     location / { | ||||||
|  |         try_files $uri $uri/ /index.php?$query_string; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     location = /favicon.ico { access_log off; log_not_found off; } | ||||||
|  |     location = /robots.txt  { access_log off; log_not_found off; } | ||||||
|  |  | ||||||
|  |     error_page 404 /index.php; | ||||||
|  |  | ||||||
|  |     location ~ \.php$ { | ||||||
|  |         fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||||||
|  |         fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; | ||||||
|  |         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||||||
|  |         fastcgi_param   QUERY_STRING        $query_string; | ||||||
|  |         fastcgi_param   REQUEST_METHOD      $request_method; | ||||||
|  |         fastcgi_param   CONTENT_TYPE        $content_type; | ||||||
|  |         fastcgi_param   CONTENT_LENGTH      $content_length; | ||||||
|  |         fastcgi_param   SCRIPT_NAME     $fastcgi_script_name; | ||||||
|  |         fastcgi_param   REQUEST_URI     $request_uri; | ||||||
|  |         fastcgi_param   DOCUMENT_URI        $document_uri; | ||||||
|  |         fastcgi_param   DOCUMENT_ROOT       $document_root; | ||||||
|  |         fastcgi_param   SERVER_PROTOCOL     $server_protocol; | ||||||
|  |         fastcgi_param   GATEWAY_INTERFACE   CGI/1.1; | ||||||
|  |         fastcgi_param   SERVER_SOFTWARE     nginx/$nginx_version; | ||||||
|  |         fastcgi_param   REMOTE_ADDR     $remote_addr; | ||||||
|  |         fastcgi_param   REMOTE_PORT     $remote_port; | ||||||
|  |         fastcgi_param   SERVER_ADDR     $server_addr; | ||||||
|  |         fastcgi_param   SERVER_PORT     $server_port; | ||||||
|  |         fastcgi_param   SERVER_NAME     $server_name; | ||||||
|  |         fastcgi_param   HTTPS           $https if_not_empty; | ||||||
|  |         fastcgi_param   REDIRECT_STATUS     200; | ||||||
|  |         fastcgi_param   HTTP_PROXY  ""; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     location ~ /\.(?!well-known).* { | ||||||
|  |         deny all; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | server {                                             # Redirect http to https | ||||||
|  |     server_name liminalgici.spacc.eu.org;                    # change this to your fqdn | ||||||
|  |     listen 80; | ||||||
|  |     listen [::]:80; | ||||||
|  |     return 301 https://$host$request_uri; | ||||||
|  | } | ||||||
							
								
								
									
										13
									
								
								Server/Root/etc/nginx/sites-available/private.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Server/Root/etc/nginx/sites-available/private.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | server { | ||||||
|  | 	listen 8083; | ||||||
|  | 	location / { | ||||||
|  | 		#proxy_http_version 1.1; | ||||||
|  | 		proxy_pass http://127.0.0.1:5283; | ||||||
|  | 		#proxy_set_header Host www.ecosia.org; | ||||||
|  | 		#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"; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -62,19 +62,19 @@ server { | |||||||
| 	error_page 500 = /error.php?code=500; | 	error_page 500 = /error.php?code=500; | ||||||
| 	access_log /var/log/nginx/root.access.log;                                                                                  | 	access_log /var/log/nginx/root.access.log;                                                                                  | ||||||
| 	error_log /var/log/nginx/root.error.log;  | 	error_log /var/log/nginx/root.error.log;  | ||||||
|  | 	sub_filter '</body>' '<script>top.postMessage(location.href.slice(location.origin.length), "https://hlb0it.blogspot.com")</script></body>'; | ||||||
|  | 	#sub_filter_once off; | ||||||
|  |  | ||||||
| 	location / { | 	location / { | ||||||
|  | 		add_header Access-Control-Allow-Origin *; | ||||||
| 		root /Main/Server/www/root; | 		root /Main/Server/www/root; | ||||||
| 		if ($request_uri ~ ^([^.\?]*[^/])$) { | 		if ($request_uri ~ ^([^.\?]*[^/])$) { | ||||||
| 			return 301 $1/; | 			return 301 $1/; | ||||||
| 		} | 		} | ||||||
| 		try_files $uri $uri/ $uri.html =404; | 		try_files $uri $uri/ $uri.html =404; | ||||||
| 		#try_files $uri =404; |  | ||||||
| 		#try_files $uri $uri.html $uri/index.html index.html; |  | ||||||
| 		autoindex off; | 		autoindex off; | ||||||
| 		#error_page 404 = /404.html; | 		#error_page 404 = /404.html; | ||||||
| 		#rewrite  ^/(\?.*)?$ index.html$1 permanent; | 		#rewrite  ^/(\?.*)?$ index.html$1 permanent; | ||||||
|  |  | ||||||
| 		location ~ ^.+?\.php(/.*)?$ { | 		location ~ ^.+?\.php(/.*)?$ { | ||||||
| 			fastcgi_pass php; | 			fastcgi_pass php; | ||||||
| 			fastcgi_split_path_info ^(.+\.php)(/.*)$; | 			fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||||||
| @@ -103,31 +103,45 @@ server { | |||||||
| 		sub_filter '</head>' '\n<meta name="viewport" content="width=device-width, initial-scale=1.0"/>\n<link rel="stylesheet" href="/Res/NginxIndex.css"/>\n</head>'; | 		sub_filter '</head>' '\n<meta name="viewport" content="width=device-width, initial-scale=1.0"/>\n<link rel="stylesheet" href="/Res/NginxIndex.css"/>\n</head>'; | ||||||
| 		sub_filter '</h1>' '</h1>\n<input type="checkbox" id="ToggleMetadata" checked="checked"/><label for="ToggleMetadata"> Metadata</label>\n'; | 		sub_filter '</h1>' '</h1>\n<input type="checkbox" id="ToggleMetadata" checked="checked"/><label for="ToggleMetadata"> Metadata</label>\n'; | ||||||
| 		sub_filter '<h1>Index of /Drive/' '<h1>Index of <a href="/Drive/">/Drive</a>/'; | 		sub_filter '<h1>Index of /Drive/' '<h1>Index of <a href="/Drive/">/Drive</a>/'; | ||||||
|  | 		sub_filter '</body>' '<script>top.postMessage(location.href.slice(location.origin.length), "https://hlb0it.blogspot.com")</script></body>'; | ||||||
| 		sub_filter_once off; | 		sub_filter_once off; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	location /Drive/Telegram/ { | 	#location /Drive/Telegram/ { | ||||||
| 		access_log /var/log/nginx/TelegramIndex.access.log; | 	#	access_log /var/log/nginx/TelegramIndex.access.log; | ||||||
| 		error_log /var/log/nginx/TelegramIndex.error.log; | 	#	error_log /var/log/nginx/TelegramIndex.error.log; | ||||||
| 		rewrite ^/Drive/Telegram/(.*)$ /$1 break; | 	#	rewrite ^/Drive/Telegram/(.*)$ /$1 break; | ||||||
| 		proxy_http_version 1.1; | 	#	proxy_http_version 1.1; | ||||||
| 		proxy_pass http://localhost:8095; | 	#	proxy_pass http://localhost:8095; | ||||||
| 		proxy_set_header Host $host; | 	#	proxy_set_header Host $host; | ||||||
| 		proxy_set_header X-Real-IP $remote_addr; | 	#	proxy_set_header X-Real-IP $remote_addr; | ||||||
| 		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 	#	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
| 		proxy_set_header X-Forwarded-Proto $scheme; | 	#	proxy_set_header X-Forwarded-Proto $scheme; | ||||||
| 		proxy_set_header Upgrade $http_upgrade; | 	#	proxy_set_header Upgrade $http_upgrade; | ||||||
| 		sub_filter '<a href="/" id="title-a"' '<a style="/*position: absolute; margin-top: 0.25em;*/ word-break: keep-all;line-break: strict;" href="/Drive/">/Drive/</a><a style="/*margin-left: 3em;*/" href="/Drive/Telegram/" id="title-a"'; | 	#	sub_filter '<a href="/" id="title-a"' '<a style="/*position: absolute; margin-top: 0.25em;*/ word-break: keep-all;line-break: strict;" href="/Drive/">/Drive/</a><a style="/*margin-left: 3em;*/" href="/Drive/Telegram/" id="title-a"'; | ||||||
| 		sub_filter '<link href="/'  '<link href="/Drive/Telegram/'; | 	#	sub_filter '<link href="/'  '<link href="/Drive/Telegram/'; | ||||||
| 		sub_filter '<a href="/'     '<a href="/Drive/Telegram/'; | 	#	sub_filter '<a href="/'     '<a href="/Drive/Telegram/'; | ||||||
| 		sub_filter '<img src="/'    '<img src="/Drive/Telegram/'; | 	#	sub_filter '<img src="/'    '<img src="/Drive/Telegram/'; | ||||||
| 		sub_filter '<source src="/' '<source src="/Drive/Telegram/'; | 	#	sub_filter '<source src="/' '<source src="/Drive/Telegram/'; | ||||||
| 		sub_filter '<script src="/' '<script src="/Drive/Telegram/'; | 	#	sub_filter '<script src="/' '<script src="/Drive/Telegram/'; | ||||||
| 		sub_filter '<meta property="og:image" content="/' '<meta property="og:image" content="https://hlb0.octt.eu.org/Drive/Telegram/'; | 	#	sub_filter '<meta property="og:image" content="/' '<meta property="og:image" content="https://hlb0.octt.eu.org/Drive/Telegram/'; | ||||||
| 		sub_filter_once off; | 	#	sub_filter_once off; | ||||||
| 	} | 	#} | ||||||
|  |  | ||||||
| 	location /wwwroot/ { | 	location /wwwroot/ { | ||||||
| 		rewrite ^/wwwroot/(.*)$ /$1 permanent; | 		rewrite ^/wwwroot/(.*)$ /$1 permanent; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #server { | ||||||
|  | #	    listen 80; | ||||||
|  | #        listen 81; | ||||||
|  | #        listen 443 ssl; | ||||||
|  | #        server_name old; | ||||||
|  | #        ssl_certificate /Main/Server/www/Temp/old/keys12/server.pem; | ||||||
|  | #        ssl_certificate_key /Main/Server/www/Temp/old/keys12/private_unencrypted.pem; | ||||||
|  | #        ssl_prefer_server_ciphers on; | ||||||
|  | #        location / { | ||||||
|  | #        	root /Main/Server/www/Temp/old; | ||||||
|  | #        } | ||||||
|  | #} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user