Skip to content

Commit 41d96f2

Browse files
author
Kristan Kenney
committed
Merge branch 'develop' into bugfix-webmail-alias
2 parents 9ca5f50 + 94e405b commit 41d96f2

File tree

9 files changed

+97
-8
lines changed

9 files changed

+97
-8
lines changed

bin/v-change-sys-release

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# info: update web templates
3+
# options: [RESTART]
4+
#
5+
# The function for changing the release branch for the
6+
# Hestia Control Panel. This allows the user to switch between
7+
# stable and pre-release builds which will automaticlly update
8+
# based on the appropriate release schedule if auto-update is
9+
# turned on.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Argument definition
16+
branch=$1
17+
18+
# Includes
19+
source $HESTIA/func/main.sh
20+
source $HESTIA/conf/hestia.conf
21+
22+
#----------------------------------------------------------#
23+
# Action #
24+
#----------------------------------------------------------#
25+
if [ -z "$branch" ]; then
26+
echo "Error: no release branch specified."
27+
echo "Usage: v-change-sys-release branchname"
28+
echo ""
29+
echo "Common release branches:"
30+
echo "(*) master: Stable releases only"
31+
echo "(*) beta: Beta builds which are being prepared for release"
32+
echo "(*) develop: Daily development builds"
33+
echo ""
34+
echo "You can also specify another branch name from the"
35+
echo "GitHub repository to install the code from that branch."
36+
echo ""
37+
exit
38+
else
39+
# Remove old branch variable
40+
sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
41+
# Set new branch variable
42+
echo "RELEASE_BRANCH='$branch'" >> $HESTIA/conf/hestia.conf
43+
echo "Changed system to follow release branch: $branch"
44+
fi
45+
46+
#----------------------------------------------------------#
47+
# Hestia #
48+
#----------------------------------------------------------#
49+
50+
exit

bin/v-list-sys-config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ json_list() {
4343
"FIREWALL_EXTENSION": "'$FIREWALL_EXTENSION'",
4444
"REPOSITORY": "'$REPOSITORY'",
4545
"VERSION": "'$VERSION'",
46+
"RELEASE_BRANCH": "'$RELEASE_BRANCH'",
4647
"LANGUAGE": "'$LANGUAGE'",
4748
"BACKUP_GZIP": "'$BACKUP_GZIP'",
4849
"BACKUP": "'$BACKUP'",
@@ -129,6 +130,7 @@ shell_list() {
129130
echo "Language: $LANGUAGE"
130131
fi
131132
echo "Version: $VERSION"
133+
echo "Release Branch: $RELEASE_BRANCH"
132134
}
133135

134136
# PLAIN list function
@@ -139,7 +141,7 @@ plain_list() {
139141
echo -ne "$ANTIVIRUS_SYSTEM\t$ANTISPAM_SYSTEM\t$DB_SYSTEM\t"
140142
echo -ne "$DNS_SYSTEM\t$DNS_CLUSTER\t$STATS_SYSTEM\t$BACKUP_SYSTEM\t"
141143
echo -ne "$CRON_SYSTEM\t$DISK_QUOTA\t$FIREWALL_SYSTEM\t"
142-
echo -ne "$FIREWALL_EXTENSION\t$REPOSITORY\t$VERSION\t$LANGUAGE\t"
144+
echo -ne "$FIREWALL_EXTENSION\t$REPOSITORY\t$VERSION\t$RELEASE_BRANCH\t$LANGUAGE\t"
143145
echo -e "$BACKUP_GZIP\t$BACKUP\t$WEBMAIL_ALIAS\t$DB_PMA_URL\t$DB_PGA_URL"
144146
}
145147

@@ -162,7 +164,7 @@ csv_list() {
162164
echo -n "'$ANTIVIRUS_SYSTEM','$ANTISPAM_SYSTEM','$DB_SYSTEM',"
163165
echo -n "'$DNS_SYSTEM','$DNS_CLUSTER','$STATS_SYSTEM','$BACKUP_SYSTEM',"
164166
echo -n "'$CRON_SYSTEM','$DISK_QUOTA','$FIREWALL_SYSTEM','$REPOSITORY',"
165-
echo -n "'$FIREWALL_EXTENSION','$VERSION','$LANGUAGE','$BACKUP_GZIP',"
167+
echo -n "'$FIREWALL_EXTENSION','$VERSION','$RELEASE_BRANCH','$LANGUAGE','$BACKUP_GZIP',"
166168
echo -n "'$BACKUP','$WEBMAIL_ALIAS','$DB_PMA_URL','$DB_PGA_URL'"
167169
echo
168170
}

bin/v-update-sys-developer

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ install=$3
3737
if [ ! -z "$1" ]; then
3838
branch=$1
3939
else
40-
branch="develop"
40+
source /usr/local/hestia/conf/hestia.conf
41+
branch=$RELEASE_BRANCH
4142
fi
4243

4344
if [ ! -z "$2" ]; then

install/hst-install-debian.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,9 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
10291029
# Language
10301030
echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
10311031

1032-
# Version
1033-
echo "VERSION='0.9.8'" >> $HESTIA/conf/hestia.conf
1032+
# Version & Release Branch
1033+
echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
1034+
echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
10341035

10351036
# Installing hosting packages
10361037
cp -rf $hestiacp/packages $HESTIA/data/

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,9 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
991991
# Language
992992
echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
993993

994-
# Version
995-
echo "VERSION='0.9.8'" >> $HESTIA/conf/hestia.conf
994+
# Version & Release Branch
995+
echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
996+
echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
996997

997998
# Installing hosting packages
998999
cp -rf $hestiacp/packages $HESTIA/data/

install/upgrade/0.10.0-190430.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
1313
echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
1414
fi
1515

16+
# Add release branch system configuration if non-existent
17+
release_branch_check=$(cat $HESTIA/conf/hestia.conf | grep RELEASE_BRANCH)
18+
if [ -z "$release_branch_check" ]; then
19+
echo "(*) Adding global release branch variable to system configuration..."
20+
sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
21+
echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
22+
fi
23+
1624
# load hestia.conf
1725
source $HESTIA/conf/hestia.conf
1826

@@ -59,6 +67,11 @@ echo ""
5967
echo "This process may take a few moments, please wait..."
6068
echo ""
6169

70+
# Set new version
71+
sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
72+
# Set new branch variable
73+
echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
74+
6275
# Update Apache and Nginx configuration to support new file structure
6376
if [ -f /etc/apache2/apache.conf ]; then
6477
echo "(*) Updating Apache configuration..."

web/edit/server/index.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,16 @@
223223
}
224224
}
225225

226+
// Update release branch
227+
if (empty($_SESSION['error_msg'])) {
228+
if ($_POST['v_release_branch'] != $_SESSION['RELEASE_BRANCH']) {
229+
exec (HESTIA_CMD."v-change-sys-release ".escapeshellarg($_POST['v_release_branch']), $output, $return_var);
230+
check_return_code($return_var,$output);
231+
unset($output);
232+
$v_release_adv = 'yes';
233+
}
234+
}
235+
226236
// Disable local backup
227237
if (empty($_SESSION['error_msg'])) {
228238
if (($_POST['v_backup'] == 'no') && ($v_backup == 'yes' )) {

web/inc/i18n/en.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
'Record Number' => 'Record Number',
316316
'in megabytes' => 'in MB',
317317
'Message' => 'Message',
318-
'use local-part' => 'Use local-part (without domain name)',
318+
'use local-part' => 'Use local-part without domain name',
319319
'one or more email addresses' => 'One or more email addresses',
320320
'Prefix will be automaticaly added to database name and database user' => 'Prefix <b>%s</b> will be added to the database and user names automatically',
321321
'Database' => 'Database',

web/templates/admin/edit_server.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@
100100
<br><br>
101101
</td>
102102
</tr>
103+
<tr>
104+
<td class="vst-text input-label">
105+
<?php print __('Release Branch') ?>
106+
</td>
107+
</tr>
108+
<tr>
109+
<td>
110+
<input type="text" size="20" class="vst-input" name="v_release_branch" value="<?php echo $_SESSION['RELEASE_BRANCH']; ?>">
111+
<br><br>
112+
</td>
113+
</tr>
103114
<tr>
104115
<td class="vst-text input-label step-top">
105116
<a href="javascript:elementHideShow('web');" class="vst-text">

0 commit comments

Comments
 (0)