Switch matrix_synapse_container_additional_volumes from using -v to --mount

Depending on the `options` that people provide, this may break
compatibility.
This commit is contained in:
Slavi Pantaleev 2024-01-11 12:12:44 +02:00
parent c4d6144bb9
commit e5130372b9
3 changed files with 4 additions and 8 deletions

View File

@ -526,12 +526,8 @@ matrix_synapse_oidc_providers: []
# A list of additional "volumes" to mount in the container. # A list of additional "volumes" to mount in the container.
# This list gets populated dynamically based on Synapse extensions that have been enabled. # This list gets populated dynamically based on Synapse extensions that have been enabled.
# Contains definition objects like this: `{"src": "/outside", "dst": "/inside", "options": "rw|ro|slave|.."} # Contains definition objects like this: `{"src": "/outside", "dst": "/inside", "options": "ro"}
# # Note: internally, this uses the `--mount` flag for mounting the specified volumes.
# Note: internally, this uses the `-v` flag for mounting the specified volumes.
# It's better (safer) to use the `--mount` flag for mounting volumes.
# To use `--mount`, specify it in `matrix_synapse_container_extra_arguments`.
# Example: `matrix_synapse_container_extra_arguments: ['--mount type=bind,src=/outside,dst=/inside,ro']
matrix_synapse_container_additional_volumes: [] matrix_synapse_container_additional_volumes: []
# A list of additional loggers to register in synapse.log.config. # A list of additional loggers to register in synapse.log.config.

View File

@ -40,7 +40,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--mount type=bind,src={{ matrix_synapse_config_dir_path }},dst=/data,ro \ --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 \ --mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
{% for volume in matrix_synapse_container_additional_volumes %} {% for volume in matrix_synapse_container_additional_volumes %}
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \ --mount type={{ volume.type | default('bind' if '/' in volume.src else 'volume') }},src={{ volume.src }},dst={{ volume.dst }}{{ (',' + volume.options) if volume.options else '' }} \
{% endfor %} {% endfor %}
{% for arg in matrix_synapse_container_arguments %} {% for arg in matrix_synapse_container_arguments %}
{{ arg }} \ {{ arg }} \

View File

@ -58,7 +58,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \ --mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
--label-file={{ matrix_synapse_base_path }}/labels \ --label-file={{ matrix_synapse_base_path }}/labels \
{% for volume in matrix_synapse_container_additional_volumes %} {% for volume in matrix_synapse_container_additional_volumes %}
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \ --mount type={{ volume.type | default('bind' if '/' in volume.src else 'volume') }},src={{ volume.src }},dst={{ volume.dst }}{{ (',' + volume.options) if volume.options else '' }} \
{% endfor %} {% endfor %}
{% for arg in matrix_synapse_container_arguments %} {% for arg in matrix_synapse_container_arguments %}
{{ arg }} \ {{ arg }} \