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

admin: Add CADDY_ADMIN env var to override the default #5332

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

francislavoie
Copy link
Member

@francislavoie francislavoie commented Jan 25, 2023

Closes #5317

I took the idea of using init() for this from here:

caddy/cmd/main.go

Lines 40 to 48 in 9623102

func init() {
// set a fitting User-Agent for ACME requests
version, _ := caddy.Version()
cleanModVersion := strings.TrimPrefix(version, "v")
ua := "Caddy/" + cleanModVersion
if uaEnv, ok := os.LookupEnv("USERAGENT"); ok {
ua = uaEnv + " " + ua
}
certmagic.UserAgent = ua

@francislavoie francislavoie added the feature ⚙️ New feature or request label Jan 25, 2023
@francislavoie francislavoie added this to the v2.6.3 milestone Jan 25, 2023
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mholt mholt enabled auto-merge (squash) February 6, 2023 17:43
@mholt mholt merged commit ac83b7e into master Feb 6, 2023
@mholt mholt deleted the admin-address-env-var branch February 6, 2023 17:55
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 this pull request may close these issues.

Set default admin address via CADDY_ADMIN env var
2 participants