Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Ability to Read Postgres-Pass from File #2110

Open
2 tasks
felixw7k opened this issue Sep 7, 2024 · 1 comment
Open
2 tasks

[Feature] Ability to Read Postgres-Pass from File #2110

felixw7k opened this issue Sep 7, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@felixw7k
Copy link

felixw7k commented Sep 7, 2024

Use case

As a system administrator i want to check my headscale-config into a git repository. Having secrets in git is considered bad practice, so any headscale-configuration with postgres.pass set, should not be pushed into a git-repo.

Description

If you want to have your configuration versioned, at the moment you are left with the options "using postgres via socket" or "using sqlite" since the password to your database-server would also be checked in.

Being able to read the postgres-password from a file in the headscale-config let's us treat the configuration as "non-secret".

In Docker this file could be bind-mounted by the admin , in a kubernetes-enviromnent it could be set as a secret; which both would no longer be headscale's concern.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

In my opinion, treating the postgres-password the same as the oidc-client-secret would be perfect:
Equivalent to oidc.client_secret_path i could imagine an option like postgres.pass_path to read the password from a file.

@felixw7k felixw7k added the enhancement New feature or request label Sep 7, 2024
@felixw7k felixw7k changed the title [Feature] Ability to Read Postgres-Secrets from File [Feature] Ability to Read Postgres-Pass from File Sep 7, 2024
@kradalby
Copy link
Collaborator

kradalby commented Sep 9, 2024

All the configuration options are also settable via environment variables, e.g. HEADSCALE_DATABASE_POSTGRES_PASS.

I dont disagree that it can also be read by file, but I think that solves the majority of problems.

Please also note that we do not actively support or improve postgres and strongly recommend the use of SQLite.

@kradalby kradalby added this to the Next milestone Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@kradalby @felixw7k and others