From 006fa1fecf39d7f868f1cbf2cc22806df1f5f62d Mon Sep 17 00:00:00 2001 From: Michiel Hazelhof Date: Sat, 14 Mar 2020 12:00:25 +0100 Subject: [PATCH] Update .net core and newtonsoft.json Co-authored-by: Michiel Hazelhof Due to compatibility issues laid out in issue #53: Update from .net core 2.0 to 3.1 and newtonsoft.json 12.0.1 to 12.0.3. --- build.sh | 2 +- src/bitBetter/Dockerfile | 2 +- src/bitBetter/bitBetter.csproj | 5 +++-- src/bitBetter/build.sh | 2 +- src/licenseGen/Dockerfile | 6 +++--- src/licenseGen/Program.cs | 7 +++---- src/licenseGen/licenseGen.csproj | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build.sh b/build.sh index dd86ce5..b80efb5 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /us cp "$DIR/.keys/cert.cert" "$DIR/src/bitBetter/.keys" -docker run --rm -v "$DIR/src/bitBetter:/bitBetter" -w=/bitBetter mcr.microsoft.com/dotnet/core/sdk:2.1 sh build.sh +docker run --rm -v "$DIR/src/bitBetter:/bitBetter" -w=/bitBetter mcr.microsoft.com/dotnet/core/sdk:3.1 sh build.sh docker build --build-arg BITWARDEN_TAG=bitwarden/api -t bitbetter/api "$DIR/src/bitBetter" # --squash docker build --build-arg BITWARDEN_TAG=bitwarden/identity -t bitbetter/identity "$DIR/src/bitBetter" # --squash diff --git a/src/bitBetter/Dockerfile b/src/bitBetter/Dockerfile index 02837cb..7437a58 100644 --- a/src/bitBetter/Dockerfile +++ b/src/bitBetter/Dockerfile @@ -1,7 +1,7 @@ ARG BITWARDEN_TAG FROM ${BITWARDEN_TAG} -COPY bin/Debug/netcoreapp2.0/publish/* /bitBetter/ +COPY bin/Debug/netcoreapp3.1/publish/* /bitBetter/ COPY ./.keys/cert.cert /newLicensing.cer RUN set -e; set -x; \ diff --git a/src/bitBetter/bitBetter.csproj b/src/bitBetter/bitBetter.csproj index c296861..3d297a1 100644 --- a/src/bitBetter/bitBetter.csproj +++ b/src/bitBetter/bitBetter.csproj @@ -2,11 +2,12 @@ Exe - netcoreapp2.0 + netcoreapp3.1 - + + diff --git a/src/bitBetter/build.sh b/src/bitBetter/build.sh index 5b0ccd2..de9b3ff 100755 --- a/src/bitBetter/build.sh +++ b/src/bitBetter/build.sh @@ -3,6 +3,6 @@ set -e set -x -dotnet add package Newtonsoft.Json --version 12.0.1 +dotnet add package Newtonsoft.Json --version 12.0.3 dotnet restore dotnet publish diff --git a/src/licenseGen/Dockerfile b/src/licenseGen/Dockerfile index 2d61df0..b0a6665 100644 --- a/src/licenseGen/Dockerfile +++ b/src/licenseGen/Dockerfile @@ -1,17 +1,17 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 as build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build WORKDIR /licenseGen COPY . /licenseGen RUN set -e; set -x; \ - dotnet add package Newtonsoft.Json --version 12.0.1 \ + dotnet add package Newtonsoft.Json --version 12.0.3 \ && dotnet restore \ && dotnet publish FROM bitbetter/api -COPY --from=build /licenseGen/bin/Debug/netcoreapp2.0/publish/* /app/ +COPY --from=build /licenseGen/bin/Debug/netcoreapp3.1/publish/* /app/ ENTRYPOINT [ "dotnet", "/app/licenseGen.dll", "--core", "/app/Core.dll", "--cert", "/cert.pfx" ] diff --git a/src/licenseGen/Program.cs b/src/licenseGen/Program.cs index fc1823a..293527d 100644 --- a/src/licenseGen/Program.cs +++ b/src/licenseGen/Program.cs @@ -38,7 +38,7 @@ namespace bitwardenSelfLicensor string buff="", licensetype="", name="", email="", businessname=""; bool valid_guid = false, valid_installid = false; - Guid guid, installid; + Guid guid = new Guid(), installid = new Guid(); config.OnExecute(() => { @@ -104,17 +104,16 @@ namespace bitwardenSelfLicensor { WriteLineOver("Please provide the username this license will be registered to. [username]:"); buff = Console.ReadLine(); - if ( checkUsername(buff) ) name = buff; + if ( checkUsername(buff) ) name = buff; } while (email == "") { WriteLineOver("Please provide the email address for the user " + name + ". [email]"); buff = Console.ReadLine(); - if ( checkEmail(buff) ) email = buff; + if ( checkEmail(buff) ) email = buff; } - if (licensetype == "user") { WriteLineOver("Confirm creation of \"user\" license for username: \"" + name + "\", email: \"" + email + "\", User-GUID: \"" + guid + "\"? Y/n"); diff --git a/src/licenseGen/licenseGen.csproj b/src/licenseGen/licenseGen.csproj index 73abe54..79e4bc9 100644 --- a/src/licenseGen/licenseGen.csproj +++ b/src/licenseGen/licenseGen.csproj @@ -2,12 +2,12 @@ Exe - netcoreapp2.0 + netcoreapp3.1 - +