2019-05-07 19:23:35 +00:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2019-03-07 05:22:08 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Matrix Dimension
|
2020-12-14 18:31:07 +00:00
|
|
|
{% for service in matrix_dimension_systemd_required_services_list %}
|
|
|
|
Requires={{ service }}
|
|
|
|
After={{ service }}
|
|
|
|
{% endfor %}
|
|
|
|
{% for service in matrix_dimension_systemd_wanted_services_list %}
|
|
|
|
Wants={{ service }}
|
|
|
|
{% endfor %}
|
2020-12-10 09:36:39 +00:00
|
|
|
DefaultDependencies=no
|
2019-03-07 05:22:08 +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-dimension 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-dimension 2>/dev/null || true'
|
2019-05-16 00:41:45 +00:00
|
|
|
|
2020-05-06 08:28:09 +00:00
|
|
|
# Fixup database ownership if it got changed somehow (during a server migration, etc.)
|
2020-12-14 19:01:47 +00:00
|
|
|
{% if matrix_dimension_database_engine == 'sqlite' %}
|
|
|
|
ExecStartPre=-{{ matrix_host_command_chown }} {{ matrix_dimension_user_uid }}:{{ matrix_dimension_user_gid }} {{ matrix_dimension_sqlite_database_path_local }}
|
|
|
|
{% endif %}
|
2020-05-06 08:28:09 +00:00
|
|
|
|
2023-02-26 21:06:36 +00:00
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
|
|
|
--rm \
|
|
|
|
--name=matrix-dimension \
|
2019-03-07 05:22:08 +00:00
|
|
|
--log-driver=none \
|
2019-03-08 13:00:53 +00:00
|
|
|
--user={{ matrix_dimension_user_uid }}:{{ matrix_dimension_user_gid }} \
|
2019-03-07 05:22:08 +00:00
|
|
|
--cap-drop=ALL \
|
2023-02-26 21:06:36 +00:00
|
|
|
--network={{ matrix_dimension_container_network }} \
|
2019-03-12 10:17:12 +00:00
|
|
|
{% if matrix_dimension_widgets_allow_self_signed_ssl_certificates %}
|
|
|
|
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
|
|
|
|
{% endif %}
|
2019-05-24 22:41:04 +00:00
|
|
|
{% if matrix_dimension_container_http_host_bind_port %}
|
|
|
|
-p {{ matrix_dimension_container_http_host_bind_port }}:8184 \
|
2019-03-08 13:00:53 +00:00
|
|
|
{% endif %}
|
2023-02-26 21:06:36 +00:00
|
|
|
--label-file={{ matrix_dimension_base_path }}/labels \
|
2020-11-24 08:15:12 +00:00
|
|
|
--mount type=bind,src={{ matrix_dimension_base_path }},dst=/data \
|
2019-04-30 14:35:18 +00:00
|
|
|
{% for arg in matrix_dimension_container_extra_arguments %}
|
|
|
|
{{ arg }} \
|
|
|
|
{% endfor %}
|
2019-03-07 05:22:08 +00:00
|
|
|
{{ matrix_dimension_docker_image }}
|
2019-05-16 00:41:45 +00:00
|
|
|
|
2023-02-26 21:06:36 +00:00
|
|
|
{% for network in matrix_dimension_container_additional_networks %}
|
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-dimension
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-dimension
|
|
|
|
|
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-dimension 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-dimension 2>/dev/null || true'
|
2023-02-26 21:06:36 +00:00
|
|
|
|
2019-03-07 05:22:08 +00:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2019-05-16 00:41:45 +00:00
|
|
|
SyslogIdentifier=matrix-dimension
|
2019-03-07 05:22:08 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|