diff --git a/configs/sputnik/nginx.nix b/configs/sputnik/nginx.nix index 0102c77..2e3209a 100644 --- a/configs/sputnik/nginx.nix +++ b/configs/sputnik/nginx.nix @@ -259,7 +259,7 @@ in { priority = 210; extraConfig = "return 301 $scheme://$host/remote.php/dav;"; }; - "~ \.(?:css|js|svg|gif)$" = { + "~ .(?:css|js|svg|gif)$" = { proxyPass = "http://nextcloud.workhorse.private$request_uri"; extraConfig = '' expires 6M; # Cache-Control policy borrowed from `.htaccess` @@ -270,7 +270,7 @@ in { client_max_body_size 0; ''; }; - "~ \.woff2?$" = { + "~ .woff2?$" = { proxyPass = "http://nextcloud.workhorse.private$request_uri"; extraConfig = '' expires 7d; # Cache-Control policy borrowed from `.htaccess` diff --git a/configs/workhorse/configuration.nix b/configs/workhorse/configuration.nix index a1951f8..f0dc263 100644 --- a/configs/workhorse/configuration.nix +++ b/configs/workhorse/configuration.nix @@ -25,8 +25,8 @@ ./nextcloud.nix #./mattermost.nix ./borg.nix - ./metabase.nix - ./jupyter.nix + #./metabase.nix + #./jupyter.nix ./mysql.nix ./property.nix ./finance.nix diff --git a/configs/workhorse/nextcloud.nix b/configs/workhorse/nextcloud.nix index e0fae82..eefa87a 100644 --- a/configs/workhorse/nextcloud.nix +++ b/configs/workhorse/nextcloud.nix @@ -175,6 +175,22 @@ in { }; }; + # Backup database + # --------------- + services.mysqlBackup = { + enable = true; + databases = config.services.mysql.ensureDatabases; + singleTransaction = true; + location = "/var/lib/nextcloud/database_backups"; + }; + systemd.services."mysql-backup".serviceConfig = { + ExecStartPre = + [ "+/run/current-system/sw/bin/nextcloud-occ maintenance:mode --on" ]; + ExecStopPost = [ + "+/run/current-system/sw/bin/nextcloud-occ maintenance:mode --off" + ]; + }; + # in php services.phpfpm.phpPackage = pkgs.php73; @@ -226,6 +242,7 @@ in { services.SystemdJournal2Gelf.enable = true; services.SystemdJournal2Gelf.graylogServer = "${hostAddress}:11201"; }; + }; # give containers internet access @@ -261,6 +278,15 @@ in { }; }; + # Backup Config + # ------------- + backup.dirs = [ + "/home/nextcloud/config" + "/home/nextcloud/database_backups" # created by mysqlBackup + ]; + + # Backup Files + # ------------ services.borgbackup.jobs = { "nextcloud-to-media" = { repo = "/media/syncthing/borg/nextcloud";