Quellcode durchsuchen

more polychat appservice tweaks

pull/3257/head
Yan Minagawa vor 2 Jahren
Ursprung
Commit
81277e29aa
4 geänderte Dateien mit 37 neuen und 13 gelöschten Zeilen
  1. +1
    -1
      group_vars/matrix_servers
  2. +26
    -9
      roles/custom/matrix-bridge-appservice-polychat/defaults/main.yml
  3. +8
    -1
      roles/custom/matrix-bridge-appservice-polychat/tasks/setup_install.yml
  4. +2
    -2
      roles/custom/matrix-bridge-appservice-polychat/templates/systemd/matrix-appservice-polychat.service.j2

+ 1
- 1
group_vars/matrix_servers Datei anzeigen

@@ -79,7 +79,7 @@ matrix_homeserver_container_extra_arguments_auto: |
+ +
(['--mount type=bind,src=' + matrix_appservice_webhooks_config_path + '/webhooks-registration.yaml,dst=/matrix-appservice-webhooks-registration.yaml,ro'] if matrix_appservice_webhooks_enabled else []) (['--mount type=bind,src=' + matrix_appservice_webhooks_config_path + '/webhooks-registration.yaml,dst=/matrix-appservice-webhooks-registration.yaml,ro'] if matrix_appservice_webhooks_enabled else [])
+ +
(['--mount type=bind,src=' + matrix_appservice_polychat_config_path + '/polychat-registration.yaml,dst=/matrix-appservice-polychat-registration.yaml,ro'] if matrix_appservice_polychat_enabled else [])
(['--mount type=bind,src=' + matrix_appservice_polychat_config_path + '/registration.yaml,dst=/matrix-appservice-polychat-registration.yaml,ro'] if matrix_appservice_polychat_enabled else [])
+ +
(['--mount type=bind,src=' + matrix_beeper_linkedin_config_path + '/registration.yaml,dst=/matrix-beeper-linkedin-registration.yaml,ro'] if matrix_beeper_linkedin_enabled else []) (['--mount type=bind,src=' + matrix_beeper_linkedin_config_path + '/registration.yaml,dst=/matrix-beeper-linkedin-registration.yaml,ro'] if matrix_beeper_linkedin_enabled else [])
+ +


+ 26
- 9
roles/custom/matrix-bridge-appservice-polychat/defaults/main.yml Datei anzeigen

@@ -13,9 +13,16 @@ matrix_appservice_polychat_container_image_self_build_repo: "https://github.com/
matrix_appservice_polychat_container_image_self_build_repo_version: "{{ 'master' if matrix_appservice_polychat_version == 'latest' else matrix_appservice_polychat_version }}" matrix_appservice_polychat_container_image_self_build_repo_version: "{{ 'master' if matrix_appservice_polychat_version == 'latest' else matrix_appservice_polychat_version }}"
matrix_appservice_polychat_container_image_self_build_repo_dockerfile_path: "Dockerfile" matrix_appservice_polychat_container_image_self_build_repo_dockerfile_path: "Dockerfile"


matrix_appservice_polychat_version: v1.0.3-01

matrix_appservice_polychat_docker_login_registry: "{{ matrix_appservice_polychat_registry_prefix }}"
matrix_appservice_polychat_docker_login_username: "{{ vault_matrix_appservice_polychat_docker_login_username }}"
matrix_appservice_polychat_docker_login_password: "{{ vault_matrix_appservice_polychat_docker_login_password }}"

matrix_appservice_polychat_version: main
matrix_appservice_polychat_registry_prefix: ghcr.io/
matrix_appservice_polychat_docker_image: "{{ matrix_appservice_polychat_docker_image_name_prefix }}polychatproject/polychat-appservice:{{ matrix_appservice_polychat_version }}" matrix_appservice_polychat_docker_image: "{{ matrix_appservice_polychat_docker_image_name_prefix }}polychatproject/polychat-appservice:{{ matrix_appservice_polychat_version }}"
matrix_appservice_polychat_docker_image_name_prefix: "{{ 'localhost/' if matrix_appservice_polychat_container_image_self_build else matrix_container_global_registry_prefix }}"
matrix_appservice_polychat_docker_image_name_prefix: "{{ 'localhost/' if matrix_appservice_polychat_container_image_self_build else matrix_appservice_polychat_registry_prefix }}"
matrix_appservice_polychat_docker_image_force_pull: "{{ matrix_appservice_polychat_docker_image.endswith(':latest') }}" matrix_appservice_polychat_docker_image_force_pull: "{{ matrix_appservice_polychat_docker_image.endswith(':latest') }}"


matrix_appservice_polychat_base_path: "{{ matrix_base_data_path }}/appservice-polychat" matrix_appservice_polychat_base_path: "{{ matrix_base_data_path }}/appservice-polychat"
@@ -31,12 +38,12 @@ matrix_appservice_polychat_bot_name: 'webhookbot'
matrix_appservice_polychat_user_prefix: '_webhook_' matrix_appservice_polychat_user_prefix: '_webhook_'


# Controls the polychat_PORT and MATRIX_PORT of the installation # Controls the polychat_PORT and MATRIX_PORT of the installation
matrix_appservice_polychat_matrix_port: 6789
matrix_appservice_polychat_matrix_port: 9999


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


