Test Environment
This directory contains the Docker Compose setup and test data for local development.
Quick Start
docker compose up -d
go run ../cmd/member-console -config mc-config.yaml
Services
| Service | URL | Credentials |
|---|---|---|
| Member Console | http://localhost:8081 | (via Keycloak) |
| Keycloak | http://keycloak.localhost:8080 | admin / admin |
| Temporal UI | http://localhost:8233 | (via Keycloak) |
| FedWiki | http://admin.localtest.me | (see mc-config.yaml) |
| PostgreSQL | localhost:5432 | member_console / member_console |
| Valkey | localhost:6379 | — |
Test Data
The testdata/ directory is named like that so that gopls can ignore it by default. It contains sample data for testing the Member Console, such as:
Keycloak
Keycloak state is managed declaratively via data/keycloak/master-realm.json. On every docker compose up, Keycloak imports this realm file into a fresh ephemeral H2 database — no persistent volume is needed.
The realm includes:
- Clients: fedwiki, member-console, temporal, temporal-ui
- Users: admin, litianmei, and service accounts
To update the realm config after making changes in the Keycloak admin UI:
docker compose stop keycloak
docker compose run --rm \
-v ./data/keycloak:/tmp/export \
keycloak export --dir /tmp/export --users realm_file
# This overwrites data/keycloak/master-realm.json
docker compose up -d keycloak
FedWiki
FedWiki runtime data lives in data/fedwiki/ (gitignored status/ dirs). Seed data for owner files and access tokens is committed in seed/fedwiki/.
A fedwiki-init container automatically copies seed files into data/fedwiki/ on docker compose up without overwriting existing files (cp -rn). This means:
- Fresh clone: seed data is copied in automatically, no manual steps needed.
- Existing setup: your local data is preserved.
To update seed data after making changes (e.g., new tokens or wiki sites):
# Copy the relevant files from data/fedwiki/ to seed/fedwiki/
cp data/fedwiki/<site>/status/owner.json seed/fedwiki/<site>/status/
cp data/fedwiki/<site>/status/user-access-tokens.json seed/fedwiki/<site>/status/