mirror of
https://github.com/Such-Software/adaptive-multi-protocol-gateway.git
synced 2026-10-17 15:41:41 +02:00
Capture transport addresses in state
This commit is contained in:
+29
-1
@@ -1,6 +1,6 @@
|
||||
# Configuration
|
||||
|
||||
> Status: draft | Updated 2026-07-05 | Applies to: `gateway.toml`
|
||||
> Status: draft | Updated 2026-07-06 | Applies to: `gateway.toml`
|
||||
|
||||
AMPG is configured from one TOML file. The file declares global paths, sites, source
|
||||
adapters, render targets, and daemon policy.
|
||||
@@ -107,6 +107,34 @@ workflow.
|
||||
| ipfs | `clearnet` | `ipfs` | `auto` |
|
||||
| reticulum | `micron` | `rnsd` | `auto` |
|
||||
|
||||
## Gateway paths
|
||||
|
||||
`[gateway]` paths are resolved relative to `gateway.toml` when they are not absolute.
|
||||
|
||||
`state_dir`
|
||||
: AMPG-owned durable state. Managed daemon identities, generated transport state, and
|
||||
the captured address registry live here.
|
||||
|
||||
`cache_dir`
|
||||
: Rebuildable intermediate data.
|
||||
|
||||
`run_dir`
|
||||
: Runtime sockets, pid files, and process metadata for managed daemons.
|
||||
|
||||
`user`
|
||||
: Preferred service user emitted into generated managed-daemon artifacts.
|
||||
|
||||
Transport URLs are resolved in this order:
|
||||
|
||||
1. Explicit protocol config such as `fixture_url`, `browser_url`, `onion_url`, `i2p_url`,
|
||||
`gemini_url`, `rns_url`, `ipfs_url`, or `cid`.
|
||||
2. Captured state from `ampg addresses capture` or `ampg addresses set`.
|
||||
3. A derived URL for clearnet/Gemini or a deterministic placeholder for identity-based
|
||||
transports whose final address is not known yet.
|
||||
|
||||
Use `address_file` on a protocol target when an adopted daemon writes its public hostname
|
||||
outside AMPG's managed state layout.
|
||||
|
||||
## Renderer defaults
|
||||
|
||||
`privacy-html` removes:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Daemon Management
|
||||
|
||||
> Status: draft | Updated 2026-07-05 | Applies to: protocol adapters
|
||||
> Status: draft | Updated 2026-07-06 | Applies to: protocol adapters
|
||||
|
||||
AMPG can use daemons that already exist on a server or create AMPG-owned daemons when
|
||||
the selected protocol is not running. This keeps simple deployments simple while avoiding
|
||||
@@ -41,6 +41,8 @@ python3 -m ampg --config gateway.toml status
|
||||
python3 -m ampg --config gateway.toml doctor
|
||||
python3 -m ampg --config gateway.toml install-plan --profile mobile-i2p
|
||||
python3 -m ampg --config gateway.toml install-plan --profile mobile-i2p --write-artifacts
|
||||
python3 -m ampg --config gateway.toml addresses list --profile mobile-i2p
|
||||
python3 -m ampg --config gateway.toml addresses capture --profile mobile-i2p
|
||||
python3 -m ampg --config gateway.toml health-plan --profile mobile-i2p
|
||||
python3 -m ampg --config gateway.toml apply --dry-run
|
||||
python3 -m ampg --config gateway.toml apply --dry-run --profile mobile-i2p
|
||||
@@ -66,6 +68,11 @@ files under the configured `plan_root`, grouped by site, protocol, and platform.
|
||||
Tor/I2P HTTP publishing, AMPG writes both transport-daemon artifacts and loopback nginx
|
||||
artifacts.
|
||||
|
||||
`addresses list` prints the effective public address for each enabled protocol:
|
||||
configured, captured, derived, or placeholder. `addresses capture` reads daemon-written
|
||||
address files from AMPG state or a protocol `address_file` override, then updates the
|
||||
address registry under `state_dir`.
|
||||
|
||||
`health-plan` prints fixture-based checks to run after services start. Published checks
|
||||
target real transport URLs; preview checks target local loopback preview endpoints.
|
||||
Missing output blocks the plan, while placeholder transport addresses are review items.
|
||||
|
||||
@@ -32,6 +32,8 @@ or deployment notes.
|
||||
```sh
|
||||
python3 -m ampg --config examples/wownero.gateway.toml build
|
||||
python3 -m ampg --config examples/wownero.gateway.toml manifest
|
||||
python3 -m ampg --config examples/wownero.gateway.toml addresses list
|
||||
python3 -m ampg --config examples/wownero.gateway.toml addresses capture --profile mobile-i2p
|
||||
python3 -m ampg --config examples/wownero.gateway.toml preview manifest
|
||||
python3 -m ampg --config examples/wownero.gateway.toml health-plan
|
||||
python3 -m ampg --config examples/wownero.gateway.toml health-plan --mode preview
|
||||
@@ -60,6 +62,11 @@ Some transports may not have final public addresses when a fixture is generated.
|
||||
cases AMPG uses route-valid placeholders such as `http://wownero.onion/` so AMPB can still
|
||||
verify transport selection without contacting the network.
|
||||
|
||||
When a managed or adopted daemon writes an actual address, run `addresses capture`.
|
||||
Captured addresses are stored under `gateway.state_dir` and replace placeholders in
|
||||
fixture manifests and published health plans. Operators can also use `addresses set` to
|
||||
store an address manually.
|
||||
|
||||
## Interaction Policy
|
||||
|
||||
Fixture interaction policy defaults to:
|
||||
|
||||
@@ -6,6 +6,10 @@ This file is generated from code. Do not edit it by hand.
|
||||
|
||||
| Section | Field | Type | Required | Default | Description |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| gateway | `state_dir` | path | no | ./.ampg/state | AMPG-owned daemon state and captured address registry root. |
|
||||
| gateway | `cache_dir` | path | no | ./.ampg/cache | AMPG cache root for generated intermediate data. |
|
||||
| gateway | `run_dir` | path | no | ./.ampg/run | Runtime socket and process metadata root for managed daemons. |
|
||||
| gateway | `user` | string | no | - | Preferred service user for generated managed-daemon artifacts. |
|
||||
| site | `id` | string | yes | - | Stable site identifier used in output paths. |
|
||||
| site | `domain` | string | yes | - | Canonical public domain for the site. |
|
||||
| site.source | `kind` | enum | yes | static-html | Source adapter kind. |
|
||||
@@ -26,6 +30,9 @@ This file is generated from code. Do not edit it by hand.
|
||||
| site.protocols.<name> | `renderer` | enum | no | <protocol> | Renderer profile to use for this protocol. |
|
||||
| site.protocols.<name> | `daemon` | enum | no | protocol default | Ingress daemon adapter. |
|
||||
| site.protocols.<name> | `daemon_policy` | enum | no | protocol default | Whether AMPG adopts, manages, or only renders config. |
|
||||
| site.protocols.<name> | `fixture_url` | url | no | - | Published URL used in fixture manifests and health plans. |
|
||||
| site.protocols.<name> | `browser_url` | url | no | - | Browser-facing URL alias used when fixture_url is not set. |
|
||||
| site.protocols.<name> | `address_file` | path | no | - | Daemon-written public address file consumed by addresses capture. |
|
||||
| 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. |
|
||||
|
||||
@@ -152,6 +152,7 @@ daemon_policy = "auto"
|
||||
python3 -m ampg --config examples/wownero.gateway.toml plan
|
||||
python3 -m ampg --config examples/wownero.gateway.toml build
|
||||
python3 -m ampg --config examples/wownero.gateway.toml manifest
|
||||
python3 -m ampg --config examples/wownero.gateway.toml addresses list
|
||||
python3 -m ampg --config examples/wownero.gateway.toml preview endpoints
|
||||
python3 -m ampg --config examples/wownero.gateway.toml preview manifest
|
||||
python3 -m ampg --config examples/i2p-only.gateway.toml plan
|
||||
|
||||
Reference in New Issue
Block a user