2022-08-04 03:07:42 +00:00
|
|
|
|
#jinja2: lstrip_blocks: "True"
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=Conduit Matrix homeserver
|
2022-08-04 17:36:13 +00:00
|
|
|
|
{% for service in matrix_conduit_systemd_required_services_list %}
|
|
|
|
|
Requires={{ service }}
|
|
|
|
|
After={{ service }}
|
|
|
|
|
{% endfor %}
|
2022-08-04 03:07:42 +00:00
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=simple
|
2022-11-04 14:37:47 +00:00
|
|
|
|
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
2023-12-06 09:52:23 +00:00
|
|
|
|
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-conduit 2>/dev/null || true'
|
2022-11-04 14:40:25 +00:00
|
|
|
|
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
|
2022-08-04 03:07:42 +00:00
|
|
|
|
|
2023-02-26 20:08:08 +00:00
|
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
|
|
|
|
--rm \
|
|
|
|
|
--name=matrix-conduit \
|
2022-08-04 03:07:42 +00:00
|
|
|
|
--log-driver=none \
|
|
|
|
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
|
|
|
|
--cap-drop=ALL \
|
|
|
|
|
--read-only \
|
|
|
|
|
--tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_conduit_tmp_directory_size_mb }}m \
|
2023-02-26 20:08:08 +00:00
|
|
|
|
--network={{ matrix_conduit_container_network }} \
|
2022-08-04 18:16:32 +00:00
|
|
|
|
--env CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml \
|
2024-01-11 06:56:51 +00:00
|
|
|
|
--label-file={{ matrix_conduit_base_path }}/labels \
|
2022-08-04 18:25:18 +00:00
|
|
|
|
--mount type=bind,src={{ matrix_conduit_data_path }},dst=/var/lib/matrix-conduit \
|
|
|
|
|
--mount type=bind,src={{ matrix_conduit_config_path }},dst=/etc/matrix-conduit,ro \
|
2022-08-04 03:07:42 +00:00
|
|
|
|
{% for arg in matrix_conduit_container_extra_arguments %}
|
|
|
|
|
{{ arg }} \
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{{ matrix_conduit_docker_image }}
|
|
|
|
|
|
2023-02-26 20:08:08 +00:00
|
|
|
|
{% for network in matrix_conduit_container_additional_networks %}
|
|
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-conduit
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-conduit
|
|
|
|
|
|
2024-01-12 10:45:18 +00:00
|
|
|
|
# Intentional delay, so that the homeserver can manage to start and various services
|
|
|
|
|
# that depend on it (After/Requires) may only start after the homeserver is up and running.
|
|
|
|
|
ExecStartPost=-{{ matrix_host_command_sleep }} 3
|
|
|
|
|
|
2023-12-06 09:52:23 +00:00
|
|
|
|
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-conduit 2>/dev/null || true'
|
2022-11-04 14:40:25 +00:00
|
|
|
|
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
|
2022-11-04 14:39:35 +00:00
|
|
|
|
ExecReload={{ devture_systemd_docker_base_host_command_docker }} exec matrix-conduit /bin/sh -c 'kill -HUP 1'
|
2022-08-04 03:07:42 +00:00
|
|
|
|
Restart=always
|
|
|
|
|
RestartSec=30
|
|
|
|
|
SyslogIdentifier=matrix-conduit
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|