You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.5 KiB
75 lines
3.5 KiB
6 years ago
|
#jinja2: lstrip_blocks: "True"
|
||
7 years ago
|
[Unit]
|
||
6 years ago
|
Description=Synapse server
|
||
6 years ago
|
{% for service in matrix_synapse_systemd_required_services_list %}
|
||
|
Requires={{ service }}
|
||
|
After={{ service }}
|
||
4 years ago
|
|
||
6 years ago
|
{% endfor %}
|
||
|
{% for service in matrix_synapse_systemd_wanted_services_list %}
|
||
|
Wants={{ service }}
|
||
|
{% endfor %}
|
||
4 years ago
|
|
||
|
{% if matrix_synapse_workers_enabled %}
|
||
|
{% for matrix_synapse_worker_details in matrix_synapse_workers_enabled_list %}
|
||
2 years ago
|
Wants={{ matrix_synapse_worker_details.name }}.service
|
||
4 years ago
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
|
||
4 years ago
|
DefaultDependencies=no
|
||
7 years ago
|
|
||
|
[Service]
|
||
|
Type=simple
|
||
4 years ago
|
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||
3 years ago
|
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-synapse 2>/dev/null || true'
|
||
|
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-synapse 2>/dev/null || true'
|
||
7 years ago
|
{% if matrix_s3_media_store_enabled %}
|
||
|
# Allow for some time before starting, so that media store can mount.
|
||
|
# Mounting can happen later too, but if we start writing,
|
||
|
# we'd write files to the local filesystem and fusermount will complain.
|
||
5 years ago
|
ExecStartPre={{ matrix_host_command_sleep }} 3
|
||
7 years ago
|
{% endif %}
|
||
6 years ago
|
|
||
5 years ago
|
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-synapse \
|
||
6 years ago
|
--log-driver=none \
|
||
6 years ago
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||
6 years ago
|
--cap-drop=ALL \
|
||
6 years ago
|
--read-only \
|
||
|
--tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_synapse_tmp_directory_size_mb }}m \
|
||
6 years ago
|
--network={{ matrix_docker_network }} \
|
||
6 years ago
|
{% if matrix_synapse_container_client_api_host_bind_port %}
|
||
3 years ago
|
-p {{ matrix_synapse_container_client_api_host_bind_port }}:{{ matrix_synapse_container_client_api_port }} \
|
||
6 years ago
|
{% endif %}
|
||
6 years ago
|
{% if matrix_synapse_federation_enabled and matrix_synapse_tls_federation_listener_enabled and matrix_synapse_container_federation_api_tls_host_bind_port %}
|
||
3 years ago
|
-p {{ matrix_synapse_container_federation_api_tls_host_bind_port }}:{{ matrix_synapse_container_federation_api_tls_port }} \
|
||
6 years ago
|
{% endif %}
|
||
3 years ago
|
{% if matrix_synapse_federation_enabled and matrix_synapse_federation_port_enabled and matrix_synapse_container_federation_api_plain_host_bind_port %}
|
||
3 years ago
|
-p {{ matrix_synapse_container_federation_api_plain_host_bind_port }}:{{ matrix_synapse_container_federation_api_plain_port }} \
|
||
7 years ago
|
{% endif %}
|
||
6 years ago
|
{% if matrix_synapse_metrics_enabled and matrix_synapse_container_metrics_api_host_bind_port %}
|
||
|
-p {{ matrix_synapse_container_metrics_api_host_bind_port }}:{{ matrix_synapse_metrics_port }} \
|
||
6 years ago
|
{% endif %}
|
||
5 years ago
|
{% if matrix_synapse_manhole_enabled and matrix_synapse_container_manhole_api_host_bind_port %}
|
||
|
-p {{ matrix_synapse_container_manhole_api_host_bind_port }}:9000 \
|
||
|
{% endif %}
|
||
4 years ago
|
--mount type=bind,src={{ matrix_synapse_config_dir_path }},dst=/data,ro \
|
||
|
--mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
|
||
6 years ago
|
{% for volume in matrix_synapse_container_additional_volumes %}
|
||
|
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
|
||
|
{% endfor %}
|
||
2 years ago
|
{% for arg in matrix_synapse_container_arguments %}
|
||
6 years ago
|
{{ arg }} \
|
||
|
{% endfor %}
|
||
2 years ago
|
{{ matrix_synapse_docker_image_final }} \
|
||
4 years ago
|
run -m synapse.app.homeserver -c /data/homeserver.yaml
|
||
6 years ago
|
|
||
3 years ago
|
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-synapse 2>/dev/null || true'
|
||
|
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-synapse 2>/dev/null || true'
|
||
4 years ago
|
ExecReload={{ matrix_host_command_docker }} exec matrix-synapse /bin/sh -c 'kill -HUP 1'
|
||
7 years ago
|
Restart=always
|
||
|
RestartSec=30
|
||
6 years ago
|
SyslogIdentifier=matrix-synapse
|
||
7 years ago
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|