pub struct GenerateEnvParams<'a> {Show 14 fields
pub config: &'a Config,
pub service_def: &'a ServiceDef,
pub auth_kind: Option<&'a AuthKind>,
pub host_port: Option<u16>,
pub resolved_ports: &'a [(String, u16)],
pub env_overrides: &'a BTreeMap<String, String>,
pub exposure: &'a Exposure,
pub extra_env: BTreeMap<String, String>,
pub pre_built_ctx: Option<BTreeMap<String, String>>,
pub enable_smtp: bool,
pub enabled_groups: &'a BTreeSet<String>,
pub selected_choices: &'a BTreeMap<String, String>,
pub existing_env_file: Option<&'a str>,
pub allow_unset_required: bool,
}Expand description
Parameters for generate_env.
Fields§
§config: &'a Config§service_def: &'a ServiceDef§auth_kind: Option<&'a AuthKind>The auth kind the user chose to enable, if any.
host_port: Option<u16>Primary host port (for service.url / service.port templating).
resolved_ports: &'a [(String, u16)]Per-port resolved host ports, keyed by port name (e.g. “http”, “smtp”).
Used to emit PORT_* lines in the .env file — each entry here
corresponds to one [[ports]] definition in service.toml.
env_overrides: &'a BTreeMap<String, String>§exposure: &'a ExposureHow the service is exposed; its URL (if any) feeds templates like
{{service.external_url}} / {{service.domain}}.
extra_env: BTreeMap<String, String>Additional env vars to append to the .env file (e.g., CA cert trust vars).
pre_built_ctx: Option<BTreeMap<String, String>>Pre-built template context. When provided, secrets and auth credentials from this context are reused instead of generating fresh ones. This ensures the values shown during interactive prompts match what gets written to the .env file.
enable_smtp: boolWhether this service should use the globally configured SMTP. When false, smtp.* is left out of the context and [mappings.smtp] is skipped — lets the user opt a single service out of email without clearing the global SMTP config.
enabled_groups: &'a BTreeSet<String>Names of [[env_group]] entries the user toggled on. Members of
groups not listed here are fully omitted from the generated .env.
selected_choices: &'a BTreeMap<String, String>[[choice]] selections (choice name -> option name). Only the
selected option’s members are written; absent choices fall back to
their declared default.
existing_env_file: Option<&'a str>Raw contents of the service’s existing on-disk .env, when one is
already present (a re-add, or a hand-authored “bring your own” file).
The generated env is merged into this rather than overwriting it:
existing lines, comments, and keys the registry doesn’t know about are
preserved; only keys the user set this run (env_overrides) are
updated in place; new declared keys are appended. None for a fresh
install (no file yet) — the generated content is written as-is.
allow_unset_required: boolSkip-setup: render an unset Required var that is a member of an
enabled group / selected choice to an empty value instead of erroring,
so an install can proceed with the operator filling the blanks in
.env afterwards. false keeps the strict default (a missing required
member is a hard error). A top-level required var renders empty either
way — it’s gated at the CLI prompt layer, not here.