Gate nginx vhost on secret and add ACME, timeouts, 50G upload limit

This commit is contained in:
Joshua Bell 2026-02-09 00:10:41 -06:00
parent 4497fa29b1
commit cfcf67fe71

View file

@ -87,15 +87,28 @@ let
}) uniqueUsers }) uniqueUsers
); );
}; };
# Secret file path (if using secrets)
hasSecret =
secret:
let
secrets = config.age.secrets or { };
in
secrets ? ${secret} && secrets.${secret} != null;
in in
{ {
options = { }; options = { };
config = { config = {
services.nginx.virtualHosts."${domain}" = { services.nginx.virtualHosts."${domain}" = lib.mkIf (hasSecret "linode_rw_domains") {
addSSL = true; forceSSL = true;
sslCertificate = "/var/lib/acme/joshuabell.xyz/fullchain.pem"; useACMEHost = "joshuabell.xyz";
sslCertificateKey = "/var/lib/acme/joshuabell.xyz/key.pem"; extraConfig = ''
client_max_body_size 50G;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
send_timeout 600s;
'';
locations = { locations = {
"/" = { "/" = {
proxyWebsockets = true; proxyWebsockets = true;
@ -232,6 +245,8 @@ in
# Environment variables for additional configuration # Environment variables for additional configuration
environment = { environment = {
# Enable registration for initial setup (set to "true" to disable after creating accounts)
DISABLE_REGISTRATION = "false";
# Set timezone if needed # Set timezone if needed
# TIME_ZONE = "America/Chicago"; # TIME_ZONE = "America/Chicago";
}; };