From 03acfab1e28ccecd4f11cfd1440c3cc5c5870511 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:35:05 +0200 Subject: [PATCH] Make hedgedoc work properly --- nixos-configurations/server/default.nix | 25 +++++++++++++++++++++---- nixos-configurations/shared-desktop.nix | 2 +- nixos-configurations/wallpaper.nix | 5 ----- 3 files changed, 22 insertions(+), 10 deletions(-) delete mode 100644 nixos-configurations/wallpaper.nix diff --git a/nixos-configurations/server/default.nix b/nixos-configurations/server/default.nix index 853a852..2d31573 100644 --- a/nixos-configurations/server/default.nix +++ b/nixos-configurations/server/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, config, ... }: +{ inputs, pkgs, ... }: { imports = [ @@ -44,6 +44,8 @@ }; nginx = { enable = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; virtualHosts = { "thilohohlt.com" = { enableACME = true; @@ -55,6 +57,16 @@ forceSSL = true; root = inputs.aurora-blog-template.packages.${pkgs.system}.default; }; + "collab.thilohohlt.com" = { + enableACME = true; + forceSSL = true; + locations."/".proxyPass = "http://localhost:3300"; + locations."/socket.io/" = { + proxyPass = "http://localhost:3300"; + proxyWebsockets = true; + extraConfig = "proxy_ssl_server_name on;"; + }; + }; }; }; hedgedoc = { @@ -62,18 +74,24 @@ settings = { port = 3300; domain = "collab.thilohohlt.com"; - useSSL = true; db = { dialect = "postgres"; host = "/run/postgresql"; database = "hedgedoc"; }; + protocolUseSSL = true; }; }; postgresql = { enable = true; package = pkgs.postgresql_15; ensureDatabases = [ "dcbot" "hedgedoc" ]; + ensureUsers = [ + { + name = "hedgedoc"; + ensurePermissions."DATABASE hedgedoc" = "ALL PRIVILEGES"; + } + ]; authentication = pkgs.lib.mkOverride 10 '' #type database DBuser auth-method local all all trust @@ -116,5 +134,4 @@ home.stateVersion = "23.05"; }; system.stateVersion = "23.05"; -} - +} \ No newline at end of file diff --git a/nixos-configurations/shared-desktop.nix b/nixos-configurations/shared-desktop.nix index 8070af9..3c1758d 100644 --- a/nixos-configurations/shared-desktop.nix +++ b/nixos-configurations/shared-desktop.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ ... }: { services = { diff --git a/nixos-configurations/wallpaper.nix b/nixos-configurations/wallpaper.nix deleted file mode 100644 index 956f69b..0000000 --- a/nixos-configurations/wallpaper.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs }: pkgs.fetchurl { - url = "https://i.imgur.com/PDwmNTA.png"; - hash = "sha256-bQM7RSjI/Lpn+7c9w0/Yr8JmD1ThfjGV9bMWpYFGceo="; -} -