From 70c0547ed141685c4bc6426571457f28c412cd4a Mon Sep 17 00:00:00 2001 From: sharklatan Date: Sat, 30 May 2026 20:38:49 -0600 Subject: [PATCH 1/3] Ensure ports directory exists for user --- nodeapp.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nodeapp.php b/nodeapp.php index 54dfafb..167afb9 100644 --- a/nodeapp.php +++ b/nodeapp.php @@ -24,6 +24,14 @@ public function allocate_ports( $nodeapp_folder ) { $user = $parse[2]; $domain = $parse[4]; + // Ensure ports directory exists for this user + $ports_dir = "/usr/local/hestia/data/hcpp/ports/$user"; + if ( ! is_dir( $ports_dir ) ) { + $hcpp->log( "allocate_ports: creating ports dir $ports_dir" ); + // Attempt to create directory and set ownership; ignore failures + $hcpp->run( "mkdir -p $ports_dir && chown -R admin:admin /usr/local/hestia/data/hcpp/ports || true" ); + } + // Wipe the existing ports for this domain if ( file_exists( "/usr/local/hestia/data/hcpp/ports/$user/$domain.ports" ) ) { unlink( "/usr/local/hestia/data/hcpp/ports/$user/$domain.ports" ); @@ -978,4 +986,4 @@ public function v_update_sys_queue( $args ) { } global $hcpp; $hcpp->register_plugin( NodeApp::class ); -} \ No newline at end of file +} From 122189f44c5afd63c5381f088134f44a6ec0064e Mon Sep 17 00:00:00 2001 From: sharklatan Date: Sat, 30 May 2026 20:55:18 -0600 Subject: [PATCH 2/3] Change git clone command for HCPP-NodeApp Updated the git clone command to use the latest repository URL. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cac8a7..9c8b79a 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ HCPP-NodeApp requires an Ubuntu or Debian based installation of [Hestia Control ``` cd /usr/local/hestia/plugins -sudo git clone --branch v2.0.3 https://github.com/virtuosoft-dev/hcpp-nodeapp nodeapp +sudo git clone https://github.com/sharklatan/hcpp-nodeapp nodeapp ``` Note: It is important that the destination plugin folder name is `nodeapp`. From 98b7b57d35b081410de12cf802744cf158f8c9e6 Mon Sep 17 00:00:00 2001 From: sharklatan Date: Sat, 6 Jun 2026 20:31:58 -0600 Subject: [PATCH 3/3] fix: check proxy template before generating nginx files on SSL events The update_nginx_files() function was triggered on SSL-related events (v_add_web_domain_ssl, v_delete_web_domain_ssl, v_add_web_domain_ssl_force, v_delete_web_domain_ssl_force) and would generate nginx.conf_nodeapp and nginx.ssl.conf_nodeapp files whenever the nodeapp folder existed, regardless of whether the domain was actually using the NodeApp proxy template. This caused incorrect nginx config files to be created for domains that had a nodeapp folder but were using a different proxy template (e.g. default), leading to potential nginx conflicts. Fix mirrors the pattern already used in v_unsuspend_domain(): query the current proxy template via v-list-web-domain before calling generate_nginx_files(), passing true only when the proxy template is NodeApp and false otherwise. --- nodeapp.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nodeapp.php b/nodeapp.php index 167afb9..543d71f 100644 --- a/nodeapp.php +++ b/nodeapp.php @@ -854,7 +854,11 @@ public function update_nginx_files( $args ) { $domain = $args[1]; $nodeapp_folder = "/home/$user/web/$domain/nodeapp"; if ( is_dir( $nodeapp_folder) ) { - $this->generate_nginx_files( $nodeapp_folder, true ); + $proxy = $hcpp->run("v-list-web-domain $user $domain json"); + if ( $proxy != NULL ) { + $proxy = $proxy[$domain]["PROXY"]; + $this->generate_nginx_files( $nodeapp_folder, ( $proxy == "NodeApp" ) ); + } } }