summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-03-25 11:41:20 -0400
committerBen Sima <ben@bsima.me>2025-04-15 15:22:43 -0400
commita20827fc0a7eb9a5bc9ae559b426b8c3f357ce3c (patch)
tree3b8a227751c0395a81bda50fcb1932dde53f4cb5
parent147dc38ec5963f594474d8d775312049d1f16902 (diff)
Enable syncthing on Beryllium too
This moves syncthing from the cloud only, and onto Beryllium as well. Also it gets rid of the nginx config because I don't really need access to it remotely like that.
-rwxr-xr-xOmni/Cloud.nix2
-rw-r--r--Omni/Cloud/Syncthing.nix38
-rwxr-xr-xOmni/Dev/Beryllium.nix1
-rw-r--r--Omni/Syncthing.nix19
4 files changed, 21 insertions, 39 deletions
diff --git a/Omni/Cloud.nix b/Omni/Cloud.nix
index 9c58008..27db37a 100755
--- a/Omni/Cloud.nix
+++ b/Omni/Cloud.nix
@@ -13,7 +13,7 @@ bild.os {
./Cloud/Hardware.nix
./Cloud/Mail.nix
./Cloud/Networking.nix
- ./Cloud/Syncthing.nix
+ ./Syncthing.nix
./Cloud/Web.nix
./Cloud/Znc.nix
./Cloud/Monica.nix
diff --git a/Omni/Cloud/Syncthing.nix b/Omni/Cloud/Syncthing.nix
deleted file mode 100644
index 7c13e6c..0000000
--- a/Omni/Cloud/Syncthing.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{config, ...}: let
- ports = import ./Ports.nix;
- rootDomain = config.networking.domain;
-in {
- services.syncthing = {
- enable = true;
- guiAddress = "0.0.0.0:${toString ports.syncthing-gui}";
- openDefaultPorts = true;
- systemService = true;
- configDir = "/var/lib/syncthing/.config/syncthing";
-
- # Default settings for new users
- settings = {
- options = {
- relaysEnabled = true;
- urAccepted = -1; # Usage reporting: -1 = not decided, 0 = no, 1 = yes
- };
- };
- };
-
- # Configure nginx as a reverse proxy for the Syncthing GUI
- services.nginx.virtualHosts."syncthing.${rootDomain}" = {
- forceSSL = true;
- enableACME = true;
- locations."/" = {
- proxyPass = "http://localhost:${toString ports.syncthing-gui}/";
- proxyWebsockets = true;
- extraConfig = ''
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_read_timeout 600s;
- proxy_send_timeout 600s;
- '';
- };
- };
-}
diff --git a/Omni/Dev/Beryllium.nix b/Omni/Dev/Beryllium.nix
index 556bea8..d40ec38 100755
--- a/Omni/Dev/Beryllium.nix
+++ b/Omni/Dev/Beryllium.nix
@@ -11,6 +11,7 @@ bild.os {
./Docker.nix
./Vpn.nix
./Beryllium/OpenWebui.nix
+ ../Syncthing.nix
];
networking.hostName = "beryllium";
networking.domain = "beryl.bensima.com";
diff --git a/Omni/Syncthing.nix b/Omni/Syncthing.nix
new file mode 100644
index 0000000..fab013b
--- /dev/null
+++ b/Omni/Syncthing.nix
@@ -0,0 +1,19 @@
+{...}: let
+ ports = import ./Cloud/Ports.nix;
+in {
+ services.syncthing = {
+ enable = true;
+ guiAddress = "0.0.0.0:${toString ports.syncthing-gui}";
+ openDefaultPorts = true;
+ systemService = true;
+ configDir = "/var/lib/syncthing/.config/syncthing";
+
+ # Default settings for new users
+ settings = {
+ options = {
+ relaysEnabled = true;
+ urAccepted = -1; # Usage reporting: -1 = not decided, 0 = no, 1 = yes
+ };
+ };
+ };
+}