Release Build
A production build of GPROXY is a single Cargo release build plus a one-time frontend build. Both steps are idempotent and can be wired into CI.
1. Build the embedded console (if changed)
Section titled “1. Build the embedded console (if changed)”If you modified anything under frontend/console/, rebuild the console
first so the new assets get baked into the binary:
cd frontend/consolepnpm installpnpm buildcd ../..pnpm build writes the compiled assets to the path the server crate
embeds via include_dir!. There is no separate static-file directory to
ship with the binary.
If you haven’t touched the frontend, you can skip this step — the last built assets stay on disk and are picked up by the next Cargo build.
2. Build the Rust binary
Section titled “2. Build the Rust binary”cargo build -p gproxy --releaseThe output binary is at target/release/gproxy. It is statically linked
against the Rust standard library but depends on the system’s OpenSSL /
TLS stack unless you build with rustls features enabled in your
environment.
3. Strip and package (optional)
Section titled “3. Strip and package (optional)”To reduce the binary size for distribution:
strip target/release/gproxyYou can then ship the stripped binary as-is; it has no runtime
dependencies beyond libc and the TLS stack.
4. First run
Section titled “4. First run”On the first run, GPROXY will:
- Create
GPROXY_DATA_DIRif it doesn’t exist. - Generate a SQLite file under the data directory if
GPROXY_DSNis unset. - Import the seed TOML (
GPROXY_CONFIG) if the database is empty. - Bootstrap an admin account from
GPROXY_ADMIN_*if needed, logging generated credentials once. - Start the HTTP server and the worker set.
See the Quick Start for a concrete first-run walkthrough.
CI tips
Section titled “CI tips”- Cache the
~/.cargoandtarget/directories between CI runs; the workspace has many dependencies and re-downloading them dominates cold-build time. - Cache
frontend/console/node_modulesvia pnpm’s store path for the same reason. - Run
cargo test -p gproxyandpnpm test(if configured) on pull requests; save thereleasebuild for tags. - If you tag a release, generate release notes from
RELEASE_NOTE.mdand attach the stripped binary as an artifact.