Skip to content

Commit 54192a9

Browse files
danhunsakerGargron
authored andcommitted
Resync Nanobox files with the 2.9.0 release (#11083)
1 parent c9eeb2e commit 54192a9

File tree

4 files changed

+49
-84
lines changed

4 files changed

+49
-84
lines changed

boxfile.yml

+2-72
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ deploy.config:
6464
- |-
6565
if [[ "${ES_ENABLED}" != "false" ]]
6666
then
67-
bundle exec rake chewy:deploy
67+
bin/tootctl search deploy
6868
fi
69+
- bin/tootctl cache clear
6970

7071

7172
web.web:
@@ -120,77 +121,6 @@ worker.sidekiq:
120121
- public/system
121122

122123

123-
worker.cron_only:
124-
start: sleep 365d
125-
126-
writable_dirs:
127-
- tmp
128-
129-
log_watch:
130-
rake: 'log/production.log'
131-
132-
network_dirs:
133-
data.storage:
134-
- public/system
135-
136-
cron:
137-
# 20:00 (8 pm), server time: send out the daily digest emails to everyone
138-
# who opted to receive one
139-
- id: send_digest_emails
140-
schedule: '00 20 * * *'
141-
command: 'bundle exec rake mastodon:emails:digest'
142-
143-
# 00:10 (ten past midnight), server time: remove local copies of remote
144-
# users' media once they are older than a certain age (use NUM_DAYS evar to
145-
# change this from the default of 7 days)
146-
- id: clear_remote_media
147-
schedule: '10 00 * * *'
148-
command: 'bundle exec rake mastodon:media:remove_remote'
149-
150-
# 00:20 (twenty past midnight), server time: remove subscriptions to remote
151-
# users that nobody follows locally (anymore)
152-
- id: clear_unfollowed_subs
153-
schedule: '20 00 * * *'
154-
command: 'bundle exec rake mastodon:push:clear'
155-
156-
# 00:30 (half past midnight), server time: update local copies of remote
157-
# users' avatars to match whatever they currently have set on their profile
158-
- id: update_remote_avatars
159-
schedule: '30 00 * * *'
160-
command: 'bundle exec rake mastodon:media:redownload_avatars'
161-
162-
############################################################################
163-
# This task is one you might want to enable, or might not. It keeps disk
164-
# usage low, but makes "shadow bans" (scenarios where the user is silenced,
165-
# but not intended to be made aware that the silencing has occurred) much
166-
# more difficult to put in place, as users would then notice their media is
167-
# vanishing on a regular basis. Enable it if you aren't worried about users
168-
# knowing they've been silenced (on the instance level), and want to save
169-
# disk space. Leave it disabled otherwise.
170-
############################################################################
171-
# # 00:00 (midnight), server time: remove media posted by silenced users
172-
# - id: clear_silenced_media
173-
# schedule: '00 00 * * *'
174-
# command: 'bundle exec rake mastodon:media:remove_silenced'
175-
176-
############################################################################
177-
# The following two tasks can be uncommented to automatically open and close
178-
# registrations on a schedule. The format of 'schedule' is a standard cron
179-
# time expression: minute hour day month day-of-week; search for "cron
180-
# time expressions" for more info on how to set these up. The examples here
181-
# open registration only from 8 am to 4 pm, server time.
182-
############################################################################
183-
# # 08:00 (8 am), server time: open registrations so new users can join
184-
# - id: open_registrations
185-
# schedule: '00 08 * * *'
186-
# command: 'bundle exec rake mastodon:settings:open_registrations'
187-
#
188-
# # 16:00 (4 pm), server time: close registrations so new users *can't* join
189-
# - id: close_registrations
190-
# schedule: '00 16 * * *'
191-
# command: 'bundle exec rake mastodon:settings:close_registrations'
192-
193-
194124
data.db:
195125
image: nanobox/postgresql:9.6
196126

nanobox/nginx-local.conf

+17-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ http {
1010
sendfile on;
1111

1212
gzip on;
13-
gzip_http_version 1.0;
13+
gzip_disable "MSIE [1-6]\.";
14+
gzip_vary on;
1415
gzip_proxied any;
16+
gzip_comp_level 6;
17+
gzip_buffers 16 8k;
1518
gzip_min_length 500;
16-
gzip_disable "MSIE [1-6]\.";
19+
gzip_http_version 1.1;
1720
gzip_types text/plain text/xml text/javascript text/css text/comma-separated-values application/xml+rss application/xml application/x-javascript application/json application/javascript application/atom+xml;
1821

1922
# Proxy upstream to the puma process
@@ -36,9 +39,12 @@ http {
3639
# Listen on port 8080
3740
listen 8080;
3841

42+
keepalive_timeout 70;
43+
client_max_body_size 80M;
44+
3945
root /app/public;
4046

41-
client_max_body_size 80M;
47+
add_header Strict-Transport-Security "max-age=31536000";
4248

4349
location / {
4450
try_files $uri @rails;
@@ -47,6 +53,10 @@ http {
4753
# Proxy connections to rails
4854
location @rails {
4955
proxy_set_header Host $host;
56+
proxy_set_header X-Real-IP $remote_addr;
57+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58+
proxy_set_header X-Forwarded-Proto https;
59+
proxy_set_header Proxy "";
5060
proxy_pass_header Server;
5161

5262
proxy_pass http://rails;
@@ -62,6 +72,10 @@ http {
6272
# Proxy connections to node
6373
location /api/v1/streaming {
6474
proxy_set_header Host $host;
75+
proxy_set_header X-Real-IP $remote_addr;
76+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
77+
proxy_set_header X-Forwarded-Proto https;
78+
proxy_set_header Proxy "";
6579

6680
proxy_pass http://node;
6781
proxy_buffering off;

nanobox/nginx-stream.conf.erb

+13-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ http {
1010
sendfile on;
1111

1212
gzip on;
13-
gzip_http_version 1.1;
13+
gzip_disable "MSIE [1-6]\.";
14+
gzip_vary on;
1415
gzip_proxied any;
16+
gzip_comp_level 6;
17+
gzip_buffers 16 8k;
1518
gzip_min_length 500;
16-
gzip_disable "MSIE [1-6]\.";
19+
gzip_http_version 1.1;
1720
gzip_types text/plain text/xml text/javascript text/css text/comma-separated-values application/xml+rss application/xml application/x-javascript application/json application/javascript application/atom+xml;
1821

1922
# Proxy upstream to the node process
@@ -31,18 +34,24 @@ http {
3134
# Listen on port 8080
3235
listen 8080;
3336

34-
add_header Strict-Transport-Security "max-age=31536000";
35-
# add_header Content-Security-Policy "style-src 'self' 'unsafe-inline'; script-src 'self'; object-src 'self'; img-src data: https:; media-src data: https:; connect-src 'self' wss://<%= ENV["LOCAL_DOMAIN"] %>; upgrade-insecure-requests";
37+
keepalive_timeout 70;
38+
client_max_body_size 80M;
3639

3740
root /app/public;
3841

42+
add_header Strict-Transport-Security "max-age=31536000";
43+
3944
location / {
4045
try_files $uri @node;
4146
}
4247

4348
# Proxy connections to node
4449
location @node {
4550
proxy_set_header Host $host;
51+
proxy_set_header X-Real-IP $remote_addr;
52+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
53+
proxy_set_header X-Forwarded-Proto https;
54+
proxy_set_header Proxy "";
4655

4756
proxy_pass http://node;
4857
proxy_buffering off;

nanobox/nginx-web.conf.erb

+17-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ http {
1010
sendfile on;
1111

1212
gzip on;
13-
gzip_http_version 1.0;
13+
gzip_disable "MSIE [1-6]\.";
14+
gzip_vary on;
1415
gzip_proxied any;
16+
gzip_comp_level 6;
17+
gzip_buffers 16 8k;
1518
gzip_min_length 500;
16-
gzip_disable "MSIE [1-6]\.";
19+
gzip_http_version 1.1;
1720
gzip_types text/plain text/xml text/javascript text/css text/comma-separated-values application/xml+rss application/xml application/x-javascript application/json application/javascript application/atom+xml;
1821

1922
# Proxy upstream to the puma process
@@ -31,30 +34,36 @@ http {
3134
# Listen on port 8080
3235
listen 8080;
3336

34-
add_header Strict-Transport-Security "max-age=31536000";
35-
# add_header Content-Security-Policy "style-src 'self' 'unsafe-inline'; script-src 'self'; object-src 'self'; img-src data: https:; media-src data: https:; connect-src 'self' wss://<%= ENV["LOCAL_DOMAIN"] %>; upgrade-insecure-requests";
37+
keepalive_timeout 70;
38+
client_max_body_size 80M;
3639

3740
root /app/public;
3841

39-
client_max_body_size 80M;
42+
add_header Strict-Transport-Security "max-age=31536000";
4043

4144
location / {
4245
try_files $uri @rails;
4346
}
4447

4548
location /sw.js {
4649
add_header Cache-Control "public, max-age=0";
50+
add_header Strict-Transport-Security "max-age=31536000";
4751
try_files $uri @rails;
4852
}
4953

5054
location ~ ^/(emoji|packs|system/media_attachments/files|system/accounts/avatars) {
5155
add_header Cache-Control "public, max-age=31536000, immutable";
56+
add_header Strict-Transport-Security "max-age=31536000";
5257
try_files $uri @rails;
5358
}
5459

5560
# Proxy connections to rails
5661
location @rails {
5762
proxy_set_header Host $host;
63+
proxy_set_header X-Real-IP $remote_addr;
64+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
65+
proxy_set_header X-Forwarded-Proto https;
66+
proxy_set_header Proxy "";
5867
proxy_pass_header Server;
5968

6069
proxy_pass http://rails;
@@ -66,7 +75,10 @@ http {
6675

6776
proxy_cache CACHE;
6877
proxy_cache_valid 200 7d;
78+
proxy_cache_valid 410 24h;
6979
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
80+
add_header Strict-Transport-Security "max-age=31536000";
81+
add_header X-Cached $upstream_cache_status;
7082

7183
tcp_nodelay on;
7284
}

0 commit comments

Comments
 (0)