Skip to content

Commit

Permalink
Fixed fermi configuration for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
aftix committed May 17, 2024
1 parent 1cece6e commit 88df2b2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions host/opt/www/znc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,25 @@ in {
};

systemd = {
tmpfiles.rules = [
"d ${cfg.dataDir} 0750 ${cfg.user} ${cfg.group} -"
"d ${cfg.dataDir}/configs 0750 ${cfg.user} ${cfg.group} -"
];

services = {
znc-init = {
description = "Initialize znc settings";
requires = ["local-fs.target"];
after = ["local-fs.target"];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
User = cfg.user;
Group = cfg.group;
RuntimeDirectory = cfg.dataDir;
RuntimeDirectoryMode = "750";
NoNewPrivileges = true;
ProtectSystem = "strict";
ReadWritePaths = cfg.dataDir;
ProtectHome = true;
StateDirectory = cfg.dataDir;
StateDirectoryMode = "755";
PrivateTmp = true;
ProtectHostname = true;
ProtectClock = true;
Expand Down Expand Up @@ -97,7 +100,7 @@ in {
locations =
{
"/" = {
proxyPass = "http://[[::1]]:7001/";
proxyPass = "http://[::1]:7001/";
extraConfig = ''
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -109,12 +112,12 @@ in {

streamConfig = ''
upstream znc {
server [::1]::7000;
server [::1]:7000;
}
server {
listen 0.0.0.0:6697 http2 ssl;
listen [::0]:6697 http2 ssl;
listen 0.0.0.0:6697 ssl;
listen [::0]:6697 ssl;
ssl_certificate ${config.security.acme.certs.${hostname}.directory}/fullchain.pem;
ssl_certificate_key ${config.security.acme.certs.${hostname}.directory}/key.pem;
Expand Down

0 comments on commit 88df2b2

Please sign in to comment.