Skip to content

Commit e4420c1

Browse files
authored
Merge pull request hestiacp#408 from hestiacp/release-1.0.1
Release 1.0.1
2 parents 76ac0fe + 6a06d76 commit e4420c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+357
-148
lines changed

bin/v-change-sys-release

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ if [ -z "$branch" ]; then
2828
echo ""
2929
echo "Common release branches:"
3030
echo "(*) master: Stable releases only"
31-
echo "(*) beta: Beta builds which are being prepared for release"
3231
echo "(*) develop: Daily development builds"
3332
echo ""
3433
echo "You can also specify another branch name from the"

bin/v-change-web-domain-hsts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
# info: add/remove HSTS support from a domain
3+
# options: USER DOMAIN STATUS
4+
#
5+
# This function will enable or disable HSTS (HTTP Strict Transport Security)
6+
# for a web domain.
7+
8+
9+
#----------------------------------------------------------#
10+
# Variable&Function #
11+
#----------------------------------------------------------#
12+
13+
# Argument definition
14+
user=$1
15+
domain=$2
16+
domain_idn=$2
17+
status=$3
18+
19+
# Includes
20+
source $HESTIA/func/main.sh
21+
source $HESTIA/func/domain.sh
22+
source $HESTIA/conf/hestia.conf
23+
24+
#----------------------------------------------------------#
25+
# Verifications #
26+
#----------------------------------------------------------#
27+
28+
check_args '2' "$#" 'USER DOMAIN'
29+
is_format_valid 'user' 'domain'
30+
is_object_valid 'user' 'USER' "$user"
31+
is_object_unsuspended 'user' 'USER' "$user"
32+
is_object_valid 'web' 'DOMAIN' "$domain"
33+
is_object_unsuspended 'web' 'DOMAIN' "$domain"
34+
35+
#----------------------------------------------------------#
36+
# Action #
37+
#----------------------------------------------------------#
38+
39+
# Load domain data
40+
eval $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
41+
42+
# Check if SSL is enabled
43+
if [ "$SSL" != 'yes' ]; then
44+
echo "Error: SSL is not enabled"
45+
exit $E_NOTEXIST
46+
fi
47+
48+
# Check for Apache/Nginx or Nginx/PHP-FPM configuration
49+
if [ -z $PROXY_SYSTEM ]; then
50+
hstsconf="$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.hsts.conf"
51+
else
52+
hstsconf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.hsts.conf"
53+
fi
54+
55+
if [ "$status" = "on" ]; then
56+
echo 'add_header Strict-Transport-Security "max-age=15768000;" always;' > $hstsconf
57+
echo "HTTP Strict Transport Security (HSTS) turned on for $domain."
58+
elif [ "$status" = "off" ]; then
59+
rm -f $hstsconf
60+
nginx -s reload
61+
echo "HTTP Strict Transport Security (HSTS) turned off for $domain."
62+
else
63+
echo "Error: Invalid mode specified."
64+
echo "Usage: v-change-web-domain-hsts USER DOMAIN [ON / OFF]"
65+
fi
66+
67+
#----------------------------------------------------------#
68+
# Hestia #
69+
#----------------------------------------------------------#
70+
71+
# Logging
72+
log_history "Enabled HTTP Strict Transport Security on $domain."
73+
log_event "$OK" "$ARGUMENTS"
74+
75+
exit

install/deb/multiphp/nginx/PHP-56.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ server {
99

1010
ssl_certificate %ssl_pem%;
1111
ssl_certificate_key %ssl_key%;
12+
ssl_stapling on;
13+
ssl_stapling_verify on;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
1216

1317
location / {
1418

install/deb/multiphp/nginx/PHP-70.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ server {
99

1010
ssl_certificate %ssl_pem%;
1111
ssl_certificate_key %ssl_key%;
12+
ssl_stapling on;
13+
ssl_stapling_verify on;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
1216

1317
location / {
1418

install/deb/multiphp/nginx/PHP-71.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ server {
99

1010
ssl_certificate %ssl_pem%;
1111
ssl_certificate_key %ssl_key%;
12+
ssl_stapling on;
13+
ssl_stapling_verify on;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
1216

1317
location / {
1418

install/deb/multiphp/nginx/PHP-72.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ server {
99

1010
ssl_certificate %ssl_pem%;
1111
ssl_certificate_key %ssl_key%;
12+
ssl_stapling on;
13+
ssl_stapling_verify on;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
1216

1317
location / {
1418

install/deb/multiphp/nginx/PHP-73.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ server {
99

1010
ssl_certificate %ssl_pem%;
1111
ssl_certificate_key %ssl_key%;
12+
ssl_stapling on;
13+
ssl_stapling_verify on;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
1216

1317
location / {
1418

install/deb/nginx/nginx.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ http {
112112
ssl_dhparam /etc/ssl/dhparam.pem;
113113
ssl_ecdh_curve secp384r1;
114114
ssl_session_tickets off;
115-
ssl_stapling on;
116-
ssl_stapling_verify on;
117115
resolver 1.0.0.1 1.1.1.1 valid=300s ipv6=off;
118116
resolver_timeout 5s;
119117

install/deb/templates/web/nginx/caching.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ server {
33
server_name %domain_idn% %alias_idn%;
44
ssl_certificate %ssl_pem%;
55
ssl_certificate_key %ssl_key%;
6+
ssl_stapling on;
7+
ssl_stapling_verify on;
68
error_log /var/log/%web_system%/domains/%domain%.error.log error;
79

10+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
11+
812
location / {
913
proxy_pass https://%ip%:%web_ssl_port%;
1014

install/deb/templates/web/nginx/default.stpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ server {
33
server_name %domain_idn% %alias_idn%;
44
ssl_certificate %ssl_pem%;
55
ssl_certificate_key %ssl_key%;
6+
ssl_stapling on;
7+
ssl_stapling_verify on;
68
error_log /var/log/%web_system%/domains/%domain%.error.log error;
79

10+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
11+
812
location / {
913
proxy_pass https://%ip%:%web_ssl_port%;
1014
location ~* ^.+\.(%proxy_extentions%)$ {

0 commit comments

Comments
 (0)