Skip to content

Commit 65d73e9

Browse files
authored
Fix DNSSEC version check (hestiacp#3430)
* Fix DNSSEC version check * Update CrafCMS templates * Update CraftCMS for RHEL * Update check * Fix craftcms template * Update v-list-sys-config
1 parent 1fb3062 commit 65d73e9

File tree

6 files changed

+175
-102
lines changed

6 files changed

+175
-102
lines changed

bin/v-change-dns-domain-dnssec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ if [ "$DNS_CLUSTER_SYSTEM" != 'hestia-zone' ]; then
5656
fi
5757

5858
version=$(named -v | awk 'NR==1{print $2}')
59-
if version_ge '9.18' $version; then
60-
check_result "$E_DISABLED" "DNSSEC is not supported when bind / named < 9.18"
59+
if version_ge '9.16.18' $version; then
60+
check_result "$E_DISABLED" "DNSSEC is not supported when bind / named version <= 9.16.18"
6161
fi
6262

6363
#----------------------------------------------------------#

bin/v-list-sys-config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ csv_list() {
269269
#----------------------------------------------------------#
270270

271271
version=$(named -v | awk 'NR==1{print $2}')
272-
if version_ge '9.18' $version; then
273-
SUPPORT_DNSSEC="yes"
274-
else
272+
if version_ge '9.16.18' $version; then
275273
SUPPORT_DNSSEC="no"
274+
else
275+
SUPPORT_DNSSEC="yes"
276276
fi
277277

278278
# Listing data

install/deb/templates/web/nginx/php-fpm/craftcms.stpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ server {
4343
fastcgi_hide_header "Set-Cookie";
4444
}
4545

46+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
47+
# If you change your `cpTrigger`, change it here as well
48+
location ^~ /admin {
49+
try_files $uri $uri/ /index.php?$query_string;
50+
}
51+
location ^~ /cpresources {
52+
try_files $uri $uri/ /index.php?$query_string;
53+
}
54+
4655
location ~ [^/]\.php(/|$) {
4756
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
4857
try_files $uri =404;

install/deb/templates/web/nginx/php-fpm/craftcms.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ server {
3838
fastcgi_hide_header "Set-Cookie";
3939
}
4040

41+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
42+
# If you change your `cpTrigger`, change it here as well
43+
location ^~ /admin {
44+
try_files $uri $uri/ /index.php?$query_string;
45+
}
46+
location ^~ /cpresources {
47+
try_files $uri $uri/ /index.php?$query_string;
48+
}
49+
4150
location ~ [^/]\.php(/|$) {
4251
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
4352
try_files $uri =404;
Lines changed: 76 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,78 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
17
server {
2-
listen %ip%:%web_ssl_port% ssl http2;
3-
server_name %domain_idn% %alias_idn%;
4-
root %sdocroot%/web;
5-
index index.php index.html index.htm;
6-
access_log /var/log/nginx/domains/%domain%.log combined;
7-
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8-
error_log /var/log/nginx/domains/%domain%.error.log error;
9-
10-
ssl_certificate %ssl_pem%;
11-
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*;
16-
17-
location / {
18-
try_files $uri $uri/ /index.php?$query_string;
19-
location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js|webp)$ {
20-
expires max;
21-
fastcgi_hide_header "Set-Cookie";
22-
}
23-
24-
location ~ [^/]\.php(/|$) {
25-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
26-
if (!-f $document_root$fastcgi_script_name) {
27-
return 404;
28-
}
29-
30-
fastcgi_pass %backend_lsnr%;
31-
fastcgi_index index.php;
32-
include /etc/nginx/fastcgi_params;
33-
}
34-
}
35-
36-
location /error/ {
37-
alias %home%/%user%/web/%domain%/document_errors/;
38-
}
39-
40-
location ~* "/\.(htaccess|htpasswd)$" {
41-
deny all;
42-
return 404;
43-
}
44-
45-
location /vstats/ {
46-
alias %home%/%user%/web/%domain%/stats/;
47-
include %home%/%user%/web/%domain%/stats/auth.conf*;
48-
}
49-
50-
include /etc/nginx/conf.d/phpmyadmin.inc*;
51-
include /etc/nginx/conf.d/phppgadmin.inc*;
52-
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
8+
listen %ip%:%web_ssl_port% ssl http2;
9+
server_name %domain_idn% %alias_idn%;
10+
root %sdocroot%/web;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
ssl_certificate %ssl_pem%;
17+
ssl_certificate_key %ssl_key%;
18+
ssl_stapling on;
19+
ssl_stapling_verify on;
20+
21+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
22+
23+
location = /favicon.ico {
24+
log_not_found off;
25+
access_log off;
26+
}
27+
28+
location = /robots.txt {
29+
allow all;
30+
log_not_found off;
31+
access_log off;
32+
}
33+
34+
location ~ /\.(?!well-known\/) {
35+
deny all;
36+
return 404;
37+
}
38+
39+
location / {
40+
try_files $uri $uri/ /index.php?$args;
41+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
42+
expires 30d;
43+
fastcgi_hide_header "Set-Cookie";
44+
}
45+
46+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
47+
# If you change your `cpTrigger`, change it here as well
48+
location ^~ /admin {
49+
try_files $uri $uri/ /index.php?$query_string;
50+
}
51+
location ^~ /cpresources {
52+
try_files $uri $uri/ /index.php?$query_string;
53+
}
54+
55+
location ~ [^/]\.php(/|$) {
56+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
57+
try_files $uri =404;
58+
fastcgi_pass %backend_lsnr%;
59+
fastcgi_index index.php;
60+
include /etc/nginx/fastcgi_params;
61+
}
62+
}
63+
64+
location /error/ {
65+
alias %home%/%user%/web/%domain%/document_errors/;
66+
}
67+
68+
location /vstats/ {
69+
alias %home%/%user%/web/%domain%/stats/;
70+
include %home%/%user%/web/%domain%/stats/auth.conf*;
71+
}
72+
73+
proxy_hide_header Upgrade;
74+
75+
include /etc/nginx/conf.d/phpmyadmin.inc*;
76+
include /etc/nginx/conf.d/phppgadmin.inc*;
77+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
5378
}
Lines changed: 76 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,78 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
17
server {
2-
listen %ip%:%web_port%;
3-
server_name %domain_idn% %alias_idn%;
4-
root %docroot%/web;
5-
index index.php index.html index.htm;
6-
access_log /var/log/nginx/domains/%domain%.log combined;
7-
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8-
error_log /var/log/nginx/domains/%domain%.error.log error;
9-
10-
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
11-
12-
location / {
13-
try_files $uri $uri/ /index.php?$query_string;
14-
location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js|webp)$ {
15-
expires max;
16-
fastcgi_hide_header "Set-Cookie";
17-
}
18-
19-
location ~ [^/]\.php(/|$) {
20-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
21-
if (!-f $document_root$fastcgi_script_name) {
22-
return 404;
23-
}
24-
25-
fastcgi_pass %backend_lsnr%;
26-
fastcgi_index index.php;
27-
include /etc/nginx/fastcgi_params;
28-
}
29-
}
30-
31-
location /error/ {
32-
alias %home%/%user%/web/%domain%/document_errors/;
33-
}
34-
35-
location ~* "/\.(htaccess|htpasswd)$" {
36-
deny all;
37-
return 404;
38-
}
39-
40-
location /vstats/ {
41-
alias %home%/%user%/web/%domain%/stats/;
42-
include %home%/%user%/web/%domain%/stats/auth.conf*;
43-
}
44-
45-
include /etc/nginx/conf.d/phpmyadmin.inc*;
46-
include /etc/nginx/conf.d/phppgadmin.inc*;
47-
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
8+
listen %ip%:%web_port%;
9+
server_name %domain_idn% %alias_idn%;
10+
root %docroot%/web;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
17+
18+
location = /favicon.ico {
19+
log_not_found off;
20+
access_log off;
21+
}
22+
23+
location = /favicon.ico {
24+
log_not_found off;
25+
access_log off;
26+
}
27+
28+
location = /robots.txt {
29+
allow all;
30+
log_not_found off;
31+
access_log off;
32+
}
33+
34+
location ~ /\.(?!well-known\/) {
35+
deny all;
36+
return 404;
37+
}
38+
39+
location / {
40+
try_files $uri $uri/ /index.php?$args;
41+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
42+
expires 30d;
43+
fastcgi_hide_header "Set-Cookie";
44+
}
45+
46+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
47+
# If you change your `cpTrigger`, change it here as well
48+
location ^~ /admin {
49+
try_files $uri $uri/ /index.php?$query_string;
50+
}
51+
location ^~ /cpresources {
52+
try_files $uri $uri/ /index.php?$query_string;
53+
}
54+
55+
location ~ [^/]\.php(/|$) {
56+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
57+
try_files $uri =404;
58+
fastcgi_pass %backend_lsnr%;
59+
fastcgi_index index.php;
60+
include /etc/nginx/fastcgi_params;
61+
}
62+
}
63+
64+
location /error/ {
65+
alias %home%/%user%/web/%domain%/document_errors/;
66+
}
67+
68+
location /vstats/ {
69+
alias %home%/%user%/web/%domain%/stats/;
70+
include %home%/%user%/web/%domain%/stats/auth.conf*;
71+
}
72+
73+
proxy_hide_header Upgrade;
74+
75+
include /etc/nginx/conf.d/phpmyadmin.inc*;
76+
include /etc/nginx/conf.d/phppgadmin.inc*;
77+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
4878
}

0 commit comments

Comments
 (0)