Skip to content

Commit c2eadfe

Browse files
author
Kristan Kenney
committed
Change variable to ENFORCE_SUBDOMAIN_OWNERSHIP
1 parent 831caaa commit c2eadfe

File tree

8 files changed

+20
-18
lines changed

8 files changed

+20
-18
lines changed

bin/v-list-sys-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ json_list() {
6868
"LOGIN_STYLE": "'$LOGIN_STYLE'",
6969
"INACTIVE_SESSION_TIMEOUT": "'$INACTIVE_SESSION_TIMEOUT'",
7070
"PHPMYADMIN_KEY": "'$PHPMYADMIN_KEY'",
71-
"ALLOW_USERS_SYSTEM": "'$ALLOW_USERS_SYSTEM'"
71+
"ENFORCE_SUBDOMAIN_OWNERSHIP": "'$ENFORCE_SUBDOMAIN_OWNERSHIP'"
7272
}
7373
}'
7474
}

func/domain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ is_base_domain_owner(){
916916
if [ "$object" != "none" ]; then
917917
get_base_domain $object
918918
web=$(grep -F -H -h "DOMAIN='$basedomain'" $HESTIA/data/users/*/web.conf);
919-
if [ $ALLOW_USERS_SYSTEM = "no" ]; then
919+
if [ $ENFORCE_SUBDOMAIN_OWNERSHIP = "no" ]; then
920920
if [ ! -z "$web" ]; then
921921
parse_object_kv_list "$web"
922922
if [ -z "$ALLOW_USERS" ] || [ "$ALLOW_USERS" != "yes" ]; then

func/upgrade.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ upgrade_health_check() {
145145
fi
146146

147147
# Inactive session timeout
148-
if [ -z "$ALLOW_USERS_SYSTEM" ]; then
149-
echo "[ ! ] Adding missing variable to hestia.conf: ALLOW_USERS_SYSTEM ('yes')"
150-
$BIN/v-change-sys-config-value "ALLOW_USERS_SYSTEM" "yes"
148+
if [ -z "$ENFORCE_SUBDOMAIN_OWNERSHIP" ]; then
149+
echo "[ ! ] Adding missing variable to hestia.conf: ENFORCE_SUBDOMAIN_OWNERSHIP ('yes')"
150+
$BIN/v-change-sys-config-value "ENFORCE_SUBDOMAIN_OWNERSHIP" "yes"
151151
fi
152152

153153
echo "[ * ] Health check complete. Starting upgrade from $VERSION to $new_version..."

install/hst-install-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ echo "LOGIN_STYLE='default'" >> $HESTIA/conf/hestia.conf
10951095
echo "INACTIVE_SESSION_TIMEOUT='60'" >> $HESTIA/conf/hestia.conf
10961096

10971097
# Allow users to always create domains even the are not the owner of the main domain
1098-
echo "ALLOW_USERS_SYSTEM='no'" >> $HESTIA/conf/hestia.conf
1098+
echo "ENFORCE_SUBDOMAIN_OWNERSHIP='yes'" >> $HESTIA/conf/hestia.conf
10991099

11001100
# Version & Release Branch
11011101
echo "VERSION='${HESTIA_INSTALL_VER}'" >> $HESTIA/conf/hestia.conf

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ echo "LOGIN_STYLE='default'" >> $HESTIA/conf/hestia.conf
11281128
echo "INACTIVE_SESSION_TIMEOUT='60'" >> $HESTIA/conf/hestia.conf
11291129

11301130
# Allow users to always create domains even the are not the owner of the main domain
1131-
echo "ALLOW_USERS_SYSTEM='no'" >> $HESTIA/conf/hestia.conf
1131+
echo "ENFORCE_SUBDOMAIN_OWNERSHIP='yes'" >> $HESTIA/conf/hestia.conf
11321132

11331133
# Version & Release Branch
11341134
echo "VERSION='${HESTIA_INSTALL_VER}'" >> $HESTIA/conf/hestia.conf

install/upgrade/versions/1.4.0.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@
1010
if [ -e "/etc/nginx/nginx.conf" ]; then
1111
check=$(cat /etc/nginx/nginx.conf | grep 'fastcgi_cache_path');
1212
if [ -z "$check" ]; then
13-
echo "[ * ] Updating Nginx to support fast cgi cache..."
13+
echo "[ * ] Enabling Nginx FastCGI cache support..."
1414
sed -i 's/# Cache bypass/# FastCGI Cache settings\n fastcgi_cache_path \/var\/cache\/nginx\/php-fpm levels=2\n keys_zone=fcgi_cache:10m inactive=60m max_size=1024m;\n fastcgi_cache_key \"$host$request_uri $cookie_user\";\n fastcgi_temp_path \/var\/cache\/nginx\/temp;\n fastcgi_ignore_headers Expires Cache-Control;\n fastcgi_cache_use_stale error timeout invalid_header;\n fastcgi_cache_valid any 1d;\n\n # Cache bypass/g' /etc/nginx/nginx.conf
1515
fi
1616
fi
1717

18-
echo '[ * ] Set Role "Admin" to Administrator'
18+
echo '[ * ] Updating System Administrator account permissions...'
1919
$HESTIA/bin/v-change-user-role admin admin
2020

2121
# Upgrading Mail System
2222
if [ "$MAIL_SYSTEM" == "exim4" ]; then
2323
if ! grep -q "send_via_smtp_relay" /etc/exim4/exim4.conf.template; then
2424

25-
echo '[ * ] Installing smtp relay feature'
25+
echo '[ * ] Enabling SMTP relay support...'
2626
if grep -q "driver = plaintext" /etc/exim4/exim4.conf.template; then
2727
disable_smtp_relay=true
28-
echo '[ ! ] SMTP Relay install requires manual intervention:'
28+
echo '[ ! ] ERROR: Manual intervention required to enable SMTP Relay:'
29+
echo ''
2930
echo ' Exim only supports one plaintext authenticator.'
3031
echo ' If you want to use the Hestia smtp relay feature,'
3132
echo ' please review the /etc/exim4/exim4.conf.template'
@@ -80,5 +81,6 @@ fi
8081

8182
# Fix PostgreSQL repo
8283
if [ -f /etc/apt/sources.list.d/postgresql.list ]; then
84+
echo "[*] Updating PostgreSQL repository..."
8385
sed -i 's|deb https://apt.postgresql.org/pub/repos/apt/|deb [arch=amd64] https://apt.postgresql.org/pub/repos/apt/|g' /etc/apt/sources.list.d/postgresql.list
8486
fi

web/edit/server/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,13 @@
671671
}
672672
}
673673

674-
// Change ALLOW_USERS_SERVER
674+
// Change ENFORCE_SUBDOMAIN_OWNERSHIP
675675
if (empty($_SESSION['error_msg'])) {
676-
if ($_POST['v_allow_users_system'] != $_SESSION['v_allow_users_system']) {
677-
exec (HESTIA_CMD."v-change-sys-config-value ALLOW_USERS_SYSTEM ".escapeshellarg($_POST['v_allow_users_system']), $output, $return_var);
676+
if ($_POST['v_enforce_subdomain_ownership'] != $_SESSION['v_enforce_subdomain_ownership']) {
677+
exec (HESTIA_CMD."v-change-sys-config-value ENFORCE_SUBDOMAIN_OWNERSHIP ".escapeshellarg($_POST['v_enforce_subdomain_ownership']), $output, $return_var);
678678
check_return_code($return_var,$output);
679679
unset($output);
680-
if (empty($_SESSION['error_msg'])) $v_allow_users_system = $_POST['v_allow_users_system'];
680+
if (empty($_SESSION['error_msg'])) $v_enforce_subdomain_ownership = $_POST['v_enforce_subdomain_ownership'];
681681
$v_security_adv = 'yes';
682682
}
683683
}

web/templates/admin/edit_server.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,14 +993,14 @@
993993
</tr>
994994
<tr>
995995
<td class="vst-text input-label">
996-
<?php print _('Disable check domain owner');?>
996+
<?php print _('Enforce subdomain ownership');?>
997997
</td>
998998
</tr>
999999
<tr>
10001000
<td>
1001-
<select class="vst-list" name="v_allow_users_system">
1001+
<select class="vst-list" name="v_enforce_subdomain_ownership">
10021002
<option value='yes'><?php print _('yes'); ?></option>
1003-
<option value='no' <?php if($_SESSION['ALLOW_USERS_SYSTEM'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
1003+
<option value='no' <?php if($_SESSION['ENFORCE_SUBDOMAIN_OWNERSHIP'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
10041004
</select>
10051005
<br><br>
10061006
</td>

0 commit comments

Comments
 (0)