]> cat aescling's git repositories - mastodon.git/blob - boxfile.yml
Add environment sample for OpenStack Swift (#4816)
[mastodon.git] / boxfile.yml
1 run.config:
2 engine: ruby
3 engine.config:
4 runtime: ruby-2.4
5
6 extra_packages:
7 # basic servers:
8 - nginx
9 - nodejs
10
11 # for images:
12 - ImageMagick
13
14 # for videos:
15 - ffmpeg3
16
17 # to prep the .env file:
18 - gettext-tools
19
20 # for node-gyp, used in the asset compilation process:
21 - python-2
22
23 # i18n:
24 - libidn
25
26 cache_dirs:
27 - node_modules
28
29 extra_path_dirs:
30 - node_modules/.bin
31
32 build_triggers:
33 - .ruby-version
34 - Gemfile
35 - Gemfile.lock
36 - package.json
37 - yarn.lock
38
39 extra_steps:
40 - envsubst < .env.nanobox > .env
41 - yarn
42
43 fs_watch: true
44
45 deploy.config:
46 extra_steps:
47 - NODE_ENV=production bundle exec rake assets:precompile
48 transform:
49 - "sed 's/LOCAL_HTTPS=.*/LOCAL_HTTPS=true/i' /app/.env.nanobox | envsubst > /app/.env.production"
50 - |-
51 if [ -z "$LOCAL_DOMAIN" ]
52 then
53 . /app/.env.production
54 export LOCAL_DOMAIN
55 fi
56 erb /app/nanobox/nginx-web.conf.erb > /app/nanobox/nginx-web.conf
57 erb /app/nanobox/nginx-stream.conf.erb > /app/nanobox/nginx-stream.conf
58 - touch /app/log/production.log
59 before_live:
60 web.web:
61 - bundle exec rake db:migrate:setup
62
63 web.web:
64 start:
65 nginx: nginx -c /app/nanobox/nginx-web.conf
66 rails: bundle exec puma -C /app/config/puma.rb
67
68 routes:
69 - '/'
70
71 writable_dirs:
72 - tmp
73
74 log_watch:
75 rails: 'log/production.log'
76
77 network_dirs:
78 data.storage:
79 - public/system
80
81 web.stream:
82 start:
83 nginx: nginx -c /app/nanobox/nginx-stream.conf
84 node: yarn run start
85
86 routes:
87 - '/api/v1/streaming*'
88 # Somehow we're getting requests for scheme://domain//api/v1/streaming* - match those, too
89 - '//api/v1/streaming*'
90
91 writable_dirs:
92 - tmp
93
94 worker.sidekiq:
95 start: bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push -L /app/log/sidekiq.log
96
97 writable_dirs:
98 - tmp
99
100 log_watch:
101 rails: 'log/production.log'
102 sidekiq: 'log/sidekiq.log'
103
104 network_dirs:
105 data.storage:
106 - public/system
107
108 cron:
109 - id: generate_static_gifs
110 schedule: '*/15 * * * *'
111 command: 'bundle exec rake mastodon:maintenance:add_static_avatars'
112
113 - id: update_counter_caches
114 schedule: '50 * * * *'
115 command: 'bundle exec rake mastodon:maintenance:update_counter_caches'
116
117 # runs feeds:clear, media:clear, users:clear, and push:refresh
118 - id: do_daily_tasks
119 schedule: '00 00 * * *'
120 command: 'bundle exec rake mastodon:daily'
121
122 - id: clear_silenced_media
123 schedule: '10 00 * * *'
124 command: 'bundle exec rake mastodon:media:remove_silenced'
125
126 - id: clear_remote_media
127 schedule: '20 00 * * *'
128 command: 'bundle exec rake mastodon:media:remove_remote'
129
130 - id: clear_unfollowed_subs
131 schedule: '30 00 * * *'
132 command: 'bundle exec rake mastodon:push:clear'
133
134 - id: send_digest_emails
135 schedule: '00 20 * * *'
136 command: 'bundle exec rake mastodon:emails:digest'
137
138 # The following two tasks can be uncommented to automatically open and close
139 # registrations on a schedule. The format of 'schedule' is a standard cron
140 # time expression: minute hour day month day-of-week; search for "cron
141 # time expressions" for more info on how to set these up. The examples here
142 # open registration only from 8 am to 4 pm, server time.
143 #
144 # - id: open_registrations
145 # schedule: '00 08 * * *'
146 # command: 'bundle exec rake mastodon:settings:open_registrations'
147 #
148 # - id: close_registrations
149 # schedule: '00 16 * * *'
150 # command: 'bundle exec rake mastodon:settings:close_registrations'
151
152 data.db:
153 image: nanobox/postgresql:9.5
154
155 cron:
156 - id: backup
157 schedule: '0 3 * * *'
158 command: |
159 PGPASSWORD=${DATA_POSTGRES_PASS} pg_dump -U ${DATA_POSTGRES_USER} -w -Fc -O gonano |
160 gzip |
161 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 --data-binary @- &&
162 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
163 json_pp |
164 grep ${HOSTNAME} |
165 sort |
166 head -n-${BACKUP_COUNT:-1} |
167 sed 's/.*: "\(.*\)".*/\1/' |
168 while read file
169 do
170 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
171 done
172
173 data.redis:
174 image: nanobox/redis:3.0
175
176 cron:
177 - id: backup
178 schedule: '0 3 * * *'
179 command: |
180 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 --data-binary @/data/var/db/redis/dump.rdb &&
181 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
182 json_pp |
183 grep ${HOSTNAME} |
184 sort |
185 head -n-${BACKUP_COUNT:-1} |
186 sed 's/.*: "\(.*\)".*/\1/' |
187 while read file
188 do
189 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
190 done
191
192 data.storage:
193 image: nanobox/unfs:0.9
194
195 cron:
196 - id: backup
197 schedule: '0 3 * * *'
198 command: |
199 tar cz -C /data/var/db/unfs/ |
200 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 --data-binary @- &&
201 curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
202 json_pp |
203 grep ${HOSTNAME} |
204 sort |
205 head -n-${BACKUP_COUNT:-1} |
206 sed 's/.*: "\(.*\)".*/\1/' |
207 while read file
208 do
209 curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
210 done
This page took 0.093736 seconds and 5 git commands to generate.