Skip to content

Commit

Permalink
Revert "Add nginx config file and support for outlets (#871)" (#912)
Browse files Browse the repository at this point in the history
This reverts commit 01cbf07.
  • Loading branch information
davidtaylorhq authored Jan 14, 2025
1 parent 01cbf07 commit 107ffb4
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 387 deletions.
289 changes: 0 additions & 289 deletions image/base/etc/nginx/conf.d/discourse.conf

This file was deleted.

Empty file.
Empty file.
Empty file.
1 change: 0 additions & 1 deletion image/base/etc/nginx/conf.d/outlets/server/http.conf

This file was deleted.

2 changes: 2 additions & 0 deletions samples/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
## Uncomment the next line to enable the IPv6 listener
#- "templates/web.ipv6.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
Expand Down
2 changes: 2 additions & 0 deletions samples/web_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

templates:
- "templates/web.template.yml"
## Uncomment the next line to enable the IPv6 listener
#- "templates/web.ipv6.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
Expand Down
19 changes: 11 additions & 8 deletions templates/offline-page.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ params:
offline_page_repository: https://github.com/discourse/discourse-offline-page.git

run:
- file:
path: "/etc/nginx/conf.d/outlets/server/offline-page.conf"
contents: |
error_page 502 /error_page.html;
location /error_page.html {
root /var/www/discourse-offline-page/html;
internal;
}
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
global: true
from: /server.+{/
to: |
server {
error_page 502 /error_page.html;
location /error_page.html {
root /var/www/discourse-offline-page/html;
internal;
}
- exec:
cmd: git clone $offline_page_repository /var/www/discourse-offline-page
Expand Down
4 changes: 0 additions & 4 deletions templates/sshd.template.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
# This file is deprecated; you can remove it from your app.yml
# TODO(2026-01-01): Remove this file
run:
- exec: |-
echo "Deprecation warning: sshd is no longer supported"
echo "Remove templates/sshd.template.yml from your containers/*.yml files"
12 changes: 7 additions & 5 deletions templates/web.ipv6.template.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# This file is deprecated; you can remove it from your app.yml
# TODO(2026-01-01): Remove this file
run:
- exec: |-
echo "Deprecation warning: IPv6 is enabled by default when possible"
echo "Remove templates/web.ipv6.template.yml from your containers/*.yml files"
- exec: echo "Enabling IPv6 listener"
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: listen 80;
to: |
listen 80;
listen [::]:80;
22 changes: 14 additions & 8 deletions templates/web.letsencrypt.ssl.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,27 @@ hooks:
/usr/sbin/nginx -c /etc/nginx/letsencrypt.conf -s stop
- replace:
filename: /shared/letsencrypt/account.conf
from: /#?ACCOUNT_EMAIL=.+/
to: |
ACCOUNT_EMAIL=$$ENV_LETSENCRYPT_ACCOUNT_EMAIL
- replace:
filename: "/etc/nginx/conf.d/outlets/server/https.conf"
filename: "/etc/nginx/conf.d/discourse.conf"
from: /ssl_certificate.+/
to: |
ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.cer;
ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.cer;
- replace:
filename: "/etc/nginx/conf.d/outlets/server/https.conf"
filename: /shared/letsencrypt/account.conf
from: /#?ACCOUNT_EMAIL=.+/
to: |
ACCOUNT_EMAIL=$$ENV_LETSENCRYPT_ACCOUNT_EMAIL
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /ssl_certificate_key.+/
to: |
ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.key;
ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.key;
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /add_header.+/
to: |
add_header Strict-Transport-Security 'max-age=63072000';
Loading

0 comments on commit 107ffb4

Please sign in to comment.