add FluffyChat (#4068)
* add FluffyChat * capitalization * Update group_vars/matrix_servers Co-authored-by: Slavi Pantaleev <slavi@devture.com> * fix link in readme --------- Co-authored-by: Slavi Pantaleev <slavi@devture.com>
This commit is contained in:
46
roles/custom/matrix-client-fluffychat/templates/labels.j2
Normal file
46
roles/custom/matrix-client-fluffychat/templates/labels.j2
Normal file
@ -0,0 +1,46 @@
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_client_fluffychat_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.matrix-client-fluffychat.loadbalancer.server.port=8080
|
||||
|
||||
{% set middlewares = [] %}
|
||||
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.matrix-client-fluffychat-slashless-redirect.redirectregex.regex=({{ matrix_client_fluffychat_container_labels_traefik_path_prefix | quote }})$
|
||||
traefik.http.middlewares.matrix-client-fluffychat-slashless-redirect.redirectregex.replacement=${1}/
|
||||
{% set middlewares = middlewares + ['matrix-client-fluffychat-slashless-redirect'] %}
|
||||
{% endif %}
|
||||
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.matrix-client-fluffychat-strip-prefix.stripprefix.prefixes={{ matrix_client_fluffychat_container_labels_traefik_path_prefix }}
|
||||
{% set middlewares = middlewares + ['matrix-client-fluffychat-strip-prefix'] %}
|
||||
{% endif %}
|
||||
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
|
||||
{% for name, value in matrix_client_fluffychat_container_labels_traefik_additional_response_headers.items() %}
|
||||
traefik.http.middlewares.matrix-client-fluffychat-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
|
||||
{% endfor %}
|
||||
{% set middlewares = middlewares + ['matrix-client-fluffychat-add-headers'] %}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-client-fluffychat.rule={{ matrix_client_fluffychat_container_labels_traefik_rule }}
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.matrix-client-fluffychat.priority={{ matrix_client_fluffychat_container_labels_traefik_priority }}
|
||||
{% endif %}
|
||||
traefik.http.routers.matrix-client-fluffychat.service=matrix-client-fluffychat
|
||||
{% if middlewares | length > 0 %}
|
||||
traefik.http.routers.matrix-client-fluffychat.middlewares={{ middlewares | join(',') }}
|
||||
{% endif %}
|
||||
traefik.http.routers.matrix-client-fluffychat.entrypoints={{ matrix_client_fluffychat_container_labels_traefik_entrypoints }}
|
||||
traefik.http.routers.matrix-client-fluffychat.tls={{ matrix_client_fluffychat_container_labels_traefik_tls | to_json }}
|
||||
{% if matrix_client_fluffychat_container_labels_traefik_tls %}
|
||||
traefik.http.routers.matrix-client-fluffychat.tls.certResolver={{ matrix_client_fluffychat_container_labels_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{ matrix_client_fluffychat_container_labels_additional_labels }}
|
@ -0,0 +1,48 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=Matrix FluffyChat Web server
|
||||
{% for service in matrix_client_fluffychat_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-fluffychat 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-fluffychat 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name=matrix-client-fluffychat \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--read-only \
|
||||
--network={{ matrix_client_fluffychat_container_network }} \
|
||||
{% if matrix_client_fluffychat_container_http_host_bind_port %}
|
||||
-p {{ matrix_client_fluffychat_container_http_host_bind_port }}:8080 \
|
||||
{% endif %}
|
||||
--label-file={{ matrix_client_fluffychat_data_path }}/labels \
|
||||
--tmpfs=/tmp:rw,noexec,nosuid,size=10m \
|
||||
{% for arg in matrix_client_fluffychat_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_client_fluffychat_docker_image }}
|
||||
|
||||
{% for network in matrix_client_fluffychat_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-fluffychat
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-fluffychat
|
||||
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-fluffychat 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-fluffychat 2>/dev/null || true'
|
||||
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-client-fluffychat
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user