Skip to content

Commit b6a0788

Browse files
committed
wip
1 parent 2ad98a1 commit b6a0788

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

ghost.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ public function setup( $args ) {
3434
$dbPassword = $options['database_password'];
3535
$dbName = $user . '_' . $options['database_name'];
3636

37-
// Copy the Ghost files to the user folder
38-
$ghost_version = basename( readlink('/opt/ghost/current') );
37+
// Get the folder details (absolute nodeapp and ghost folder, and relative subfolder)
3938
$ghost_folder = $options['ghost_folder'];
4039
if ( $ghost_folder == '' || $ghost_folder[0] != '/' ) $ghost_folder = '/' . $ghost_folder;
4140
$nodeapp_folder = "/home/$user/web/$domain/nodeapp";
4241
$subfolder = $ghost_folder;
4342
$ghost_folder = $nodeapp_folder . $ghost_folder;
4443

45-
// TODO: Accelerate installation: copy over from /opt/ghost,
46-
// adjust symbolic links, .ghost-cli,
47-
// then run "ghost update"
48-
49-
// Create the nodeapp folder
44+
// Create nodeapp folder and 'Absolute' copy over ghost files
5045
$cmd = "mkdir -p " . escapeshellarg( $ghost_folder ) . " ; ";
46+
$cmd .= __DIR__ . '/abcopy "/opt/ghost/" "' . $ghost_folder . '" && ';
5147
$cmd .= "chown -R $user:$user " . escapeshellarg( $nodeapp_folder ) . " ; ";
52-
$cmd .= 'runuser -l ' . $user . ' -c "cd ' . escapeshellarg( $ghost_folder ) . ' && ';
53-
$cmd .= 'export NVM_DIR=/opt/nvm && source /opt/nvm/nvm.sh && nvm use v18 && ';
54-
$cmd .= 'ghost install --url https://' . $domain . ' --db mysql --dbhost 127.0.0.1 --dbuser ';
55-
$cmd .= $dbUser . ' --dbpass ' . $dbPassword;
56-
$cmd .= ' --port 3306 --dbname ' . $dbName . ' --mail Sendmail';
57-
$cmd .= ' --process local --dir ' . $ghost_folder . ' --no-prompt --no-setup-nginx"';
48+
49+
// // Create the nodeapp folder
50+
51+
// $cmd .= "chown -R $user:$user " . escapeshellarg( $nodeapp_folder ) . " ; ";
52+
// $cmd .= 'runuser -l ' . $user . ' -c "cd ' . escapeshellarg( $ghost_folder ) . ' && ';
53+
// $cmd .= 'export NVM_DIR=/opt/nvm && source /opt/nvm/nvm.sh && nvm use v18 && ';
54+
// $cmd .= 'ghost install --url https://' . $domain . ' --db mysql --dbhost 127.0.0.1 --dbuser ';
55+
// $cmd .= $dbUser . ' --dbpass ' . $dbPassword;
56+
// $cmd .= ' --port 3306 --dbname ' . $dbName . ' --mail Sendmail';
57+
// $cmd .= ' --process local --dir ' . $ghost_folder . ' --no-prompt --no-setup-nginx"';
5858
$hcpp->log( $cmd );
5959
$hcpp->log( shell_exec( $cmd ) );
6060

0 commit comments

Comments
 (0)