This is a back end for dComms DIY project. It creates instances of applications and runs these via docker compose suite. There's a special application dawa which is the WebUI to manage this back end. Other supported apps for now are Mastodon and Peertube.
NOTE: This is definitely not production quality but mostly a result of explorative programming sessions.
Requirements
- Go
Run the back end
go run ./cmd/
Connect to a websocket on port 6006 and call these actions. Some examples (though incomplete) are in jrpc.html
There is a schema_jrpc.json file in the root folder. It is generated every server start.
This is far from complete. Look at the rpc_*.go files for arguments and return values.
scripts/cleanup.sh - stops all services running from .instances folder and removes the folder after
Logs go to stdout as JSON, one object per line. LOG_LEVEL sets the minimum severity
that is written; everything below it is dropped. Unset or unrecognised values fall back
to info. none silences everything.
| Level | Writes |
|---|---|
none |
nothing |
error |
failures: unreadable config, closed locks, failed jobs, bind and connect errors |
warn |
TBD |
info |
startup, the bound address, client connections, shutdown |
debug |
API requests and their responses, container inspection, caddy replies |
For example:
LOG_LEVEL=debug go run ./cmd/
RPC request and response bodies appear under a json key. Requests that carry no params
log no json key at all, which distinguishes them from an explicit {}.
Check Caddy config:
# entire config
curl -s http://localhost:2019/config/ | jq
# app routes (https on localhost, plain http on :80 for any other DCOMMS_WEB_DOMAIN)
curl -s http://localhost:2019/config/apps/http/servers/srv0/routes | jq
# localhost-only http server
curl -s http://localhost:2019/config/apps/http/servers/srv1/routes | jqCheck an app is being routed through caddy:
curl -sv http://APP_INST_DOMAIN:CADDY_PORT/ -o /dev/null
curl -sv http://testapp.localhost:8000/ -o /dev/null