From d7a0887a4b47d9002186923276be4de0179cae40 Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 15 Dec 2019 22:54:00 +0100 Subject: [PATCH 1/8] Remove Gitea socket connection to the DB Revert "Disable wizard on Gitea" This reverts commit d8b415ee16e1a560dac430f577d34cb098e0f832. Remove Gitea socket connection to the DB Disable wizard on Gitea --- modules/devops.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/devops.nix b/modules/devops.nix index aea6ad8..5d5478a 100644 --- a/modules/devops.nix +++ b/modules/devops.nix @@ -13,18 +13,12 @@ database = { type = "postgres"; passwordFile = "/var/keys/gitea/db"; - socket = "/run/postgresql/.s.PGSQL.5432"; }; cookieSecure = true; disableRegistration = true; repositoryRoot = "/vault/git"; dump.enable = true; - useWizard = false; appName = "Gitea"; - extraConfig = '' - LFS_START_SERVER = true - LFS_HTTP_AUTH_EXPIRY = 60m - ''; }; } From d0aa9883000681c47af8e95636b6d55ccf76532d Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 19 Dec 2019 21:04:23 +0100 Subject: [PATCH 2/8] Disable auto reboot --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 0217050..5f77455 100644 --- a/configuration.nix +++ b/configuration.nix @@ -69,7 +69,7 @@ # Auto-upgrade the system and reboot if needed system.autoUpgrade = { enable = true; - allowReboot = true; + allowReboot = false; }; # Enable zeroconf From b62e8ee389cc6caaf927ed28afa5e775be07103b Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 23 Dec 2019 19:34:02 +0100 Subject: [PATCH 3/8] Add unit to Syncthing --- modules/datasync.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/datasync.nix b/modules/datasync.nix index 5cfca19..ecfa8c7 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -17,14 +17,15 @@ devices = { monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; }; roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; }; + unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; }; }; folders = { - "Documents" = { devices = [ "monolith" "roamer" ]; id = "wusdj-bfjkr"; }; - "Notes" = { devices = [ "monolith" "roamer" ]; id = "2aqt7-vpprc"; }; - "Music" = { devices = [ "monolith" "roamer" ]; id = "kafhz-bfmzm"; }; - "Photos" = { devices = [ "monolith" "roamer" ]; id = "mjibc-ustcg"; }; - "Security" = { devices = [ "monolith" "roamer" ]; id = "z4lpn-pmm3v"; }; - "Projects" = { devices = [ "monolith" ]; id = "cjhmu-avy9v"; }; + "Documents" = { devices = [ "monolith" "roamer" "unit" ]; id = "wusdj-bfjkr"; }; + "Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; }; + "Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; }; + "Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; }; + "Security" = { devices = [ "monolith" "roamer" "unit" ]; id = "z4lpn-pmm3v"; }; + "Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; }; Documents.type = "receiveonly"; Notes.type = "receiveonly"; From b76e3ef71ce9031f3daa2fc8d5e0d9bae64d0346 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 23 Dec 2019 20:01:40 +0100 Subject: [PATCH 4/8] Allo zion to sync Family photos --- modules/datasync.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/datasync.nix b/modules/datasync.nix index ecfa8c7..fd72ce0 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -7,7 +7,7 @@ radicale ]; - # Enable syncthingthing + # Enable syncthing services.syncthing = { enable = true; openDefaultPorts = true; @@ -30,7 +30,7 @@ Documents.type = "receiveonly"; Notes.type = "receiveonly"; Music.type = "receiveonly"; - Photos.type = "receiveonly"; + #Photos.type = "receiveonly"; Security.type = "receiveonly"; Projects.type = "receiveonly"; From 85d4f2cbd85c72b92f6f47904242e1962601b957 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 23 Dec 2019 21:23:13 +0100 Subject: [PATCH 5/8] Fix inconsistent folder-ids on Syncthing --- modules/datasync.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/datasync.nix b/modules/datasync.nix index fd72ce0..2ea28d5 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -21,8 +21,8 @@ }; folders = { "Documents" = { devices = [ "monolith" "roamer" "unit" ]; id = "wusdj-bfjkr"; }; - "Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; }; - "Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; }; + "Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; }; + "Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; }; "Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; }; "Security" = { devices = [ "monolith" "roamer" "unit" ]; id = "z4lpn-pmm3v"; }; "Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; }; @@ -30,7 +30,7 @@ Documents.type = "receiveonly"; Notes.type = "receiveonly"; Music.type = "receiveonly"; - #Photos.type = "receiveonly"; + Photos.type = "receiveonly"; Security.type = "receiveonly"; Projects.type = "receiveonly"; From e8850eff5166ae6f6e56ac11d58cc56491fca255 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 25 Dec 2019 16:24:10 +0100 Subject: [PATCH 6/8] Restart nginx after Gitea --- configuration.nix | 3 ++- modules/devops.nix | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 5f77455..c97a4c6 100644 --- a/configuration.nix +++ b/configuration.nix @@ -69,7 +69,7 @@ # Auto-upgrade the system and reboot if needed system.autoUpgrade = { enable = true; - allowReboot = false; + allowReboot = true; }; # Enable zeroconf @@ -86,6 +86,7 @@ nix.gc = { automatic = true; dates = "03:15"; + options = "--delete-older-than 14d"; }; # Configure fish shell diff --git a/modules/devops.nix b/modules/devops.nix index 5d5478a..a8b8b9d 100644 --- a/modules/devops.nix +++ b/modules/devops.nix @@ -21,4 +21,7 @@ appName = "Gitea"; }; + # Restart nginx after startup + systemd.services.gitea.postStart = "systemctl restart nginx"; + } From caf4a49ec2796948213539f0dcb6a38d51228f6f Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 25 Dec 2019 16:37:11 +0100 Subject: [PATCH 7/8] Configure nginx service as dependent on gitea --- modules/devops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/devops.nix b/modules/devops.nix index a8b8b9d..3165b06 100644 --- a/modules/devops.nix +++ b/modules/devops.nix @@ -22,6 +22,6 @@ }; # Restart nginx after startup - systemd.services.gitea.postStart = "systemctl restart nginx"; + systemd.services.nginx.partOf = [ "gitea.service" ]; } From 51ed142c5f851a718ec814a8badc0ca670f22d7b Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 25 Dec 2019 17:15:42 +0100 Subject: [PATCH 8/8] Use mkforce for 'partOf' option --- modules/devops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/devops.nix b/modules/devops.nix index 3165b06..298bf23 100644 --- a/modules/devops.nix +++ b/modules/devops.nix @@ -22,6 +22,6 @@ }; # Restart nginx after startup - systemd.services.nginx.partOf = [ "gitea.service" ]; + systemd.services.nginx.unitConfig.partOf = lib.mkForce [ "gitea.service" ]; }