Cleanup
This commit is contained in:
parent
c783601fa9
commit
792f2749b6
21 changed files with 160 additions and 58 deletions
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- hosts: bank
|
- hosts: bank
|
||||||
roles:
|
|
||||||
- common
|
|
||||||
- bank
|
|
||||||
vars:
|
vars:
|
||||||
bank_revbank_git: https://github.com/bitlair/revbank.git
|
bank_revbank_git: https://github.com/bitlair/revbank.git
|
||||||
|
roles:
|
||||||
|
- { role: "common", tags: [ "common" ] }
|
||||||
|
- { role: "bank", tags: [ "bank" ] }
|
||||||
|
|
6
bar.yaml
6
bar.yaml
|
@ -4,6 +4,6 @@
|
||||||
vars:
|
vars:
|
||||||
raspi_rotate_display: "2"
|
raspi_rotate_display: "2"
|
||||||
roles:
|
roles:
|
||||||
- raspi
|
- { role: "raspi", tags: [ "raspi" ] }
|
||||||
- common
|
- { role: "common", tags: [ "common" ] }
|
||||||
- bank-terminal
|
- { role: "bank-terminal", tags: [ "bank-terminal" ] }
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
- hosts: monitoring
|
- hosts: monitoring
|
||||||
roles:
|
roles:
|
||||||
- { role: "acme", tags: [ "acme" ] }
|
- { role: "acme", tags: [ "acme" ] }
|
||||||
|
- { role: "nginx", tags: [ "nginx" ] }
|
||||||
- { role: "monitoring", tags: [ "monitoring" ] }
|
- { role: "monitoring", tags: [ "monitoring" ] }
|
||||||
|
|
||||||
- hosts: mqtt
|
- hosts: mqtt
|
||||||
|
@ -55,4 +56,5 @@
|
||||||
- hosts: wiki
|
- hosts: wiki
|
||||||
roles:
|
roles:
|
||||||
- { role: "acme", tags: [ "acme" ] }
|
- { role: "acme", tags: [ "acme" ] }
|
||||||
|
- { role: "nginx", tags: [ "nginx" ] }
|
||||||
- { role: "www", tags: [ "www" ] }
|
- { role: "www", tags: [ "www" ] }
|
||||||
|
|
21
group_vars/wiki.yaml
Normal file
21
group_vars/wiki.yaml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
acme_bootstrap_certs: yes
|
||||||
|
acme_san_domains:
|
||||||
|
- [ bitlair.nl, wiki.bitlair.nl, www.bitlair.nl ]
|
||||||
|
- [ bitair.nl ]
|
||||||
|
- [ ravespace.nl ]
|
||||||
|
|
||||||
|
nginx_sites:
|
||||||
|
- server_name: "bitlair.nl"
|
||||||
|
server_alias: "wiki.bitlair.nl www.bitlair.nl cyber.bitlair.nl"
|
||||||
|
snippets:
|
||||||
|
- "mqtt2web-nginx.j2"
|
||||||
|
- "spaceapi-nginx.j2"
|
||||||
|
- "www-nginx.j2"
|
||||||
|
- server_name: "bitair.nl"
|
||||||
|
server_alias: "www.bitair.nl"
|
||||||
|
snippets:
|
||||||
|
- "bitair-nginx.j2"
|
||||||
|
- server_name: "ravespace.nl"
|
||||||
|
server_alias: "www.ravespace.nl"
|
||||||
|
snippets:
|
||||||
|
- "ravespace-nginx.j2"
|
|
@ -1,5 +0,0 @@
|
||||||
acme_bootstrap_certs: yes
|
|
||||||
acme_san_domains:
|
|
||||||
- [ bitlair.nl, wiki.bitlair.nl, www.bitlair.nl ]
|
|
||||||
- [ bitair.nl ]
|
|
||||||
- [ ravespace.nl ]
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
- hosts: mqtt
|
- hosts: mqtt
|
||||||
roles:
|
roles:
|
||||||
- common
|
- { role: "common", tags: [ "common" ] }
|
||||||
- mqtt-internal
|
- { role: "mqtt-internal", tags: [ "mqtt", "mqtt-internal" ] }
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
- hosts: music
|
- hosts: music
|
||||||
roles:
|
roles:
|
||||||
- common
|
- { role: "common", tags: [ "common" ] }
|
||||||
- acme
|
- { role: "acme", tags: [ "acme" ] }
|
||||||
- go
|
- { role: "go", tags: [ "go" ] }
|
||||||
- music
|
# - { role: "nginx", tags: [ "nginx" ] }
|
||||||
|
- { role: "music", tags: [ "music" ] }
|
||||||
|
|
7
pad.yaml
7
pad.yaml
|
@ -5,6 +5,7 @@
|
||||||
acme_san_domains:
|
acme_san_domains:
|
||||||
- [ pad.bitlair.nl ]
|
- [ pad.bitlair.nl ]
|
||||||
roles:
|
roles:
|
||||||
- common
|
- { role: "common", tags: [ "common" ] }
|
||||||
- acme
|
- { role: "acme", tags: [ "acme" ] }
|
||||||
- etherpad
|
# - { role: "nginx", tags: [ "nginx" ] }
|
||||||
|
- { role: "etherpad", tags: [ "etherpad" ] }
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
---
|
---
|
||||||
- tags: etherpad
|
- tags: etherpad
|
||||||
block:
|
block:
|
||||||
- ansible.builtin.import_tasks:
|
|
||||||
file: ../../../snippets/common-nginx.yaml
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: [ gpg, postgresql, python3-psycopg2, apt-transport-https ]
|
name: [ gpg, postgresql, python3-psycopg2, apt-transport-https ]
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
---
|
---
|
||||||
- ansible.builtin.import_tasks:
|
|
||||||
file: ../../../snippets/common-nginx.yaml
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
- name: monitoring
|
- name: monitoring
|
||||||
tags: monitoring
|
tags: monitoring
|
||||||
block:
|
block:
|
||||||
- ansible.builtin.import_tasks:
|
|
||||||
file: ../../../snippets/common-nginx.yaml
|
|
||||||
|
|
||||||
- name: Install nginx site
|
- name: Install nginx site
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: nginx-site.conf
|
src: nginx-site.conf
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
|
|
||||||
- tags: music
|
- tags: music
|
||||||
block:
|
block:
|
||||||
- ansible.builtin.import_tasks:
|
|
||||||
file: ../../../snippets/common-nginx.yaml
|
|
||||||
|
|
||||||
- name: Install nginx config
|
- name: Install nginx config
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
name: php-fpm
|
name: php-fpm
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- ansible.builtin.import_tasks:
|
|
||||||
file: ../../../snippets/common-nginx.yaml
|
|
||||||
|
|
||||||
- name: Install security.txt
|
- name: Install security.txt
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: security.txt
|
src: security.txt
|
||||||
|
|
2
snippets/bitair-nginx.j2
Normal file
2
snippets/bitair-nginx.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
root /opt/bitair.nl/;
|
||||||
|
index index.html;
|
|
@ -1,18 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install nginx
|
|
||||||
apt:
|
|
||||||
name: nginx
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Disable nginx server_tokens
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/nginx/nginx.conf
|
|
||||||
line: "\tserver_tokens off;"
|
|
||||||
regexp: "server_tokens"
|
|
||||||
notify: reload nginx
|
|
||||||
|
|
||||||
- name: Clear default nginx site
|
|
||||||
file:
|
|
||||||
state: absent
|
|
||||||
path: /etc/nginx/sites-enabled/default
|
|
||||||
notify: reload nginx
|
|
11
snippets/mqtt2web-nginx.j2
Normal file
11
snippets/mqtt2web-nginx.j2
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# mqtt2web nginx config snippet
|
||||||
|
|
||||||
|
location /mqtt/ {
|
||||||
|
proxy_pass http://localhost:8080/mqtt;
|
||||||
|
include proxy_params;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_cache off;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection '';
|
||||||
|
chunked_transfer_encoding off;
|
||||||
|
}
|
2
snippets/ravespace-nginx.j2
Normal file
2
snippets/ravespace-nginx.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
root /opt/ravespace.nl/;
|
||||||
|
index index.html;
|
8
snippets/spaceapi-nginx.j2
Normal file
8
snippets/spaceapi-nginx.j2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# spaceapi nginx config snippet
|
||||||
|
|
||||||
|
location = /statejson {
|
||||||
|
proxy_pass http://localhost:8888;
|
||||||
|
include proxy_params;
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
}
|
||||||
|
|
89
snippets/www-nginx.j2
Normal file
89
snippets/www-nginx.j2
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
root /opt/mediawiki-1.41.1/;
|
||||||
|
|
||||||
|
# Photo gallery
|
||||||
|
location = /fotos {
|
||||||
|
return 302 $scheme://bitlair.nl/fotos/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* ^/fotos/(.*)$ {
|
||||||
|
proxy_pass http://204.2.68.2:4567/$1$is_args$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/state/(.+)$ {
|
||||||
|
alias /opt/spaceapi/assets/$1;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /events.ics {
|
||||||
|
alias /var/lib/bitlair-calendar/events.ics;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(cache|maintenance|vendor|extensions)/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Legacy space API stuff.
|
||||||
|
location ~ ^/(putconfig|putjson|putstate|state|statejson)\.php$ {
|
||||||
|
root "/opt/legacy/";
|
||||||
|
fastcgi_pass unix:/run/php/php-fpm.sock;
|
||||||
|
include fastcgi.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(bitlair.svg|bitlair_closed.png|bitlair_open.png|state|statejson)$ {
|
||||||
|
root "/opt/legacy/";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/wp-content {
|
||||||
|
root "/opt/legacy/";
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /statejson.php {
|
||||||
|
rewrite ^.+$ /statejson;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Mediawiki
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ @rewrite;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri @rewrite;
|
||||||
|
fastcgi_pass unix:/run/php/php-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
location @rewrite {
|
||||||
|
# rewrite ^/(.*)$ /index.php;
|
||||||
|
rewrite ^/(.*)$ /index.php?title=$1$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.(png|css|ico|pdf|flv|jpe?g|gif|js|css)$ {
|
||||||
|
try_files $uri @rewrite;
|
||||||
|
expires 1M;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /_.gif {
|
||||||
|
expires max;
|
||||||
|
empty_gif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#location /dumps {
|
||||||
|
# root /opt/bitlair-wiki/local;
|
||||||
|
# autoindex on;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Legacy: redirect old prefix.
|
||||||
|
location /Pages/ {
|
||||||
|
rewrite ^/Pages/(.*) https://$server_name/$1$args redirect;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Matrix realm delegation
|
||||||
|
location = /.well-known/matrix/server {
|
||||||
|
add_header "Content-Type" "application/json";
|
||||||
|
add_header "Access-Control-Allow-Origin" "*";
|
||||||
|
alias /opt/matrix-delegation.json;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /.well-known/security.txt {
|
||||||
|
alias /opt/security.txt;
|
||||||
|
}
|
8
wiki.yaml
Normal file
8
wiki.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- hosts: wiki
|
||||||
|
roles:
|
||||||
|
- { role: "common", tags: [ "common" ] }
|
||||||
|
- { role: "acme", tags: [ "acme" ] }
|
||||||
|
- { role: "nginx", tags: [ "nginx" ] }
|
||||||
|
- { role: "www", tags: [ "www" ] }
|
7
www.yaml
7
www.yaml
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
- hosts: wiki
|
|
||||||
roles:
|
|
||||||
- common
|
|
||||||
- acme
|
|
||||||
- www
|
|
Loading…
Add table
Reference in a new issue