Skip to content

Commit

Permalink
Fixed matrix-appservice-slack docker command problems
Browse files Browse the repository at this point in the history
  • Loading branch information
kingoftheconnors committed Jul 27, 2019
1 parent 49766c5 commit 177ec29
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions group_vars/matrix_servers
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ matrix_appservice_discord_homeserver_token: "{{ matrix_synapse_macaroon_secret_k
# We don't enable bridges by default.
matrix_appservice_slack_enabled: false

# Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-slack over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# matrix-appservice-slack's client-server port to the local host.
matrix_appservice_slack_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:{{ matrix_appservice_slack_slack_port }}' }}"

matrix_appservice_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack-appservice-token') | to_uuid }}"

matrix_appservice_slack_homeserver_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack-homeserver-token') | to_uuid }}"
Expand Down
2 changes: 2 additions & 0 deletions roles/matrix-bridge-appservice-slack/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ matrix_appservice_slack_user_prefix: 'slack_'
matrix_appservice_slack_matrix_port: 9004
matrix_appservice_slack_slack_port: 9003

# Controls whether the appservice-slack container exposes its HTTP port (tcp/9003 in the container).
#
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose.
matrix_appservice_slack_container_http_host_bind_port: ''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@ ExecStartPre=/bin/sleep 5

ExecStart=/usr/bin/docker run --rm --name matrix-appservice-slack \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--network={{ matrix_docker_network }} \
{% if matrix_appservice_slack_container_http_host_bind_port %}
-p {{ matrix_appservice_slack_container_http_host_bind_port }}:{{matrix_appservice_slack_slack_port}} \
{% endif %}
-v {{ matrix_appservice_slack_config_path }}:/config:z \
-v {{ matrix_appservice_slack_data_path }}:/data:z \
{% for arg in matrix_appservice_slack_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_appservice_slack_docker_image }} \
node app.js -c /config/config.yaml -f /config/slack-registration.yaml -p {{matrix_appservice_slack_matrix_port}}
node app.js -p {{matrix_appservice_slack_matrix_port}} -c /config/config.yaml -f /config/slack-registration.yaml

ExecStop=-/usr/bin/docker kill matrix-appservice-slack
ExecStop=-/usr/bin/docker rm matrix-appservice-slack
Expand Down

0 comments on commit 177ec29

Please sign in to comment.