Add deployment profiles

This commit is contained in:
jwinterm
2026-07-06 05:28:35 -04:00
parent 034b463611
commit a3ad5c900b
10 changed files with 339 additions and 24 deletions
+29 -2
View File
@@ -45,7 +45,7 @@ public_allowed = false
[site.protocols.clearnet]
enabled = true
renderer = "clearnet"
daemon = "caddy"
daemon = "nginx"
daemon_policy = "adopt"
[site.protocols.tor]
@@ -100,7 +100,7 @@ workflow.
| Protocol | Default renderer | Default daemon | Default policy |
| --- | --- | --- | --- |
| clearnet | `clearnet` | `caddy` | `adopt` |
| clearnet | `clearnet` | `nginx` | `adopt` |
| tor | `privacy-html` | `tor` | `auto` |
| i2p | `privacy-html` | `i2pd` | `auto` |
| gemini | `gemtext` | `agate` | `auto` |
@@ -246,6 +246,33 @@ not belong in it.
Enabled protocols are independent. A config can omit clearnet entirely and publish only
to I2P, Tor, Gemini, IPFS, Reticulum, or any combination of supported targets.
## Deployment profiles
Profiles are named command defaults stored in `gateway.toml`. They can select enabled
protocols, set a default platform provider, and turn on safe plan artifact writes.
```toml
[profiles.mobile-i2p]
description = "User-space I2P-only deployment for Android/Termux-style hosts."
protocols = ["i2p"]
platform = "android-termux"
[profiles.vps-full]
description = "Full VPS deployment."
protocols = ["clearnet", "tor", "i2p", "gemini"]
platform = "linux-systemd"
write_artifacts = true
```
Use profiles with operational commands:
```sh
python3 -m ampg --config gateway.toml build --profile mobile-i2p
python3 -m ampg --config gateway.toml apply --dry-run --profile mobile-i2p
```
Explicit `--protocol` and `--platform` flags override profile defaults for that command.
For an existing HTML site that should publish only to I2P:
```toml
+5
View File
@@ -40,6 +40,7 @@ config artifacts.
python3 -m ampg --config gateway.toml status
python3 -m ampg --config gateway.toml doctor
python3 -m ampg --config gateway.toml apply --dry-run
python3 -m ampg --config gateway.toml apply --dry-run --profile mobile-i2p
python3 -m ampg --config gateway.toml apply --dry-run --protocol i2p
python3 -m ampg --config gateway.toml apply --dry-run --write-artifacts
python3 -m ampg --config gateway.toml doctor --platform android-termux
@@ -62,6 +63,10 @@ services.
`adopt` failure will block a full activation run, but it will not block
`apply --dry-run --protocol i2p` because clearnet is outside that selected run.
`--profile` loads named command defaults from `gateway.toml`. Profiles can set selected
protocols, platform provider, and safe artifact-writing defaults. Explicit command-line
flags override profile defaults.
Platform providers describe how AMPG may supervise managed daemons:
- `linux-systemd`: system service management after approval.
+4
View File
@@ -29,3 +29,7 @@ This file is generated from code. Do not edit it by hand.
| site.protocols.<name> | `max_asset_bytes` | integer | no | 1048576 | Maximum asset size copied by privacy-html render targets. |
| site.protocols.<name> | `script_policy` | enum | no | strip | Script handling policy for privacy-html render targets. |
| site.protocols.<name> | `max_tier` | enum | no | transport default | Maximum interaction tier this protocol target may expose. |
| profiles.<name> | `description` | string | no | - | Human-readable deployment profile description. |
| profiles.<name> | `protocols` | array<string> | no | all enabled protocols | Enabled protocols selected by this deployment profile. |
| profiles.<name> | `platform` | enum | no | detected platform | Platform provider used by status, doctor, and apply when not overridden. |
| profiles.<name> | `write_artifacts` | boolean | no | false | Whether plan/apply dry-run writes review artifacts by default. |