CloudJod

SecurityVibe coder

Where do I put my API keys? Is a .env file in git fine?

The answer

Never commit a .env file with real keys: anything in git history stays readable to everyone who can clone it, even after you delete the file. Keep keys as environment variables set on the platform, and keep a .env.example with the names and no values in the repository.

Why doing it by hand hurts

Copying a .env to a server by hand means one more file to lose, to back up, and to forget to update on the second server. A key pasted into a chat or a CI log is leaked for good, and rotating it means finding every place it was copied to.

How CloudJod handles it

Paste the whole .env under Import a .env file on the app's Environment tab, or run cloudjod env push APP --file .env --secret. Every line becomes a variable in one change, so the app restarts once. Values are sealed under the app's own key unless you untick the box (names such as NODE_ENV can stay readable), and a sealed value is never shown again to anybody, through the dashboard or the API. The audit log records that a secret changed, never its value. The trade-off: a sealed value cannot be read back, so to change one you set it again.

sealed settings opened at start container starting running PORT=8080 DATABASE_URL=••• API_KEY=•••
Sealed values are opened only as a container starts, and only for that app.
Under the hood

the key that opens a sealed variable opens that one app's values and nothing else, so it is handed only to the server running that app. Why does that limit what a compromised server gives away?

Read more in the documentation