Add user setup script

This commit is contained in:
soraefir
2026-05-10 21:39:12 +02:00
parent 1b2a724a26
commit 09539b5866
6 changed files with 80 additions and 46 deletions

View File

@@ -57,10 +57,10 @@ in {
};
setup = {
trigger="server";
trigger = "server";
script = pkgs.writeShellScript "setup" ''
# Define the command wrapper
OCC="${pkgs.podman}/bin/podman --events-backend=none exec -u www-data nextcloud-server php occ"
OCC="${pkgs.podman}/bin/podman --events-backend=none exec --env-file ${config.sops.secrets."CUSTOM".path} -e DOMAIN=${serverCfg.hostDomain} -u www-data nextcloud-server php occ"
echo "Waiting for Nextcloud container to start..."
until $OCC status > /dev/null 2>&1; do
@@ -71,10 +71,11 @@ in {
if [ -z "$INSTALLED" ]; then
echo "Running first-time setup..."
# $OCC maintenance:install \
# --admin-user "admin" \
# --admin-pass "adminpassword"
$OCC maintenance:install \
--admin-user "$DEFAULT_ADMIN_USERNAME" \
--admin-pass "$DEFAULT_ADMIN_PASSWORD"
fi
if [ -z "$INSTALLED" ]; then
echo "Applying Settings..."
$OCC config:system:set default_phone_region --value="CH"