The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

249 lines
7.6 KiB

  1. run.config:
  2. engine: ruby
  3. engine.config:
  4. runtime: ruby-2.4
  5. extra_packages:
  6. # basic servers:
  7. - nginx
  8. - nodejs
  9. # for images:
  10. - ImageMagick
  11. # for videos:
  12. - ffmpeg3
  13. # to prep the .env file:
  14. - gettext-tools
  15. # for node-gyp, used in the asset compilation process:
  16. - python-2
  17. # i18n:
  18. - libidn
  19. cache_dirs:
  20. - node_modules
  21. extra_path_dirs:
  22. - node_modules/.bin
  23. build_triggers:
  24. - .ruby-version
  25. - Gemfile
  26. - Gemfile.lock
  27. - package.json
  28. - yarn.lock
  29. extra_steps:
  30. - envsubst < .env.nanobox > .env
  31. - yarn
  32. fs_watch: true
  33. deploy.config:
  34. extra_steps:
  35. - NODE_ENV=production bundle exec rake assets:precompile
  36. transform:
  37. - "sed 's/LOCAL_HTTPS=.*/LOCAL_HTTPS=true/i' /app/.env.nanobox | envsubst > /app/.env.production"
  38. - |-
  39. if [ -z "$LOCAL_DOMAIN" ]
  40. then
  41. . /app/.env.production
  42. export LOCAL_DOMAIN
  43. fi
  44. erb /app/nanobox/nginx-web.conf.erb > /app/nanobox/nginx-web.conf
  45. erb /app/nanobox/nginx-stream.conf.erb > /app/nanobox/nginx-stream.conf
  46. - touch /app/log/production.log
  47. before_live:
  48. web.web:
  49. - bundle exec rake db:migrate:setup
  50. web.web:
  51. start:
  52. nginx: nginx -c /app/nanobox/nginx-web.conf
  53. rails: bundle exec puma -C /app/config/puma.rb
  54. routes:
  55. - '/'
  56. writable_dirs:
  57. - tmp
  58. log_watch:
  59. rails: 'log/production.log'
  60. network_dirs:
  61. data.storage:
  62. - public/system
  63. web.stream:
  64. start:
  65. nginx: nginx -c /app/nanobox/nginx-stream.conf
  66. node: yarn run start
  67. routes:
  68. - '/api/v1/streaming*'
  69. # Somehow we're getting requests for scheme://domain//api/v1/streaming* - match those, too
  70. - '//api/v1/streaming*'
  71. writable_dirs:
  72. - tmp
  73. worker.sidekiq:
  74. start:
  75. default: bundle exec sidekiq -c 5 -q default -L /app/log/sidekiq.log
  76. mailers: bundle exec sidekiq -c 5 -q mailers -L /app/log/sidekiq.log
  77. pull: bundle exec sidekiq -c 5 -q pull -L /app/log/sidekiq.log
  78. push: bundle exec sidekiq -c 5 -q push -L /app/log/sidekiq.log
  79. writable_dirs:
  80. - tmp
  81. log_watch:
  82. rails: 'log/production.log'
  83. sidekiq: 'log/sidekiq.log'
  84. network_dirs:
  85. data.storage:
  86. - public/system
  87. worker.cron_only:
  88. start: sleep 365d
  89. writable_dirs:
  90. - tmp
  91. log_watch:
  92. rake: 'log/production.log'
  93. network_dirs:
  94. data.storage:
  95. - public/system
  96. cron:
  97. # 20:00 (8 pm), server time: send out the daily digest emails to everyone
  98. # who opted to receive one
  99. - id: send_digest_emails
  100. schedule: '00 20 * * *'
  101. command: 'bundle exec rake mastodon:emails:digest'
  102. # 00:10 (ten past midnight), server time: remove local copies of remote
  103. # users' media once they are older than a certain age (use NUM_DAYS evar to
  104. # change this from the default of 7 days)
  105. - id: clear_remote_media
  106. schedule: '10 00 * * *'
  107. command: 'bundle exec rake mastodon:media:remove_remote'
  108. # 00:20 (twenty past midnight), server time: remove subscriptions to remote
  109. # users that nobody follows locally (anymore)
  110. - id: clear_unfollowed_subs
  111. schedule: '20 00 * * *'
  112. command: 'bundle exec rake mastodon:push:clear'
  113. # 00:30 (half past midnight), server time: update local copies of remote
  114. # users' avatars to match whatever they currently have set on their profile
  115. - id: update_remote_avatars
  116. schedule: '30 00 * * *'
  117. command: 'bundle exec rake mastodon:media:redownload_avatars'
  118. ############################################################################
  119. # This task is one you might want to enable, or might not. It keeps disk
  120. # usage low, but makes "shadow bans" (scenarios where the user is silenced,
  121. # but not intended to be made aware that the silencing has occurred) much
  122. # more difficult to put in place, as users would then notice their media is
  123. # vanishing on a regular basis. Enable it if you aren't worried about users
  124. # knowing they've been silenced (on the instance level), and want to save
  125. # disk space. Leave it disabled otherwise.
  126. ############################################################################
  127. # # 00:00 (midnight), server time: remove media posted by silenced users
  128. # - id: clear_silenced_media
  129. # schedule: '00 00 * * *'
  130. # command: 'bundle exec rake mastodon:media:remove_silenced'
  131. ############################################################################
  132. # The following two tasks can be uncommented to automatically open and close
  133. # registrations on a schedule. The format of 'schedule' is a standard cron
  134. # time expression: minute hour day month day-of-week; search for "cron
  135. # time expressions" for more info on how to set these up. The examples here
  136. # open registration only from 8 am to 4 pm, server time.
  137. ############################################################################
  138. # # 08:00 (8 am), server time: open registrations so new users can join
  139. # - id: open_registrations
  140. # schedule: '00 08 * * *'
  141. # command: 'bundle exec rake mastodon:settings:open_registrations'
  142. #
  143. # # 16:00 (4 pm), server time: close registrations so new users *can't* join
  144. # - id: close_registrations
  145. # schedule: '00 16 * * *'
  146. # command: 'bundle exec rake mastodon:settings:close_registrations'
  147. data.db:
  148. image: nanobox/postgresql:9.5
  149. cron:
  150. - id: backup
  151. schedule: '0 3 * * *'
  152. command: |
  153. PGPASSWORD=${DATA_POSTGRES_PASS} pg_dump -U ${DATA_POSTGRES_USER} -w -Fc -O gonano |
  154. gzip |
  155. 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 @- &&
  156. curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
  157. json_pp |
  158. grep ${HOSTNAME} |
  159. sort |
  160. head -n-${BACKUP_COUNT:-1} |
  161. sed 's/.*: "\(.*\)".*/\1/' |
  162. while read file
  163. do
  164. curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
  165. done
  166. data.redis:
  167. image: nanobox/redis:3.0
  168. cron:
  169. - id: backup
  170. schedule: '0 3 * * *'
  171. command: |
  172. 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 &&
  173. curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
  174. json_pp |
  175. grep ${HOSTNAME} |
  176. sort |
  177. head -n-${BACKUP_COUNT:-1} |
  178. sed 's/.*: "\(.*\)".*/\1/' |
  179. while read file
  180. do
  181. curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
  182. done
  183. data.storage:
  184. image: nanobox/unfs:0.9
  185. cron:
  186. - id: backup
  187. schedule: '0 3 * * *'
  188. command: |
  189. tar cz -C /data/var/db/unfs/ |
  190. 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 @- &&
  191. curl -k -s -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/ |
  192. json_pp |
  193. grep ${HOSTNAME} |
  194. sort |
  195. head -n-${BACKUP_COUNT:-1} |
  196. sed 's/.*: "\(.*\)".*/\1/' |
  197. while read file
  198. do
  199. curl -k -H "X-AUTH-TOKEN: ${WAREHOUSE_DATA_HOARDER_TOKEN}" https://${WAREHOUSE_DATA_HOARDER_HOST}:7410/blobs/${file} -X DELETE
  200. done