Configuration files
vanityURLs keeps product defaults, instance-owned choices, local workstation settings, and generated runtime artifacts in separate files.
Use this page to identify the current configuration files and the schema shape each one follows. The exact implementation contract remains the Git files and scripts in the code repository.
Source configuration
| File | Format | Schema shape | Owner |
|---|---|---|---|
wrangler.toml | TOML, following Cloudflare Wrangler configuration | name, main, compatibility_date, workers_dev, preview_urls, [build], [assets], [vars], [[routes]], [observability] | Instance |
package.json | npm package manifest JSON | scripts, devDependencies, package metadata | Product |
package-lock.json | npm lockfile JSON | Locked dependency graph generated by npm | Product |
defaults/v8s-site-config.json | vanityURLs site config JSON, schema_version: "1.0" | Product baseline for i18n, links, and operator | Product |
custom/v8s-site-config.json | vanityURLs site config JSON, schema_version: "1.0" | Instance overrides for i18n, links, operator, and branding; operator.operator_domain can drive default contact email domains | Instance |
defaults/v8s-links.txt | Pipe-delimited text with optional inline @schedule blocks | slug|target|state|title|description|tags|owner|expires_at|notes, followed by indented schedule directives when needed | Product starter links |
custom/v8s-links.txt | Pipe-delimited text with optional inline @schedule blocks | Same as defaults/v8s-links.txt; this is the human-authored source of truth for links | Instance |
custom/v8s-schedules.json | Legacy vanityURLs schedule JSON | Deprecated 3.x compatibility source read by the build and current lnk schedule command; inline @schedule blocks take precedence | Instance |
defaults/v8s-policies.json | vanityURLs policy JSON, schema_version: "1.0" | defaults, allow_domains, blocked_keywords, block_domains, optional generated_sources | Product |
custom/v8s-policies.json | vanityURLs policy JSON, schema_version: "1.0" | Same as defaults/v8s-policies.json; custom policy replaces the default source policy before generated feeds are merged | Instance |
defaults/v8s-blocklist-categories.json | vanityURLs policy taxonomy JSON, schema_version: "1.0" | categories, severities, sources | Product |
custom/v8s-blocklist-categories.json | vanityURLs policy taxonomy JSON, schema_version: "1.0" | Optional custom extension or override for generated blocklist categories, severities, and sources | Instance |
defaults/v8s-language-metadata.json | vanityURLs language metadata JSON | Product labels for generated localized page lists and state-page navigation | Product |
defaults/legal/v8s-legal-content.json | vanityURLs legal content JSON | Default legal-page, Trust & Safety, security, and response-window copy rendered by the build | Product |
defaults/v8s-local-config.json | vanityURLs local helper JSON, schema_version: "1.0" | shell_helper, lnk_cli, local_publish, registry, repository | Product |
custom/v8s-local-config.json | vanityURLs local helper JSON, schema_version: "1.0" | Workstation-specific helper paths and local publish settings written by npm run local-install | Workstation |
defaults/public/_headers | Cloudflare static asset header rules | Path pattern followed by indented header lines | Product or instance overlay |
Legacy blocklist filenames Changed in 3.0.0
custom/v8s-blocklist.json and defaults/v8s-blocklist.json may still be recognized for migration compatibility, but new instances should use v8s-policies.json.Site Config
custom/v8s-site-config.json is the main setup file written by npm run setup. It stores instance-owned site settings, including languages, branding, operator contacts, legal-page mode, and link CLI overrides. The exact field list is defined by defaults/v8s-site-config.json and the installer. The build deep-merges the default and custom site config, so additive defaults can arrive through defaults/ without rewriting your custom file. The important top-level sections are:
| Section | Purpose |
|---|---|
schema_version | Stored configuration contract version. It changes only when an existing custom file needs migration |
i18n | Default language and supported languages |
links | Optional overrides for generated slug length, readable alphabet, and tag-specific generated slug lengths for lnk |
operator | Operator identity, contacts, timezone, legal-page mode, analytics disclosure, and response window |
branding | Short domain, public slogan, public-page copy flag, and split-color wordmark |
Use IANA timezone names for operator.timezone, such as America/Toronto or Europe/Berlin. Avoid numeric offsets such as -4 or -5; they do not describe daylight saving time transitions and setup rejects them.
Example:
{
"schema_version": "1.0",
"i18n": {
"default_language": "en",
"supported_languages": ["en", "fr"]
},
"links": {
"random_slug_length": 3,
"random_slug_alphabet": "34789abcdefghjkmnpqrstvwxy",
"tag_random_slug_lengths": {
"training": 4,
"debug": 2
}
},
"operator": {
"legal_name": "Example Inc.",
"short_domain": "example.link",
"operator_domain": "example.com",
"abuse_contact": "abuse@example.com",
"security_contact": "security@example.com",
"timezone": "America/Toronto",
"abuse_response_window": "5 business days",
"legal_pages_enabled": false
},
"branding": {
"domain": "example.link",
"slogan": {
"en": "A short-link service for Example Inc.'s projects",
"fr": "Un service de liens courts pour les projets de Example Inc."
},
"custom_public": true,
"wordmark": {
"black": "example.",
"green": "link"
}
}
}
Additive fields can appear without changing schema_version. Schema version changes are reserved for incompatible stored-config changes that need migration; the decision is recorded in the code repository ADRs. Additive field changes are tracked in the code repository docs/schema-changelog.md.
Do not edit generated files
build/. Edit custom/, then rebuild with npm run check.Generated configuration
| File | Format | Schema shape | Generated by |
|---|---|---|---|
build/v8s.json | Runtime registry JSON, schema_version: "3.0" | generated_at, generated_timezone, default_state, routing, tree, links[]; each link has slug, match, target, state, metadata, and optional schedule | scripts/build-redirect-targets.mjs |
build/v8s-blocklist.json | Runtime policy JSON, schema_version: "1.0" | Normalized defaults, merged allow_domains, blocked_keywords, block_domains | scripts/build.mjs |
build/v8s-site-config.json | Runtime site config JSON, schema_version: "1.0" | Effective site config after merging defaults and custom values | scripts/build.mjs |
build/blocklist.generated.json | Generated policy feed JSON, schema_version: "1.0" | generated_at, sources[], generated block_domains[] | npm run generate:blocklist |
build/v8s-release-manifest.json | Release manifest JSON, schema_version: "1.0" | Package version, Git commit, Cloudflare compatibility date, schema versions, and SHA-256 hashes for release inputs and outputs | scripts/generate-release-manifest.mjs |
src/worker.mjs | Generated Worker module | Worker source copied from scripts/workers/worker.mjs with generated language constants | scripts/build.mjs |
src/lib/analytics-policy.mjs | Generated Worker support module | Analytics bot-detection policy copied from scripts/workers/lib/analytics-policy.mjs | scripts/build.mjs |
Generated files are build outputs
Public overlay order
The public asset build is deterministic:
- Copy
defaults/public/intobuild/ - Overlay
custom/public/when it exists - Copy the default
defaults/public/_stats/index.html - Overlay
custom/public/_stats/index.htmlwhen it exists - Prune unsupported language directories based on
v8s-site-config.json - Build
v8s.json,v8s-blocklist.json, andv8s-site-config.json - Generate
src/fromscripts/workers/for Wrangler
Runtime artifacts
The Worker does not read v8s-links.txt on every request. The build creates runtime artifacts from source files, validates them, and deploys them with the Worker assets.
Build inputs include:
defaults/v8s-links.txt, replaced bycustom/v8s-links.txtwhen present, including inline@scheduleblockscustom/v8s-schedules.jsonwhen present as a deprecated 3.x compatibility sourcedefaults/v8s-policies.json, replaced bycustom/v8s-policies.jsonwhen presentdefaults/v8s-site-config.json, withcustom/v8s-site-config.jsonmerged into site-level choices- static page assets from
defaults/public/, overlaid bycustom/public/ - generated blocklist feed data when
npm run generate:blocklisthas produced it
The build writes:
| Artifact | Purpose |
|---|---|
build/v8s.json | Redirect registry consumed by the Worker |
build/v8s-blocklist.json | Runtime policy artifact consumed by the Worker |
build/v8s-site-config.json | Site configuration used by the build |
src/worker.mjs | Generated Worker entry copied from scripts/workers/ for Wrangler |
scripts/workers/ is the Worker source of truth. src/ is generated output. Direct public requests for raw runtime files such as /v8s.json, /v8s-blocklist.json, and /v8s-site-config.json should return 404.