From dc5b0cb0e16b88c9bb2ad6696a23e6a28ea25cdd Mon Sep 17 00:00:00 2001 From: Jean LELIEVRE Date: Mon, 25 Mar 2019 20:53:56 +0100 Subject: [PATCH] handle s3rver cors option --- README.md | 2 ++ launch_server.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d52849..b733099 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ config.vm.define "s3" do |s3| d.image = "jean553/docker-s3-server-dev" d.env = { "S3_BUCKET_NAME" => "MyBucketName", + "CORS_CONF_PATH" => "config/cors-config.xml" } end + config.vm.synced_folder "config/", "/config" end ``` diff --git a/launch_server.sh b/launch_server.sh index 758aae8..12378c5 100644 --- a/launch_server.sh +++ b/launch_server.sh @@ -1,7 +1,15 @@ #!/usr/bin/env bash +# build the s3rver command +COMMAND="s3rver --hostname 0.0.0.0 --port 5000 --directory /tmp" +if [ -n ${CORS_CONF_PATH} ] +then + COMMAND="$COMMAND --cors $CORS_CONF_PATH" +fi +COMMAND="$COMMAND &" + # Launch the local S3 server -s3rver --hostname 0.0.0.0 --port 5000 --directory /tmp & +$COMMAND # Wait 2 seconds to give the server the time to be up sleep 2