Make hedgedoc work properly

This commit is contained in:
thiloho
2023-09-26 20:35:05 +02:00
parent 0def8bfab1
commit 03acfab1e2
3 changed files with 22 additions and 10 deletions

View File

@@ -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
@@ -117,4 +135,3 @@
};
system.stateVersion = "23.05";
}

View File

@@ -1,4 +1,4 @@
{ inputs, ... }:
{ ... }:
{
services = {

View File

@@ -1,5 +0,0 @@
{ pkgs }: pkgs.fetchurl {
url = "https://i.imgur.com/PDwmNTA.png";
hash = "sha256-bQM7RSjI/Lpn+7c9w0/Yr8JmD1ThfjGV9bMWpYFGceo=";
}