- Rename mdbook source directory
- Rename Grav environment directory in container
- Update setup.php hostname mapping
- Update configure-sites.sh
- Update etc-hosts-entries.txt
- Update README.md site inventory
Consistent naming convention: all plan sites now use plan.{domain}
🤖 Generated with [Crush](https://crush.cbhops.com)
Assisted-by: GLM-5 via Crush <crush@charm.land>
60 lines
2.4 KiB
PHP
60 lines
2.4 KiB
PHP
<?php
|
|
/**
|
|
* Grav Multi-Site Setup Configuration
|
|
* Maps hostnames to environment-specific directories
|
|
*
|
|
* Uses Grav's native environment-based multi-site feature.
|
|
* The environment is determined by hostname.
|
|
*/
|
|
|
|
// Get the hostname from request
|
|
$hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
|
|
$hostname = preg_replace('/:\d+$/', '', $hostname);
|
|
$hostname = strtolower($hostname);
|
|
|
|
// Define supported hostnames
|
|
$hostMap = [
|
|
'charters.turnsys.com' => 'charters.turnsys.com',
|
|
'plan.afabn.org' => 'plan.afabn.org',
|
|
'plan.ap4ap.org' => 'plan.ap4ap.org',
|
|
'plan.ezeda.org' => 'plan.ezeda.org',
|
|
'plan.ezpodstack.org' => 'plan.ezpodstack.org',
|
|
'plan.hfnoc.net' => 'plan.hfnoc.net',
|
|
'plan.knownelement.com' => 'plan.knownelement.com',
|
|
'plan.meetmorse.com' => 'plan.meetmorse.com',
|
|
'plan.merchantsofhope.org' => 'plan.merchantsofhope.org',
|
|
'plan.rackrental.net' => 'plan.rackrental.net',
|
|
'plan.redwfo.com' => 'plan.redwfo.com',
|
|
'plan.rwscp.net' => 'plan.rwscp.net',
|
|
'plan.sidedoorgroup.org' => 'plan.sidedoorgroup.org',
|
|
'plan.sol-calc.com' => 'plan.sol-calc.com',
|
|
'plan.suborbital-systems.com' => 'plan.suborbital-systems.com',
|
|
'plan.teamrental.net' => 'plan.teamrental.net',
|
|
'plan.thecampustradingcompany.com' => 'plan.thecampustradingcompany.com',
|
|
'plan.thepeernet.com' => 'plan.thepeernet.com',
|
|
'plan.turnsys.com' => 'plan.turnsys.com',
|
|
'plan.yourdreamnamehere.com' => 'plan.yourdreamnamehere.com',
|
|
'plan.startinglineproductions.com' => 'plan.startinglineproductions.com',
|
|
'staticsites.turnsys.com' => 'staticsites.turnsys.com',
|
|
];
|
|
|
|
// Determine environment name (falls back to staticsites.turnsys.com)
|
|
$environment = isset($hostMap[$hostname]) ? $hostMap[$hostname] : 'staticsites.turnsys.com';
|
|
$envPath = GRAV_ROOT . '/user/env/' . $environment;
|
|
|
|
// If environment directory doesn't exist, use default
|
|
if (!is_dir($envPath)) {
|
|
$environment = 'staticsites.turnsys.com';
|
|
$envPath = GRAV_ROOT . '/user/env/' . $environment;
|
|
}
|
|
|
|
// Set the Grav environment - this tells Grav to look for config in user/env/{environment}/
|
|
// Grav will automatically handle stream prefixes based on this
|
|
if (!defined('GRAV_ENVIRONMENT')) {
|
|
define('GRAV_ENVIRONMENT', $environment);
|
|
}
|
|
|
|
// Return empty array - Grav's native environment handling will take over
|
|
// based on the GRAV_ENVIRONMENT constant
|
|
return [];
|