# TSYS Static Sites - Grav Multi-Site Installation

This repository contains the configuration for a Grav CMS multi-site installation hosting 21 static sites, migrated from mdbook.

## Quick Start

### 1. Add hosts entries

Add the following to `/etc/hosts`:

```
127.0.0.1 staticsites.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
127.0.0.1 plan.ezpodstack.org
127.0.0.1 plan.hfnoc.net
127.0.0.1 plan.knownelement.com
127.0.0.1 plan.meetmorse.com
127.0.0.1 plan.merchantsofhope.org
127.0.0.1 plan.rackrental.net
127.0.0.1 plan.redwfo.com
127.0.0.1 plan.rwscp.net
127.0.0.1 plan.sidedoorgroup.org
127.0.0.1 plan.sol-calc.com
127.0.0.1 plan.suborbital-systems.com
127.0.0.1 plan.teamrental.net
127.0.0.1 plan.thecampustradingcompany.com
127.0.0.1 plan.thepeernet.com
127.0.0.1 plan.turnsys.com
127.0.0.1 plan.yourdreamnamehere.com
127.0.0.1 plan.startinglineproductions.com
```

See `etc-hosts-entries.txt` for the complete list.

### 2. Start the Docker container

```bash
docker run -d \
  --name tsysstatic-dev-grav \
  -p 12000:80 \
  -v tsysstatic_grav_data:/var/www/html \
  --restart unless-stopped \
  getgrav/grav:latest
```

### 3. Configure multi-site

```bash
# Copy setup.php to container
docker cp setup.php tsysstatic-dev-grav:/var/www/html/setup.php
docker exec tsysstatic-dev-grav chown www-data:www-data /var/www/html/setup.php

# Run configuration script
docker cp scripts/configure-sites.sh tsysstatic-dev-grav:/tmp/
docker exec tsysstatic-dev-grav bash /tmp/configure-sites.sh

# Clear cache
docker exec tsysstatic-dev-grav rm -rf /var/www/html/cache/* /var/www/html/tmp/*
```

### 4. Access sites

Open browser to `http://staticsites.turnsys.com:12000` or any other configured domain.

## Architecture

### Multi-Site Configuration

Grav's native environment-based multi-site is used:

- `setup.php` - Detects hostname and sets `GRAV_ENVIRONMENT` constant
- `user/env/{fqdn}/` - Per-site configuration and content directories

### Directory Structure

```
user/env/{fqdn}/
├── config/
│   ├── system.yaml    # Grav system settings
│   └── site.yaml      # Site metadata (title, author, etc.)
├── pages/             # Site content
│   └── 01.home/
│       └── default.md
├── themes/            # Site-specific themes (optional)
├── data/              # Site-specific data files
└── accounts/          # Site-specific user accounts
```

### Shared Resources

- `user/plugins/` - Shared plugins (all sites)
- `user/themes/` - Shared themes (fallback if site doesn't have its own)

## Sites

| FQDN | Title |
|------|-------|
| charters.turnsys.com | TSYS Group Charters |
| plan.afabn.org | AFABN Business Plan |
| plan.ap4ap.org | AP4AP Business Plan |
| plan.ezeda.org | EzEDA Business Plan |
| plan.ezpodstack.org | EzPodStack Business Plan |
| plan.hfnoc.net | High Flight NOC Business Plan |
| plan.knownelement.com | Known Element Business Plan |
| plan.meetmorse.com | MeetMorse Business Plan |
| plan.merchantsofhope.org | Merchants of Hope Business Plan |
| plan.rackrental.net | RackRental Business Plan |
| plan.redwfo.com | Redwood Family Office Business Plan |
| plan.rwscp.net | RWSCP Business Plan |
| plan.sidedoorgroup.org | Side Door Group Business Plan |
| plan.sol-calc.com | Sol-Calc Business Plan |
| plan.suborbital-systems.com | Suborbital Systems Business Plan |
| plan.teamrental.net | TeamRental Business Plan |
| plan.thecampustradingcompany.com | Campus Trading Company Business Plan |
| plan.thepeernet.com | The Peer Network Business Plan |
| plan.turnsys.com | TSYS Business Plan |
| plan.yourdreamnamehere.com | Your Dream Name Here Business Plan |
| plan.startinglineproductions.com | Starting Line Productions Business Plan |
| staticsites.turnsys.com | TSYS Static Sites (default) |

## Production Deployment

For Cloudron deployment:

1. Deploy Grav app from Cloudron app store to staticsites.turnsys.com
2. Copy `setup.php` to the Grav root
3. Copy `user/env/` directory structure
4. Clear cache

## Source Content

Original mdbook content is in sibling directories:

```
../charters.turnsys.com/
../plan.afabn.org/
../plan.ap4ap.org/
... (etc)
```

Content migration from mdbook to Grav format is pending.
