fixed piped frontend, nginx module for all and gotosocial trusted-proxies
This commit is contained in:
parent
29af2a96d4
commit
3c2b9ffbe0
|
@ -69,6 +69,7 @@ in {
|
||||||
profiles.base
|
profiles.base
|
||||||
inputs.home-manager-unstable.nixosModules.home-manager
|
inputs.home-manager-unstable.nixosModules.home-manager
|
||||||
|
|
||||||
|
profiles.nginx
|
||||||
modules.nixos.secrets
|
modules.nixos.secrets
|
||||||
|
|
||||||
users.root
|
users.root
|
||||||
|
|
|
@ -18,6 +18,11 @@
|
||||||
"piped_restic_env"
|
"piped_restic_env"
|
||||||
"piped_restic_password"
|
"piped_restic_password"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
containerName = "piped";
|
||||||
|
pipedSocketForComponent = (
|
||||||
|
component: "/var/lib/nixos-containers/${containerName}/var/sockets/piped-${component}.sock"
|
||||||
|
);
|
||||||
in {
|
in {
|
||||||
imports = with tree; [
|
imports = with tree; [
|
||||||
# needed so can get nginx defaults for proxy
|
# needed so can get nginx defaults for proxy
|
||||||
|
@ -54,6 +59,7 @@ in {
|
||||||
inputs.home-manager-unstable.nixosModules.home-manager
|
inputs.home-manager-unstable.nixosModules.home-manager
|
||||||
|
|
||||||
profiles.sshd
|
profiles.sshd
|
||||||
|
#profiles.nginx
|
||||||
|
|
||||||
modules.nixos.secrets
|
modules.nixos.secrets
|
||||||
|
|
||||||
|
@ -88,11 +94,16 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."piped.owo.monster" = {
|
services.nginx.virtualHosts."piped.owo.monster" = let
|
||||||
|
backendDomain = "backend.piped.owo.monster";
|
||||||
|
frontend-package = pkgs.piped-frontend.override {
|
||||||
|
inherit backendDomain;
|
||||||
|
};
|
||||||
|
in {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://unix:/var/lib/nixos-containers/piped/var/sockets/piped-proxy.sock";
|
proxyPass = "http://unix:${pipedSocketForComponent "frontend"}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,7 +111,7 @@ in {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://unix:/var/lib/nixos-containers/piped/var/sockets/piped-backend.sock";
|
proxyPass = "http://unix:${pipedSocketForComponent "backend"}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -108,7 +119,7 @@ in {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://unix:/var/lib/nixos-containers/piped/var/sockets/piped-proxy.sock";
|
proxyPass = "http://unix:${pipedSocketForComponent "proxy"}";
|
||||||
extraConfig = config.services.piped.proxyNginxExtraConfig;
|
extraConfig = config.services.piped.proxyNginxExtraConfig;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
{...}: {
|
{...}: let
|
||||||
|
container-addresses = import ../../../data/container-addresses.nix {};
|
||||||
|
hostIP = container-addresses.host;
|
||||||
|
containerIP = container-addresses.containers.social;
|
||||||
|
in {
|
||||||
services.gotosocial = {
|
services.gotosocial = {
|
||||||
enable = true;
|
enable = true;
|
||||||
setupPostgresqlDB = true;
|
setupPostgresqlDB = true;
|
||||||
|
@ -7,9 +11,16 @@
|
||||||
host = "gts-01.owo.monster";
|
host = "gts-01.owo.monster";
|
||||||
bind-address = "0.0.0.0";
|
bind-address = "0.0.0.0";
|
||||||
|
|
||||||
log-level = "info";
|
log-level = "verbose";
|
||||||
log-client-ip = false;
|
log-client-ip = false;
|
||||||
|
|
||||||
|
trusted-proxies = [
|
||||||
|
"127.0.0.1/32"
|
||||||
|
"::1"
|
||||||
|
hostIP
|
||||||
|
containerIP
|
||||||
|
];
|
||||||
|
|
||||||
port = 8080;
|
port = 8080;
|
||||||
letsencrypt-enabled = false;
|
letsencrypt-enabled = false;
|
||||||
|
|
||||||
|
|
|
@ -87,11 +87,10 @@ in {
|
||||||
proxyPass = "http://${containerIP}:8080";
|
proxyPass = "http://${containerIP}:8080";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
# uncomment if running nginx without recommendedProxySettings
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
# proxy_set_header Host $host;
|
||||||
proxy_set_header Connection "upgrade";
|
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
# proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
|
@ -33,6 +33,7 @@ in {
|
||||||
commonHttpConfig = "";
|
commonHttpConfig = "";
|
||||||
clientMaxBodySize = lib.mkDefault "512m";
|
clientMaxBodySize = lib.mkDefault "512m";
|
||||||
serverNamesHashBucketSize = 1024;
|
serverNamesHashBucketSize = 1024;
|
||||||
|
mapHashMaxSize = 512;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.logrotate.settings.nginx = {
|
services.logrotate.settings.nginx = {
|
||||||
|
|
Loading…
Reference in a new issue