From 1a80058a2a5d679b8d4f440612d59cb7d7c70f2a Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 26 Jan 2019 09:37:26 +0200 Subject: [PATCH] Indent (non-YAML) using tabs Fixes #83 (Github issue) --- .../usr-local-bin/matrix-remove-all.j2 | 42 +++++++++---------- .../nginx-conf.d/matrix-riot-web.conf.j2 | 10 ++--- .../usr-local-bin/matrix-make-user-admin.j2 | 17 ++++---- .../matrix-riot-web/templates/config.json.j2 | 30 ++++++------- .../matrix-synapse-register-user.j2 | 10 ++--- 5 files changed, 54 insertions(+), 55 deletions(-) diff --git a/roles/matrix-base/templates/usr-local-bin/matrix-remove-all.j2 b/roles/matrix-base/templates/usr-local-bin/matrix-remove-all.j2 index 5614b0e3..9fdd7a21 100644 --- a/roles/matrix-base/templates/usr-local-bin/matrix-remove-all.j2 +++ b/roles/matrix-base/templates/usr-local-bin/matrix-remove-all.j2 @@ -1,8 +1,8 @@ #!/bin/bash if [ "$(id -u)" != "0" ]; then - echo "This script must be executed as root! Aborting." - exit 1 + echo "This script must be executed as root! Aborting." + exit 1 fi echo "WARNING! You are about to remove everything the playbook installs for matrix.{{ host_specific_hostname_identity }}: matrix, docker images,..." @@ -10,25 +10,25 @@ echo -n "If you're sure you want to do this, type: 'Yes, I really want to remove read sure if [ "$sure" != "Yes, I really want to remove everything!" ]; then - echo "Good thing I asked, exiting" - exit 0 + echo "Good thing I asked, exiting" + exit 0 else - echo "Stop and remove matrix services" - for s in $(find /etc/systemd/system/ -name "matrix-*" -printf "%f\n"); do - systemctl stop $s - rm -f /etc/systemd/system/$s - done - systemctl daemon-reload - echo "Remove matrix cronjobs" - find /etc/cron.d/ -name "matrix-*" -delete - echo "Remove matrix scripts" - find /usr/local/bin/ -name "matrix-*" -delete - echo "Remove every docker images" - docker rmi $(docker images -aq) - echo "Remove docker matrix network" - docker network rm matrix - echo "Remove /matrix directory" - rm -fr /matrix - exit 0 + echo "Stop and remove matrix services" + for s in $(find /etc/systemd/system/ -name "matrix-*" -printf "%f\n"); do + systemctl stop $s + rm -f /etc/systemd/system/$s + done + systemctl daemon-reload + echo "Remove matrix cronjobs" + find /etc/cron.d/ -name "matrix-*" -delete + echo "Remove matrix scripts" + find /usr/local/bin/ -name "matrix-*" -delete + echo "Remove every docker images" + docker rmi $(docker images -aq) + echo "Remove docker matrix network" + docker network rm matrix + echo "Remove /matrix directory" + rm -fr /matrix + exit 0 fi diff --git a/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 b/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 index 967a4355..99172147 100644 --- a/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 +++ b/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 @@ -22,10 +22,10 @@ server { } server { - listen 443 ssl http2; - listen [::]:443 ssl http2; + listen 443 ssl http2; + listen [::]:443 ssl http2; - server_name {{ matrix_nginx_proxy_proxy_riot_hostname }}; + server_name {{ matrix_nginx_proxy_proxy_riot_hostname }}; server_tokens off; root /dev/null; @@ -39,7 +39,7 @@ server { ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; - location / { + location / { {% if matrix_nginx_proxy_enabled %} {# Use the embedded DNS resolver in Docker containers to discover the service #} resolver 127.0.0.11 valid=5s; @@ -52,5 +52,5 @@ server { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; - } + } } diff --git a/roles/matrix-postgres/templates/usr-local-bin/matrix-make-user-admin.j2 b/roles/matrix-postgres/templates/usr-local-bin/matrix-make-user-admin.j2 index 3e5b6ebe..7b8fba37 100644 --- a/roles/matrix-postgres/templates/usr-local-bin/matrix-make-user-admin.j2 +++ b/roles/matrix-postgres/templates/usr-local-bin/matrix-make-user-admin.j2 @@ -1,15 +1,14 @@ #!/bin/bash if [ $# -ne 1 ]; then - echo "Usage: "$0" " - exit 1 + echo "Usage: "$0" " + exit 1 fi docker run \ - -it \ - --rm \ - --env-file={{ matrix_postgres_base_path }}/env-postgres-psql \ - --network {{ matrix_docker_network }} \ - {{ matrix_postgres_docker_image_to_use }} \ - psql -h {{ matrix_postgres_connection_hostname }} -c "UPDATE users set admin=1 WHERE name like '@$1:{{ host_specific_hostname_identity }}'" - + -it \ + --rm \ + --env-file={{ matrix_postgres_base_path }}/env-postgres-psql \ + --network {{ matrix_docker_network }} \ + {{ matrix_postgres_docker_image_to_use }} \ + psql -h {{ matrix_postgres_connection_hostname }} -c "UPDATE users set admin=1 WHERE name like '@$1:{{ host_specific_hostname_identity }}'" diff --git a/roles/matrix-riot-web/templates/config.json.j2 b/roles/matrix-riot-web/templates/config.json.j2 index 05d9a442..9eec9e22 100644 --- a/roles/matrix-riot-web/templates/config.json.j2 +++ b/roles/matrix-riot-web/templates/config.json.j2 @@ -1,17 +1,17 @@ { - "default_hs_url": {{ matrix_riot_web_default_hs_url|to_json }}, - "default_is_url": {{ matrix_riot_web_default_is_url|to_json }}, - "disable_custom_urls": {{ matrix_riot_web_disable_custom_urls|to_json }}, - "disable_guests": {{ matrix_riot_web_disable_guests|to_json }}, - "brand": "Riot", - "integrations_ui_url": {{ matrix_riot_web_integrations_ui_url|to_json }}, - "integrations_rest_url": {{ matrix_riot_web_integrations_rest_url|to_json }}, - "integrations_widgets_urls": {{ matrix_riot_web_integrations_widgets_urls|to_json }}, - "integrations_jitsi_widget_url": {{ matrix_riot_web_integrations_jitsi_widget_url|to_json }}, - "bug_report_endpoint_url": "https://riot.im/bugreports/submit", - "enableLabs": true, - "roomDirectory": { - "servers": {{ matrix_riot_web_roomdir_servers|to_json }} - }, - "welcomeUserId": {{ matrix_riot_web_welcome_user_id|to_json }} + "default_hs_url": {{ matrix_riot_web_default_hs_url|to_json }}, + "default_is_url": {{ matrix_riot_web_default_is_url|to_json }}, + "disable_custom_urls": {{ matrix_riot_web_disable_custom_urls|to_json }}, + "disable_guests": {{ matrix_riot_web_disable_guests|to_json }}, + "brand": "Riot", + "integrations_ui_url": {{ matrix_riot_web_integrations_ui_url|to_json }}, + "integrations_rest_url": {{ matrix_riot_web_integrations_rest_url|to_json }}, + "integrations_widgets_urls": {{ matrix_riot_web_integrations_widgets_urls|to_json }}, + "integrations_jitsi_widget_url": {{ matrix_riot_web_integrations_jitsi_widget_url|to_json }}, + "bug_report_endpoint_url": "https://riot.im/bugreports/submit", + "enableLabs": true, + "roomDirectory": { + "servers": {{ matrix_riot_web_roomdir_servers|to_json }} + }, + "welcomeUserId": {{ matrix_riot_web_welcome_user_id|to_json }} } diff --git a/roles/matrix-synapse/templates/synapse/usr-local-bin/matrix-synapse-register-user.j2 b/roles/matrix-synapse/templates/synapse/usr-local-bin/matrix-synapse-register-user.j2 index d47addb6..f0846334 100644 --- a/roles/matrix-synapse/templates/synapse/usr-local-bin/matrix-synapse-register-user.j2 +++ b/roles/matrix-synapse/templates/synapse/usr-local-bin/matrix-synapse-register-user.j2 @@ -1,8 +1,8 @@ #!/bin/bash if [ $# -ne 3 ]; then - echo "Usage: "$0" " - exit 1 + echo "Usage: "$0" " + exit 1 fi user=$1 @@ -10,7 +10,7 @@ password=$2 admin=$3 if [ "$admin" -eq "1" ]; then - docker exec matrix-synapse register_new_matrix_user -u $user -p $password -c /data/homeserver.yaml --admin http://localhost:8008 + docker exec matrix-synapse register_new_matrix_user -u $user -p $password -c /data/homeserver.yaml --admin http://localhost:8008 else - docker exec matrix-synapse register_new_matrix_user -u $user -p $password -c /data/homeserver.yaml --no-admin http://localhost:8008 -fi \ No newline at end of file + docker exec matrix-synapse register_new_matrix_user -u $user -p $password -c /data/homeserver.yaml --no-admin http://localhost:8008 +fi