kanidm-setup: become the gitea user as root; README: postfix relays from the containers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GT37Z1Xtfd9pUuQtMTg6Yt
This commit is contained in:
+6
-2
@@ -136,8 +136,12 @@ if [ -n "${GITEA_URL:-}" ] && [ -n "${RESPONSIBLE_GROUP:-}" ]; then
|
||||
discover="https://$ID_HOST/oauth2/openid/$G/.well-known/openid-configuration"
|
||||
# On the host that runs that Gitea, add or update its source here;
|
||||
# anywhere else, leave the secret in a file only this user can read.
|
||||
if command -v gitea >/dev/null 2>&1 && sudo -n -u gitea true 2>/dev/null; then
|
||||
GT="sudo -n -u gitea gitea --config ${GITEA_CONFIG:-/etc/gitea/app.ini} admin auth"
|
||||
# As root (this script is usually run under sudo) become the gitea
|
||||
# user directly: on kasse root is not in sudoers.
|
||||
as_gitea=""
|
||||
if [ "$(id -u)" = 0 ]; then as_gitea="runuser -u gitea --"; elif sudo -n -u gitea true 2>/dev/null; then as_gitea="sudo -n -u gitea"; fi
|
||||
if command -v gitea >/dev/null 2>&1 && [ -n "$as_gitea" ]; then
|
||||
GT="$as_gitea gitea --config ${GITEA_CONFIG:-/etc/gitea/app.ini} admin auth"
|
||||
id=$($GT list 2>/dev/null | awk -v n="$N" '$2 == n { print $1 }')
|
||||
if [ -n "$id" ]; then
|
||||
$GT update-oauth --id "$id" --key "$G" --secret "$gsecret" --auto-discover-url "$discover" \
|
||||
|
||||
Reference in New Issue
Block a user