From 841a690499c4259d28f04e70dd531d2c3071f684 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 13 Nov 2024 09:21:58 -0800 Subject: [PATCH] synapse container: dynamically find python path --- containers/synapse/Containerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/containers/synapse/Containerfile b/containers/synapse/Containerfile index da94da1..3c7060a 100644 --- a/containers/synapse/Containerfile +++ b/containers/synapse/Containerfile @@ -1,4 +1,6 @@ FROM matrixdotorg/synapse:v1.118.0 RUN pip install boto3 humanize tqdm -RUN curl -Lo /usr/local/lib/python3.11/site-packages/s3_storage_provider.py https://github.com/matrix-org/synapse-s3-storage-provider/raw/v1.4.0/s3_storage_provider.py +# there is probably a better way to figure out where the site packages are +# this used to be hard coded to /usr/local/lib/python3.11/site-packages but then synapse updated it's minor python version and it broke +RUN curl -Lo $(python -c 'import sys; print([x for x in sys.path if "site-packages" in x][0])')/s3_storage_provider.py https://github.com/matrix-org/synapse-s3-storage-provider/raw/v1.4.0/s3_storage_provider.py RUN curl -L https://github.com/matrix-org/synapse-s3-storage-provider/raw/main/scripts/s3_media_upload | sed "s#/usr/bin/env python#/usr/local/bin/python#" > /usr/local/bin/s3_media_upload && chmod +x /usr/local/bin/s3_media_upload