@@ -96,6 +96,15 @@ public function setup( $args ) {
96
96
$ config = str_replace ( '%nodebb_url% ' , $ url , $ config );
97
97
file_put_contents ( $ nodebb_folder . '/config.json ' , $ config );
98
98
99
+ // Update proxy and restart nginx
100
+ if ( $ nodeapp_folder . '/ ' == $ nodebb_folder ) {
101
+ $ hcpp ->run ( "change-web-domain-proxy-tpl $ user $ domain NodeApp " );
102
+ }else {
103
+ $ hcpp ->nodeapp ->generate_nginx_files ( $ nodeapp_folder );
104
+ $ hcpp ->nodeapp ->startup_apps ( $ nodeapp_folder );
105
+ $ hcpp ->run ( "restart-proxy " );
106
+ }
107
+
99
108
// Run initial setup
100
109
$ setup = './nodebb setup ' ;
101
110
$ setup .= "' " .
@@ -105,21 +114,13 @@ public function setup( $args ) {
105
114
"admin:password:confirm " => $ options ['nodebb_password ' ],
106
115
"admin:email " => $ options ['nodebb_email ' ]
107
116
] ) . "' \n" ;
108
- $ setup .= "./nodebb stop && ./nodebb start \n" ;
117
+ $ setup .= "./nodebb restart \n" ;
109
118
file_put_contents ( $ nodebb_folder . '/setup.sh ' , $ setup );
110
119
$ cmd = 'runuser -s /bin/bash -l ' . $ user . ' -c "cd ' . $ nodebb_folder . ' && source setup.sh" ' . "\n" ;
111
120
$ cmd .= '#rm -f ' . $ nodebb_folder . 'setup.sh ' ;
112
121
$ hcpp ->log ( $ cmd );
113
122
$ hcpp ->log (shell_exec ( $ cmd ));
114
-
115
- // Update proxy and restart nginx
116
- if ( $ nodeapp_folder . '/ ' == $ nodebb_folder ) {
117
- $ hcpp ->run ( "change-web-domain-proxy-tpl $ user $ domain NodeApp " );
118
- }else {
119
- $ hcpp ->nodeapp ->generate_nginx_files ( $ nodeapp_folder );
120
- $ hcpp ->nodeapp ->startup_apps ( $ nodeapp_folder );
121
- $ hcpp ->run ( "restart-proxy " );
122
- }
123
+
123
124
return $ args ;
124
125
}
125
126
0 commit comments