Repository navigation
Configuration
estrogen takes its per-site settings from a TOML config file, passed with -c /
--config on the CLI or config in the Node options. A flag given directly
overrides the same setting in the file.
The exact config format is an open question in the handoff and is not frozen. The shape below is the planned surface; treat field names as provisional until the first site's build is ported.
The config points at the two per-site data files and sets the pass options:
- the name map (proxy and store names to rename, and the store-name allow-list),
- the canary list (literals that must not survive verbatim),
- the obfuscation options that differ per site.
Per-site data (the actual names and canary literals) lives in its own files, not
inline in the config, so each site keeps its own names and canary next to
its build.
# estrogen.toml
names = "estrogen.names.json"
canary = "canary-list.json"
[options]
jobs = 8Run it:
estrogen -c estrogen.toml dist-
names: path to the name map file, relative to the config file. Same as--names. -
canary: path to the canary list, relative to the config file. Same as--canary. -
sourcemap: directory for private source maps, outside the served build. Same as--sourcemap. Omit it to write no map. See Source maps. -
[options]: the pass options.-
jobs: maximum files in parallel. - other per-site options as the passes settle. Not frozen.
-
The canary list is a JSON file of literals that must not appear in the output verbatim. After the rewrite, estrogen checks every processed file against it, including vendored transport assets that estrogen does not re-obfuscate, so no sensitive plaintext of ours rides along. A surviving literal fails the run. Add any newly user-visible sensitive literal to the list. See Security and limits.
The name map lists the proxy and store names estrogen renames to per-build substitutes, and the allow-list the store-name guard checks against. A store name not in the allow-list fails the run (fail closed). The file format tracks the Node scripts estrogen replaces and is not frozen here.
A setting given three ways resolves highest first: a CLI flag or a Node options
field, then the config file, then estrogen's default. For example --canary on the
command line overrides canary in the TOML file.
@sysce/estrogen ·
Fracital/estrogen · ISC · by David Reed.
estrogen raises the cost of reading a build; it does not make it secret.