From 15d77b7766eea3789d97348bd3424f56527563ca Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Fri, 8 Aug 2025 08:57:16 -0600 Subject: [PATCH] Initial commit of template files --- .../web/nginx/php-fpm/include_only.stpl | 15 +++++++ .../web/nginx/php-fpm/include_only.tpl | 12 ++++++ .../templates/web/nginx/php-fpm/nodejs.sh | 13 +++++++ .../templates/web/nginx/php-fpm/nodejs.stpl | 39 +++++++++++++++++++ .../templates/web/nginx/php-fpm/nodejs.tpl | 34 ++++++++++++++++ .../templates/web/skel/public_html/index.html | 25 ++++++++++++ 6 files changed, 138 insertions(+) create mode 100644 usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.stpl create mode 100644 usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.tpl create mode 100755 usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.sh create mode 100644 usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.stpl create mode 100644 usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.tpl create mode 100644 usr/local/hestia/data/templates/web/skel/public_html/index.html diff --git a/usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.stpl b/usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.stpl new file mode 100644 index 0000000..04d5e11 --- /dev/null +++ b/usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.stpl @@ -0,0 +1,15 @@ +server { + listen %ip%:%web_ssl_port% ssl; + server_name %domain_idn% %alias_idn%; + root %sdocroot%; + index index.php index.html index.htm; + access_log /var/log/nginx/domains/%domain%.log combined; + access_log /var/log/nginx/domains/%domain%.bytes bytes; + error_log /var/log/nginx/domains/%domain%.error.log error; + + ssl_certificate %ssl_pem%; + ssl_certificate_key %ssl_key%; + + include %home%/%user%/web/%domain%/custom_config/https.conf; + include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; +} diff --git a/usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.tpl b/usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.tpl new file mode 100644 index 0000000..5543183 --- /dev/null +++ b/usr/local/hestia/data/templates/web/nginx/php-fpm/include_only.tpl @@ -0,0 +1,12 @@ +server { + listen %ip%:%web_port%; + server_name %domain_idn% %alias_idn%; + root %docroot%; + index index.php index.html index.htm; + access_log /var/log/nginx/domains/%domain%.log combined; + access_log /var/log/nginx/domains/%domain%.bytes bytes; + error_log /var/log/nginx/domains/%domain%.error.log error; + + include %home%/%user%/web/%domain%/custom_config/http.conf; + include %home%/%user%/conf/web/%domain%/nginx.conf_*; +} diff --git a/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.sh b/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.sh new file mode 100755 index 0000000..d1e1cee --- /dev/null +++ b/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +user=$1 +domain=$2 +ip=$3 +home=$4 +docroot=$5 + +rm "$home/$user/web/$domain/node_app/app.sock" +runuser -l $user -s /bin/bash -c "npm install --prefix $home/$user/web/$domain/node_app" +runuser -l $user -s /bin/bash -c "npm start --prefix $home/$user/web/$domain/node_app" +sleep 5 +chmod a+w "$home/$user/web/$domain/node_app/app.sock" diff --git a/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.stpl b/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.stpl new file mode 100644 index 0000000..f8a9d3f --- /dev/null +++ b/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.stpl @@ -0,0 +1,39 @@ +server { + listen %ip%:%web_ssl_port% ssl http2; + server_name %domain_idn% %alias_idn%; + root %sdocroot%; + index index.php index.html index.htm; + access_log /var/log/nginx/domains/%domain%.log combined; + access_log /var/log/nginx/domains/%domain%.bytes bytes; + error_log /var/log/nginx/domains/%domain%.error.log error; + + ssl_certificate %ssl_pem%; + ssl_certificate_key %ssl_key%; + ssl_stapling on; + ssl_stapling_verify on; + + include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*; + + location / { + proxy_pass http://unix:%home%/%user%/web/%domain%/node_app/app.sock:/; + proxy_set_header Host $host; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location ~ /\.(?!well-known\/) { + deny all; + return 404; + } + + location /vstats/ { + alias %home%/%user%/web/%domain%/stats/; + include %home%/%user%/web/%domain%/stats/auth.conf*; + } + + include /etc/nginx/conf.d/phpmyadmin.inc*; + include /etc/nginx/conf.d/phppgadmin.inc*; + include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; +} diff --git a/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.tpl b/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.tpl new file mode 100644 index 0000000..3f7d006 --- /dev/null +++ b/usr/local/hestia/data/templates/web/nginx/php-fpm/nodejs.tpl @@ -0,0 +1,34 @@ +server { + listen %ip%:%web_port%; + server_name %domain_idn% %alias_idn%; + root %docroot%; + index index.php index.html index.htm; + access_log /var/log/nginx/domains/%domain%.log combined; + access_log /var/log/nginx/domains/%domain%.bytes bytes; + error_log /var/log/nginx/domains/%domain%.error.log error; + + include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*; + + location / { + proxy_pass http://unix:%home%/%user%/web/%domain%/node_app/app.sock:/; + proxy_set_header Host $host; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location ~ /\.(?!well-known\/) { + deny all; + return 404; + } + + location /vstats/ { + alias %home%/%user%/web/%domain%/stats/; + include %home%/%user%/web/%domain%/stats/auth.conf*; + } + + include /etc/nginx/conf.d/phpmyadmin.inc*; + include /etc/nginx/conf.d/phppgadmin.inc*; + include %home%/%user%/conf/web/%domain%/nginx.conf_*; +} diff --git a/usr/local/hestia/data/templates/web/skel/public_html/index.html b/usr/local/hestia/data/templates/web/skel/public_html/index.html new file mode 100644 index 0000000..92e33b0 --- /dev/null +++ b/usr/local/hestia/data/templates/web/skel/public_html/index.html @@ -0,0 +1,25 @@ + + + + + %domain% + + + + +
+
+

%domain%

+
+ +
+ +