Fix hostname SSL toggle and PHP mode option

This commit is contained in:
Marek Miklewicz
2026-06-13 21:25:45 +02:00
parent 678cbc9066
commit c0261418c8
2 changed files with 15 additions and 4 deletions
+7 -3
View File
@@ -16,6 +16,7 @@ DEFAULT_NS1=dns3.hitme.net.pl
DEFAULT_NS2=dns4.hitme.net.pl DEFAULT_NS2=dns4.hitme.net.pl
SSH_PORT=10022 SSH_PORT=10022
REDIS_VERSION=8 REDIS_VERSION=8
HOSTNAME_SSL=1
SETUP_TXT="$DADIR/conf/setup.txt" SETUP_TXT="$DADIR/conf/setup.txt"
PLUGIN_ARCHIVE_DIR="$DAPOSTINSTALL_DIR/plugins" PLUGIN_ARCHIVE_DIR="$DAPOSTINSTALL_DIR/plugins"
BRANDING_DIR="$DAPOSTINSTALL_DIR/branding" BRANDING_DIR="$DAPOSTINSTALL_DIR/branding"
@@ -50,11 +51,9 @@ configure_custombuild_php() {
release_var="php${idx}_release" release_var="php${idx}_release"
release="${!release_var}" release="${!release_var}"
da build set "php${idx}_release" "$release" da build set "php${idx}_release" "$release"
if [[ "$release" != "no" ]]; then
da build set "php${idx}_mode" "php-fpm"
fi
done done
da build set "php1_mode" "php-fpm"
da build php da build php
da build rewrite_confs da build rewrite_confs
} }
@@ -134,6 +133,11 @@ install_local_plugins() {
} }
request_directadmin_certificate() { request_directadmin_certificate() {
if [[ "$HOSTNAME_SSL" == "0" ]]; then
echo "HOSTNAME_SSL=0 - pomijam certyfikat Let's Encrypt dla hostname DirectAdmin"
return 0
fi
echo "Instalacja certyfikatu Let's Encrypt dla hostname DirectAdmin" echo "Instalacja certyfikatu Let's Encrypt dla hostname DirectAdmin"
if ! "$DADIR/scripts/letsencrypt.sh" server_cert; then if ! "$DADIR/scripts/letsencrypt.sh" server_cert; then
+8 -1
View File
@@ -103,6 +103,7 @@ assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^DEFAULT_NS1=dns3\.hitme\.net
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^DEFAULT_NS2=dns4\.hitme\.net\.pl$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^DEFAULT_NS2=dns4\.hitme\.net\.pl$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^SSH_PORT=10022$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^SSH_PORT=10022$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^REDIS_VERSION=8$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^REDIS_VERSION=8$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^HOSTNAME_SSL=1$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^PLUGIN_ARCHIVE_DIR="\$DAPOSTINSTALL_DIR/plugins"$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^PLUGIN_ARCHIVE_DIR="\$DAPOSTINSTALL_DIR/plugins"$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^BRANDING_DIR="\$DAPOSTINSTALL_DIR/branding"$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^BRANDING_DIR="\$DAPOSTINSTALL_DIR/branding"$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^DA_TEMPLATES_ARCHIVE="\$BRANDING_DIR/da_templates\.tar"$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^DA_TEMPLATES_ARCHIVE="\$BRANDING_DIR/da_templates\.tar"$'
@@ -110,6 +111,9 @@ assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^DA_BRANDING_ARCHIVE="\$BRAND
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^php1_release=' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^php1_release='
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^php2_release=' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^php2_release='
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^php9_release=' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^php9_release='
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build set "php1_mode" "php-fpm"'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'php\$?\{?idx\}?_mode'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'php[2-9]_mode'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^ioncube=yes$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^ioncube=yes$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^zend=yes$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^zend=yes$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^opcache=yes$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^opcache=yes$'
@@ -143,7 +147,8 @@ assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^configure_custombuild_php\(\
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'release_var="php\$\{idx\}_release"' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'release_var="php\$\{idx\}_release"'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'release="\$\{!release_var\}"' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'release="\$\{!release_var\}"'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build set "php\$\{idx\}_release" "\$release"' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build set "php\$\{idx\}_release" "\$release"'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build set "php\$\{idx\}_mode" "php-fpm"' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build set "php1_mode" "php-fpm"'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'da build set "php\$\{idx\}_mode"'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build php' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build php'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build rewrite_confs' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'da build rewrite_confs'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'eximconf_release' assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'eximconf_release'
@@ -175,6 +180,8 @@ assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'Jaka skorke ustawic'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'Wybierz tryb instalacji' assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'Wybierz tryb instalacji'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" "s/evolution/enhanced" assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" "s/evolution/enhanced"
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'request_directadmin_certificate\(\)' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'request_directadmin_certificate\(\)'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '\[\[ "\$HOSTNAME_SSL" == "0" \]\]'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'HOSTNAME_SSL=0 - pomijam certyfikat'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'letsencrypt\.sh" server_cert' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'letsencrypt\.sh" server_cert'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'Nie udalo sie wystawic certyfikatu DirectAdmin' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'Nie udalo sie wystawic certyfikatu DirectAdmin'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'request_single "\$da_hostname" 4096' assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" 'request_single "\$da_hostname" 4096'