From 5f9594451080326bbafb7c7730d79353002651b0 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 19 Aug 2025 18:27:46 +0300 Subject: [PATCH] Update install.php --- install.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/install.php b/install.php index b3929f5ae..bd9803d57 100644 --- a/install.php +++ b/install.php @@ -303,22 +303,6 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) { 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 out("\n--- Web Server configuration ---\n", 'info'); 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; } 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('Adapt them to your environment and web server setup', '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'); 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'); }