Skip to content

Commit edc3dad

Browse files
committed
wip
1 parent 43c07c7 commit edc3dad

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

nodebb.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,23 @@ public function setup( $args ) {
9494
$url = "https://$domain" . $subfolder;
9595
}
9696
$config = str_replace( '%nodebb_url%', $url, $config );
97-
9897
file_put_contents( $nodebb_folder . '/config.json', $config );
9998

10099
// Run initial setup
101-
chmod( $nodebb_folder . '/nodebb', 0750 );
102-
$cmd = 'runuser -s /bin/bash -l ' . $user . ' -c "cd ' . $nodebb_folder . ' && ./nodebb setup ';
103-
$cmd .= "'" . addslashes(
100+
$setup = './nodebb setup ';
101+
$setup .= "'" . addslashes(
104102
json_encode( [
105103
"admin:username" => $options['nodebb_username'],
106104
"admin:password" => $options['nodebb_password'],
107105
"admin:password:confirm" => $options['nodebb_password'],
108106
"admin:email" => $options['nodebb_email']
109107
] )
110-
) . "'\"";
108+
) . "'";
109+
file_put_contents( $nodebb_folder . '/setup.sh', $setup );
110+
$cmd = 'runuser -s /bin/bash -l ' . $user . ' -c "cd ' . $nodebb_folder . ' && source setup.sh"' . "\n";
111+
$cmd .= 'rm ' . $nodebb_folder . '/setup.sh';
111112
$hcpp->log( $cmd );
112-
shell_exec( $cmd );
113+
$hcpp->log(shell_exec( $cmd ));
113114

114115
// Update proxy and restart nginx
115116
if ( $nodeapp_folder . '/' == $nodebb_folder ) {

0 commit comments

Comments
 (0)