- remove the handling of which template to use - do not access parent role - update riot-web nginx configuration - update icinga role to use new nginx templating - update synapse nginx configuration - update matrix role to use new nginx templates - update dokuwiki to use new nginx template - extend nginx template in dokuwiki - update login role to new nginx templates - add protocol for default option - add extra block to nginx template - update riote-web version - fix template extension for riot web nginx definition - update login template for nginx endpointpython3
@ -1,6 +1,4 @@ | |||||
--- | --- | ||||
dependencies: | dependencies: | ||||
- role: nginx | - role: nginx | ||||
php: true | |||||
config_name: "dokuwiki" | |||||
parent_role_path: "dokuwiki" | |||||
server_fqdn: "wiki.lilik.it" |
@ -1,15 +1,23 @@ | |||||
--- | --- | ||||
- name: install dokuwiki and associated packages | - name: install dokuwiki and associated packages | ||||
apt: | apt: | ||||
name: "{{ item }}" | |||||
state: present | |||||
update_cache: yes | |||||
cache_valid_time: 3600 | |||||
name: "{{ item }}" | |||||
state: present | |||||
update_cache: yes | |||||
cache_valid_time: 3600 | |||||
with_items: | with_items: | ||||
- dokuwiki | |||||
- dokuwiki | |||||
- name: add nginx configurations | |||||
template: | |||||
src: dokuwiki.conf | |||||
dest: "/etc/nginx/locations/{{ server_fqdn }}/dokuwiki.conf" | |||||
notify: | |||||
- restart nginx | |||||
- name: Write dokuwiki configuration to local.php | - name: Write dokuwiki configuration to local.php | ||||
copy: | copy: | ||||
src: dokuwiki.php | src: dokuwiki.php | ||||
dest: /etc/dokuwiki/local.php | dest: /etc/dokuwiki/local.php | ||||
notify: | notify: | ||||
- restart nginx | |||||
- restart nginx |
@ -0,0 +1,24 @@ | |||||
{% extends "proxy.conf.nginx.j2" %} | |||||
{% block proxy_conf %} | |||||
root /usr/share/dokuwiki; | |||||
index doku.php; | |||||
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; } | |||||
location / { try_files $uri $uri/ @dokuwiki; } | |||||
location @dokuwiki { | |||||
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; | |||||
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; | |||||
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; | |||||
rewrite ^/(.*) /doku.php?id=$1&$args last; | |||||
} | |||||
location ~ \.php$ { | |||||
try_files $uri $uri/ /doku.php; | |||||
include fastcgi_params; | |||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |||||
fastcgi_param REDIRECT_STATUS 200; | |||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |||||
} | |||||
{% endblock %} |
@ -1,20 +0,0 @@ | |||||
root /usr/share/dokuwiki; | |||||
index doku.php; | |||||
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; } | |||||
location / { try_files $uri $uri/ @dokuwiki; } | |||||
location @dokuwiki { | |||||
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; | |||||
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; | |||||
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; | |||||
rewrite ^/(.*) /doku.php?id=$1&$args last; | |||||
} | |||||
location ~ \.php$ { | |||||
try_files $uri $uri/ /doku.php; | |||||
include fastcgi_params; | |||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |||||
fastcgi_param REDIRECT_STATUS 200; | |||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |||||
} |
@ -1,7 +1,5 @@ | |||||
--- | |||||
dependencies: | dependencies: | ||||
- role: nginx | - role: nginx | ||||
php: true | |||||
parent_role_path: "icinga2" | |||||
config_name: "icinga2" | |||||
server_fqdn: "status.lilik.it" | server_fqdn: "status.lilik.it" | ||||
- role: postgresql | - role: postgresql |
@ -1 +1,5 @@ | |||||
--- | |||||
ldap_server: ldap.dmz.lilik | ldap_server: ldap.dmz.lilik | ||||
proxy_location_path: api | |||||
remote_host: "http://localhost:5000" | |||||
server_fqdn: "login.lilik.it" |
@ -1,8 +1,4 @@ | |||||
--- | --- | ||||
dependencies: | dependencies: | ||||
- role: nginx | - role: nginx | ||||
is_proxy: true | |||||
config_name: "login" | |||||
remote_host: "http://localhost:5000" | |||||
server_fqdn: "login.lilik.it" | server_fqdn: "login.lilik.it" | ||||
parent_role_path: "login" |
@ -0,0 +1,5 @@ | |||||
{% extends "roles/nginx/templates/service.conf" %} | |||||
{% block extra %} | |||||
root /srv/login/static; | |||||
{% block extra %} |
@ -1 +0,0 @@ | |||||
rewrite ^/$ /static/index.html permanent; |
@ -1,8 +1,4 @@ | |||||
--- | --- | ||||
dependencies: | dependencies: | ||||
- role: nginx | - role: nginx | ||||
is_proxy: true | |||||
parent_role_path: "matrix-synapse" | |||||
remote_host: "http://127.0.0.1:8008/_matrix" | |||||
proxy_location_path: "_matrix" | |||||
server_fqdn: "{{ ansible_hostname }}.lilik.it" | |||||
server_fqdn: "matrix.lilik.it" |
@ -0,0 +1 @@ | |||||
{% extends "roles/nginx/templates/service.conf" %} |
@ -1,38 +1,2 @@ | |||||
--- | --- | ||||
is_proxy: false | |||||
php: false | |||||
config_name: null | |||||
# max body size in Mb | |||||
max_body_size: 8 | |||||
server_fqdn: "{{ ansible_hostname }}.lilik.it" | server_fqdn: "{{ ansible_hostname }}.lilik.it" | ||||
proxy_location_path: '' | |||||
# Same example usages: | |||||
# | |||||
# Redirect trakt folder to a proxy on fqdn_domain, | |||||
# create a location file in /etc/nginx/locations/media.lilik.it/trakt.conf | |||||
# dependencies: | |||||
# - role: nginx | |||||
# is_proxy: true | |||||
# proxy_location_path: "trakt" | |||||
# remote_host: "http://localhost:5000" | |||||
# server_fqdn: "media.lilik.it" | |||||
# parent_role_path: "trakt" | |||||
# | |||||
# Serve a location based on role template 'kodi-repository.conf.nginx.j2' on fqdn_domain, | |||||
# create a location file in /etc/nginx/locations/media.lilik.it/kodi-repository.conf | |||||
# dependencies: | |||||
# - role: nginx | |||||
# config_name: "kodi-repository" | |||||
# server_fqdn: "{{ fqdn_domain }}" | |||||
# parent_role_path: "kodi-repository" | |||||
# | |||||
# Serve a location based on role template 'roundcube.conf.nginx.j2' on fqdn_domain, | |||||
# create a location file in /etc/nginx/locations/media.lilik.it/roundcube.conf, | |||||
# serve php file using php pfm | |||||
# dependencies: | |||||
# - role: nginx | |||||
# php: true | |||||
# config_name: "roundcube" | |||||
# server_fqdn: "webmail.lilik.it" | |||||
# parent_role_path: "roundcube" |
@ -1,11 +0,0 @@ | |||||
location /{{ proxy_location_path }} { | |||||
client_max_body_size {{ max_body_size }}M; | |||||
proxy_set_header Upgrade $http_upgrade; | |||||
proxy_set_header Connection "upgrade"; | |||||
proxy_set_header Host $http_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 $scheme; | |||||
proxy_set_header X-Frame-Options SAMEORIGIN; | |||||
proxy_pass {{ remote_host }}; | |||||
} |
@ -0,0 +1,20 @@ | |||||
{% block proxy_conf %} | |||||
{# | |||||
This is the default block that gets included if the | |||||
child template does not declare a {% block proxy_conf %} | |||||
#} | |||||
location /{{ proxy_location_path | default("")}} { | |||||
client_max_body_size {{ max_body_size | default(8) }}M; | |||||
proxy_set_header Upgrade $http_upgrade; | |||||
proxy_set_header Connection "upgrade"; | |||||
proxy_set_header Host $http_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 $scheme; | |||||
proxy_set_header X-Frame-Options SAMEORIGIN; | |||||
proxy_pass {{ remote_host | default("http://127.0.0.1:8080") }}; | |||||
} | |||||
{% endblock %} | |||||
{% block extra %} | |||||
{% endblock %} |
@ -1,2 +1,4 @@ | |||||
# Based on https://github.com/vector-im/riot-web/releases | # Based on https://github.com/vector-im/riot-web/releases | ||||
riot_web_version: "v0.12.2" | |||||
--- | |||||
riot_web_version: "v0.15.4" | |||||
server_fqdn: "{{ ansible_hostname }}.lilik.it" |
@ -0,0 +1,7 @@ | |||||
{% extends "roles/nginx/templates/service.conf" %} | |||||
{% block proxy_conf %} | |||||
location / { | |||||
root /srv/riot-web/riot-{{ riot_web_version }}; | |||||
} | |||||
{% endblock %} |
@ -1,3 +0,0 @@ | |||||
location / { | |||||
root /srv/riot-web/riot-{{ riot_web_version }}; | |||||
} |