From d2e01fab7613cef8698454f120d1475524334c26 Mon Sep 17 00:00:00 2001 From: phre4k Date: Tue, 9 Feb 2016 22:30:42 +0100 Subject: [PATCH 1/3] added check for web server type in SSL config, closes #626 --- bin/v-add-web-domain-ssl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/v-add-web-domain-ssl b/bin/v-add-web-domain-ssl index 72767e772..4ed702897 100755 --- a/bin/v-add-web-domain-ssl +++ b/bin/v-add-web-domain-ssl @@ -90,11 +90,15 @@ if [ -x $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$template.sh ]; then $user $domain $ip $HOMEDIR $sdocroot fi -# Checking web config +# Checking web config include web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf" -if [ -z "$(grep "$conf" $web_conf)" ]; then +web_include=$(grep "$conf" $web_conf ) +if [ -z "$web_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then echo "Include $conf" >> $web_conf fi +if [ -z "$web_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then + echo "include $conf;" >> $web_conf +fi # Checking proxy if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then From 663c4dd301edc2fe5d25276bc8816edec19a4272 Mon Sep 17 00:00:00 2001 From: phre4k Date: Fri, 19 Feb 2016 14:57:36 +0100 Subject: [PATCH 2/3] change dokuwiki template to execute php files in lib/exe --- install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.stpl | 2 +- install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.tpl | 2 +- install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.stpl | 2 +- install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.tpl | 2 +- install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.stpl | 2 +- install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.tpl | 2 +- install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.stpl | 2 +- install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.tpl | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/debian/7/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/debian/8/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.stpl b/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.stpl +++ b/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.tpl b/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.tpl +++ b/install/rhel/5/templates/web/nginx/php-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.stpl b/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.stpl +++ b/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.tpl b/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.tpl +++ b/install/rhel/6/templates/web/nginx/php-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.stpl b/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.stpl +++ b/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.tpl b/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.tpl +++ b/install/rhel/7/templates/web/nginx/php-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.stpl index 27483cd8c..8acad0894 100644 --- a/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.stpl +++ b/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.stpl @@ -32,7 +32,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } diff --git a/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.tpl index 31647c9ff..f3456aa78 100644 --- a/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.tpl +++ b/install/ubuntu/15.10/templates/web/nginx/php5-fpm/dokuwiki.tpl @@ -28,7 +28,7 @@ server { } } - location ^~ /lib/ { + location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } From 3f314d19bd0011b4dab1600777122eaf8e7aaa44 Mon Sep 17 00:00:00 2001 From: phre4k Date: Mon, 27 Jun 2016 09:37:56 +0200 Subject: [PATCH 3/3] Revert "added check for web server type in SSL config, closes #626" This reverts commit d2e01fab7613cef8698454f120d1475524334c26. --- bin/v-add-web-domain-ssl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/v-add-web-domain-ssl b/bin/v-add-web-domain-ssl index 4ed702897..72767e772 100755 --- a/bin/v-add-web-domain-ssl +++ b/bin/v-add-web-domain-ssl @@ -90,15 +90,11 @@ if [ -x $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$template.sh ]; then $user $domain $ip $HOMEDIR $sdocroot fi -# Checking web config include +# Checking web config web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf" -web_include=$(grep "$conf" $web_conf ) -if [ -z "$web_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then +if [ -z "$(grep "$conf" $web_conf)" ]; then echo "Include $conf" >> $web_conf fi -if [ -z "$web_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then - echo "include $conf;" >> $web_conf -fi # Checking proxy if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then