mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
feat(installer): Add web server config guidance post-installation
This commit is contained in:
parent
1e3e58aeed
commit
2153c1b0aa
3 changed files with 33 additions and 4 deletions
29
install.php
29
install.php
|
@ -319,6 +319,35 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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): ";
|
||||
$webserver = mb_strtolower(trim(readline()));
|
||||
$install_dir = 'install' . DIRECTORY_SEPARATOR;
|
||||
|
||||
switch ($webserver) {
|
||||
case 'nginx':
|
||||
$config_path = BB_ROOT . $install_dir . 'nginx.conf';
|
||||
if (is_file($config_path)) {
|
||||
out("- Nginx configuration file: $config_path", 'success');
|
||||
} else {
|
||||
out("- Nginx config not found: $config_path", 'warning');
|
||||
out('- You can find an example in the documentation', 'info');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'caddy':
|
||||
$config_path = BB_ROOT . $install_dir . 'Caddyfile';
|
||||
if (is_file($config_path)) {
|
||||
out("- Caddy configuration file: $config_path", 'success');
|
||||
} else {
|
||||
out("- Caddy config not found: $config_path", 'warning');
|
||||
out('- You can find an example in the documentation', 'info');
|
||||
}
|
||||
break;
|
||||
}
|
||||
sleep(3);
|
||||
|
||||
// Cleanup...
|
||||
if (is_file(BB_ROOT . '_cleanup.php')) {
|
||||
out("\n--- Finishing installation (Cleanup) ---\n", 'info');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Example Caddy configuration for TorrentPier
|
||||
|
||||
example.com {
|
||||
root * /path/to/root
|
||||
root * /path/to/www
|
||||
encode gzip zstd
|
||||
php_fastcgi unix//run/php/php-fpm.sock
|
||||
try_files {path} {path}/ /index.php?{query}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Example nginx configuration for TorrentPier
|
||||
|
||||
server {
|
||||
listen 80; # port
|
||||
server_name example.com; # your domain
|
||||
root /path/to/root; # folder with TorrentPier installed
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
root /path/to/www;
|
||||
index index.php;
|
||||
charset utf-8;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue