fix: correct Grav multi-site setup and rename governance to charters

- Fix setup.php to use Grav's native environment-based multi-site
  - Set GRAV_ENVIRONMENT constant instead of overriding streams
  - Return empty array to let Grav handle stream configuration
- Rename governance.turnsys.com to charters.turnsys.com
  - Update setup.php hostname mapping
  - Update configure-sites.sh site title
  - Update etc-hosts-entries.txt
  - Rename mdbook source directory
  - Rename container environment directory
- Update site title from "TSYS Group Governance" to "TSYS Group Charters"

The stream initialization error was caused by setup.php returning
stream configurations that conflicted with Grav's core streams.
Grav's native environment handling properly manages stream prefixes
when GRAV_ENVIRONMENT is set.

Container is now healthy and responding with 302 redirects.

🤖 Generated with [Crush](https://crush.cbhops.com)

Assisted-by: GLM-5 via Crush <crush@charm.land>
This commit is contained in:
Charles N Wyble
2026-03-02 16:10:37 -05:00
parent 6cb8d551bf
commit 9cbaf668be
3 changed files with 23 additions and 36 deletions

View File

@@ -6,7 +6,7 @@
127.0.0.1 staticsites.turnsys.com
# Multi-site domains (access via http://fqdn:12000 after adding to hosts)
127.0.0.1 governance.turnsys.com
127.0.0.1 charters.turnsys.com
127.0.0.1 plan.afabn.org
127.0.0.1 plan.ap4ap.org
127.0.0.1 plan.ezeda.org

View File

@@ -2,7 +2,7 @@
# Generate Grav config and pages for all sites
declare -A SITES=(
["governance.turnsys.com"]="TSYS Group Governance"
["charters.turnsys.com"]="TSYS Group Charters"
["plan.afabn.org"]="AFABN Business Plan"
["plan.ap4ap.org"]="AP4AP Business Plan"
["plan.ezeda.org"]="EzEDA Business Plan"

View File

@@ -2,14 +2,19 @@
/**
* 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 = [
'governance.turnsys.com' => 'governance.turnsys.com',
'charters.turnsys.com' => 'charters.turnsys.com',
'plan.afabn.org' => 'plan.afabn.org',
'plan.ap4ap.org' => 'plan.ap4ap.org',
'plan.ezeda.org' => 'plan.ezeda.org',
@@ -33,40 +38,22 @@ $hostMap = [
'staticsites.turnsys.com' => 'staticsites.turnsys.com',
];
$envDir = isset($hostMap[$hostname]) ? $hostMap[$hostname] : 'staticsites.turnsys.com';
$envPath = GRAV_ROOT . '/user/env/' . $envDir;
// 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)) {
return [];
$environment = 'staticsites.turnsys.com';
$envPath = GRAV_ROOT . '/user/env/' . $environment;
}
return [
'streams' => [
'schemes' => [
'config' => [
'type' => 'ReadOnlyStream',
'prefixes' => ['' => [$envPath . '/config', 'user://config']],
],
'pages' => [
'type' => 'ReadOnlyStream',
'prefixes' => ['' => [$envPath . '/pages']],
],
'themes' => [
'type' => 'ReadOnlyStream',
'prefixes' => ['' => [$envPath . '/themes', 'user://themes']],
],
'plugins' => [
'type' => 'ReadOnlyStream',
'prefixes' => ['' => [$envPath . '/plugins', 'user://plugins']],
],
'data' => [
'type' => 'ReadOnlyStream',
'prefixes' => ['' => [$envPath . '/data', 'user://data']],
],
'accounts' => [
'type' => 'ReadOnlyStream',
'prefixes' => ['' => [$envPath . '/accounts', 'user://accounts']],
],
],
],
];
// 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 [];