Skip to main content

Module scaffold

Module scaffold 

Source
Expand description

Project scaffolding for edgeguard init.

The first five minutes decide whether someone adopts a front door for their (often generated) app. init removes the “read the whole README, hand-write a config and a Dockerfile” step: it detects the upstream app’s runtime from the files in the working directory and renders a starter edgeguard.toml plus a Dockerfile that wraps the app behind EdgeGuard with --wrap.

This module is the pure core (detection + templating) so it’s unit-testable; the CLI in main.rs does the filesystem side (scan the directory, write the files, print next steps).

Enums§

Runtime
A detected upstream-app runtime. Drives the default app port, the --wrap start command, and the base image in the generated Dockerfile.

Constants§

EDGEGUARD_TOML
The annotated, secure-by-default config reference, embedded at compile time so the scaffold edgeguard.toml is byte-identical to the documented reference and can never drift from it.

Functions§

dockerfile
Render a Dockerfile that wraps the detected app behind EdgeGuard: it copies the static edgeguard binary from the published image, keeps the app’s own base image, and makes EdgeGuard the entrypoint (binding the platform $PORT, running the app on APP_PORT).
next_steps
The next-steps blurb printed after init writes its files: how to set a credential and run.