update
This commit is contained in:
@@ -109,6 +109,29 @@ start-direct)
|
||||
-f compose.direct.yaml \
|
||||
up -d --build
|
||||
;;
|
||||
create-admin)
|
||||
require_env
|
||||
command -v openssl >/dev/null 2>&1 ||
|
||||
fail "openssl is required to generate the temporary password"
|
||||
printf 'Gitea administrator username [taiadmin]: '
|
||||
read -r admin_username
|
||||
admin_username="${admin_username:-taiadmin}"
|
||||
printf 'Gitea administrator email: '
|
||||
read -r admin_email
|
||||
[[ -n "$admin_email" ]] || fail "an administrator email is required"
|
||||
temporary_password="$(openssl rand -base64 24)"
|
||||
docker compose exec -T gitea gitea admin user create \
|
||||
--admin \
|
||||
--username "$admin_username" \
|
||||
--email "$admin_email" \
|
||||
--password "$temporary_password" \
|
||||
--must-change-password
|
||||
printf '\nGitea administrator created.\n'
|
||||
printf 'Username: %s\n' "$admin_username"
|
||||
printf 'Temporary password: %s\n' "$temporary_password"
|
||||
printf 'Sign in at https://%s/ and change the password immediately.\n' \
|
||||
"$GITEA_DOMAIN"
|
||||
;;
|
||||
renew)
|
||||
require_env
|
||||
[[ "$SSL_MODE" == "letsencrypt" ]] ||
|
||||
@@ -133,7 +156,7 @@ status)
|
||||
docker compose -f compose.yaml -f compose.tls.yaml ps
|
||||
;;
|
||||
*)
|
||||
printf 'Usage: %s {prepare|bootstrap|start|start-direct|renew|backup|status}\n' "$0"
|
||||
printf 'Usage: %s {prepare|bootstrap|start|start-direct|create-admin|renew|backup|status}\n' "$0"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user