From 14ef3c9dcd51d0ea7286316fbdfbabe5e8e2bb6a Mon Sep 17 00:00:00 2001
From: "Edgar P. Burkhart" <git@edgarpierre.fr>
Date: Tue, 16 May 2023 15:14:06 +0200
Subject: [PATCH] Add Nginx install script

---
 src/Nginx/.install.fish                         | 9 +++++++++
 src/Nginx/nginx.conf                            | 1 -
 src/Nginx/{sites-all => sites}/autoconfig.conf  | 0
 src/Nginx/{sites-all => sites}/cockpit.conf     | 0
 src/Nginx/{sites-all => sites}/edoceo.conf      | 0
 src/Nginx/{sites-all => sites}/forgejo.conf     | 0
 src/Nginx/{sites-all => sites}/galene.conf      | 0
 src/Nginx/{sites-all => sites}/grafana.conf     | 0
 src/Nginx/{sites-all => sites}/influxdb.conf    | 0
 src/Nginx/{sites-all => sites}/mastodon.conf    | 0
 src/Nginx/{sites-all => sites}/nextcloud.conf   | 0
 src/Nginx/{sites-all => sites}/photoview.conf   | 0
 src/Nginx/{sites-all => sites}/public.conf      | 0
 src/Nginx/{sites-all => sites}/radicale.conf    | 0
 src/Nginx/{sites-all => sites}/syncthing.conf   | 0
 src/Nginx/{sites-all => sites}/vaultwarden.conf | 0
 src/Nginx/{sites-all => sites}/web.conf         | 0
 17 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100755 src/Nginx/.install.fish
 rename src/Nginx/{sites-all => sites}/autoconfig.conf (100%)
 rename src/Nginx/{sites-all => sites}/cockpit.conf (100%)
 rename src/Nginx/{sites-all => sites}/edoceo.conf (100%)
 rename src/Nginx/{sites-all => sites}/forgejo.conf (100%)
 rename src/Nginx/{sites-all => sites}/galene.conf (100%)
 rename src/Nginx/{sites-all => sites}/grafana.conf (100%)
 rename src/Nginx/{sites-all => sites}/influxdb.conf (100%)
 rename src/Nginx/{sites-all => sites}/mastodon.conf (100%)
 rename src/Nginx/{sites-all => sites}/nextcloud.conf (100%)
 rename src/Nginx/{sites-all => sites}/photoview.conf (100%)
 rename src/Nginx/{sites-all => sites}/public.conf (100%)
 rename src/Nginx/{sites-all => sites}/radicale.conf (100%)
 rename src/Nginx/{sites-all => sites}/syncthing.conf (100%)
 rename src/Nginx/{sites-all => sites}/vaultwarden.conf (100%)
 rename src/Nginx/{sites-all => sites}/web.conf (100%)

diff --git a/src/Nginx/.install.fish b/src/Nginx/.install.fish
new file mode 100755
index 0000000..925d9b1
--- /dev/null
+++ b/src/Nginx/.install.fish
@@ -0,0 +1,9 @@
+#!/usr/bin/env fish
+sudo mkdir -p /etc/nginx
+sudo install -m a=r,u=rw nginx.conf /etc/nginx/
+
+sudo mkdir -p /etc/nginx/conf
+sudo install -m a=r,u=rw conf/* /etc/nginx/conf/
+
+sudo mkdir -p /etc/nginx/sites-enabled
+sudo install -m a=r,u=rw sites/* /etc/nginx/sites-enabled/
diff --git a/src/Nginx/nginx.conf b/src/Nginx/nginx.conf
index 175ed04..7ed2d25 100644
--- a/src/Nginx/nginx.conf
+++ b/src/Nginx/nginx.conf
@@ -41,7 +41,6 @@ http {
 		listen 80 default_server;
 		listen [::]:80 default_server;
 		server_name _;
-		include conf/00-hsts.conf;
 
 		return 301 https://$host$request_uri;
 	}
diff --git a/src/Nginx/sites-all/autoconfig.conf b/src/Nginx/sites/autoconfig.conf
similarity index 100%
rename from src/Nginx/sites-all/autoconfig.conf
rename to src/Nginx/sites/autoconfig.conf
diff --git a/src/Nginx/sites-all/cockpit.conf b/src/Nginx/sites/cockpit.conf
similarity index 100%
rename from src/Nginx/sites-all/cockpit.conf
rename to src/Nginx/sites/cockpit.conf
diff --git a/src/Nginx/sites-all/edoceo.conf b/src/Nginx/sites/edoceo.conf
similarity index 100%
rename from src/Nginx/sites-all/edoceo.conf
rename to src/Nginx/sites/edoceo.conf
diff --git a/src/Nginx/sites-all/forgejo.conf b/src/Nginx/sites/forgejo.conf
similarity index 100%
rename from src/Nginx/sites-all/forgejo.conf
rename to src/Nginx/sites/forgejo.conf
diff --git a/src/Nginx/sites-all/galene.conf b/src/Nginx/sites/galene.conf
similarity index 100%
rename from src/Nginx/sites-all/galene.conf
rename to src/Nginx/sites/galene.conf
diff --git a/src/Nginx/sites-all/grafana.conf b/src/Nginx/sites/grafana.conf
similarity index 100%
rename from src/Nginx/sites-all/grafana.conf
rename to src/Nginx/sites/grafana.conf
diff --git a/src/Nginx/sites-all/influxdb.conf b/src/Nginx/sites/influxdb.conf
similarity index 100%
rename from src/Nginx/sites-all/influxdb.conf
rename to src/Nginx/sites/influxdb.conf
diff --git a/src/Nginx/sites-all/mastodon.conf b/src/Nginx/sites/mastodon.conf
similarity index 100%
rename from src/Nginx/sites-all/mastodon.conf
rename to src/Nginx/sites/mastodon.conf
diff --git a/src/Nginx/sites-all/nextcloud.conf b/src/Nginx/sites/nextcloud.conf
similarity index 100%
rename from src/Nginx/sites-all/nextcloud.conf
rename to src/Nginx/sites/nextcloud.conf
diff --git a/src/Nginx/sites-all/photoview.conf b/src/Nginx/sites/photoview.conf
similarity index 100%
rename from src/Nginx/sites-all/photoview.conf
rename to src/Nginx/sites/photoview.conf
diff --git a/src/Nginx/sites-all/public.conf b/src/Nginx/sites/public.conf
similarity index 100%
rename from src/Nginx/sites-all/public.conf
rename to src/Nginx/sites/public.conf
diff --git a/src/Nginx/sites-all/radicale.conf b/src/Nginx/sites/radicale.conf
similarity index 100%
rename from src/Nginx/sites-all/radicale.conf
rename to src/Nginx/sites/radicale.conf
diff --git a/src/Nginx/sites-all/syncthing.conf b/src/Nginx/sites/syncthing.conf
similarity index 100%
rename from src/Nginx/sites-all/syncthing.conf
rename to src/Nginx/sites/syncthing.conf
diff --git a/src/Nginx/sites-all/vaultwarden.conf b/src/Nginx/sites/vaultwarden.conf
similarity index 100%
rename from src/Nginx/sites-all/vaultwarden.conf
rename to src/Nginx/sites/vaultwarden.conf
diff --git a/src/Nginx/sites-all/web.conf b/src/Nginx/sites/web.conf
similarity index 100%
rename from src/Nginx/sites-all/web.conf
rename to src/Nginx/sites/web.conf
