Ideally, strawman can be included with any project setup via docker-compose.
It should be possible to run a strawman server with as little configuration as this:
version: "3.9"
services:
my-service:
image: strawman
ports:
- 8081:8080
environment:
STRAWMAN_REMOTE_SERVICE_URI: https://example.com
volumes:
- ./snapshots:/snapshots
The idea is that inside the respective docker container, a strawman server runs at port 8080. The server should run in replay mode by default.
Through a shortcut script, the strawman-rc CLI (see: #9) can be used to control that server:
docker-compose exec my-service rc capture
(This would put the already running server into capture mode)
A local snapshot directory can be mounted into the strawman container as a volume. The container assumes the inner snapshot directory to reside at /snapshots.
The container should take care of the appropriate Deno permissions to give strawman access to the proxied service. It should be very restrictive at that and should not just apply allow-net.
However, Deno permissions should be configurable from the outside, so that users can add permissions in case their template implementation need additional access.
We should provide an interface here that encourages strict permission handling as well.
Links: