Compare commits

..
10 Commits
13 changed files with 71 additions and 27 deletions
+2 -4
View File
@@ -1,7 +1,5 @@
roles/mastodon/vars/main.yml roles/mastodon/vars/main.yml
host_vars/ host_vars/
group_vars/ group_vars/
roles/frontend/templates/cdn.fullchain.pem roles/frontend/files/wildcard.fullchain.pem
roles/frontend/templates/cdn.privkey.pem roles/frontend/files/wildcard.privkey.pem
roles/frontend/templates/domain.fullchain.pem
roles/frontend/templates/domain.privkey.pem
+7 -5
View File
@@ -1,18 +1,20 @@
[yttrx] [yttrx]
tusky.masto.yttrx.com tusky.masto.yttrx.com
wooly.masto.yttrx.com mammoth.masto.yttrx.com
grafana.yttrx.com
mail.yttrx.com
[mastodon] [mastodon]
wooly.masto.yttrx.com mammoth.masto.yttrx.com
[frontend] [frontend]
wooly.masto.yttrx.com mammoth.masto.yttrx.com
[webapp] [webapp]
wooly.masto.yttrx.com mammoth.masto.yttrx.com
[sidekiq] [sidekiq]
wooly.masto.yttrx.com mammoth.masto.yttrx.com
[yttrx:vars] [yttrx:vars]
ansible_python_interpreter=/usr/bin/python3 ansible_python_interpreter=/usr/bin/python3
+8 -8
View File
@@ -67,29 +67,29 @@
- install - install
- name: Install mastodon domain SSL certificate - name: Install mastodon domain SSL certificate
template: copy:
src: domain.fullchain.pem src: wildcard.fullchain.pem
dest: /etc/nginx/ssl/domain.fullchain.pem dest: /etc/nginx/ssl/domain.fullchain.pem
tags: tags:
- install - install
- name: Install mastodon domain ssl key - name: Install mastodon domain ssl key
template: copy:
src: domain.privkey.pem src: wildcard.privkey.pem
dest: /etc/nginx/ssl/domain.privkey.pem dest: /etc/nginx/ssl/domain.privkey.pem
tags: tags:
- install - install
- name: Install mastodon CDN SSL certificate - name: Install mastodon CDN SSL certificate
template: copy:
src: cdn.fullchain.pem src: wildcard.fullchain.pem
dest: /etc/nginx/ssl/cdn.fullchain.pem dest: /etc/nginx/ssl/cdn.fullchain.pem
tags: tags:
- install - install
- name: Install mastodon CDN ssl key - name: Install mastodon CDN ssl key
template: copy:
src: cdn.privkey.pem src: wildcard.privkey.pem
dest: /etc/nginx/ssl/cdn.privkey.pem dest: /etc/nginx/ssl/cdn.privkey.pem
tags: tags:
- install - install
+3 -3
View File
@@ -12,7 +12,7 @@ log_format files_cache '$remote_addr - $upstream_cache_status [$time_local] '
'"$request" $status $body_bytes_sent ' '"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"'; '"$http_referer" "$http_user_agent"';
proxy_cache_path /data/nginx/cache keys_zone=mycache:50m inactive=3d; proxy_cache_path /data/nginx/cache keys_zone=mycache:50m inactive=7d;
server { server {
listen 443 ssl http2; listen 443 ssl http2;
@@ -25,8 +25,8 @@ server {
ssl_certificate /etc/nginx/ssl/cdn.fullchain.pem; ssl_certificate /etc/nginx/ssl/cdn.fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/cdn.privkey.pem; ssl_certificate_key /etc/nginx/ssl/cdn.privkey.pem;
access_log /var/log/nginx/{{ ENV_PRODUCTION['S3_ALIAS_HOST'] }}.access.log files_cache; access_log /var/log/nginx/cdn.access.log files_cache;
error_log /var/log/nginx/{{ ENV_PRODUCTION['S3_ALIAS_HOST'] }}.error.log; error_log /var/log/nginx/cdn.error.log;
proxy_cache mycache; proxy_cache mycache;
keepalive_timeout 30; keepalive_timeout 30;
+15 -2
View File
@@ -3,15 +3,17 @@ map $http_upgrade $connection_upgrade {
'' close; '' close;
} }
{% for server in ENV_PRODUCTION['ALTERNATE_DOMAINS'] | split(",") %}
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name {{ ENV_PRODUCTION['LOCAL_DOMAIN'] }} server_name {{ server }}
root /home/mastodon/live/public; root /home/mastodon/live/public;
# Useful for Let's Encrypt # Useful for Let's Encrypt
location /.well-known/acme-challenge/ { allow all; } location /.well-known/acme-challenge/ { allow all; }
location / { return 301 https://$host$request_uri; } location / { return 301 https://$host$request_uri; }
} }
{% endfor %}
upstream webbackend { upstream webbackend {
{% for server in webapp_hosts %} {% for server in webapp_hosts %}
@@ -25,10 +27,11 @@ upstream streamingbackend {
{% endfor %} {% endfor %}
} }
{% for server in ENV_PRODUCTION['ALTERNATE_DOMAINS'] | split(",") %}
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name {{ ENV_PRODUCTION['LOCAL_DOMAIN'] }}; server_name {{ server }};
include /etc/nginx/cloudflare; include /etc/nginx/cloudflare;
@@ -56,6 +59,15 @@ server {
add_header Strict-Transport-Security "max-age=31536000"; add_header Strict-Transport-Security "max-age=31536000";
{% if PREFERRED_ALT_DOMAIN and PREFERRED_ALT_DOMAIN != server %}
location = / {
rewrite / https://{{ PREFERRED_ALT_DOMAIN }}/ redirect;
}
location ~ ^/@(.+)?$ {
rewrite ^/(@.*) https://{{ PREFERRED_ALT_DOMAIN }}/$1 permanent;
}
{% endif %}
location / { location / {
try_files $uri @proxy; try_files $uri @proxy;
} }
@@ -121,3 +133,4 @@ server {
error_page 500 501 502 503 504 /500.html; error_page 500 501 502 503 504 /500.html;
} }
{% endfor %}
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
# Wrap around a docker command to invoke `tootctl` # Wrap around a docker command to invoke `tootctl`
docker exec -it $(docker ps -f name=web -q | head -n1) bin/tootctl $* docker exec -it $(docker ps -f name=web -q | head -n1) bin/tootctl $@
+12
View File
@@ -23,6 +23,7 @@
hour: "*/6" hour: "*/6"
tags: tags:
- configure - configure
when: TRIM_STORAGE is defined and TRIM_STORAGE
- name: Install image puller - name: Install image puller
copy: copy:
@@ -53,3 +54,14 @@
mode: '0755' mode: '0755'
tags: tags:
- install - install
- name: Create cronjob for tootctl accounts prune
ansible.builtin.cron:
name: tootctl accounts prune
job: /usr/local/bin/tootctl accounts prune
weekday: "1"
minute: "0"
hour: "5"
tags:
- configure
when: PRUNE_ACCOUNTS is defined and PRUNE_ACCOUNTS
-1
View File
@@ -1,4 +1,3 @@
--- ---
sidekiq: sidekiq:
- name: default - name: default
q: [ 'push', 'pull', 'default', 'ingress', 'mailer', 'scheduler' ]
@@ -9,7 +9,7 @@ services:
{% if 'q' in SK %} {% if 'q' in SK %}
command: bundle exec sidekiq -q {{ SK['q'] | join(' -q ') }} -c 10 command: bundle exec sidekiq -q {{ SK['q'] | join(' -q ') }} -c 10
{% else %} {% else %}
command: bundle exec sidekiq command: bundle exec sidekiq -c 10
{% endif %} {% endif %}
depends_on: depends_on:
- pgbouncer - pgbouncer
-1
View File
@@ -1,4 +1,3 @@
--- ---
sidekiq: sidekiq:
- name: default - name: default
q: [ 'push', 'pull', 'default', 'ingress', 'mailers', 'scheduler' ]
+4
View File
@@ -1,6 +1,10 @@
--- ---
- import_tasks: swap.yml - import_tasks: swap.yml
- name: Set timezone
timezone:
name: America/Los_Angeles
- name: Install prometheus node exporter - name: Install prometheus node exporter
package: package:
name: prometheus-node-exporter name: prometheus-node-exporter
+17
View File
@@ -40,7 +40,24 @@
name: unzip name: unzip
state: present state: present
- name: install clang
package:
name: clang
state: present
- name: install npm
package:
name: npm
state: present
- name: Install python3.10-venv - name: Install python3.10-venv
package: package:
name: python3.10-venv name: python3.10-venv
state: present state: present
when: ansible_distribution == 'Ubuntu'
- name: Install python3.10-venv
package:
name: python3-venv
state: present
when: ansible_distribution == 'Debian'
+1 -1
View File
@@ -1,5 +1,5 @@
--- ---
- name: Configure yttrx mastodon server - name: Configure yttrx mastodon server
hosts: [mastodon] hosts: [yttrx]
roles: roles:
- role: yttrx - role: yttrx