This commit is contained in:
@@ -17,6 +17,9 @@ fail() {
|
||||
sed -n '/^read_existing_env()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^read_setup_env()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^read_reinstall_env()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^port_is_listening()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^valid_app_port()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^configure_app_port()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^is_semver()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^write_env_file_preserving_unknown()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
sed -n '/^azul_arch()/,/^}/p' "$ROOT/deploy/install.sh"
|
||||
@@ -78,6 +81,31 @@ grep -qx 'jdbc:mysql://runtime/kaidi_finance' <(read_reinstall_env DB_URL) \
|
||||
grep -qx 'runtime-user' <(read_reinstall_env DB_USERNAME) \
|
||||
|| fail 'reinstall did not prefer the completed setup runtime database user'
|
||||
|
||||
for port in 1024 18080 65535; do
|
||||
valid_app_port "$port" || fail "installer rejected valid application port $port"
|
||||
done
|
||||
for port in 0 80 1023 65536 invalid 18080.0; do
|
||||
! valid_app_port "$port" || fail "installer accepted invalid application port $port"
|
||||
done
|
||||
port_is_listening() { return 1; }
|
||||
log() { printf '%s\n' "$*" >/dev/null; }
|
||||
# shellcheck disable=SC2329 # Invoked by the extracted installer helper.
|
||||
die() { printf '%s\n' "$*" >&2; return 1; }
|
||||
export APP_PORT=19090 SERVER_ADDRESS=127.0.0.1 HEALTH_URL='' APP_INDEX_URL='' REINSTALL=false
|
||||
configure_app_port
|
||||
[ "$HEALTH_URL" = 'http://127.0.0.1:19090/actuator/health' ] \
|
||||
|| fail 'selected application port did not reach the health URL'
|
||||
[ "$APP_INDEX_URL" = 'http://127.0.0.1:19090/' ] \
|
||||
|| fail 'selected application port did not reach the frontend URL'
|
||||
export APP_PORT=19091 SERVER_ADDRESS=::1 HEALTH_URL='' APP_INDEX_URL=''
|
||||
configure_app_port
|
||||
[ "$HEALTH_URL" = 'http://[::1]:19091/actuator/health' ] \
|
||||
|| fail 'IPv6 bind address did not produce a bracketed health URL'
|
||||
[ "$APP_INDEX_URL" = 'http://[::1]:19091/' ] \
|
||||
|| fail 'IPv6 bind address did not produce a bracketed frontend URL'
|
||||
[ "$PROXY_TARGET" = 'http://[::1]:19091' ] \
|
||||
|| fail 'IPv6 bind address did not produce a bracketed reverse-proxy target'
|
||||
|
||||
for version in 0.0.0 1.2.3-alpha- 1.2.3--alpha 1.2.3-alpha+build.07; do
|
||||
is_semver "$version" || fail "installer rejected valid SemVer $version"
|
||||
"$ROOT/scripts/check-semver.sh" "$version" || fail "release workflow rejected valid SemVer $version"
|
||||
@@ -218,6 +246,14 @@ grep -Fq 'KAIDI_SETUP_WIZARD' "$ROOT/deploy/install.sh" \
|
||||
|| fail 'installer no longer supports first-run setup mode'
|
||||
grep -Fq 'FINANCE_SETUP_TOKEN_SHA256' "$ROOT/deploy/install.sh" \
|
||||
|| fail 'installer no longer writes the one-time setup-code hash'
|
||||
# shellcheck disable=SC2016 # Match literal installer source.
|
||||
grep -Fq 'SERVER_PORT "$APP_PORT"' "$ROOT/deploy/install.sh" \
|
||||
|| fail 'installer does not persist the selected application port'
|
||||
# shellcheck disable=SC2016 # Match literal installer source.
|
||||
grep -Fq 'SERVER_ADDRESS "$SERVER_ADDRESS"' "$ROOT/deploy/install.sh" \
|
||||
|| fail 'installer does not persist the selected bind address'
|
||||
! grep -Eqi 'nginx|/etc/nginx/' "$ROOT/deploy/install.sh" \
|
||||
|| fail 'installer must not install, start, or modify Nginx'
|
||||
grep -Fq 'EnvironmentFile=-/var/lib/kaidi/setup/application.env' \
|
||||
"$ROOT/deploy/systemd/kaidi-finance.service" \
|
||||
|| fail 'application service no longer loads the setup-completion environment'
|
||||
@@ -230,4 +266,4 @@ grep -Fq 'chown root:kaidi "$UPDATE_STATE_ROOT"' "$ROOT/deploy/install.sh" \
|
||||
grep -Fq 'install.sh | sudo bash' "$ROOT/README.md" \
|
||||
|| fail 'README does not document the public one-line setup-wizard install path'
|
||||
|
||||
printf 'Install configuration, public Gitea, optional private token, i686, setup wizard, and MySQL 8.4 fixtures passed\n'
|
||||
printf 'Install configuration, custom port, public Gitea, optional private token, i686, setup wizard, and MySQL 8.4 fixtures passed\n'
|
||||
|
||||
Reference in New Issue
Block a user