Suggest hostname-based SRS domain for first installation

This commit is contained in:
2026-10-20 12:03:11 +02:00
parent 53b92f7867
commit b9adecf3d6
+12 -1
View File
@@ -232,8 +232,19 @@ read_config_domain_hint() {
# First user interaction, before any installation/prerequisite checks. # First user interaction, before any installation/prerequisite checks.
# The shared Git script never has a server-specific domain hardcoded. # The shared Git script never has a server-specific domain hardcoded.
prompt_srs_domain() { prompt_srs_domain() {
local answer='' local answer='' host_fqdn=''
read_config_domain_hint read_config_domain_hint
# For a first installation, suggest srs.<hostname -f>.
# A configured SRS domain always takes precedence.
if [[ -z "$CONFIG_DOMAIN_HINT" ]]; then
host_fqdn="$(hostname -f 2>/dev/null || true)"
host_fqdn="${host_fqdn,,}"
if [[ "$host_fqdn" =~ ^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.])+[a-z]{2,63}$ ]] &&
(( ${#host_fqdn} <= 249 )); then
CONFIG_DOMAIN_HINT="srs.${host_fqdn}"
fi
fi
echo echo
echo 'Selective SRS - domain selection' echo 'Selective SRS - domain selection'
echo echo