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

Trailing comma causes endless loop #254

Closed
StreamOfRon opened this issue Aug 31, 2017 · 3 comments
Closed

Trailing comma causes endless loop #254

StreamOfRon opened this issue Aug 31, 2017 · 3 comments
Labels
kind/bug Issue reporting a bug

Comments

@StreamOfRon
Copy link

If the LETSENCRYPT_HOST variable for a container has a trailing comma, the script does not detect this and attempts to add a certificate for an empty domain name. This causes simp_le to fail, and the update_certs loop repeats endlessly.

@buchdag
Copy link
Member

buchdag commented Aug 31, 2017

I think that can be easily fixed with adjustment to letsencrypt_service_data.tmpl, I'll give it a try tomorrow.

@buchdag
Copy link
Member

buchdag commented Sep 1, 2017

My fix worked, but as I suspected the same trailing comma in the VIRTUAL_HOST variable cause nginx-proxy / docker-gen to generate an invalid conf file anyway:

nginx-proxy | 2017/09/01 14:06:46 [emerg] 1#1: invalid number of arguments in "upstream" directive in /etc/nginx/conf.d/default.conf:54

So there is no point in trying to fix that if the nginx.tmpl isn't fixed first to strip the trailing comma from VIRTUAL_HOST. nginx.tmpl is way more complex than letsencrypt_service_data.tmpl and I'm not good enough with the Go template package to come up with a fix yet.

@buchdag buchdag added the kind/bug Issue reporting a bug label Nov 24, 2017
buchdag added a commit that referenced this issue Nov 24, 2017
Incorrect trimming did lead to empty domains being created on space separated domains
or with comma trailed LETSENCRYPT_HOST environment variable. This in turns led to the
container being caught in an endless loop trying to delete /etc/nginx/certs #254 #288
buchdag added a commit that referenced this issue Nov 24, 2017
Incorrect trimming did lead to empty domains being created on space separated domains
or with comma trailed LETSENCRYPT_HOST environment variable. This in turns led to the
container being caught in an endless loop trying to delete /etc/nginx/certs #254 #288
@buchdag
Copy link
Member

buchdag commented Nov 24, 2017

So the issue has been fixed for LETSENCRYPT_HOST by 4085f64, but since a trailing comma in VIRTUAL_HOST will still cause nginx-proxy / docker-gen to generate an invalid nginx config file, I think using trailing commas should still be avoided for now.

@buchdag buchdag closed this as completed Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issue reporting a bug
Projects
None yet
Development

No branches or pull requests

2 participants