fix(install) : good order of creation
This commit is contained in:
parent
5768569a2a
commit
c8b6f72be4
2 changed files with 4 additions and 3 deletions
|
@ -150,6 +150,7 @@ function createNginxConfig($domain, $user, $herseUser, $hersePass)
|
|||
throw new Exception('You need an username AND a password to add a herse.');
|
||||
} else {
|
||||
// add password file to domain
|
||||
exec('mkdir -p /home'.'/'.$user.'/'.$domain);
|
||||
file_put_contents(
|
||||
'/home'.'/'.$user.'/'.$domain.'/.htpasswd',
|
||||
$herseUser.':'.password_hash($hersePass, PASSWORD_BCRYPT)
|
||||
|
@ -233,7 +234,7 @@ function copyYesWikiFiles($domain, $user, $dbUser, $herseUser = null, $hersePass
|
|||
unlink($tmpFile);
|
||||
$herse = '';
|
||||
if (!empty($herseUser) && !empty($hersePass)) {
|
||||
$herse = $herseUser.':'.$hersePass;
|
||||
$herse = $herseUser.':'.$hersePass.'@';
|
||||
}
|
||||
$curl = 'curl -X POST --insecure --data-urlencode \'config[default_language]=fr\' --data-urlencode \'config[wakka_name]='.$domain.'\' --data-urlencode \'config[root_page]=PagePrincipale\' --data-urlencode \'config[mysql_host]=localhost\' --data-urlencode \'config[mysql_database]='.$dbUser['database'].'\' --data-urlencode \'config[mysql_user]='.$dbUser['user'].'\' --data-urlencode \'config[mysql_password]='.$dbUser['password'].'\' --data-urlencode \'config[table_prefix]=yeswiki_\' --data-urlencode \'admin_name='.$_SERVER['admin_id'].'\' --data-urlencode \'admin_password='.$_SERVER['admin_password'].'\' --data-urlencode \'admin_password_conf='.$_SERVER['admin_password'].'\' --data-urlencode \'admin_email='.$_SERVER['admin_email'].'\' --data-urlencode \'config[rewrite_mode]=0\' --data-urlencode \'config[allow_raw_html]=1\' --data-urlencode \'config[allow_robots]=1\' --data-urlencode \'submit=Continue\' \'https://'.$herse.$domain.'/?PagePrincipale&installAction=install\' 2>&1';
|
||||
$output = [];
|
||||
|
|
|
@ -76,13 +76,13 @@ if (0 == posix_getuid()) {
|
|||
if ($confirm || $input->confirmed()) {
|
||||
$unixUser = createUnixUserWithQuota($user, $quota);
|
||||
$dbUser = createSQLUserAndDatabase($user, $type);
|
||||
createNginxConfig($domain, $user, $herseUser, $hersePass);
|
||||
createPhpFpmConfig($user);
|
||||
if ($needHerse) {
|
||||
copyYesWikiFiles($domain, $user, $dbUser, $herseUser, $hersePass);
|
||||
} else {
|
||||
copyYesWikiFiles($domain, $user, $dbUser);
|
||||
}
|
||||
createNginxConfig($domain, $user, $herseUser, $hersePass);
|
||||
createPhpFpmConfig($user);
|
||||
$climate->shout(
|
||||
'The yeswiki was successfully installed on <bold>'.$domain.'</bold>, congrats ! 🎉'."\n"
|
||||
.' Unix user : <bold>'.$unixUser['user'].'</bold> with password : <bold>'.$unixUser['password'].'</bold> was created.'."\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue