fix: fix: disinto init change-password triggers must_change_password despite --must-change-password=false (#267)
This commit is contained in:
parent
f04a57e6db
commit
20de8e5d3a
1 changed files with 9 additions and 5 deletions
14
bin/disinto
14
bin/disinto
|
|
@ -708,11 +708,15 @@ setup_forge() {
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Admin user: ${admin_user} (already exists)"
|
echo "Admin user: ${admin_user} (already exists)"
|
||||||
# Reset password to the persisted value so basic-auth works (#158)
|
# Only reset password if basic auth fails (#158, #267)
|
||||||
_forgejo_exec forgejo admin user change-password \
|
# Forgejo 11.x may ignore --must-change-password=false, blocking token creation
|
||||||
--username "${admin_user}" \
|
if ! curl -sf --max-time 5 -u "${admin_user}:${admin_pass}" \
|
||||||
--password "${admin_pass}" \
|
"${forge_url}/api/v1/user" >/dev/null 2>&1; then
|
||||||
--must-change-password=false
|
_forgejo_exec forgejo admin user change-password \
|
||||||
|
--username "${admin_user}" \
|
||||||
|
--password "${admin_pass}" \
|
||||||
|
--must-change-password=false
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# Preserve password for Woodpecker OAuth2 token generation (#779)
|
# Preserve password for Woodpecker OAuth2 token generation (#779)
|
||||||
_FORGE_ADMIN_PASS="$admin_pass"
|
_FORGE_ADMIN_PASS="$admin_pass"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue