From 9caf8338fa73923f2aebc43a20c11151ef7af0c7 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 26 Nov 2022 16:49:27 +0200 Subject: [PATCH] Remove secrets from source code --- build.sh | 2 +- buildx.sh | 4 ++-- private/Docker.txt | 2 +- src/api/api.js | 1 - src/api/axiosApi.js | 15 ++++++--------- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/build.sh b/build.sh index f1a308b..ae964ff 100644 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ echo "Welcome!" version="1.2.0" -registryPass="***REMOVED***" +registryPass="******************" echo "Create docker image with version $version." docker image build -t "reverse-proxy-frontend:$version" . diff --git a/buildx.sh b/buildx.sh index 2574369..177c9e5 100644 --- a/buildx.sh +++ b/buildx.sh @@ -4,8 +4,8 @@ echo "Welcome!" version="1.4.1" platform="linux/amd64,linux/arm64,linux/arm/v7" appSubfolder="/reverse-proxy" -localRegistryPass="***REMOVED***" -npmToken="***REMOVED***" +localRegistryPass="******************" +npmToken="******************" echo "Login to alpine-nexus registry." docker login --username=admin --password=$localRegistryPass alpine-nexus:8500 diff --git a/private/Docker.txt b/private/Docker.txt index 5d604db..2d97977 100644 --- a/private/Docker.txt +++ b/private/Docker.txt @@ -14,7 +14,7 @@ Push image to registry: docker tag reverse-proxy-frontend:1.0.5 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5 --login to registry -docker login --username=admin --password="***REMOVED***" alpine-nexus:8500 +docker login --username=admin --password="******************" alpine-nexus:8500 --push image docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5 diff --git a/src/api/api.js b/src/api/api.js index bb38b80..65564ff 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -4,7 +4,6 @@ function getHeaders() { const headers = new Headers(); headers.append("Accept", "application/json"); headers.append("Content-Type", "application/json"); - headers.append("Authorization", "Basic ***REMOVED***"); headers.append("Accept-Language", `${i18next.language}`); return headers; } diff --git a/src/api/axiosApi.js b/src/api/axiosApi.js index f291193..8522b48 100644 --- a/src/api/axiosApi.js +++ b/src/api/axiosApi.js @@ -4,7 +4,6 @@ import i18next from "i18next"; function getHeaders() { return { "Content-Type": "application/json", - Authorization: "Basic ***REMOVED***", "Accept-Language": `${i18next.language}` }; } @@ -12,15 +11,13 @@ function getHeaders() { function internalRequest(url, options) { return axios .request(url, options) - .then((res) => res.data) - .catch(function (error) { + .then(res => res.data) + .catch(function(error) { if (error.response && error.response.data) { - throw ( - { - ...error.response.data, - message: error.response.data.detail || error.response.data.title - } || error - ); + throw { + ...error.response.data, + message: error.response.data.detail || error.response.data.title + } || error; } // The request was made but no response was received // `error.request` is an instance of XMLHttpRequest in the browser and an instance of