jakeswenson / BitBetter

Modify bit warden to provide my own licensing for self hosting
510 stars 115 forks source link

Fix #128 #129

Closed h44z closed 2 years ago

h44z commented 2 years ago

Fix #128

Grommish commented 2 years ago

After applying the change:

bitwarden@bitwarden:/opt/bitwarden/BitBetter$ ./update-bitwarden.sh
Starting Bitwarden update, newest server version:
Enter Bitwarden base directory [/opt/bitwarden]:
Rebuild docker-compose override? [Y/n]:
BitBetter docker-compose override created!
Rebuild BitBetter images? [y/N]: y
Building BitBetter for BitWarden version
Unable to find image 'mcr.microsoft.com/dotnet/sdk:5.0' locally
5.0: Pulling from dotnet/sdk
a4b007099961: Pull complete
ad49eec29a70: Pull complete
b716af1be809: Pull complete
de9ca3a197ba: Pull complete
497a942d4856: Pull complete
cd7b08dfeba0: Pull complete
749bbfa92b9e: Pull complete
29612dd155c9: Pull complete
Digest: sha256:bce1e40a24da092c31513337a39a1b9f923e32884a57dd71cbe4c2f8d1f4b067
Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:5.0
+ dotnet add package Newtonsoft.Json --version 12.0.3
  Determining projects to restore...
  Writing /tmp/tmp2y1d4S.tmp
info : Adding PackageReference for package 'Newtonsoft.Json' into project '/bitBetter/bitBetter.csproj'.
info : Restoring packages for /bitBetter/bitBetter.csproj...
info :   GET https://api.nuget.org/v3-flatcontainer/mono.cecil/index.json
info :   GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/mono.cecil/index.json 79ms
info :   GET https://api.nuget.org/v3-flatcontainer/mono.cecil/0.11.2/mono.cecil.0.11.2.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/mono.cecil/0.11.2/mono.cecil.0.11.2.nupkg 29ms
info :   OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json 231ms
info :   GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/12.0.3/newtonsoft.json.12.0.3.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/12.0.3/newtonsoft.json.12.0.3.nupkg 119ms
info : Installed Newtonsoft.Json 12.0.3 from https://api.nuget.org/v3/index.json with content hash 6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==.
info : Installed Mono.Cecil 0.11.2 from https://api.nuget.org/v3/index.json with content hash hZNAnXKQsOs/SZMFtT/e82/nA/iLgkeDy+sHD8xix4f0m9/3G0RNZplE1QHB+0n8QXq54jLqR/IPgVOkLapkyg==.
info : Package 'Newtonsoft.Json' is compatible with all the specified frameworks in project '/bitBetter/bitBetter.csproj'.
info : PackageReference for package 'Newtonsoft.Json' version '12.0.3' updated in file '/bitBetter/bitBetter.csproj'.
info : Committing restore...
info : Writing assets file to disk. Path: /bitBetter/obj/project.assets.json
log  : Restored /bitBetter/bitBetter.csproj (in 4.84 sec).
+ dotnet restore
  Determining projects to restore...
  All projects are up-to-date for restore.
+ dotnet publish
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  bitBetter -> /bitBetter/bin/Debug/netcoreapp5.0/bitBetter.dll
  bitBetter -> /bitBetter/bin/Debug/netcoreapp5.0/publish/
Sending build context to Docker daemon  5.819MB
Step 1/6 : ARG BITWARDEN_TAG
Step 2/6 : FROM ${BITWARDEN_TAG}
invalid reference format
Sending build context to Docker daemon  5.819MB
Step 1/6 : ARG BITWARDEN_TAG
Step 2/6 : FROM ${BITWARDEN_TAG}
invalid reference format
Error parsing reference: "bitbetter/api:" is not a valid repository/tag: invalid reference format
Error parsing reference: "bitbetter/identity:" is not a valid repository/tag: invalid reference format
BitBetter images updated to version:
 _     _ _                         _
| |__ (_) |___      ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2022, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 1.45.4
Docker version 20.10.13, build a224086
docker-compose version 1.28.4, build cabd5cfb

Updated self.
Patching bitwarden.sh completed...
 _     _ _                         _
| |__ (_) |___      ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|
Open source password management solutions
Copyright 2015-2022, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden
===================================================
We have moved our self-hosted scripts to their own repository (https://github.com/bitwarden/self-host).  Your 'bitwarden.sh' script has been automatically upgraded. Please run it again.
Pruning Docker images without at least one container associated to them...
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N]
Total reclaimed space: 0B
Bitwarden update completed!
bitwarden@bitwarden:/opt/bitwarden/BitBetter$
colinmahns commented 2 years ago

Maintain a Bitwarden instance with BitBetter, want to also confirm after testing it the broken update I was facing is no longer the case, was gettng the usual ERROR: pull access denied for bitbetter/api, repository does not exist or may require 'docker login': denied: requested access to the resource is denied Error up until putting in the patch proposed in this PR. Not sure what logs you want me to provide to confirm it :)

h44z commented 2 years ago

alright, can someone approve this pr so that it can be merged? @captainhook

captainhook commented 2 years ago

Approved - I'll leave to @h44z to merge.