feat: initialize Grav multi-site project

- Add AGENTS.md with project requirements and site inventory
- Add JOURNAL.md for project tracking
- Add etc-hosts-entries.txt for local testing (22 domains)
- Add setup.php for Grav multi-site routing configuration

This project migrates 21 mdbook sites to a single Grav multi-site
installation. Each site will have its own environment directory under
user/env/{fqdn}/ with independent config, pages, and themes.

Development runs in Docker on port 12000 (container: tsysstatic-dev-grav).
Production target: Cloudron Grav app at staticsites.turnsys.com.

🤖 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:04:09 -05:00
commit 87feb5e3b5
4 changed files with 179 additions and 0 deletions

72
setup.php Normal file
View File

@@ -0,0 +1,72 @@
<?php
/**
* Grav Multi-Site Setup Configuration
* Maps hostnames to environment-specific directories
*/
$hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
$hostname = preg_replace('/:\d+$/', '', $hostname);
$hostname = strtolower($hostname);
$hostMap = [
'governance.turnsys.com' => 'governance.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',
'startinglineproductions.com-bizopprodplan' => 'startinglineproductions.com-bizopprodplan',
'staticsites.turnsys.com' => 'staticsites.turnsys.com',
];
$envDir = isset($hostMap[$hostname]) ? $hostMap[$hostname] : 'staticsites.turnsys.com';
$envPath = GRAV_ROOT . '/user/env/' . $envDir;
if (!is_dir($envPath)) {
return [];
}
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']],
],
],
],
];