The owner decided how a Server forwards. Forwarding spends the operator's bandwidth, so the operator offers it and it is off by default. Once offered, rooms use it without a second switch, a room manager can decline it, and the service ranks after participant paths (canon: P2P first, load is shared, the same rule for every node, automatic). a. Operator switches. PIIK_CHANNEL_SERVICE_TRANSIT is the master switch, off by default. PIIK_CHANNEL_SERVICE_TRANSIT_SCREEN, _VOICE and _FILES default to true and each turns one kind off. Files include original video forwarded for watching together. With the master switch off nothing is offered. The offer reaches room hosts with the service socket. The room removes the service from the relays of a kind it does not offer, and the channel rejects a projection that gives the service such a kind as site transit. A service that offers no kind reads as unavailable. b. A new room allows the service. Creation paths apply only an explicit choice, so Browser, App and Server-hosted rooms and room copies take the default, and a stored false stays false. The setting reads as declining a default, and its note says the site forwards only the kinds its operator offers, in all five locales. c. The planner names the service as the fallback. When a route is assigned it first extends the tree with participant relays only, then lets the service reach the receivers still waiting. It keeps that tree unless the joint tree, where the service may take a scarce output, serves more receivers, so ties go to participants. A strict participant-first pass could spend the source's outputs on direct listeners and leave those reachable only through the service unserved; a test reproduces that. The ranking among participants is unchanged. The rule applies when a route is assigned. A receiver already served through the service keeps that route until it fails or demand ends, even if a participant path appears later. A screen viewer can still make the usual move to a direct path from the person sharing. Left open: in a public room the service's session has ordinary read access, so a modified room host can list it as a plain participant relay, without the transit view that carries the room's choice and the operator's kinds, even when forwarding is off. Closing it needs the channel to recognise the Server's own session by identity in rooms that session does not host. Tests added in channel-core: a participant wins over the service; the service serves only receivers no participant path reaches; the service takes a scarce source output when that serves more receivers; a moved child takes a ready participant before the service; the service carries only the kinds its operator offers; a service that offers no kind reads as unavailable; a new room uses the offered service until its manager declines. Expectations changed for the new default in host_review, service_transit, stored_room and the first test of tests/service-transit-wasm.test.ts. Verified on the lane: cargo test for piik-channel-core with and without sqlite, cargo check for channel-server and channel-browser, the room_creation_policy test, a rebuilt WASM package, tsc -b, the whole vitest suite and the docs check. The channel-native suites were not run.
55 lines
1.5 KiB
TOML
55 lines
1.5 KiB
TOML
# Candidate configuration; follow docs/deployment.md before creating resources.
|
|
# Replace the app, region, image, public origin and dedicated IPv4 address.
|
|
# Deploy with --ha=false: one Machine owns this site's authority and volume.
|
|
app = "replace-with-your-app-name"
|
|
primary_region = "iad"
|
|
kill_signal = "SIGTERM"
|
|
kill_timeout = 20
|
|
|
|
[build]
|
|
image = "ghcr.io/tntcrafthim/piik:replace-with-matching-3.0-tag"
|
|
|
|
[env]
|
|
PIIK_CHANNEL_BIND_ADDRESS = "0.0.0.0"
|
|
PIIK_CHANNEL_PORT = "8787"
|
|
PIIK_CHANNEL_DATA_DIR = "/home/nonroot"
|
|
PIIK_CHANNEL_WEB_ORIGIN = "https://share.example.com"
|
|
PIIK_CHANNEL_UDP_BIND_ADDRESS = "fly-global-services"
|
|
PIIK_CHANNEL_UDP_PORT = "8787"
|
|
PIIK_CHANNEL_UDP_PUBLIC_ADDRESS = "203.0.113.10:8787"
|
|
PIIK_CHANNEL_SERVICE_TRANSIT = "false"
|
|
# With forwarding on, set PIIK_CHANNEL_SERVICE_TRANSIT_SCREEN, _VOICE or _FILES to "false" to turn one kind off.
|
|
# Supply PIIK_CHANNEL_OWNER_KEY through Fly secrets before first startup.
|
|
|
|
[mounts]
|
|
source = "piik_data"
|
|
destination = "/home/nonroot"
|
|
initial_size = "1gb"
|
|
|
|
[http_service]
|
|
internal_port = 8787
|
|
force_https = true
|
|
auto_stop_machines = "off"
|
|
auto_start_machines = false
|
|
|
|
[[http_service.checks]]
|
|
interval = "15s"
|
|
grace_period = "10s"
|
|
timeout = "2s"
|
|
method = "GET"
|
|
path = "/healthz"
|
|
|
|
[[services]]
|
|
protocol = "udp"
|
|
internal_port = 8787
|
|
auto_stop_machines = "off"
|
|
auto_start_machines = false
|
|
|
|
[[services.ports]]
|
|
port = 8787
|
|
|
|
[[vm]]
|
|
cpu_kind = "shared"
|
|
cpus = 1
|
|
memory = "512mb"
|