mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Update install.php
This commit is contained in:
parent
417524dbc1
commit
5f95944510
1 changed files with 18 additions and 18 deletions
36
install.php
36
install.php
|
@ -303,22 +303,6 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
|
||||||
file_put_contents($robots_txt_file, $content);
|
file_put_contents($robots_txt_file, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($APP_ENV) && $APP_ENV === 'local') {
|
|
||||||
if (!is_file(BB_ROOT . 'library/config.local.php')) {
|
|
||||||
if (copy(BB_ROOT . 'library/config.php', BB_ROOT . 'library/config.local.php')) {
|
|
||||||
out('- Local configuration file created!', 'success');
|
|
||||||
} else {
|
|
||||||
out('- Cannot create library/config.local.php file. You can create it manually, just copy config.php and rename it to config.local.php', 'warning');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (rename(__FILE__, __FILE__ . '_' . hash('xxh128', time()))) {
|
|
||||||
out("- Installation file renamed!", 'success');
|
|
||||||
} else {
|
|
||||||
out('- Cannot rename installation file (' . __FILE__ . '). Please, rename it manually for security reasons', 'warning');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suggest configuration files based on selected web server
|
// Suggest configuration files based on selected web server
|
||||||
out("\n--- Web Server configuration ---\n", 'info');
|
out("\n--- Web Server configuration ---\n", 'info');
|
||||||
echo "Which web server are you using? (nginx / caddy / apache): ";
|
echo "Which web server are you using? (nginx / caddy / apache): ";
|
||||||
|
@ -347,8 +331,8 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (in_array($webserver, ['nginx', 'caddy'])) {
|
if (in_array($webserver, ['nginx', 'caddy'])) {
|
||||||
out('Note: These configuration files include settings specific to TorrentPier, such as URL rewriting, security headers, and PHP handling', 'info');
|
out("- Note: These configuration files include settings specific to TorrentPier,\nsuch as URL rewriting, security headers, and PHP handling", 'info');
|
||||||
out('Adapt them to your environment and web server setup', 'info');
|
out('- Adapt them to your environment and web server setup', 'info');
|
||||||
sleep(3);
|
sleep(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,5 +354,21 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($APP_ENV) && $APP_ENV === 'local') {
|
||||||
|
if (!is_file(BB_ROOT . 'library/config.local.php')) {
|
||||||
|
if (copy(BB_ROOT . 'library/config.php', BB_ROOT . 'library/config.local.php')) {
|
||||||
|
out('- Local configuration file created!', 'success');
|
||||||
|
} else {
|
||||||
|
out('- Cannot create library/config.local.php file. You can create it manually, just copy config.php and rename it to config.local.php', 'warning');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (rename(__FILE__, __FILE__ . '_' . hash('xxh128', time()))) {
|
||||||
|
out("- Installation file renamed!", 'success');
|
||||||
|
} else {
|
||||||
|
out('- Cannot rename installation file (' . __FILE__ . '). Please, rename it manually for security reasons', 'warning');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out("\n- Voila! Good luck & have fun!", 'success');
|
out("\n- Voila! Good luck & have fun!", 'success');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue