Преглед изворни кода

Indent (non-YAML) using tabs

Fixes #83 (Github issue)
pull/84/head
Slavi Pantaleev пре 7 година
родитељ
комит
1a80058a2a
5 измењених фајлова са 54 додато и 55 уклоњено
  1. +21
    -21
      roles/matrix-base/templates/usr-local-bin/matrix-remove-all.j2
  2. +5
    -5
      roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2
  3. +8
    -9
      roles/matrix-postgres/templates/usr-local-bin/matrix-make-user-admin.j2
  4. +15
    -15
      roles/matrix-riot-web/templates/config.json.j2
  5. +5
    -5
      roles/matrix-synapse/templates/synapse/usr-local-bin/matrix-synapse-register-user.j2

+ 21
- 21
roles/matrix-base/templates/usr-local-bin/matrix-remove-all.j2 Прегледај датотеку

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash


if [ "$(id -u)" != "0" ]; then 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 fi


echo "WARNING! You are about to remove everything the playbook installs for matrix.{{ host_specific_hostname_identity }}: matrix, docker images,..." 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 read sure


if [ "$sure" != "Yes, I really want to remove everything!" ]; then 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 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 fi



+ 5
- 5
roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 Прегледај датотеку

@@ -22,10 +22,10 @@ server {
} }


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; server_tokens off;
root /dev/null; root /dev/null;
@@ -39,7 +39,7 @@ server {
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";


location / {
location / {
{% if matrix_nginx_proxy_enabled %} {% if matrix_nginx_proxy_enabled %}
{# Use the embedded DNS resolver in Docker containers to discover the service #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
@@ -52,5 +52,5 @@ server {


proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
}
}
} }

+ 8
- 9
roles/matrix-postgres/templates/usr-local-bin/matrix-make-user-admin.j2 Прегледај датотеку

@@ -1,15 +1,14 @@
#!/bin/bash #!/bin/bash


if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo "Usage: "$0" <username>"
exit 1
echo "Usage: "$0" <username>"
exit 1
fi fi


docker run \ 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 }}'"

+ 15
- 15
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 }}
} }

+ 5
- 5
roles/matrix-synapse/templates/synapse/usr-local-bin/matrix-synapse-register-user.j2 Прегледај датотеку

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash


if [ $# -ne 3 ]; then if [ $# -ne 3 ]; then
echo "Usage: "$0" <username> <password> <admin access: 0 or 1>"
exit 1
echo "Usage: "$0" <username> <password> <admin access: 0 or 1>"
exit 1
fi fi


user=$1 user=$1
@@ -10,7 +10,7 @@ password=$2
admin=$3 admin=$3


if [ "$admin" -eq "1" ]; then 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 else
docker exec matrix-synapse register_new_matrix_user -u $user -p $password -c /data/homeserver.yaml --no-admin http://localhost:8008
fi
docker exec matrix-synapse register_new_matrix_user -u $user -p $password -c /data/homeserver.yaml --no-admin http://localhost:8008
fi

Loading…
Откажи
Сачувај