From 126ab04becad81bac80086520791f15319268f2c Mon Sep 17 00:00:00 2001 From: lhahn Date: Wed, 14 Oct 2026 16:31:40 +0200 Subject: [PATCH] Make admin creation upgrade-safe and drop deprecated avatar options - "generate admin user" handler also fires on version upgrades; tolerate an existing admin and hide the password from logs (no_log) - remove [picture] DISABLE_GRAVATAR / ENABLE_FEDERATED_AVATAR, which Gitea >= 1.23 ignores (moved to the admin panel) Co-Authored-By: Claude Opus 5.5 --- handlers/main.yml | 5 +++++ templates/opt/gitea/home/app.ini.j2 | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 186ea82..256ca8c 100755 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -16,3 +16,8 @@ --work-path {{ gitea_data_location }} become: yes become_user: "{{ gitea_usr }}" + register: gitea_admin_create + # handler also fires on version upgrades; an existing admin is fine + failed_when: gitea_admin_create.rc != 0 and 'user already exists' not in gitea_admin_create.stderr + changed_when: gitea_admin_create.rc == 0 + no_log: true diff --git a/templates/opt/gitea/home/app.ini.j2 b/templates/opt/gitea/home/app.ini.j2 index 303eff8..e2118d2 100755 --- a/templates/opt/gitea/home/app.ini.j2 +++ b/templates/opt/gitea/home/app.ini.j2 @@ -58,10 +58,6 @@ DEFAULT_ALLOW_CREATE_ORGANIZATION = true DEFAULT_ENABLE_TIMETRACKING = true NO_REPLY_ADDRESS = noreply.{{ gitea_ssh_domain }} -[picture] -DISABLE_GRAVATAR = false -ENABLE_FEDERATED_AVATAR = true - [openid] ENABLE_OPENID_SIGNIN = false ENABLE_OPENID_SIGNUP = false