aboutsummaryrefslogtreecommitdiff
path: root/server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'server.sh')
-rwxr-xr-xserver.sh36
1 files changed, 35 insertions, 1 deletions
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"