diff --git a/system/Legion.nix b/system/Legion.nix index 7191d846..09030e10 100644 --- a/system/Legion.nix +++ b/system/Legion.nix @@ -9,6 +9,7 @@ ./services/nix-serve.nix ./services/sshd.nix ./services/syncthing.nix + ./services/webdav.nix ./services/xandikos.nix # ./services/minecraft.nix # ./services/satisfactory/default.nix diff --git a/system/services/forgejo.nix b/system/services/forgejo.nix index 3c868c4c..0f1c06c6 100644 --- a/system/services/forgejo.nix +++ b/system/services/forgejo.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { imports = [ ./caddy.nix ]; services = { @@ -23,16 +23,10 @@ }; }; }; - # gitea-actions-runner = { - # package = pkgs.forgejo-runner; - # instances.default = { - # enable = true; - # name = "monolith"; - # url = config.services.forgejo.settings.server.ROOT_URL; - # tokenFile = /var/lib/forgejo/runner_registration_token; - # labels = ["native:host"]; - # }; - # }; - caddy.virtualHosts."git.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:3100"; + caddy.virtualHosts."git.xenia.me.uk".extraConfig = + let + port = config.services.forgejo.settings.server.HTTP_PORT; + in + "reverse_proxy http://localhost:${toString port}"; }; } diff --git a/system/services/webdav.nix b/system/services/webdav.nix new file mode 100644 index 00000000..35e0855c --- /dev/null +++ b/system/services/webdav.nix @@ -0,0 +1,28 @@ +{ config, ... }: +{ + imports = [ ./caddy.nix ]; + services = { + webdav = { + enable = true; + settings = { + address = "0.0.0.0"; + port = 6065; + debug = true; + behindProxy = true; + directory = "/srv/webdav"; + users = [ + { + username = "pixelifytica"; + password = "{bcrypt}$2b$12$ulThbG9JGJP/FYI4RyX8sufMOE/vfw928gJMFedajiINbqx585wY."; + permissions = "CRUD"; + } + ]; + }; + }; + caddy.virtualHosts."files.xenia.me.uk".extraConfig = + let + inherit (config.services.webdav.settings) port; + in + "reverse_proxy http://localhost:${toString port}"; + }; +}