aboutsummaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authormagikcypress <cyp@rouquin.me>2017-04-08 04:04:27 +0200
committermagikcypress <cyp@rouquin.me>2017-04-08 04:04:27 +0200
commitdab2e3571a3afc33795fa54fef57f10243522f90 (patch)
tree45185c425033f44c333d66291b5eeb5420d86e49 /conf
downloadmastodon_ynh-dab2e3571a3afc33795fa54fef57f10243522f90.tar.gz
mastodon_ynh-dab2e3571a3afc33795fa54fef57f10243522f90.tar.bz2
mastodon_ynh-dab2e3571a3afc33795fa54fef57f10243522f90.zip
Initial commit
Diffstat (limited to 'conf')
-rw-r--r--conf/backports.list1
-rw-r--r--conf/crontab_mastodon3
-rw-r--r--conf/mastodon-sidekiq.service16
-rw-r--r--conf/mastodon-streaming.service16
-rw-r--r--conf/mastodon-web.service16
-rw-r--r--conf/nginx.conf35
6 files changed, 87 insertions, 0 deletions
diff --git a/conf/backports.list b/conf/backports.list
new file mode 100644
index 0000000..b8c3f51
--- /dev/null
+++ b/conf/backports.list
@@ -0,0 +1 @@
+deb http://httpredir.debian.org/debian jessie-backports main \ No newline at end of file
diff --git a/conf/crontab_mastodon b/conf/crontab_mastodon
new file mode 100644
index 0000000..972cc3c
--- /dev/null
+++ b/conf/crontab_mastodon
@@ -0,0 +1,3 @@
+@hourly cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:media:clear
+@hourly cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:push:refresh
+@hourly cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:feeds:clear \ No newline at end of file
diff --git a/conf/mastodon-sidekiq.service b/conf/mastodon-sidekiq.service
new file mode 100644
index 0000000..d31fed4
--- /dev/null
+++ b/conf/mastodon-sidekiq.service
@@ -0,0 +1,16 @@
+[Unit]
+ Description=mastodon-sidekiq
+ After=network.target
+
+[Service]
+ Type=simple
+ User=mastodon
+ WorkingDirectory=/opt/mastodon/live
+ Environment="RAILS_ENV=production"
+ Environment="DB_POOL=5"
+ ExecStart=/opt/mastodon/.rbenv/shims/bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push
+ TimeoutSec=15
+ Restart=always
+
+[Install]
+ WantedBy=multi-user.target \ No newline at end of file
diff --git a/conf/mastodon-streaming.service b/conf/mastodon-streaming.service
new file mode 100644
index 0000000..1a5be2c
--- /dev/null
+++ b/conf/mastodon-streaming.service
@@ -0,0 +1,16 @@
+[Unit]
+ Description=mastodon-streaming
+ After=network.target
+
+[Service]
+ Type=simple
+ User=mastodon
+ WorkingDirectory=/opt/mastodon/live
+ Environment="NODE_ENV=production"
+ Environment="PORT=4000"
+ ExecStart=/usr/bin/npm run start
+ TimeoutSec=15
+ Restart=always
+
+[Install]
+ WantedBy=multi-user.target \ No newline at end of file
diff --git a/conf/mastodon-web.service b/conf/mastodon-web.service
new file mode 100644
index 0000000..9f1d710
--- /dev/null
+++ b/conf/mastodon-web.service
@@ -0,0 +1,16 @@
+[Unit]
+ Description=mastodon-web
+ After=network.target
+
+[Service]
+ Type=simple
+ User=mastodon
+ WorkingDirectory=/opt/mastodon/live
+ Environment="RAILS_ENV=production"
+ Environment="PORT=3000"
+ ExecStart=/opt/mastodon/.rbenv/shims/bundle exec puma -C config/puma.rb
+ TimeoutSec=15
+ Restart=always
+
+[Install]
+ WantedBy=multi-user.target \ No newline at end of file
diff --git a/conf/nginx.conf b/conf/nginx.conf
new file mode 100644
index 0000000..19650dd
--- /dev/null
+++ b/conf/nginx.conf
@@ -0,0 +1,35 @@
+ location __PATH__ {
+ try_files $uri @proxy;
+ }
+
+ location @proxy {
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto https;
+ proxy_pass_header Server;
+ proxy_pass http://127.0.0.1:3000;
+ proxy_buffering off;
+ proxy_redirect off;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ tcp_nodelay on;
+ }
+
+ location __PATH__/api/v1/streaming {
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto https;
+ proxy_pass http://127.0.0.1:4000;
+ proxy_buffering off;
+ proxy_redirect off;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ tcp_nodelay on;
+ }
+
+ error_page 500 501 502 503 504 /500.html;
+} \ No newline at end of file