@@ -20,6 +20,8 @@ public function __construct() {
20
20
$ hcpp ->add_action ( 'hcpp_invoke_plugin ' , [ $ this , 'setup ' ] );
21
21
$ hcpp ->add_action ( 'hcpp_render_body ' , [ $ this , 'hcpp_render_body ' ] );
22
22
$ hcpp ->add_action ( 'hcpp_nginx_reload ' , [ $ this , 'hcpp_nginx_reload ' ] );
23
+ $ hcpp ->add_action ( 'priv_unsuspend_web_domain ' , [ $ this , 'priv_unsuspend_domain ' ] ); // Bulk unsuspend domains only throws this event
24
+ $ hcpp ->add_action ( 'priv_unsuspend_domain ' , [ $ this , 'priv_unsuspend_domain ' ] ); // Individually unsuspend domain only throws this event
23
25
}
24
26
25
27
/**
@@ -67,6 +69,22 @@ public function hcpp_nginx_reload( $cmd ) {
67
69
return $ cmd ;
68
70
}
69
71
72
+ /**
73
+ * Add flag to add .vitepress to nginx.conf and nginx.ssl.conf on unsuspend
74
+ */
75
+ public function priv_unsuspend_domain ( $ args ) {
76
+ global $ hcpp ;
77
+ $ user = $ args [0 ];
78
+ $ domain = $ args [1 ];
79
+
80
+ // Flag to add .vitepress to nginx.conf and nginx.ssl.conf on hcpp_nginx_reload
81
+ if ( file_exists ( '/tmp/vitepress_domains ' ) ) {
82
+ $ vitepress_domains = json_decode ( file_get_contents ( '/tmp/vitepress_domains ' ), true );
83
+ }
84
+ $ vitepress_domains [] = [ 'user ' => $ user , 'domain ' => $ domain ];
85
+ file_put_contents ( '/tmp/vitepress_domains ' , json_encode ( $ vitepress_domains ) );
86
+ }
87
+
70
88
/**
71
89
* Setup VitePress with the given options
72
90
*/
@@ -104,11 +122,7 @@ public function setup( $args ) {
104
122
$ hcpp ->nodeapp ->allocate_ports ( $ nodeapp_folder );
105
123
106
124
// Flag to add .vitepress to nginx.conf and nginx.ssl.conf on hcpp_nginx_reload
107
- if ( file_exists ( '/tmp/vitepress_domains ' ) ) {
108
- $ vitepress_domains = json_decode ( file_get_contents ( '/tmp/vitepress_domains ' ), true );
109
- }
110
- $ vitepress_domains [] = [ 'user ' => $ user , 'domain ' => $ domain ];
111
- file_put_contents ( '/tmp/vitepress_domains ' , json_encode ( $ vitepress_domains ) );
125
+ $ this ->priv_unsuspend_domain ( [ $ user , $ domain ] );
112
126
113
127
// Update proxy and restart nginx
114
128
if ( $ nodeapp_folder . '/ ' == $ vitepress_folder ) {
0 commit comments