Compare commits
1 commit
38c8b76669
...
817d691e4d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
817d691e4d |
1 changed files with 4 additions and 4 deletions
|
|
@ -138,7 +138,7 @@ setup_forge() {
|
||||||
admin_pass="admin-$(head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 20)"
|
admin_pass="admin-$(head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 20)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! curl -sf --max-time 5 -H "Authorization: token ${admin_token}" "${forge_url}/api/v1/users/${admin_user}" >/dev/null 2>&1; then
|
if ! curl -sf --max-time 5 -H "Authorization: token ${FORGE_TOKEN:-}" "${forge_url}/api/v1/users/${admin_user}" >/dev/null 2>&1; then
|
||||||
echo "Creating admin user: ${admin_user}"
|
echo "Creating admin user: ${admin_user}"
|
||||||
local create_output
|
local create_output
|
||||||
if ! create_output=$(_forgejo_exec forgejo admin user create \
|
if ! create_output=$(_forgejo_exec forgejo admin user create \
|
||||||
|
|
@ -159,7 +159,7 @@ setup_forge() {
|
||||||
--must-change-password=false
|
--must-change-password=false
|
||||||
|
|
||||||
# Verify admin user was actually created
|
# Verify admin user was actually created
|
||||||
if ! curl -sf --max-time 5 -H "Authorization: token ${admin_token}" "${forge_url}/api/v1/users/${admin_user}" >/dev/null 2>&1; then
|
if ! curl -sf --max-time 5 -H "Authorization: token ${FORGE_TOKEN:-}" "${forge_url}/api/v1/users/${admin_user}" >/dev/null 2>&1; then
|
||||||
echo "Error: admin user '${admin_user}' not found after creation" >&2
|
echo "Error: admin user '${admin_user}' not found after creation" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -190,7 +190,7 @@ setup_forge() {
|
||||||
local human_pass
|
local human_pass
|
||||||
human_pass="admin-$(head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 20)"
|
human_pass="admin-$(head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 20)"
|
||||||
|
|
||||||
if ! curl -sf --max-time 5 -H "Authorization: token ${admin_token}" "${forge_url}/api/v1/users/${human_user}" >/dev/null 2>&1; then
|
if ! curl -sf --max-time 5 -H "Authorization: token ${FORGE_TOKEN:-}" "${forge_url}/api/v1/users/${human_user}" >/dev/null 2>&1; then
|
||||||
echo "Creating human user: ${human_user}"
|
echo "Creating human user: ${human_user}"
|
||||||
local create_output
|
local create_output
|
||||||
if ! create_output=$(_forgejo_exec forgejo admin user create \
|
if ! create_output=$(_forgejo_exec forgejo admin user create \
|
||||||
|
|
@ -211,7 +211,7 @@ setup_forge() {
|
||||||
--must-change-password=false
|
--must-change-password=false
|
||||||
|
|
||||||
# Verify human user was actually created
|
# Verify human user was actually created
|
||||||
if ! curl -sf --max-time 5 -H "Authorization: token ${admin_token}" "${forge_url}/api/v1/users/${human_user}" >/dev/null 2>&1; then
|
if ! curl -sf --max-time 5 -H "Authorization: token ${FORGE_TOKEN:-}" "${forge_url}/api/v1/users/${human_user}" >/dev/null 2>&1; then
|
||||||
echo "Error: human user '${human_user}' not found after creation" >&2
|
echo "Error: human user '${human_user}' not found after creation" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue