2022-06-23 18:24:52 +00:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
|
|
|
[Unit]
|
|
|
|
Description=Maubot
|
2022-06-23 19:57:52 +00:00
|
|
|
{% for service in matrix_bot_maubot_systemd_required_services_list %}
|
2022-06-23 18:24:52 +00:00
|
|
|
Requires={{ service }}
|
|
|
|
After={{ service }}
|
|
|
|
{% endfor %}
|
2022-06-23 19:57:52 +00:00
|
|
|
{% for service in matrix_bot_maubot_systemd_wanted_services_list %}
|
2022-06-23 18:24:52 +00:00
|
|
|
Wants={{ service }}
|
|
|
|
{% endfor %}
|
|
|
|
DefaultDependencies=no
|
|
|
|
|
|
|
|
[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-bot-maubot 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-bot-maubot 2>/dev/null || true'
|
2022-06-23 18:24:52 +00:00
|
|
|
|
2022-11-04 14:39:35 +00:00
|
|
|
ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-bot-maubot \
|
2022-07-11 23:22:20 +00:00
|
|
|
--log-driver=none \
|
|
|
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
|
|
|
--read-only \
|
|
|
|
--cap-drop=ALL \
|
2022-07-20 09:48:12 +00:00
|
|
|
--mount type=bind,src={{ matrix_bot_maubot_config_path }},dst=/config,ro \
|
|
|
|
--mount type=bind,src={{ matrix_bot_maubot_data_path }},dst=/data \
|
2022-07-11 23:22:20 +00:00
|
|
|
{% for arg in matrix_bot_maubot_container_extra_arguments %}
|
|
|
|
{{ arg }} \
|
|
|
|
{% endfor %}
|
|
|
|
--network={{ matrix_docker_network }} \
|
2022-07-20 09:50:00 +00:00
|
|
|
{% if matrix_bot_maubot_management_interface_http_bind_port %}
|
2022-08-05 17:02:01 +00:00
|
|
|
-p {{ matrix_bot_maubot_management_interface_http_bind_port }}:{{ matrix_bot_maubot_management_interface_port }} \
|
2022-07-20 09:50:00 +00:00
|
|
|
{% endif %}
|
2022-07-11 23:22:20 +00:00
|
|
|
{{ matrix_bot_maubot_docker_image }} \
|
2022-08-04 09:18:12 +00:00
|
|
|
python3 -m maubot -c /config/config.yaml --no-update
|
2022-06-23 18:24:52 +00:00
|
|
|
|
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-bot-maubot 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-bot-maubot 2>/dev/null || true'
|
2022-06-23 18:24:52 +00:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2022-06-24 15:54:57 +00:00
|
|
|
SyslogIdentifier=matrix-bot-maubot
|
2022-06-23 18:24:52 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|