From cbb4a33b1282349f1d5b9fb75604a82513f4ed32 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: May 22 2017 20:36:59 +0000 Subject: Add attachments volume Signed-off-by: Patrick Uiterwijk --- diff --git a/docker-compose.yml b/docker-compose.yml index aa5ee9e..c2cabbd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ version: '3.2' volumes: repos: + attachments: services: web: build: @@ -17,6 +18,10 @@ services: source: repos target: /repos read_only: true + - type: volume + source: attachments + target: /attachments + read_only: false - .:/code worker: build: @@ -31,6 +36,10 @@ services: source: repos target: /repos read_only: false + - type: volume + source: attachments + target: /attachments + read_only: true - .:/code environment: - PYTHONPATH=. diff --git a/docker/web b/docker/web index 0d434e1..3f1d9e1 100644 --- a/docker/web +++ b/docker/web @@ -23,3 +23,4 @@ EXPOSE 5000 # Code injection is last to make optimal use of caches VOLUME ["/code"] # Openshift: COPY / /code +VOLUME ["/attachments"] diff --git a/docker/worker b/docker/worker index 98cd896..18072d3 100644 --- a/docker/worker +++ b/docker/worker @@ -21,5 +21,6 @@ ENTRYPOINT ["/usr/bin/celery", "-A", "pagure.lib.tasks", "worker", "--loglevel", # Code injection is last to make optimal use of caches VOLUME ["/code"] # Openshift: COPY / /code +VOLUME ["/attachments"] # Ideally this would run as non-root, but that needs the /repos owned correctly ENV C_FORCE_ROOT true diff --git a/openshift.cfg b/openshift.cfg index 8cdd73b..94e6544 100644 --- a/openshift.cfg +++ b/openshift.cfg @@ -9,3 +9,4 @@ DOCS_FOLDER = '/repos/docs' TICKETS_FOLDER = '/repos/tickets' REQUESTS_FOLDER = '/repos/requests' REMOTE_GIT_FOLDER = '/repos/remote' +ATTACHMENTS_FOLDER = '/attachments' diff --git a/pagure/default_config.py b/pagure/default_config.py index d4e3dc5..56bae2d 100644 --- a/pagure/default_config.py +++ b/pagure/default_config.py @@ -126,6 +126,13 @@ REMOTE_GIT_FOLDER = os.path.join( 'remotes' ) +# Folder containing attachments +ATTACHMENTS_FOLDER = os.path.join( + os.path.abspath(os.path.dirname(__file__)), + '..', + 'attachments' +) + # Whether to enable scanning for viruses in attachments VIRUS_SCAN_ATTACHMENTS = False