Skip to content

Commit 43d9ac1

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#1786 from jaapmarcus/fix/vars-missing-upgrade
System variables missing on upgrade
2 parents 653d09b + a5777f6 commit 43d9ac1

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

func/syshealth.sh

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,83 @@ function syshealth_repair_system_config() {
304304
fi
305305
fi
306306
fi
307+
308+
# Enforce subdomain ownership
309+
if [ -z "$ENFORCE_SUBDOMAIN_OWNERSHIP" ]; then
310+
echo "[ ! ] Adding missing variable to hestia.conf: ENFORCE_SUBDOMAIN_OWNERSHIP ('yes')"
311+
$BIN/v-change-sys-config-value "ENFORCE_SUBDOMAIN_OWNERSHIP" "yes"
312+
fi
313+
# Debug mode
314+
if [ -z "$DEBUG_MODE" ]; then
315+
echo "[ ! ] Adding missing variable to hestia.conf: DEBUG_MODE ('false')"
316+
$BIN/v-change-sys-config-value "DEBUG_MODE" "false"
317+
fi
318+
# Quick install plugin
319+
if [ -z "$PLUGIN_APP_INSTALLER" ]; then
320+
echo "[ ! ] Adding missing variable to hestia.conf: PLUGIN_APP_INSTALLER ('true')"
321+
$BIN/v-change-sys-config-value "PLUGIN_APP_INSTALLER" "true"
322+
fi
323+
# Enable preview mode
324+
if [ -z "$POLICY_SYSTEM_ENABLE_BACON" ]; then
325+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_ENABLE_BACON ('false')"
326+
$BIN/v-change-sys-config-value "POLICY_SYSTEM_ENABLE_BACON" "false"
327+
fi
328+
# Hide system services
329+
if [ -z "$POLICY_SYSTEM_HIDE_SERVICES" ]; then
330+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_HIDE_SERVICES ('no')"
331+
$BIN/v-change-sys-config-value "POLICY_SYSTEM_HIDE_SERVICES" "no"
332+
fi
333+
# Password reset
334+
if [ -z "$POLICY_SYSTEM_PASSWORD_RESET" ]; then
335+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_PASSWORD_RESET ('no')"
336+
$BIN/v-change-sys-config-value "POLICY_SYSTEM_PASSWORD_RESET" "no"
337+
fi
338+
# Protect admin user
339+
if [ -z "$POLICY_SYSTEM_PROTECTED_ADMIN" ]; then
340+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_PROTECTED_ADMIN ('no')"
341+
$BIN/v-change-sys-config-value "POLICY_SYSTEM_PROTECTED_ADMIN" "no"
342+
fi
343+
# Theme editor
344+
if [ -z "$POLICY_USER_CHANGE_THEME" ]; then
345+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_CHANGE_THEME ('yes')"
346+
$BIN/v-change-sys-config-value "POLICY_USER_CHANGE_THEME" "true"
347+
fi
348+
# Allow user delete logs
349+
if [ -z "$POLICY_USER_DELETE_LOGS" ]; then
350+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_DELETE_LOGS ('yes')"
351+
$BIN/v-change-sys-config-value "POLICY_USER_DELETE_LOGS" "yes"
352+
fi
353+
# Allow users to delete details
354+
if [ -z "$POLICY_USER_EDIT_DETAILS" ]; then
355+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_EDIT_DETAILS ('yes')"
356+
$BIN/v-change-sys-config-value "POLICY_USER_EDIT_DETAILS" "yes"
357+
fi
358+
# Allow users to edit DNS templates
359+
if [ -z "$POLICY_USER_EDIT_DNS_TEMPLATES" ]; then
360+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_EDIT_DNS_TEMPLATES ('yes')"
361+
$BIN/v-change-sys-config-value "POLICY_USER_EDIT_DNS_TEMPLATES" "yes"
362+
fi
363+
# Allow users to edit web templates
364+
if [ -z "$POLICY_USER_EDIT_WEB_TEMPLATES" ]; then
365+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_EDIT_WEB_TEMPLATES ('yes')"
366+
$BIN/v-change-sys-config-value "POLICY_USER_EDIT_WEB_TEMPLATES" "true"
367+
fi
368+
# View user logs
369+
if [ -z "$POLICY_USER_VIEW_LOGS" ]; then
370+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_VIEW_LOGS ('yes')"
371+
$BIN/v-change-sys-config-value "POLICY_USER_VIEW_LOGS" "true"
372+
fi
373+
# Allow users to login (read only) when suspended
374+
if [ -z "$POLICY_USER_VIEW_SUSPENDED" ]; then
375+
echo "[ ! ] Adding missing variable to hestia.conf: POLICY_USER_VIEW_SUSPENDED ('no')"
376+
$BIN/v-change-sys-config-value "POLICY_USER_VIEW_SUSPENDED" "no"
377+
fi
378+
# PHPMyadmin SSO key
379+
if [ -z "$PHPMYADMIN_KEY" ]; then
380+
echo "[ ! ] Adding missing variable to hestia.conf: PHPMYADMIN_KEY ('')"
381+
$BIN/v-change-sys-config-value "PHPMYADMIN_KEY" ""
382+
fi
383+
307384
}
308385

309386
# Repair System Cron Jobs
@@ -319,4 +396,4 @@ function syshealth_repair_system_cronjobs() {
319396
$HESTIA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "sudo $HESTIA/bin/v-update-user-stats" '' 'no'
320397
$HESTIA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "sudo $HESTIA/bin/v-update-sys-rrd" '' 'no'
321398
$HESTIA/bin/v-restart-cron
322-
}
399+
}

web/templates/pages/list_packages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<div class="clearfix l-unit__stat-col--left text-right compact-3">
8585
<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
8686
<div class="actions-panel clearfix">
87-
<?php if (($key == 'default') && ($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin')) { ?>
87+
<?php if (($key == 'default')) { ?>
8888
<!-- Restrict editing default package -->
8989
<?php } else {?>
9090
<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Package');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>

0 commit comments

Comments
 (0)