This commit is contained in:
ryuuseijin 2026-08-17 22:57:58 +08:00
parent 69501a7a63
commit d26d2f4ccc

View file

@ -46,7 +46,11 @@ case "$primary_region" in
;; ;;
esac esac
prompt admin_username 'Forgejo admin username' 'admin' prompt admin_username 'Forgejo admin username'
if [ "${admin_username,,}" = admin ]; then
printf 'The username "admin" is reserved by Forgejo. Choose another username.\n' >&2
exit 1
fi
case "$admin_username" in case "$admin_username" in
-*|*-|*[!A-Za-z0-9._-]*) -*|*-|*[!A-Za-z0-9._-]*)
printf 'The Forgejo username may only contain letters, numbers, ., _, and internal hyphens.\n' >&2 printf 'The Forgejo username may only contain letters, numbers, ., _, and internal hyphens.\n' >&2