summary refs log tree commit diff
path: root/host/Rory-nginx
diff options
context:
space:
mode:
Diffstat (limited to 'host/Rory-nginx')
-rwxr-xr-xhost/Rory-nginx/configuration.nix4
-rwxr-xr-xhost/Rory-nginx/hosts/rory.gay/matrix.nix5
-rwxr-xr-xhost/Rory-nginx/hosts/thearcanebrony.net/root.nix6
-rwxr-xr-xhost/Rory-nginx/post-rebuild.sh32
-rwxr-xr-xhost/Rory-nginx/software.nix1
5 files changed, 45 insertions, 3 deletions
diff --git a/host/Rory-nginx/configuration.nix b/host/Rory-nginx/configuration.nix
index c38a1bf..2f2f7cc 100755
--- a/host/Rory-nginx/configuration.nix
+++ b/host/Rory-nginx/configuration.nix
@@ -4,9 +4,11 @@
   imports =
     [
       ../../modules/base-server.nix
+      ../../modules/users/levi.nix
+      ../../modules/users/db2k.nix
       ./software.nix
     ];
-
+  users.groups.ocp = {};
   networking = {
     hostName = "Rory-nginx";
     interfaces.ens18.ipv4.addresses = [ { 
diff --git a/host/Rory-nginx/hosts/rory.gay/matrix.nix b/host/Rory-nginx/hosts/rory.gay/matrix.nix
index 60a8e2c..46514a2 100755
--- a/host/Rory-nginx/hosts/rory.gay/matrix.nix
+++ b/host/Rory-nginx/hosts/rory.gay/matrix.nix
@@ -25,6 +25,11 @@
   		# https://matrix-org.github.io/synapse/latest/workers.html#synapseappgeneric_worker
 	locations."~ ^/_matrix/client/(r0|v3)/sync$" = {
 		proxyPass = "http://generic_workers_upstream$request_uri";
+                extraConfig = ''
+                     proxy_read_timeout 300;
+                     proxy_connect_timeout 300;
+                     proxy_send_timeout 300; 
+                  '';
 	};
 	locations."~ ^/_matrix/client/(api/v1|r0|v3)/events$" = {
 		proxyPass = "http://generic_workers_upstream$request_uri";
diff --git a/host/Rory-nginx/hosts/thearcanebrony.net/root.nix b/host/Rory-nginx/hosts/thearcanebrony.net/root.nix
index 722e989..bd23f10 100755
--- a/host/Rory-nginx/hosts/thearcanebrony.net/root.nix
+++ b/host/Rory-nginx/hosts/thearcanebrony.net/root.nix
@@ -2,9 +2,11 @@
   enableACME = true;
   addSSL = true;
   root = "/data/nginx/html_thearcanebrony";
+  extraConfig = ''
+    autoindex on;'';
   locations = {
     "/" = {
-      index = "index.html";
+      #index = "index.html";
     };
     "/destroy" = {
       return = "301 https://gitlab.com/KinoshitaProductions/SecureDestroyer/-/raw/master/run";
@@ -35,4 +37,4 @@
     }';
   ''; 
   };
-}
\ No newline at end of file
+}
diff --git a/host/Rory-nginx/post-rebuild.sh b/host/Rory-nginx/post-rebuild.sh
new file mode 100755
index 0000000..ea6e013
--- /dev/null
+++ b/host/Rory-nginx/post-rebuild.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl gnused nix coreutils jq openssl
+#set -x
+REG_KEY=`cat /var/lib/matrix-synapse/registration_shared_secret.txt`
+LOCALPART='rory.gay'
+REACHABLE_DOMAIN='http://localhost:8008'
+
+# -- LICENSE: CNPL v7+ - https://thufie.lain.haus/files/CNPLv7.md
+# Modified from Nyaaori (https://nyaaori.cat) <+@nyaaori.cat>
+# Explicit authorisation to use the code has been granted by the original author
+#  for use by members of the Rory system (https://rory.gay)
+
+
+# the magic function:
+register(){
+	echo "Registering $1"
+	_nonce=`curl -s http://localhost:8008/_synapse/admin/v1/register | jq -r .nonce`
+	#data: nonce, domain, username, password
+	_hmac=`printf '%s\0%s\0%s\0%s' "$_nonce" "$1" "$2" "admin" |  openssl dgst -sha1 -hmac "$REG_KEY" |  awk '{print $2}'`
+	curl -s -XPOST -d '{"nonce": "'"$_nonce"'", "username": "'"$1"'", "displayname": "'"$1"'", "password": "'"$2"'", "admin": true, "mac": "'"$_hmac"'"}' $REACHABLE_DOMAIN/_synapse/admin/v1/register | tee -a matrix-user-tokens.txt
+	echo
+}
+
+# -- END OF LICENSED CODE
+
+
+
+PASSWD=`cat /etc/matrix-user-pass`
+for u in {draupnir,Alicia,Emma,Rory,root,Quetzelle}
+do 
+	register $u $PASSWD
+done
diff --git a/host/Rory-nginx/software.nix b/host/Rory-nginx/software.nix
index 6423c08..56b09f4 100755
--- a/host/Rory-nginx/software.nix
+++ b/host/Rory-nginx/software.nix
@@ -27,6 +27,7 @@
         '';
       appendHttpConfig = ''
         #sendfile on;
+        disable_symlinks off;
       '';
       upstreams = import ./matrix/upstreams.nix;
       additionalModules = with pkgs.nginxModules; [