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

Allow users to provide default values for unset environment variables #2313

Closed
aioobe opened this issue Oct 7, 2018 · 6 comments · Fixed by #3682
Closed

Allow users to provide default values for unset environment variables #2313

aioobe opened this issue Oct 7, 2018 · 6 comments · Fixed by #3682
Labels
feature ⚙️ New feature or request
Milestone

Comments

@aioobe
Copy link

aioobe commented Oct 7, 2018

Reading up on Environment Variables I don't see a way to specify default values for environment variables. This is a common feature in similar types of configuration files. Docker for example supports the standard bash syntax:

${variable:-word} indicates that if variable is set then the result will be that value. If variable is not set then word will be the result.

I would very much like to have a self contained Caddyfile with sane defaults so you can safely do caddy in prod. (I don't want to say "oh, when you deploy in prod you need to follow instruction A, B and C", I would like it to be "Just run caddy".) And then something like DOMAIN=staging caddy / DOMAIN=dev caddy to override relevant parts in staging and dev.

@tobya tobya added the feature ⚙️ New feature or request label Nov 11, 2018
@mholt mholt added this to the 2.0 milestone May 9, 2019
@mholt
Copy link
Member

mholt commented May 9, 2019

Will look into this for Caddy 2, probably for all placeholder values spawning from the new Replacer type.

@aioobe
Copy link
Author

aioobe commented May 10, 2019

Where can I follow the work on Caddy 2? Is there a list of features, breaking changes, estimated release date, etc somewhere?

@mholt
Copy link
Member

mholt commented May 10, 2019

@aioobe It's not public yet, but when we get around to the public beta period, we'll move it into this repo! That's the plan as of now, anyway.

Watch for announcements at OpenGo 2019.

@mholt
Copy link
Member

mholt commented Mar 23, 2020

Related to / same as #1793

@francislavoie
Copy link
Member

I'll close this as a duplicate of #1793

@francislavoie francislavoie added duplicate 🖇️ This issue or pull request already exists and removed feature ⚙️ New feature or request labels Aug 23, 2020
@francislavoie
Copy link
Member

francislavoie commented Aug 23, 2020

Actually, derp, they're not really the same. #1793 is for defaults for placeholders in general, whereas this is defaults for environment variables specifically.

I'll reopen this but I'm also submitting a PR for this specific issue now 😛

@francislavoie francislavoie reopened this Aug 23, 2020
@francislavoie francislavoie added feature ⚙️ New feature or request and removed duplicate 🖇️ This issue or pull request already exists labels Aug 23, 2020
@mholt mholt modified the milestones: 2.x, v2.3.0 Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants