Remove secrets from source code

master
Tudor Stanciu 2022-11-26 16:49:27 +02:00
parent aab834bc10
commit 9caf8338fa
5 changed files with 10 additions and 14 deletions

View File

@ -2,7 +2,7 @@
echo "Welcome!" echo "Welcome!"
version="1.2.0" version="1.2.0"
registryPass="***REMOVED***" registryPass="******************"
echo "Create docker image with version $version." echo "Create docker image with version $version."
docker image build -t "reverse-proxy-frontend:$version" . docker image build -t "reverse-proxy-frontend:$version" .

View File

@ -4,8 +4,8 @@ echo "Welcome!"
version="1.4.1" version="1.4.1"
platform="linux/amd64,linux/arm64,linux/arm/v7" platform="linux/amd64,linux/arm64,linux/arm/v7"
appSubfolder="/reverse-proxy" appSubfolder="/reverse-proxy"
localRegistryPass="***REMOVED***" localRegistryPass="******************"
npmToken="***REMOVED***" npmToken="******************"
echo "Login to alpine-nexus registry." echo "Login to alpine-nexus registry."
docker login --username=admin --password=$localRegistryPass alpine-nexus:8500 docker login --username=admin --password=$localRegistryPass alpine-nexus:8500

View File

@ -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 docker tag reverse-proxy-frontend:1.0.5 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5
--login to registry --login to registry
docker login --username=admin --password="***REMOVED***" alpine-nexus:8500 docker login --username=admin --password="******************" alpine-nexus:8500
--push image --push image
docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5 docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5

View File

@ -4,7 +4,6 @@ function getHeaders() {
const headers = new Headers(); const headers = new Headers();
headers.append("Accept", "application/json"); headers.append("Accept", "application/json");
headers.append("Content-Type", "application/json"); headers.append("Content-Type", "application/json");
headers.append("Authorization", "Basic ***REMOVED***");
headers.append("Accept-Language", `${i18next.language}`); headers.append("Accept-Language", `${i18next.language}`);
return headers; return headers;
} }

View File

@ -4,7 +4,6 @@ import i18next from "i18next";
function getHeaders() { function getHeaders() {
return { return {
"Content-Type": "application/json", "Content-Type": "application/json",
Authorization: "Basic ***REMOVED***",
"Accept-Language": `${i18next.language}` "Accept-Language": `${i18next.language}`
}; };
} }
@ -12,15 +11,13 @@ function getHeaders() {
function internalRequest(url, options) { function internalRequest(url, options) {
return axios return axios
.request(url, options) .request(url, options)
.then((res) => res.data) .then(res => res.data)
.catch(function (error) { .catch(function(error) {
if (error.response && error.response.data) { if (error.response && error.response.data) {
throw ( throw {
{
...error.response.data, ...error.response.data,
message: error.response.data.detail || error.response.data.title message: error.response.data.detail || error.response.data.title
} || error } || error;
);
} }
// The request was made but no response was received // The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of // `error.request` is an instance of XMLHttpRequest in the browser and an instance of