Merged PR 65: remove secrets from source code

remove secrets from source code
master
Tudor Stanciu 2022-11-21 17:59:16 +00:00
commit dc456db6a2
5 changed files with 14 additions and 10 deletions

View File

@ -26,13 +26,15 @@ WORKDIR /app
COPY --from=publish /app/publish .
ENV urls="http://*:80"
ENV ConnectionStrings__DatabaseConnection="***REMOVED***"
ENV TZ=Europe/Bucharest
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG APP_VERSION=0.0.0.0
ENV APP_VERSION=${APP_VERSION}
ARG DATABASE_CONNECTION
ENV ConnectionStrings__DatabaseConnection=${DATABASE_CONNECTION}
#Workaround to lower the TLS level in container for old sql server version
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf

View File

@ -1,7 +1,7 @@
{
"urls": "http://*:5055",
"ConnectionStrings": {
"DatabaseConnection": "***REMOVED***"
"DatabaseConnection": "Server=##########;Database=##########;User Id=##########;Password=##########;MultipleActiveResultSets=true"
},
"Logging": {
"LogLevel": {
@ -12,7 +12,7 @@
},
"AllowedHosts": "*",
"Credentials": {
"UserName": "***REMOVED***",
"Password": "***REMOVED***"
"UserName": "**********",
"Password": "**********"
}
}

View File

@ -1,7 +1,7 @@
Basic ***REMOVED***
Basic **********
##############################################################################################
Azure DevOps Repository Password: ***REMOVED***
Azure DevOps Repository Password: **********
##############################################################################################
Docker commands:
*****************
@ -18,14 +18,14 @@ Push image to registry:
docker tag chatbot-api:1.0.5 cloud.canister.io:5000/tstanciu/chatbot:api-1.0.5
--login to registry
docker login --username=tstanciu --password="***REMOVED***" cloud.canister.io:5000
docker login --username=tstanciu --password="**********" cloud.canister.io:5000
--push image
docker push cloud.canister.io:5000/tstanciu/chatbot:api-1.0.5
Pull image from registry
--login to registry with readonly rights
docker login --username=deploy+tstanciu --password=***REMOVED*** cloud.canister.io:5000
docker login --username=deploy+tstanciu --password=********** cloud.canister.io:5000
--pull image
docker pull cloud.canister.io:5000/tstanciu/chatbot:api-1.0.5

View File

@ -3,7 +3,7 @@
echo "Welcome!"
version="1.0.0"
localRegistryPass="***REMOVED***"
localRegistryPass="**********"
echo "Create docker image with version $version."
docker image build -t "chatbot-api:$version" -f "Chatbot.Api/Dockerfile" .

View File

@ -3,7 +3,8 @@ echo "Welcome!"
version="1.0.1"
platform="linux/amd64,linux/arm64"
localRegistryPass="***REMOVED***"
localRegistryPass="**********"
databaseConnection="#########"
echo "Login to alpine-nexus registry."
docker login --username=admin --password=$localRegistryPass alpine-nexus:8500
@ -11,6 +12,7 @@ docker login --username=admin --password=$localRegistryPass alpine-nexus:8500
echo "Create docker image with version $version for platform $platform"
docker buildx build \
--build-arg APP_VERSION=$version \
--build-arg DATABASE_CONNECTION=$databaseConnection \
--platform $platform \
--output=type=image,push=true,registry.insecure=true \
--push \