php-fpm, vaultwarden

This commit is contained in:
bogale 2026-09-17 17:26:25 +09:00
commit 3c8807e38f
3 changed files with 54 additions and 8 deletions

View file

@ -18,21 +18,63 @@
'';
};
};
#environment.systemPackages = with pkgs; [
#php
#];
services = {
postgresql.enable = true;
openssh = {
enable = true;
openFirewall = false;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
phpfpm.pools.main = {
user = "nginx";
group = "nginx";
settings = {
"pm" = "ondemand";
"pm.max_children" = 8;
"listen.owner" = "nginx";
"listen.group" = "nginx";
};
};
nginx = {
enable = true;
virtualHosts."_".default = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedBrotliSettings = true;
virtualHosts."_" = {
locations."/" = {
return = "200 '<html><body>It works</body></html>'";
extraConfig = ''
default_type text/html;
'';
};
default = true;
root = "/srv/http/_";
locations."~ \\.php$".extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.main.socket};
'';
};
};
vaultwarden = {
enable = true;
configureNginx = true;
dbBackend = "postgresql";
configurePostgres = true;
package = pkgs.vaultwarden-postgresql;
domain = "https://wg.bogaledev.ru/vault";
environmentFile = "/root/secrets/vaultwarden.env";
config = {
EMAIL_TOKEN_SIZE = 8;
SMTP_SECURITY = "off";
SMTP_HOST = "localhost";
SIGNUPS_ALLOWED = false;
REQUIRE_DEVICE_EMAIL = true;
TRASH_AUTO_DELETE_DAYS = 90;
ROCKET_ADDRESS = "127.0.0.1";
PASSWORD_HINTS_ALLOWED = false;
EMERGENCY_ACCESS_ALLOWED = false;
SMTP_FROM = "vaultwarden@bogaledev.ru";
};
};
};