From 3f42dca62b2cad903f92dbdd6789c1428976fd81 Mon Sep 17 00:00:00 2001 From: Tyler Starr Date: Sun, 25 May 2025 15:35:53 -0700 Subject: [PATCH] switch to nextcloud in docker and edit nginx --- provision/hosts/torus/configuration.nix | 18 +++++-- provision/hosts/torus/nextcloud.nix | 68 ------------------------- 2 files changed, 14 insertions(+), 72 deletions(-) delete mode 100644 provision/hosts/torus/nextcloud.nix diff --git a/provision/hosts/torus/configuration.nix b/provision/hosts/torus/configuration.nix index 7b5b7fdd..62556a12 100644 --- a/provision/hosts/torus/configuration.nix +++ b/provision/hosts/torus/configuration.nix @@ -6,7 +6,6 @@ ./rss.nix ./home-assistant ./gitea.nix - ./nextcloud.nix ./backup.nix ./jellyfin.nix ]; @@ -73,17 +72,28 @@ client_max_body_size 3000m; ''; }); + "cloud.tstarr.us" = (SSL // { + locations."/".proxyPass = "http://localhost:8080/"; + extraConfig = '' + client_max_body_size 3000m; + ''; + }); "lc.tstarr.us" = (SSL // { locations."/" = { proxyPass = "http://localhost:8065/"; proxyWebsockets = true; }; }); - "code.tstarr.us" = (SSL // { + "codeA.tstarr.us" = (SSL // { locations."/" = { - proxyPass = "http://localhost:8443/"; + proxyPass = "http://localhost:3000/"; + proxyWebsockets = true; + }; + }); + "codeB.tstarr.us" = (SSL // { + locations."/" = { + proxyPass = "http://localhost:3002/"; proxyWebsockets = true; - }; }); }; diff --git a/provision/hosts/torus/nextcloud.nix b/provision/hosts/torus/nextcloud.nix deleted file mode 100644 index 31c16a63..00000000 --- a/provision/hosts/torus/nextcloud.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, lib, pkgs, user, ... }: -let - dumpFolder = "/engi/backup/dumps/nextcloud"; - domain = "cloud.tstarr.us"; -in { - environment.systemPackages = with pkgs; [ - cron - zip - rsync - (pkgs.writeScriptBin "dump-nextcloud" '' - #!/bin/sh - cd ${dumpFolder} - [ -e nextcloud-sql ] && rm nextcloud-sql - nextcloud-occ maintenance:mode --on - mysqldump --single-transaction nextcloud > ${dumpFolder}/nextcloud-sql - nextcloud-occ maintenance:mode --off - '') - ]; - - systemd.tmpfiles.rules = [ - "d ${dumpFolder} 0775 nextcloud nextcloud -" - ]; - - # nextcloud secrets - age.secrets."nextcloud/password" = { - file = ../../secrets/nextcloud/password.age; - owner = "nextcloud"; - group = "nextcloud"; - }; - - services = { - nginx.virtualHosts = { - "${domain}" = { - forceSSL = true; - enableACME = true; - }; - }; - - nextcloud = { - enable = true; - hostName = "${domain}"; - - # Need to manually increment with every major upgrade. - package = pkgs.nextcloud30; - - # Let NixOS install and configure the database automatically. - database.createLocally = true; - - # Let NixOS install and configure Redis caching automatically. - configureRedis = true; - - # Increase the maximum file upload size to avoid problems uploading videos. - maxUploadSize = "16G"; - https = true; - autoUpdateApps.enable = true; - settings = { - overwriteprotocol = "https"; - default_phone_region = "US"; - }; - - config = { - dbtype = "mysql"; - adminuser = "admin"; - adminpassFile = "/run/agenix/nextcloud/password"; - }; - }; - }; -}