nitrojs / nitrojs/nitro

Option to read runtime config values from secrets files

Open
#2,885 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Describe the feature

Many deployment environments offer the ability to provide secrets via files (e.g. Docker and Kubernetes Secrets, systemd Credentials). Nitro should be able to pick these up and read read their contents automatically.

The location where these files are placed is not fully standardized. Docker places them under /run/secrets, systemd under $CREDENTIALS_DIRECTORY (which is /run/credentials for system units), and Kubernetes allows mounting them at arbitrary places. The best way to support all these (and more) is likely to use special environment variables which contain the paths to the secrets files. E.g. NUXT_API_SECRET_FILE=/run/secrets/apikey would automatically be detected as an env var for a secrets file due to the _FILE suffix. Another approach is to use a value prefix like NUXT_API_SECRET=file:/run/secrets/apikey where the file: prefix of the value would indicate that it is a path to a secrets file.

Motivation:
Passing secrets/credentials as files is preferred over environment variables as they offer better access control and are less likely to leak (printed in logs, inherited by child processes, included in core dumps etc.)

Additional information
  • Would you be willing to help implement this feature?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, entry points, or tests are named. Start by locating Nitro's runtime configuration and environment-variable parsing, then compare the proposed _FILE suffix and file: prefix approaches. Done should include an agreed file-secret format, safe file reading behavior, and tests covering the selected convention.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.