Skip to content

Commit b4ca1b5

Browse files
committed
wip
1 parent 88c25eb commit b4ca1b5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

nodebb.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ 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-
10899
// Run initial setup
109100
$setup = './nodebb setup ';
110101
$setup .= "'" .
@@ -116,11 +107,20 @@ public function setup( $args ) {
116107
] ) . "'\n";
117108
$setup .= "./nodebb restart\n";
118109
file_put_contents( $nodebb_folder . '/setup.sh', $setup );
119-
$cmd = 'runuser -s /bin/bash -l ' . $user . ' -c "cd ' . $nodebb_folder . ' && source setup.sh"' . "\n";
110+
$cmd = 'runuser -s /bin/bash -l ' . $user . ' -c "export NVM_DIR=/opt/nvm && source /opt/nvm/nvm.sh && ';
111+
$cmd .= 'cd ' . $nodebb_folder . ' && source setup.sh"' . "\n";
120112
$cmd .= '#rm -f ' . $nodebb_folder . 'setup.sh';
121113
$hcpp->log( $cmd );
122114
$hcpp->log(shell_exec( $cmd ));
123-
115+
116+
// Update proxy and restart nginx
117+
if ( $nodeapp_folder . '/' == $nodebb_folder ) {
118+
$hcpp->run( "change-web-domain-proxy-tpl $user $domain NodeApp" );
119+
}else{
120+
$hcpp->nodeapp->generate_nginx_files( $nodeapp_folder );
121+
$hcpp->nodeapp->startup_apps( $nodeapp_folder );
122+
$hcpp->run( "restart-proxy" );
123+
}
124124
return $args;
125125
}
126126

0 commit comments

Comments
 (0)