Skip to content

dmno-dev/epic-stack-with-varlock

Repository files navigation

Epic Stack + Varlock

An example repo using Varlock within the Epic Stack to help manage configuration and secrets.

With Varlock, we convert the .env.example file into a .env.schema which contains additional schema information about all configuration in the system. This will improve developer onboarding into the epic stack, as well as ongoing DX as devs add more config into their apps. It adds additional guardrails around configuration in general, and notably adds additional protection for sensitive secrets.

Why do this?

  • validations, default values, and documentation are all now in one source of truth (.env.schema)
  • no more duplication between .env.example and .env, which means it will never get out of sync
  • only overrides must be added by user
  • clear env validation, decoupled from the application booting
  • improved TS types / IntelliSense
  • allows more flexible validation and composition of values based on other items
  • easy to now pull secrets from secure backends like 1pass, etc
  • leak prevention! log redaction!
  • clear error messages when accessing bad env vars, or using them in wrong place

Screenshots

Some screenshots of varlock in action:

varlock load showing loaded and validated env
image

Improved IntelliSense
image

Leak detection example
image

Log redaction example
image

Example of failing env validation
image

About

Varlock + Epic Stack example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages