Skip to content

Commit 88c25eb

Browse files
committed
wip
1 parent 39284cb commit 88c25eb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

nodebb.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ public function setup( $args ) {
9696
$config = str_replace( '%nodebb_url%', $url, $config );
9797
file_put_contents( $nodebb_folder . '/config.json', $config );
9898

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+
99108
// Run initial setup
100109
$setup = './nodebb setup ';
101110
$setup .= "'" .
@@ -105,21 +114,13 @@ public function setup( $args ) {
105114
"admin:password:confirm" => $options['nodebb_password'],
106115
"admin:email" => $options['nodebb_email']
107116
] ) . "'\n";
108-
$setup .= "./nodebb stop && ./nodebb start\n";
117+
$setup .= "./nodebb restart\n";
109118
file_put_contents( $nodebb_folder . '/setup.sh', $setup );
110119
$cmd = 'runuser -s /bin/bash -l ' . $user . ' -c "cd ' . $nodebb_folder . ' && source setup.sh"' . "\n";
111120
$cmd .= '#rm -f ' . $nodebb_folder . 'setup.sh';
112121
$hcpp->log( $cmd );
113122
$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+
123124
return $args;
124125
}
125126

0 commit comments

Comments
 (0)