🚀
ShipClojure
  • README
  • Development
    • Getting Started
    • REPL Workflow
    • AI Development with ShipClojure
    • Getting Updates
    • Formatting code
    • ShipClojure Guiding Principles
  • Backend
    • Migrations
    • Secrets
    • Routing
    • ShipClojure Blog
    • Email
  • Frontend
    • UIx + re-frame
    • HTTP Requests with Re-frame
    • Frontend Navigation with Re-frame
    • Toast Notifications
    • Icons
  • Server Side Rendering
    • Static/Landing pages
  • Auth
    • How Auth works
    • Oauth2 providers
  • Deployment
    • Deployment
  • Decisions
    • 001 - Cookie Sessions
    • 002 - Single Page Application Architecture
    • 003 - Re-frame instead of Refx
    • 003 - Move from cookie sessions to JWT Access + refresh tokens
Powered by GitBook
On this page
  • Getting started with secrets
  • Local development
  • Production development
  1. Backend

Secrets

PreviousMigrationsNextRouting

Last updated 1 month ago

Managing secrets in the ShipClojure is done using environment variables and the fly secrets command.

Warning: It is very important that you do NOT hard code any secrets in the source code. Even if your app source is not public, there are a lot of reasons this is dangerous.

Getting started with secrets

Shipclojure uses for managing secrets and other configuration.

Secrets are kept under:

  1. resources/.dev-secrets.edn - development secrets (what you use locally to develop)

  2. resources/.prod-secrets.edn - production secrets (what your production deployment uses)

Secrets are imported into your config in the here:

;; Merge our public config file with the secrets
{:saas/secrets #include #join [#env HOME "/.saas-secrets.edn"]

Local development

When you need to create a new secret, it's best to add a line to your with an example value of the new secret so folks know what secret is necessary.

To keep everything in line with the of "Offline Development," you should also strive make it so whatever service you're interacting with can be mocked out.

  1. Copy the example secrets cp saas-secrets.example.edn resources/.dev-secrets.edn

  2. Modify the values with correct ones

  3. Done

Production development

The process is almost the same as for Local development but step 1 will be cp saas-secrets.example.edn resources/.prod-secrets.edn

aero
resources/system.edn
saas-secrets.example.edn
guiding principle