]> cat aescling's git repositories - mastodon.git/blob - boxfile.yml
Weblate translations (2019-02-23) (#10103)
[mastodon.git] / boxfile.yml
1 run.config:
2 engine: ruby
3 engine.config:
4 runtime: ruby-2.5
5
6 extra_packages:
7 # basic servers:
8 - nginx
9 - nodejs
10
11 # for images:
12 - ImageMagick
13 - jemalloc
14
15 # for videos:
16 - ffmpeg3
17
18 # to prep the .env file:
19 - gettext-tools
20
21 # for node-gyp, used in the asset compilation process:
22 - python-2
23
24 # i18n:
25 - libidn
26
27 cache_dirs:
28 - node_modules
29
30 extra_path_dirs:
31 - node_modules/.bin
32
33 build_triggers:
34 - .ruby-version
35 - Gemfile
36 - Gemfile.lock
37 - package.json
38 - yarn.lock
39
40 extra_steps:
41 - cp .env.nanobox .env
42 - yarn
43
44 fs_watch: true
45
46
47 deploy.config:
48 extra_steps:
49 - NODE_ENV=production bundle exec rake assets:precompile
50 transform:
51 - "envsubst < /app/.env.nanobox > /app/.env.production"
52 - |-
53 if [ -z "$LOCAL_DOMAIN" ]
54 then
55 . /app/.env.production
56 export LOCAL_DOMAIN
57 fi
58 erb /app/nanobox/nginx-web.conf.erb > /app/nanobox/nginx-web.conf
59 erb /app/nanobox/nginx-stream.conf.erb > /app/nanobox/nginx-stream.conf
60 - touch /app/log/production.log
61 before_live:
62 web.web:
63 - bundle exec rake db:migrate:setup
64 - |-
65 if [[ "${ES_ENABLED}" != "false" ]]
66 then
67 bundle exec rake chewy:deploy
68 fi
69
70
71 web.web:
72 start:
73 nginx: nginx -c /app/nanobox/nginx-web.conf
74 rails: bundle exec puma -C /app/config/puma.rb
75
76 routes:
77 - '/'
78
79 writable_dirs:
80 - tmp
81
82 log_watch:
83 rails: 'log/production.log'
84
85 network_dirs:
86 data.storage:
87 - public/system
88
89
90 web.stream:
91 start:
92 nginx: nginx -c /app/nanobox/nginx-stream.conf
93 node: yarn run start
94
95 routes:
96 - '/api/v1/streaming*'
97 # Somehow we're getting requests for scheme://domain//api/v1/streaming* - match those, too
98 - '//api/v1/streaming*'
99
100 writable_dirs:
101 - tmp
102
103
104 worker.sidekiq:
105 start:
106 default: bundle exec sidekiq -c 5 -q default -L /app/log/sidekiq.log
107 mailers: bundle exec sidekiq -c 5 -q mailers -L /app/log/sidekiq.log
108 pull: bundle exec sidekiq -c 5 -q pull -L /app/log/sidekiq.log
109 push: bundle exec sidekiq -c 5 -q push -L /app/log/sidekiq.log
110
111 writable_dirs:
112 - tmp
113
114 log_watch:
115 rails: 'log/production.log'
116 sidekiq: 'log/sidekiq.log'
117
118 network_dirs:
119 data.storage:
120 - public/system
121
122
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
194 data.db:
195 image: nanobox/postgresql:9.6
196
197 cron:
198 - id: backup
199 schedule: '0 3 * * *'
200 command: |
201 PGPASSWORD=${DATA_DB_PASS} pg_dump -U ${DATA_DB_USER} -w -Fc -O gonano |
202 gzip |
203 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/backup-${HOSTNAME}-$(date -u +%Y-%m-%d.%H-%M-%S).sql.gz -X POST -T - >&2
204 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
205 sed 's/,/\n/g' |
206 grep ${HOSTNAME} |
207 sort |
208 head -n-${BACKUP_COUNT:-1} |
209 sed 's/.*: \?"\(.*\)".*/\1/' |
210 while read file
211 do
212 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
213 done
214
215
216 data.elastic:
217 image: nanobox/elasticsearch:5
218
219 cron:
220 - id: backup
221 schedule: '0 3 * * *'
222 command: |
223 id=$(cat /proc/sys/kernel/random/uuid)
224 curl -X PUT -H "Content-Type: application/json" "127.0.0.1:9200/_snapshot/${id}" -d "{\"type\": \"fs\",\"settings\": {\"location\": \"/var/tmp/${id}\",\"compress\": true}}"
225 curl -X PUT -H "Content-Type: application/json" "127.0.0.1:9200/_snapshot/${id}/backup?wait_for_completion=true&pretty"
226 tar -cz -C "/var/tmp/${id}" . |
227 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/backup-${HOSTNAME}-$(date -u +%Y-%m-%d.%H-%M-%S).tgz -X POST -T - >&2
228 curl -X DELETE -H "Content-Type: application/json" "127.0.0.1:9200/_snapshot/${id}"
229 rm -rf "/var/tmp/${id}"
230 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
231 sed 's/,/\n/g' |
232 grep ${HOSTNAME} |
233 sort |
234 head -n-${BACKUP_COUNT:-1} |
235 sed 's/.*: \?"\(.*\)".*/\1/' |
236 while read file
237 do
238 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
239 done
240
241
242 data.redis:
243 image: nanobox/redis:4.0
244
245 cron:
246 - id: backup
247 schedule: '0 3 * * *'
248 command: |
249 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/backup-${HOSTNAME}-$(date -u +%Y-%m-%d.%H-%M-%S).rdb -X POST -T /data/var/db/redis/dump.rdb >&2
250 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
251 sed 's/,/\n/g' |
252 grep ${HOSTNAME} |
253 sort |
254 head -n-${BACKUP_COUNT:-1} |
255 sed 's/.*: \?"\(.*\)".*/\1/' |
256 while read file
257 do
258 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
259 done
260
261
262 data.storage:
263 image: nanobox/unfs:0.9
264
265 cron:
266 - id: backup
267 schedule: '0 3 * * *'
268 command: |
269 tar cz -C /data/var/db/unfs/ . |
270 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/backup-${HOSTNAME}-$(date -u +%Y-%m-%d.%H-%M-%S).tgz -X POST -T - >&2
271 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
272 sed 's/,/\n/g' |
273 grep ${HOSTNAME} |
274 sort |
275 head -n-${BACKUP_COUNT:-1} |
276 sed 's/.*: \?"\(.*\)".*/\1/' |
277 while read file
278 do
279 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
280 done
This page took 0.123887 seconds and 4 git commands to generate.