diff --git a/host.nix b/host.nix index a122ba7..102b5b2 100644 --- a/host.nix +++ b/host.nix @@ -90,7 +90,8 @@ lib.flatMap ({ name, config, ip, ports, volumes, ... }: then {} else { "${host}" = { - # enableACME = true; + enableACME = true; + forceSSL = true; locations."/".proxyPass = "http://${ip}:${builtins.toString ports.http}"; }; @@ -155,43 +156,43 @@ lib.flatMap ({ name, config, ip, ports, volumes, ... }: }; # [BACKUPS] - systemd = { - timers.backup-container-storage = { - enable = true; - description = "Backup container volumes"; - wantedBy = ["multi-user.target"]; - timerConfig = { - OnCalendar = "*-*-* 02:00:00"; - Unit = "backup-container-storage.service"; - }; - }; - services.backup-container-storage = { - description = "Backup container volumes"; - startLimitBurst = 1; - startLimitIntervalSec = 1800; - script = with builtins; let - volumes = concatMap (s: s.volumes) services; - backupVolumes = filter (v: if v ? backup then v.backup else true) volumes; - backupMountpoints = map (v: hostVolumeDir + v.name) backupVolumes; - in '' - PATH="$PATH:${pkgs.lib.makeBinPath [ - pkgs.gnutar - pkgs.gzip - ]}" - mountpoint ${hostBackupDir} || { - echo "${hostBackupDir} is not a mountpoint!" - exit 7 - } - echo "Starting Backup" - # 7 days of backups - rm -rf ${hostBackupDir}/backup.7.tgz - for x in $(seq 6); do - mv "${hostBackupDir}/backup.$x.tgz" "${hostBackupDir}/backup.$((x+1)).tgz" - done - tar -zcvpf ${hostBackupDir}/backup.1.tgz ${toString backupMountpoints} - ''; - }; - }; + # systemd = { + # timers.backup-container-storage = { + # enable = true; + # description = "Backup container volumes"; + # wantedBy = ["multi-user.target"]; + # timerConfig = { + # OnCalendar = "*-*-* 02:00:00"; + # Unit = "backup-container-storage.service"; + # }; + # }; + # services.backup-container-storage = { + # description = "Backup container volumes"; + # startLimitBurst = 1; + # startLimitIntervalSec = 1800; + # script = with builtins; let + # volumes = concatMap (s: s.volumes) services; + # backupVolumes = filter (v: if v ? backup then v.backup else true) volumes; + # backupMountpoints = map (v: hostVolumeDir + v.name) backupVolumes; + # in '' + # PATH="$PATH:${pkgs.lib.makeBinPath [ + # pkgs.gnutar + # pkgs.gzip + # ]}" + # mountpoint ${hostBackupDir} || { + # echo "${hostBackupDir} is not a mountpoint!" + # exit 7 + # } + # echo "Starting Backup" + # # 7 days of backups + # rm -rf ${hostBackupDir}/backup.7.tgz + # for x in $(seq 6); do + # mv "${hostBackupDir}/backup.$x.tgz" "${hostBackupDir}/backup.$((x+1)).tgz" + # done + # tar -zcvpf ${hostBackupDir}/backup.1.tgz ${toString backupMountpoints} + # ''; + # }; + # }; # [SECURITY] security.sudo.execWheelOnly = true; diff --git a/services/gitea.nix b/services/gitea.nix index f8643da..8712309 100644 --- a/services/gitea.nix +++ b/services/gitea.nix @@ -20,7 +20,7 @@ server = { DOMAIN = "githug.xyz"; ROOT_URL = "https://githug.xyz/"; - # COOKIE_SECURE = true; + COOKIE_SECURE = true; HTTP_PORT = 3001; OFFLINE_MODE = true; };