Fixed initial setup not creating config files
This commit is contained in:
@ -140,7 +140,8 @@ if(!@$version=$db->query("SELECT value FROM settings WHERE setting='version';"))
|
||||
}
|
||||
$stmt=$db->prepare("UPDATE settings SET value=? WHERE setting='version';");
|
||||
$stmt->execute([DBVERSION]);
|
||||
foreach(PHP_VERSIONS as $version){
|
||||
}
|
||||
foreach(PHP_VERSIONS as $version){
|
||||
if(!file_exists("/etc/php/$version/fpm/conf.d/")){
|
||||
mkdir("/etc/php/$version/fpm/conf.d/", 0755, true);
|
||||
}
|
||||
@ -237,26 +238,25 @@ php_admin_value[open_basedir] = /usr/share/adminer:/tmp
|
||||
}
|
||||
file_put_contents("/etc/php/$version/fpm/pool.d/www.conf", $pool_config);
|
||||
exec("service php$version-fpm@default reload");
|
||||
}
|
||||
echo "Updating chroots, this might take a while…\n";
|
||||
exec('/var/www/setup_chroot.sh /var/www');
|
||||
$stmt=$db->query('SELECT system_account FROM users;');
|
||||
$shell = ENABLE_SHELL_ACCESS ? '/bin/bash' : '/usr/sbin/nologin';
|
||||
while($tmp=$stmt->fetch(PDO::FETCH_ASSOC)){
|
||||
}
|
||||
echo "Updating chroots, this might take a while…\n";
|
||||
exec('/var/www/setup_chroot.sh /var/www');
|
||||
$stmt=$db->query('SELECT system_account FROM users;');
|
||||
$shell = ENABLE_SHELL_ACCESS ? '/bin/bash' : '/usr/sbin/nologin';
|
||||
while($tmp=$stmt->fetch(PDO::FETCH_ASSOC)){
|
||||
echo "Updating chroot for user $tmp[system_account]…\n";
|
||||
exec('usermod -s ' . escapeshellarg($shell) . ' ' . escapeshellarg($tmp['system_account']));
|
||||
exec('/var/www/setup_chroot.sh ' . escapeshellarg('/home/'.$tmp['system_account']));
|
||||
exec('grep ' . escapeshellarg($tmp['system_account']) . ' /etc/passwd >> ' . escapeshellarg("/home/$tmp[system_account]/etc/passwd"));
|
||||
}
|
||||
file_put_contents('/etc/nginx/sites-enabled/default', NGINX_DEFAULT);
|
||||
if(!file_exists("/etc/nginx/streams-enabled/")){
|
||||
}
|
||||
file_put_contents('/etc/nginx/sites-enabled/default', NGINX_DEFAULT);
|
||||
if(!file_exists("/etc/nginx/streams-enabled/")){
|
||||
mkdir("/etc/nginx/streams-enabled/", 0755, true);
|
||||
}
|
||||
file_put_contents('/etc/nginx/streams-enabled/default', "server {
|
||||
}
|
||||
file_put_contents('/etc/nginx/streams-enabled/default', "server {
|
||||
listen unix:/var/www/var/run/mysqld/mysqld.sock;
|
||||
proxy_pass unix:/var/run/mysqld/mysqld.sock;
|
||||
}");
|
||||
exec("service nginx reload");
|
||||
$db->exec('UPDATE service_instances SET reload=1;');
|
||||
echo "Done - Database and files have been updated to the latest version :)\n";
|
||||
}
|
||||
exec("service nginx reload");
|
||||
$db->exec('UPDATE service_instances SET reload=1;');
|
||||
echo "Done - Database and files have been updated to the latest version :)\n";
|
||||
|
Reference in New Issue
Block a user