From 966b476d3640a78ebcee5f79c6f63b2fe82c8980 Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Thu, 30 Mar 2017 11:04:09 +0800 Subject: [PATCH] mount ca dir to container, fix #1829 --- .travis.yml | 4 ++-- make/dev/docker-compose.yml | 1 + make/docker-compose.tpl | 1 + src/ui/api/systeminfo.go | 2 +- tests/testprepare.sh | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd7588c36..d26364069 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,8 +74,8 @@ before_script: - sudo chmod 777 /tmp/registry.db script: - - sudo mkdir -p /harbor_storage/ca_download - - sudo mv ./tests/ca.crt /harbor_storage/ca_download + - sudo mkdir -p /etc/ui/ca/ + - sudo mv ./tests/ca.crt /etc/ui/ca/ - sudo mkdir -p /harbor - sudo mv ./VERSION /harbor/VERSION - sudo service mysql stop diff --git a/make/dev/docker-compose.yml b/make/dev/docker-compose.yml index 3079e5c1b..c25a4d7c8 100644 --- a/make/dev/docker-compose.yml +++ b/make/dev/docker-compose.yml @@ -69,6 +69,7 @@ services: - ../common/config/ui/app.conf:/etc/ui/app.conf - ../common/config/ui/private_key.pem:/etc/ui/private_key.pem - /data/secretkey:/etc/ui/key + - /data/ca_download/:/etc/ui/ca/ depends_on: - log - adminserver diff --git a/make/docker-compose.tpl b/make/docker-compose.tpl index 302c15dd1..2cd98d09b 100644 --- a/make/docker-compose.tpl +++ b/make/docker-compose.tpl @@ -76,6 +76,7 @@ services: - ./common/config/ui/app.conf:/etc/ui/app.conf - ./common/config/ui/private_key.pem:/etc/ui/private_key.pem - /data/secretkey:/etc/ui/key + - /data/ca_download/:/etc/ui/ca/ networks: - harbor depends_on: diff --git a/src/ui/api/systeminfo.go b/src/ui/api/systeminfo.go index 88dff92bc..0d8f7cb46 100644 --- a/src/ui/api/systeminfo.go +++ b/src/ui/api/systeminfo.go @@ -20,7 +20,7 @@ type SystemInfoAPI struct { isAdmin bool } -const defaultRootCert = "/harbor_storage/ca_download/ca.crt" +const defaultRootCert = "/etc/ui/ca/ca.crt" const harborVersionFile = "/harbor/VERSION" //SystemInfo models for system info. diff --git a/tests/testprepare.sh b/tests/testprepare.sh index cb337e2f9..e13de830c 100755 --- a/tests/testprepare.sh +++ b/tests/testprepare.sh @@ -2,7 +2,7 @@ set -e cp tests/docker-compose.test.yml make/. -mkdir /etc/ui +mkdir -p /etc/ui cp make/common/config/ui/private_key.pem /etc/ui/. mkdir conf