myst/packages/cli/src/generators/examples.ts
ZTatman 577d91fc47 Complete CLI init skeleton with CodeRabbit review fixes
CLI changes:
- Narrow init to Myst-only config generation (no Forgejo provisioning)
- Add yoctocolors styling to CLI output
- Simplify URL validation logic (remove dead code)
- Fix typo in env.ts comment
- Remove docker-compose generator (out of scope)
- Move example config from src/ to packages/cli/examples/
- Fix CommandName type to match implemented commands only

Config changes:
- Remove databaseUrl from myst.config.json (DB is .env-only)
- Update example config with current fields
- Reject non-HTTP schemes before auto-prepending https://
- Use localhost -> 127.0.0.1 in Caddy/Nginx examples
- Add file existence checks and 0o600 permissions

Build passes after all changes.
2026-04-02 16:37:53 -04:00

22 lines
410 B
TypeScript

export function generateExampleCaddyfile(domain: string): string {
return `${domain} {
reverse_proxy /_myst/* 127.0.0.1:4000
reverse_proxy 127.0.0.1:3000
}
`;
}
export function generateExampleNginxConf(domain: string): string {
return `server {
server_name ${domain};
location /_myst/ {
proxy_pass http://127.0.0.1:4000/;
}
location / {
proxy_pass http://127.0.0.1:3000/;
}
}
`;
}