Skip to content

Commit ed85ade

Browse files
committed
Simplify plugin outlets
1 parent e801e32 commit ed85ade

File tree

9 files changed

+41
-24
lines changed

9 files changed

+41
-24
lines changed

templates/files/nginx/outlets/http/.gitkeep

Whitespace-only changes.

templates/files/nginx/outlets/http/http.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

templates/files/nginx/outlets/https/.gitkeep

Whitespace-only changes.

templates/files/nginx/outlets/https/https.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include conf.d/outlets/http/*.conf;
1+
listen 80;

templates/web.ipv6.template.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

templates/web.letsencrypt.ssl.template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ hooks:
113113
ACCOUNT_EMAIL=$$ENV_LETSENCRYPT_ACCOUNT_EMAIL
114114
115115
- replace:
116-
filename: "/etc/nginx/conf.d/outlets/https/ssl.conf"
116+
filename: "/etc/nginx/conf.d/outlets/server/https.conf"
117117
from: /ssl_certificate.+/
118118
to: |
119119
ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.cer;
120120
ssl_certificate /shared/ssl/$$ENV_DISCOURSE_HOSTNAME_ecc.cer;
121121
122122
- replace:
123-
filename: "/etc/nginx/conf.d/outlets/https/ssl.conf"
123+
filename: "/etc/nginx/conf.d/outlets/server/https.conf"
124124
from: /ssl_certificate_key.+/
125125
to: |
126126
ssl_certificate_key /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.key;

templates/web.ssl.template.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ run:
77
path: "/etc/nginx/conf.d/outlets/before-server/redirect-http-to-https.conf"
88
contents: |
99
server {
10-
include conf.d/outlets/http/*.conf;
10+
listen 80;
1111
return 301 https://$$ENV_DISCOURSE_HOSTNAME$request_uri;
1212
}
1313
@@ -16,14 +16,11 @@ run:
1616
contents: ""
1717

1818
- file:
19+
hook: ssl
1920
path: "/etc/nginx/conf.d/outlets/server/https.conf"
2021
contents: |
21-
include conf.d/outlets/https/*.conf;
22+
listen 443 ssl;
2223
23-
- file:
24-
hook: ssl
25-
path: "/etc/nginx/conf.d/outlets/https/ssl.conf"
26-
contents: |
2724
ssl_protocols TLSv1.2 TLSv1.3;
2825
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
2926
ssl_prefer_server_ciphers off;
@@ -42,6 +39,14 @@ run:
4239
}
4340
4441
- file:
45-
path: "/etc/nginx/conf.d/outlets/discourse/ssl.conf"
42+
path: "/etc/nginx/conf.d/outlets/discourse/https.conf"
4643
contents: |
4744
add_header Strict-Transport-Security 'max-age=31536000';
45+
46+
- exec:
47+
cmd:
48+
- |-
49+
if [ -f "/proc/net/if_inet6" ] ; then
50+
sed -i 's/listen 80;/listen 80;\nlisten [::]:80;/g' /etc/nginx/conf.d/outlets/before-server/redirect-http-to-https.conf
51+
sed -i 's/listen 443 ssl;/listen 443 ssl;\nlisten [::]:443 ssl;/g' /etc/nginx/conf.d/outlets/https/https.conf
52+
fi

templates/web.template.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ run:
151151
from: /client_max_body_size.+$/
152152
to: client_max_body_size $upload_size;
153153

154+
- exec:
155+
cmd:
156+
- |-
157+
if [ -f "/proc/net/if_inet6" ]; then
158+
sed -i 's/listen 80;/listen 80;\nlisten [::]:80;/g' /etc/nginx/conf.d/outlets/server/http.conf
159+
fi
160+
154161
- exec:
155162
cmd: echo "done configuring web"
156163
hook: web_config
@@ -191,6 +198,25 @@ run:
191198
hook: plugin_compatibility
192199
raise_on_fail: false
193200

201+
- exec:
202+
cd: $home
203+
tag: migrate
204+
hook: db_migrate
205+
cmd:
206+
- su discourse -c 'bundle exec rake db:migrate'
207+
- exec:
208+
cd: $home
209+
tag: build
210+
hook: assets_precompile_build
211+
cmd:
212+
- su discourse -c 'bundle exec rake assets:precompile:build'
213+
- exec:
214+
cd: $home
215+
tag: precompile
216+
hook: assets_precompile
217+
cmd:
218+
- su discourse -c 'SKIP_EMBER_CLI_COMPILE=1 bundle exec rake themes:update assets:precompile'
219+
194220
- replace:
195221
tag: precompile
196222
filename: /etc/service/unicorn/run

0 commit comments

Comments
 (0)