@@ -76,6 +76,13 @@ public function __construct() {
76
76
$ hcpp ->add_action ( 'hcpp_rebooted ' , [ $ this , 'hcpp_rebooted ' ] );
77
77
$ hcpp ->add_action ( 'hcpp_runuser ' , [ $ this , 'hcpp_runuser ' ] );
78
78
$ hcpp ->add_action ( 'v_restart_proxy ' , [ $ this , 'v_restart_proxy ' ] );
79
+
80
+ // Rewrite config files on ssl related events
81
+ $ hcpp ->add_action ( 'v_add_web_domain_ssl ' , [ $ this , 'update_nginx_files ' ] );
82
+ $ hcpp ->add_action ( 'v_delete_web_domain_ssl ' , [ $ this , 'update_nginx_files ' ] );
83
+ $ hcpp ->add_action ( 'v_add_web_domain_ssl_force ' , [ $ this , 'update_nginx_files ' ] );
84
+ $ hcpp ->add_action ( 'v_delete_web_domain_ssl_force ' , [ $ this , 'update_nginx_files ' ] );
85
+
79
86
$ hcpp ->add_custom_page ( 'nodeapp ' , __DIR__ . '/pages/nodeapp.php ' );
80
87
$ hcpp ->add_custom_page ( 'nodeapplog ' , __DIR__ . '/pages/nodeapplog.php ' );
81
88
}
@@ -829,6 +836,19 @@ public function update_all() {
829
836
}, $ majors );
830
837
}
831
838
839
+ /**
840
+ * Update the nginx config files for the given user and domain
841
+ */
842
+ public function update_nginx_files ( $ args ) {
843
+ global $ hcpp ;
844
+ $ user = $ args [0 ];
845
+ $ domain = $ args [1 ];
846
+ $ nodeapp_folder = "/home/ $ user/web/ $ domain/nodeapp " ;
847
+ if ( is_dir ( $ nodeapp_folder ) ) {
848
+ $ this ->generate_nginx_files ( $ nodeapp_folder , true );
849
+ }
850
+ }
851
+
832
852
/**
833
853
* On proxy template change, copy basic nodeapp, allocate ports, and start apps
834
854
*/
0 commit comments