diff --git a/PulumiWebServer/Domain.fs b/PulumiWebServer/Domain.fs index 86a0ed7..54c5de7 100644 --- a/PulumiWebServer/Domain.fs +++ b/PulumiWebServer/Domain.fs @@ -95,6 +95,7 @@ type Address = type WellKnownSubdomain = | Nextcloud + | Apps | Gitea | Radicale | Rss @@ -106,18 +107,20 @@ type WellKnownSubdomain = override this.ToString () = match this with - | Nextcloud -> "nextcloud" - | Gitea -> "gitea" - | Radicale -> "calendar" - | Rss -> "rss" - | Grafana -> "grafana" - | Woodpecker -> "woodpecker" - | WoodpeckerAgent -> "woodpecker-agent" - | PureGym -> "puregym" - | Whisper -> "whisper" + | WellKnownSubdomain.Nextcloud -> "nextcloud" + | WellKnownSubdomain.Apps -> "apps" + | WellKnownSubdomain.Gitea -> "gitea" + | WellKnownSubdomain.Radicale -> "calendar" + | WellKnownSubdomain.Rss -> "rss" + | WellKnownSubdomain.Grafana -> "grafana" + | WellKnownSubdomain.Woodpecker -> "woodpecker" + | WellKnownSubdomain.WoodpeckerAgent -> "woodpecker-agent" + | WellKnownSubdomain.PureGym -> "puregym" + | WellKnownSubdomain.Whisper -> "whisper" static member Parse (s : string) = match s with + | "apps" -> WellKnownSubdomain.Apps | "nextcloud" -> WellKnownSubdomain.Nextcloud | "gitea" -> WellKnownSubdomain.Gitea | "calendar" -> WellKnownSubdomain.Radicale diff --git a/PulumiWebServer/Nix/apps/apps.nix b/PulumiWebServer/Nix/apps/apps.nix new file mode 100644 index 0000000..54cbf16 --- /dev/null +++ b/PulumiWebServer/Nix/apps/apps.nix @@ -0,0 +1,32 @@ +{ + lib, + config, + ... +}: { + options = { + services.apps-config = { + domain = lib.mkOption { + type = lib.types.str; + example = "example.com"; + description = lib.mdDoc "Top-level domain to configure"; + }; + subdomain = lib.mkOption { + type = lib.types.str; + example = "apps"; + description = lib.mdDoc "Subdomain in which to put apps"; + }; + port = lib.mkOption { + type = lib.types.port; + description = lib.mdDoc "App server localhost port"; + default = 9521; + }; + }; + }; + config = { + services.nginx.virtualHosts."${config.services.apps-config.subdomain}.${config.services.apps-config.domain}" = { + forceSSL = true; + enableACME = true; + root = ./static; + }; + }; +} diff --git a/PulumiWebServer/Nix/apps/static/index.html b/PulumiWebServer/Nix/apps/static/index.html new file mode 100644 index 0000000..70b5e9f --- /dev/null +++ b/PulumiWebServer/Nix/apps/static/index.html @@ -0,0 +1,12 @@ + + + +

Apps

+

This is a collection of single-page applications, mostly vomited out by Claude to solve small tasks.

+ + + + diff --git a/PulumiWebServer/Nix/apps/static/middle_word.html b/PulumiWebServer/Nix/apps/static/middle_word.html new file mode 100644 index 0000000..f768fe3 --- /dev/null +++ b/PulumiWebServer/Nix/apps/static/middle_word.html @@ -0,0 +1,25 @@ + + + +
+ +
+ + + + diff --git a/PulumiWebServer/Nix/apps/static/sha256sum.html b/PulumiWebServer/Nix/apps/static/sha256sum.html new file mode 100644 index 0000000..7781b20 --- /dev/null +++ b/PulumiWebServer/Nix/apps/static/sha256sum.html @@ -0,0 +1,95 @@ + + + + Base64 Decoder and SHA256 Calculator + + + +
+
+ + + +
+ +
+ + + +
+ +
+ +
+
+
+ + + + diff --git a/PulumiWebServer/Nix/configuration.nix b/PulumiWebServer/Nix/configuration.nix index 10d0314..924f34c 100644 --- a/PulumiWebServer/Nix/configuration.nix +++ b/PulumiWebServer/Nix/configuration.nix @@ -7,6 +7,7 @@ in { imports = [ ./sops.nix + ./apps/apps.nix ./radicale/radicale-config.nix ./gitea/gitea-config.nix ./miniflux/miniflux.nix @@ -43,6 +44,8 @@ in { services.prometheus-config.domain-exporter-domains = [userConfig.domain]; services.puregym-config.domain = userConfig.domain; services.puregym-config.subdomain = "puregym"; + services.apps-config.subdomain = "apps"; + services.apps-config.domain = userConfig.domain; # services.whisper-config.domain = userConfig.domain; # services.whisper-config.subdomain = "whisper";