Skip to content

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

FileFormatSchema shapeOwner
wrangler.tomlTOML, following Cloudflare Wrangler configurationname, main, compatibility_date, workers_dev, preview_urls, [build], [assets], [vars], [[routes]], [observability]Instance
package.jsonnpm package manifest JSONscripts, devDependencies, package metadataProduct
package-lock.jsonnpm lockfile JSONLocked dependency graph generated by npmProduct
defaults/v8s-site-config.jsonvanityURLs site config JSON, schema_version: "1.0"Product baseline for i18n, links, and operatorProduct
custom/v8s-site-config.jsonvanityURLs site config JSON, schema_version: "1.0"Instance overrides for i18n, links, operator, and branding; operator.operator_domain can drive default contact email domainsInstance
defaults/v8s-links.txtPipe-delimited text with optional inline @schedule blocksslug|target|state|title|description|tags|owner|expires_at|notes, followed by indented schedule directives when neededProduct starter links
custom/v8s-links.txtPipe-delimited text with optional inline @schedule blocksSame as defaults/v8s-links.txt; this is the human-authored source of truth for linksInstance
custom/v8s-schedules.jsonLegacy vanityURLs schedule JSONDeprecated 3.x compatibility source read by the build and current lnk schedule command; inline @schedule blocks take precedenceInstance
defaults/v8s-policies.jsonvanityURLs policy JSON, schema_version: "1.0"defaults, allow_domains, blocked_keywords, block_domains, optional generated_sourcesProduct
custom/v8s-policies.jsonvanityURLs policy JSON, schema_version: "1.0"Same as defaults/v8s-policies.json; custom policy replaces the default source policy before generated feeds are mergedInstance
defaults/v8s-blocklist-categories.jsonvanityURLs policy taxonomy JSON, schema_version: "1.0"categories, severities, sourcesProduct
custom/v8s-blocklist-categories.jsonvanityURLs policy taxonomy JSON, schema_version: "1.0"Optional custom extension or override for generated blocklist categories, severities, and sourcesInstance
defaults/v8s-language-metadata.jsonvanityURLs language metadata JSONProduct labels for generated localized page lists and state-page navigationProduct
defaults/legal/v8s-legal-content.jsonvanityURLs legal content JSONDefault legal-page, Trust & Safety, security, and response-window copy rendered by the buildProduct
defaults/v8s-local-config.jsonvanityURLs local helper JSON, schema_version: "1.0"shell_helper, lnk_cli, local_publish, registry, repositoryProduct
custom/v8s-local-config.jsonvanityURLs local helper JSON, schema_version: "1.0"Workstation-specific helper paths and local publish settings written by npm run local-installWorkstation
defaults/public/_headersCloudflare static asset header rulesPath pattern followed by indented header linesProduct or instance overlay

Legacy blocklist filenames Changed in 3.0.0

Legacy 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:

SectionPurpose
schema_versionStored configuration contract version. It changes only when an existing custom file needs migration
i18nDefault language and supported languages
linksOptional overrides for generated slug length, readable alphabet, and tag-specific generated slug lengths for lnk
operatorOperator identity, contacts, timezone, legal-page mode, analytics disclosure, and response window
brandingShort 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

Do not edit generated files in build/. Edit custom/, then rebuild with npm run check.

Generated configuration

FileFormatSchema shapeGenerated by
build/v8s.jsonRuntime 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 schedulescripts/build-redirect-targets.mjs
build/v8s-blocklist.jsonRuntime policy JSON, schema_version: "1.0"Normalized defaults, merged allow_domains, blocked_keywords, block_domainsscripts/build.mjs
build/v8s-site-config.jsonRuntime site config JSON, schema_version: "1.0"Effective site config after merging defaults and custom valuesscripts/build.mjs
build/blocklist.generated.jsonGenerated policy feed JSON, schema_version: "1.0"generated_at, sources[], generated block_domains[]npm run generate:blocklist
build/v8s-release-manifest.jsonRelease manifest JSON, schema_version: "1.0"Package version, Git commit, Cloudflare compatibility date, schema versions, and SHA-256 hashes for release inputs and outputsscripts/generate-release-manifest.mjs
src/worker.mjsGenerated Worker moduleWorker source copied from scripts/workers/worker.mjs with generated language constantsscripts/build.mjs
src/lib/analytics-policy.mjsGenerated Worker support moduleAnalytics bot-detection policy copied from scripts/workers/lib/analytics-policy.mjsscripts/build.mjs

Generated files are build outputs

Generated files are build outputs. Do not edit them directly.

Public overlay order

The public asset build is deterministic:

  1. Copy defaults/public/ into build/
  2. Overlay custom/public/ when it exists
  3. Copy the default defaults/public/_stats/index.html
  4. Overlay custom/public/_stats/index.html when it exists
  5. Prune unsupported language directories based on v8s-site-config.json
  6. Build v8s.json, v8s-blocklist.json, and v8s-site-config.json
  7. Generate src/ from scripts/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 by custom/v8s-links.txt when present, including inline @schedule blocks
  • custom/v8s-schedules.json when present as a deprecated 3.x compatibility source
  • defaults/v8s-policies.json, replaced by custom/v8s-policies.json when present
  • defaults/v8s-site-config.json, with custom/v8s-site-config.json merged into site-level choices
  • static page assets from defaults/public/, overlaid by custom/public/
  • generated blocklist feed data when npm run generate:blocklist has produced it

The build writes:

ArtifactPurpose
build/v8s.jsonRedirect registry consumed by the Worker
build/v8s-blocklist.jsonRuntime policy artifact consumed by the Worker
build/v8s-site-config.jsonSite configuration used by the build
src/worker.mjsGenerated 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.

Edit this page Last modified: