add gotosocial to freun.dev

This commit is contained in:
Joakim Repomaa
2024-11-04 14:19:44 +02:00
parent f54eda2815
commit 0c95824992
2 changed files with 42 additions and 0 deletions

41
freun.dev/gotosocial.nix Normal file
View File

@@ -0,0 +1,41 @@
{ config, ... }:
let
fqdn = "social.freun.dev";
port = 3500;
in
{
services.gotosocial = {
enable = true;
environmentFile = "/var/secrets/gotosocial.env";
settings = {
host = "social.freun.dev";
account-domain = "freun.dev";
protocol = "https";
bind-address = "localhost";
instance-languages = [ "de" "fi" "en" ];
instance-inject-mastodon-version = true;
accounts-registrations-open = true;
letsencrypt-enabled = false;
smtp-host = "horologium.uberspace.de";
smtp-port = 587;
smtp-username = "noreply@freun.dev";
smtp-from = "noreply@freun.dev";
inherit port;
};
setupPostgresqlDB = true;
};
services.caddy.virtualHosts = {
"freun.dev".extraConfig = ''
redir /.well-known/host-meta* https://${fqdn}{uri} permanent
redir /.well-known/webfinger* https://${fqdn}{uri} permanent
redir /.well-known/nodeinfo* https://${fqdn}{uri} permanent
'';
"${fqdn}".extraConfig = ''
reverse_proxy localhost:${toString config.services.gotosocial.settings.port} {
flush_interval -1
}
'';
};
}