authgear / authgear/authgear-server

Proposal: Add a --quiet or -y option for authgear init secrets

Open
#802 0 comments 0 reactions 0 assignees View on GitHub
cooldown/enhancement
Dominant language
Go
Stars
2k
Forks
125
Avg merge
2d 17h
Merged PRs (30d)
32

Description

The use case is for local project setup, where database user and password are defined in `.env` and instead of supplying through command line we would use tools to overwrite the values instead.

Currently the workaround is
```
echo "" | docker run --rm -it -w "/work" -v "$PWD:/work" quay.io/theauthgear/authgear-server authgear init secrets
sed -i "s/postgres:postgres/$DB_USER:$DB_PASSWORD/g"
# Replace other values...
```

## Optional: Add default env for authgear init secrets
So that the following works:
```
docker run --rm -it -w "/work" -v "$PWD:/work" quay.io/theauthgear/authgear-server authgear init secrets -e DB_USER=postgres -e DB_PASSWORD=postgres -e DB_HOST=localhost -e REDIS_HOST=localhost
```

The name of these variables in the example are placeholders only.

I suppose the implementation would automatically work with `--env-file` as well.

Contributor guide

Open the contributing guide

Research direction

Start by locating the `authgear init secrets` CLI entry point and inspect its option parsing and prompt/input handling. Clarify whether the required scope is only `--quiet`/`-y` or also environment and `--env-file` support; done means secrets initialization can use supplied values without interactive input.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.