better prompts

This commit is contained in:
ryuuseijin 2026-08-17 23:01:01 +08:00
parent d26d2f4ccc
commit da25d78c21
3 changed files with 21 additions and 4 deletions

View file

@ -38,6 +38,7 @@ case "$app_name" in
;;
esac
printf 'Available Fly regions: https://fly.io/docs/reference/regions/\n'
prompt primary_region 'Fly primary region' 'nrt'
case "$primary_region" in
*[!a-z0-9]*)
@ -63,6 +64,20 @@ if [[ "$admin_email" != *@* ]]; then
exit 1
fi
require_signin_view=true
read -r -p 'Force visitors to sign in before viewing Forgejo? [Y/n]: ' force_forgejo_login
case "$force_forgejo_login" in
''|y|Y|yes|YES)
;;
n|N|no|NO)
require_signin_view=false
;;
*)
printf 'Please answer yes or no.\n' >&2
exit 1
;;
esac
caddy_username=
caddy_password=
read -r -p 'Enable Caddy HTTP basic auth? [y/N]: ' enable_caddy_auth
@ -100,6 +115,7 @@ admin_password="$(openssl rand -base64 24 | tr -d '\n')"
sed \
-e "s/__APP_NAME__/$app_name/g" \
-e "s/__PRIMARY_REGION__/$primary_region/g" \
-e "s/__REQUIRE_SIGNIN_VIEW__/$require_signin_view/g" \
"$template" > "$config"
printf '\nGenerated Forgejo admin credentials:\n'