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

Add env vars to configuration the tusd service #1043

Open
Maksclub opened this issue Dec 11, 2023 · 3 comments
Open

Add env vars to configuration the tusd service #1043

Maksclub opened this issue Dec 11, 2023 · 3 comments

Comments

@Maksclub
Copy link

Maksclub commented Dec 11, 2023

Is your feature request related to a problem? Please describe.
I using golang-plugins for external behaviours and using internal abstractions of tusd (composer, store) then I would like configuring main tusd and my plugins via common var envs, but tusd use only flags.

Describe the solution you'd like
I propose to use env tags. For example:

S3Bucket   string `envconfig:"S3_BUCKET"  required:"false"`
S3Endpoint string `envconfig:"S3_ENDPOINT"  required:"false"`
Basepath   string `envconfig:"BASE_PATH"  required:"false"`
HttpHost   string `envconfig:"HTTP_HOST"  required:"false"`
HttpPort   string `envconfig:"HTTP_PORT"  required:"false"`

Can you provide help with implementing this feature?
Yes. I can add envconfig tags (or an alternative lib) and rename the config abstraction from "flags" to config for use flags and envs together

@Acconut
Copy link
Member

Acconut commented Dec 12, 2023

I am open to adding this as it seems useful in certain situations. We should probably just discuss which library to use for this. A quick search also revealed https://github.com/jnovack/flag, which is advertised as a drop-in replacement for Go's flag package. Since we currently use flag, this would mean minimal changes to our code. Do you have other recommendations?

@Maksclub
Copy link
Author

@Acconut thanks, https://github.com/jnovack/flag seems good compromise!

@Acconut
Copy link
Member

Acconut commented Dec 13, 2023

Would you be interested in trying it out? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants