switch to nextcloud in docker and edit nginx

This commit is contained in:
Tyler Starr 2025-05-25 15:35:53 -07:00
parent 72b6c537c5
commit 3f42dca62b
2 changed files with 14 additions and 72 deletions

View File

@ -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;
};
});
};

View File

@ -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";
};
};
};
}