Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It works fine with Bitwarden unified. #154

Open
ghost opened this issue Jan 2, 2023 · 2 comments
Open

It works fine with Bitwarden unified. #154

ghost opened this issue Jan 2, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 2, 2023

Hi,

I just wanted to say that Bitbetter works fine on Bitwarden Unified, (running in kubernetes)
I wrote this Dockerfile(It doesnt look that great, but it does work! 😄

A pre-generated certs directory is needed in the same folder as the Dockerfile.


# Build bitbetter
FROM mcr.microsoft.com/dotnet/sdk:6.0 as build

ENV COMMIT="b819fe0c7de96f6fec99db0524b66b2a5ab261e8"
COPY certs/cert.cert /newLicensing.cer

RUN set -e ;set -x;  cd / && git clone https://github.com/jakeswenson/BitBetter.git && \
cd /BitBetter && git checkout ${COMMIT} && \
cp -rp /BitBetter/src /src && \
cp -rp /src/bitBetter /src/identity && \
# change paths for bitwarden unified
sed -i 's#/app/Core.dll#/app/Api/Core.dll#g' /src/bitBetter/Program.cs && \
cd /src/bitBetter && \
dotnet restore && \
dotnet publish && \

# Build bitbetter for identity
# change path for bitwarden unified
sed -i 's#/app/Core.dll#/app/Identity/Core.dll#g' /src/identity/Program.cs && \
cd /src/identity && \
dotnet restore && \
dotnet publish && \

# build licensegen, when built, run the following in the created container:
# dotnet /licensegen/licenseGen.dll --core /app/Api/Core.dll --cert /certs/cert.pfx interactive
cd /src/licenseGen &&  \
        dotnet add package Newtonsoft.Json --version 13.0.1 && \
        dotnet restore && \
        dotnet publish

# Final Bitwarden image
FROM bitwarden/self-host:beta

# Import everything
COPY --chown=1000:1000 certs/* /certs/
COPY --chown=1000:1000 --from=build /src/licenseGen/bin/Debug/netcoreapp6.0/* /licensegen/
COPY --chown=1000:1000 --from=build /newLicensing.cer /newLicensing.cer
COPY --chown=1000:1000 --from=build /src/bitBetter/bin/Debug/netcoreapp6.0/publish/* /bitBetter/
COPY --chown=1000:1000 --from=build /src/identity/bin/Debug/netcoreapp6.0/publish/* /identity/

# Run bitbetter to modify api core.dll
RUN cd /tmp && dotnet /bitBetter/bitBetter.dll && \
mv /tmp/modified.dll /app/Api/Core.dll && \

# Run bitbetter to modify identify core.dll.
cd /tmp && dotnet /identity/bitBetter.dll && \
mv /tmp/modified.dll /app/Identity/Core.dll && \

# Remove temp files
rm -rf /bitBetter /identity /newLicensing.cer
@GieltjE
Copy link
Contributor

GieltjE commented Jan 2, 2023

Literaly been working on a new structure to support it all, but have yet to crack my final mistake (won't accept custom licenses for now), see #155

Would you be interested in working together?

@GieltjE
Copy link
Contributor

GieltjE commented Jan 3, 2023

Working on windows now too, at least we have some options now :)

h44z pushed a commit that referenced this issue Jan 16, 2023
* Initial work

* Fix typo

* Fix typo

* Fix stupid issue

* Add comments and fix minor issues

* Add extra information

* Add Linux script for generating keys

* Add circleci

* Add comments

* Add extra option

* Add missing permissions and empty script for now

* Fix line endings

* Add missing mount point

* Simplify patch

* Fix scripts

* Reduce complexity

* Fix circleci

* Remove useless line

* Move to src folder and improve image creation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant