From b82033f8579f1fa16427da0dbab7b7da7d3538e5 Mon Sep 17 00:00:00 2001 From: soraefir Date: Mon, 11 May 2026 22:45:34 +0200 Subject: [PATCH] gitea adminify --- modules/server/containers/apps/etherpad.nix | 1 + modules/server/containers/apps/gitea.nix | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/modules/server/containers/apps/etherpad.nix b/modules/server/containers/apps/etherpad.nix index d37e538..2af792d 100644 --- a/modules/server/containers/apps/etherpad.nix +++ b/modules/server/containers/apps/etherpad.nix @@ -117,6 +117,7 @@ in { envFile = config.sops.secrets."ETHERPAD".path; script = pkgs.writeShellScript "setup" '' echo "$APIKEY" > ${serverCfg.configPath}/etherpad/APIKEY.txt + chmod 444 ${serverCfg.configPath}/etherpad/APIKEY.txt ''; }; diff --git a/modules/server/containers/apps/gitea.nix b/modules/server/containers/apps/gitea.nix index c9b9de7..c8398d9 100644 --- a/modules/server/containers/apps/gitea.nix +++ b/modules/server/containers/apps/gitea.nix @@ -82,4 +82,18 @@ in { }; }; }; + + + setup = { + trigger = "server"; + script = pkgs.writeShellScript "setup" '' + # Define the command wrapper + GT="${pkgs.podman}/bin/podman --events-backend=none exec --env-file ${config.sops.secrets."CUSTOM".path} -e DOMAIN=${serverCfg.hostDomain} -u root gitea-server gitea" + + $GT admin user create --admin --username "$DEFAULT_ADMIN_USERNAME" --password "$DEFAULT_ADMIN_PASSWORD" --email "$DEFAULT_ADMIN_EMAIL" || true + $GT admin user change --username "$DEFAULT_ADMIN_USERNAME" --admin + + echo "Completed Gitea Setup" + ''; + }; } \ No newline at end of file