Use http for the fake GCS server

This commit is contained in:
Simon Detheridge 2020-03-04 17:01:20 +00:00
parent 30114cd79b
commit 3bb956b38e
5 changed files with 9 additions and 5 deletions

View file

@ -19,6 +19,9 @@ if (settings.filestore.gcs && settings.filestore.gcs.apiEndpoint) {
request: function(reqOpts) {
const url = new URL(reqOpts.uri)
url.host = settings.filestore.gcs.apiEndpoint
if (settings.filestore.gcs.apiScheme) {
url.protocol = settings.filestore.gcs.apiScheme
}
reqOpts.uri = url.toString()
return reqOpts
}

View file

@ -34,11 +34,11 @@ services:
AWS_SECRET_ACCESS_KEY: fake
AWS_S3_PATH_STYLE: 'true'
GCS_API_ENDPOINT: gcs:9090
GCS_API_SCHEME: http
GCS_USER_FILES_BUCKET_NAME: fake_userfiles
GCS_TEMPLATE_FILES_BUCKET_NAME: fake_templatefiles
GCS_PUBLIC_FILES_BUCKET_NAME: fake_publicfiles
NODE_TLS_REJECT_UNAUTHORIZED: 0
STORAGE_EMULATOR_HOST: https://gcs:9090/storage/v1
STORAGE_EMULATOR_HOST: http://gcs:9090/storage/v1
depends_on:
s3:
condition: service_healthy

View file

@ -44,11 +44,11 @@ services:
AWS_ACCESS_KEY_ID: fake
AWS_SECRET_ACCESS_KEY: fake
GCS_API_ENDPOINT: gcs:9090
GCS_API_SCHEME: http
GCS_USER_FILES_BUCKET_NAME: fake_userfiles
GCS_TEMPLATE_FILES_BUCKET_NAME: fake_templatefiles
GCS_PUBLIC_FILES_BUCKET_NAME: fake_publicfiles
NODE_TLS_REJECT_UNAUTHORIZED: 0
STORAGE_EMULATOR_HOST: https://gcs:9090/storage/v1
STORAGE_EMULATOR_HOST: http://gcs:9090/storage/v1
user: node
depends_on:
s3:

View file

@ -2,4 +2,4 @@ FROM fsouza/fake-gcs-server
RUN apk add --update --no-cache curl
COPY healthcheck.sh /healthcheck.sh
HEALTHCHECK --interval=1s --timeout=1s --retries=30 CMD /healthcheck.sh http://localhost:9090
CMD ["--port=9090"]
CMD ["--port=9090", "--scheme=http"]

View file

@ -22,6 +22,7 @@ function s3Stores() {
function gcsConfig() {
return {
apiEndpoint: process.env.GCS_API_ENDPOINT,
apiScheme: process.env.GCS_API_SCHEME,
projectId: 'fake'
}
}