Skip to content

Commit 1c8b770

Browse files
Mykola NicholasNickCoolii
andauthored
fix: added missing cronjob LE renewal after import / new install (hestiacp#2498)
* fix: added missing cronjob LE renewal after import / new install * Update hst-install-debian.sh * Update hst-install-ubuntu.sh * Update v-restore-user * Adding LE autorenew cronjob if there are none * Create 1.5.9.sh whoops * Update 1.6.0.sh Co-authored-by: niko <autosave007@gmail.com>
1 parent 54f6006 commit 1c8b770

File tree

4 files changed

+57
-3
lines changed

4 files changed

+57
-3
lines changed

bin/v-restore-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ if [ "$web" != 'no' ] && [ -n "$WEB_SYSTEM" ]; then
314314
done
315315
fi
316316
fi
317-
317+
318318
# Merging web.conf keys
319319
str="DOMAIN='$domain' IP='$IP' IP6='$IP6' ALIAS='$ALIAS'"
320320
str="$str CUSTOM_DOCROOT='$CUSTOM_DOCROOT' CUSTOM_PHPROOT='$CUSTOM_PHPROOT'"

install/hst-install-debian.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@ download_file() {
117117

118118
# Defining password-gen function
119119
gen_pass() {
120-
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
120+
matrix=$1
121+
length=$2
122+
if [ -z "$matrix" ]; then
123+
matrix="A-Za-z0-9"
124+
fi
125+
if [ -z "$length" ]; then
126+
length=16
127+
fi
128+
head /dev/urandom | tr -dc $matrix | head -c$length
121129
}
122130

123131
# Defining return code check function
@@ -1977,6 +1985,10 @@ command="sudo $HESTIA/bin/v-update-user-stats"
19771985
$HESTIA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
19781986
command="sudo $HESTIA/bin/v-update-sys-rrd"
19791987
$HESTIA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
1988+
command="sudo $HESTIA/bin/v-update-letsencrypt-ssl"
1989+
min=$(gen_pass '012345' '2')
1990+
hour=$(gen_pass '1234567' '1')
1991+
$HESTIA/bin/v-add-cron-job 'admin' "$min" "$hour" '*' '*' '*' "$command"
19801992

19811993
# Enable automatic updates
19821994
$HESTIA/bin/v-add-cron-hestia-autoupdate apt

install/hst-install-ubuntu.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,15 @@ download_file() {
9898

9999
# Defining password-gen function
100100
gen_pass() {
101-
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
101+
matrix=$1
102+
length=$2
103+
if [ -z "$matrix" ]; then
104+
matrix="A-Za-z0-9"
105+
fi
106+
if [ -z "$length" ]; then
107+
length=16
108+
fi
109+
head /dev/urandom | tr -dc $matrix | head -c$length
102110
}
103111

104112
# Defining return code check function
@@ -1997,6 +2005,10 @@ command="sudo $HESTIA/bin/v-update-user-stats"
19972005
$HESTIA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
19982006
command="sudo $HESTIA/bin/v-update-sys-rrd"
19992007
$HESTIA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
2008+
command="sudo $HESTIA/bin/v-update-letsencrypt-ssl"
2009+
min=$(gen_pass '012345' '2')
2010+
hour=$(gen_pass '1234567' '1')
2011+
$HESTIA/bin/v-add-cron-job 'admin' "$min" "$hour" '*' '*' '*' "$command"
20002012

20012013
# Enable automatic updates
20022014
$HESTIA/bin/v-add-cron-hestia-autoupdate apt

install/upgrade/versions/1.6.0.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.6.0
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### Pass through information to the end user in case of a issue or problem #######
9+
####### #######
10+
####### Use add_upgrade_message "My message here" to include a message #######
11+
####### in the upgrade notification email. Example: #######
12+
####### #######
13+
####### add_upgrade_message "My message here" #######
14+
####### #######
15+
####### You can use \n within the string to create new lines. #######
16+
#######################################################################################
17+
18+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
19+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
20+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
21+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
23+
24+
# Adding LE autorenew cronjob if there are none
25+
if [ -z "$(grep v-update-lets $HESTIA/data/users/admin/cron.conf)" ]; then
26+
min=$(generate_password '012345' '2')
27+
hour=$(generate_password '1234567' '1')
28+
command="sudo $BIN/v-update-letsencrypt-ssl"
29+
$BIN/v-add-cron-job 'admin' "$min" "$hour" '*' '*' '*' "$command"
30+
fi

0 commit comments

Comments
 (0)