matrix_appservice_polychat_container_network: "" matrix_appservice_polychat_container_network: ""


@@ -73,7 +80,15 @@ matrix_appservice_polychat_container_labels_public_endpoint_traefik_tls_certReso
matrix_appservice_polychat_container_labels_additional_labels: '' matrix_appservice_polychat_container_labels_additional_labels: ''


# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_appservice_polychat_container_extra_arguments: []
matrix_appservice_polychat_container_extra_arguments:
- "-e API_BIND_ADDRESS=0.0.0.0"
- "-e API_PORT=9998"
- "-e APPSERVICE_BIND_ADDRESS=127.0.0.1"
- "-e APPSERVICE_PORT=9999"
- "-e DEBUG_MXID=@testuser:polychat.de"
- "-e HOMESERVER_NAME={{ matrix_domain }}"
- "-e HOMESERVER_URL={{ matrix_homeserver_url }}"



# List of systemd services that matrix-appservice-polychat.service depends on. # List of systemd services that matrix-appservice-polychat.service depends on.
matrix_appservice_polychat_systemd_required_services_list: "{{ matrix_appservice_polychat_systemd_required_services_list_default + matrix_appservice_polychat_systemd_required_services_list_auto + matrix_appservice_polychat_systemd_required_services_list_custom }}" matrix_appservice_polychat_systemd_required_services_list: "{{ matrix_appservice_polychat_systemd_required_services_list_default + matrix_appservice_polychat_systemd_required_services_list_auto + matrix_appservice_polychat_systemd_required_services_list_custom }}"
@@ -112,13 +127,15 @@ matrix_appservice_polychat_registration_yaml: |
as_token: "{{ matrix_appservice_polychat_appservice_token }}" as_token: "{{ matrix_appservice_polychat_appservice_token }}"
namespaces: namespaces:
users: users:
- exclusive: false
regex: '@polychat_*'
aliases:
- exclusive: true - exclusive: true
regex: '^@{{ matrix_appservice_polychat_user_prefix | regex_escape }}.*:{{ matrix_domain | regex_escape }}$'
aliases: []
rooms: []
regex: '#polychat_*'
url: "{{ matrix_appservice_polychat_appservice_url }}:{{ matrix_appservice_polychat_matrix_port }}" url: "{{ matrix_appservice_polychat_appservice_url }}:{{ matrix_appservice_polychat_matrix_port }}"
sender_localpart: _webhook
sender_localpart: polychat
rate_limited: false rate_limited: false
protocols: null protocols: null


matrix_appservice_polychat_registration: "{{ matrix_appservice_polychat_registration_yaml | from_yaml }}" matrix_appservice_polychat_registration: "{{ matrix_appservice_polychat_registration_yaml | from_yaml }}"


+ 8
- 1
roles/custom/matrix-bridge-appservice-polychat/tasks/setup_install.yml Datei anzeigen

@@ -14,6 +14,13 @@
- {path: "{{ matrix_appservice_polychat_docker_src_files_path }}", when: "{{ matrix_appservice_polychat_container_image_self_build }}"} - {path: "{{ matrix_appservice_polychat_docker_src_files_path }}", when: "{{ matrix_appservice_polychat_container_image_self_build }}"}
when: "item.when | bool" when: "item.when | bool"


- name: Log into private registry and force re-authorization
docker_login:
registry: "{{ matrix_appservice_polychat_docker_login_registry }}"
username: "{{ matrix_appservice_polychat_docker_login_username }}"
password: "{{ matrix_appservice_polychat_docker_login_password }}"
reauthorize: yes

- name: Ensure matrix-appservice-polychat container image is pulled - name: Ensure matrix-appservice-polychat container image is pulled
community.docker.docker_image: community.docker.docker_image:
name: "{{ matrix_appservice_polychat_docker_image }}" name: "{{ matrix_appservice_polychat_docker_image }}"
@@ -76,7 +83,7 @@
- name: Ensure appservice-polychat registration.yaml installed - name: Ensure appservice-polychat registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_polychat_registration | to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_polychat_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_polychat_config_path }}/polychat-registration.yaml"
dest: "{{ matrix_appservice_polychat_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}" group: "{{ matrix_user_groupname }}"


roles/custom/matrix-bridge-appservice-polychat/templates/systemd/matrix-appservice-webhooks.service.j2 → roles/custom/matrix-bridge-appservice-polychat/templates/systemd/matrix-appservice-polychat.service.j2 Datei anzeigen

@@ -32,8 +32,8 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
{% for arg in matrix_appservice_polychat_container_extra_arguments %} {% for arg in matrix_appservice_polychat_container_extra_arguments %}
{{ arg }} \ {{ arg }} \
{% endfor %} {% endfor %}
{{ matrix_appservice_polychat_docker_image }} \
node index.js -p {{ matrix_appservice_polychat_matrix_port }} -c /config/config.yaml -f /config/polychat-registration.yaml
{{ matrix_appservice_polychat_docker_image }}


{% for network in matrix_appservice_polychat_container_additional_networks %} {% for network in matrix_appservice_polychat_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-polychat ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-polychat

Laden…
Abbrechen
Speichern