From 66c32ec2e72397147c111685fb71ec000fe683c7 Mon Sep 17 00:00:00 2001 From: hitlerrip Date: Thu, 18 Dec 2025 11:31:54 +0100 Subject: 4get - added initial 4get setup script - added 4get to web page and nginx config - changed privacy policy to remove clicker - changed pricacy policy to add search --- server.sh | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'server.sh') diff --git a/server.sh b/server.sh index d74395a..df67d4b 100755 --- a/server.sh +++ b/server.sh @@ -139,9 +139,12 @@ server { if (\$host = git.hitler.rip) { return 301 https://git.hitler.rip\$request_uri; } + if (\$host = search.hitler.rip) { + return 301 https://search.hitler.rip\$request_uri; + } listen 80; listen [::]:80; - serer_name hitler.rip www.hitler.rip links.hitler.rip git.hitler.rip; + serer_name hitler.rip www.hitler.rip links.hitler.rip git.hitler.rip search.hitler.rip; return 301 https://hitler.rip\$request_uri; } @@ -189,6 +192,30 @@ server { include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } + +server { + server_name search.hitler.rip; + root /srv/frontends/4get; + location @php { + try_files $uri.php $uri/index.php =404; + fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_intercept_errors on; + } + location / { + try_files $uri @php; + } + location ~* ^(.*)\.php$ { + return 301 $1; + } + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/hitler.rip/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/hitler.rip/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} EOF sudo mkdir -p /srv/web/ sudo mkdir -p /srv/build/ @@ -264,6 +291,13 @@ sudo tee -a /usr/share/cgit/cgit.css << EOF EOF echo "[server] cgit server created. you may now replace /usr/share/cgit/cgit.png and /usr/share/cgit/favicon.ico with a custom image." +echo "[server] setting up 4get..." +sudo apt install -y php-mbstring php-imagick imagemagick php-curl php-apcu +sudo mkdir -p /srv/frontends/4get/ +sudo chown -R "$(whoami)":"$(whoami)" /srv/frontends/4get/ +git clone --depth 1 https://git.lolcat.ca/lolcat/4get /srv/frontends/4get +echo "[server] 4get server created. You may now edit the robots.txt, enable cloudflare support and style the page. (TODO!)" + echo "[server] configuring shell..." tee ~/.bash_aliases << EOF alias t="tmux" -- cgit v1.2.3