-
Couldn't load subscription status.
- Fork 796
letsencrypt updates: renew location for .well-known, add support for multiple hostnames #992
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
Changes from 3 commits
06a522c
b519bf1
b865ad0
0832bf8
4d2a524
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,20 @@ run: | |||||||||
| LE_WORKING_DIR="${LETSENCRYPT_DIR}" ./acme.sh --upgrade --auto-upgrade | ||||||||||
| LE_WORKING_DIR="${LETSENCRYPT_DIR}" ./acme.sh --set-default-ca --server letsencrypt | ||||||||||
|
|
||||||||||
| cat << EOF > /etc/nginx/conf.d/outlets/before-server/20-redirect-http-to-https.conf | ||||||||||
| server { | ||||||||||
| listen 80; | ||||||||||
|
|
||||||||||
| location ~ /.well-known { | ||||||||||
| root /var/www/discourse/public; | ||||||||||
| allow all; | ||||||||||
| } | ||||||||||
| location / { | ||||||||||
| return 301 https://${DISCOURSE_HOSTNAME}$request_uri; | ||||||||||
| } | ||||||||||
| } | ||||||||||
| EOF | ||||||||||
|
|
||||||||||
| cat << EOF > /etc/nginx/letsencrypt.conf | ||||||||||
| user www-data; | ||||||||||
| worker_processes auto; | ||||||||||
|
|
@@ -41,7 +55,6 @@ run: | |||||||||
|
|
||||||||||
| server { | ||||||||||
| listen 80; | ||||||||||
| listen [::]:80; | ||||||||||
|
|
||||||||||
| location ~ /.well-known { | ||||||||||
| root /var/www/discourse/public; | ||||||||||
|
|
@@ -51,6 +64,11 @@ run: | |||||||||
| } | ||||||||||
| EOF | ||||||||||
|
|
||||||||||
| if [ -f "/proc/net/if_inet6" ] ; then | ||||||||||
|
||||||||||
| if [ -f "/proc/net/if_inet6" ] ; then | |
| sed -i 's/listen 80;/listen 80;\nlisten [::]:80;/g' /etc/nginx/conf.d/outlets/before-server/20-redirect-http-to-https.conf | |
| sed -i 's/listen 443 ssl;/listen 443 ssl;\nlisten [::]:443 ssl;/g' /etc/nginx/conf.d/outlets/server/20-https.conf | |
| fi |
But if this isn't necessary, perhaps we can remove the references in both places and simplify everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually know what the behavior is when IPv6 is enabled but not configured anywhere. Maybe that if test is OK?
If listen [::]:80 does not error when IPv6 is not available that sure looks like the cleanest option. I'll try and figure out a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Survey says "yes". The default install on Debian has listen [::]:80 default_server; Running echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 turned off IPv6. The service still starts fine afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In, for example,
samples/web_only.yml, we tell operators to uncomment bothweb.ssl.template.ymlandweb.letsencrypt.ssl.template.yml.However, the
configure-letsencryptandconfigure-sslscripts are writing to the same outlet. So future changes to the latter are going to be mysteriously overwritten by the former.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point - perhaps something simple we could do is bundle the /.well-known passthrough location into the base ssl template? It's not a path used by Discourse anywhere, and maybe it's... well known... enough that it's OK to have in the base ssl template.