nextcloud configured

This commit is contained in:
bogale 2026-10-18 15:54:55 +09:00
commit 8ec85705ca

View file

@ -2,22 +2,24 @@
{ {
services = let services = let
sslCertDir = config.security.acme.certs."bogaledev.ru".directory; sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
phpSettings = {
"pm" = "ondemand";
"pm.max_children" = 4;
"listen.group" = "nginx";
"listen.owner" = "nginx";
};
in { in {
dnsmasq.settings.cname = "nextcloud-local,localhost";
phpfpm.pools.php = {
user = "php";
group = "php";
settings = phpSettings;
};
postgresqlBackup = { postgresqlBackup = {
enable = true; enable = true;
startAt = "16:00"; startAt = "16:00";
compression = "none"; compression = "none";
databases = [ "php" "forgejo" "grafana" "vaultwarden" ]; databases = [ "php" "forgejo" "grafana" "nextcloud" "vaultwarden" ];
};
phpfpm.pools.php = {
user = "php";
group = "php";
settings = {
"pm" = "ondemand";
"pm.max_children" = 4;
"listen.group" = "nginx";
"listen.owner" = "nginx";
};
}; };
postgresql = { postgresql = {
enable = true; enable = true;
@ -29,6 +31,20 @@
}; };
in map user [ "php" "grafana" ]; in map user [ "php" "grafana" ];
}; };
nextcloud = {
enable = true;
poolSettings = phpSettings;
hostName = "nextcloud-local";
database.createLocally = true;
config = {
dbtype = "pgsql";
adminpassFile = "/secrets/nextcloud-pw";
};
settings = {
overwritewebroot = "/nextcloud";
trusted_domains = [ "bogaledev.ru" "wl.bogaledev.ru" ];
};
};
vaultwarden = { vaultwarden = {
enable = true; enable = true;
configurePostgres = true; configurePostgres = true;
@ -41,7 +57,7 @@
TRASH_AUTO_DELETE_DAYS = 90; TRASH_AUTO_DELETE_DAYS = 90;
PASSWORD_HINTS_ALLOWED = false; PASSWORD_HINTS_ALLOWED = false;
EMERGENCY_ACCESS_ALLOWED = false; EMERGENCY_ACCESS_ALLOWED = false;
DOMAIN = "https://bogaledev.ru/vw/"; DOMAIN = "https://bogaledev.ru/vaultwarden/";
}; };
}; };
forgejo = { forgejo = {
@ -73,43 +89,50 @@
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedBrotliSettings = true; recommendedBrotliSettings = true;
virtualHosts.main = let virtualHosts = {
phpPool = '' nextcloud-local.listen = [ {
index index.php index.html; port = 45837;
location ~ \.php$ { addr = "nextcloud-local";
fastcgi_pass unix:${config.services.phpfpm.pools.php.socket}; } ];
} main = let
''; phpPool = ''
localNetworks = '' index index.php index.html;
allow fc00::/64; location ~ \.php$ {
allow fc01::/96; fastcgi_pass unix:${config.services.phpfpm.pools.php.socket};
allow 10.0.0.0/16; }
allow 10.1.0.0/24; '';
deny all; localNetworks = ''
''; allow fc00::/64;
in { allow fc01::/96;
quic = true; allow 10.0.0.0/16;
default = true; allow 10.1.0.0/24;
forceSSL = true; deny all;
root = "/srv/http"; '';
useACMEHost = "bogaledev.ru"; in {
extraConfig = '' quic = true;
add_header Alt-Svc 'h3=":443"; ma=2592000' always; default = true;
add_header X-Content-Type-Options 'nosniff' always; forceSSL = true;
''; root = "/srv/http";
locations = { useACMEHost = "bogaledev.ru";
"/".extraConfig = phpPool; extraConfig = ''
"/local/".extraConfig = "${phpPool} ${localNetworks}"; add_header Alt-Svc 'h3=":443"; ma=2592000' always;
"/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/"; add_header X-Content-Type-Options 'nosniff' always;
"/vw/" = { '';
proxyWebsockets = true; locations = {
extraConfig = localNetworks; "/".extraConfig = phpPool;
proxyPass = "http://localhost:46151"; "/local/".extraConfig = "${phpPool} ${localNetworks}";
}; "/nextcloud/".proxyPass = "http://nextcloud-local:45837/";
"/grafana/" = { "/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/";
proxyWebsockets = true; "/vaultwarden/" = {
extraConfig = localNetworks; proxyWebsockets = true;
proxyPass = "http://unix:/run/grafana/grafana.sock:/"; extraConfig = localNetworks;
proxyPass = "http://localhost:46151";
};
"/grafana/" = {
proxyWebsockets = true;
extraConfig = localNetworks;
proxyPass = "http://unix:/run/grafana/grafana.sock:/";
};
}; };
}; };
}; };