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

remove non-OSI license code to ensure it's not used in builds #163

Closed
wants to merge 1 commit into from

Conversation

jonathanspw
Copy link

fixes #162

Copy link
Collaborator

@BlackDex BlackDex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the PR, but i think it's not very useful to implement this because of the reasons given per change

@@ -53,4 +53,7 @@ pushd "${VAULT_FOLDER}"
git fetch --tags --depth 1 origin "${VAULT_VERSION}"
# Checkout the branch we want
git -c advice.detachedHead=false checkout FETCH_HEAD
# Make sure we don't use non-OSI code
# requires patching in next step
rm -rf bitwarden_license
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem useful, that directory is not packed or used, only pulled as part of the repo. Removing this doesn't serve anything useful.

"files": [
"src/polyfills.ts",
"src/main.ts",
- "../../bitwarden_license/bit-web/src/main.ts",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed anymore as this is already changed upstream https://github.com/bitwarden/clients/pull/8818/files

So, I also do not see the huge benefit here either.
We already build the OSS version, which is determined by Bitwarden to be GPLv3 compatibel ans not using there Bitwarden Licensed code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the benefit would be the assurance that the compiled code is actually GPLv3 compatible and not relying on the content in the bitwarden_license directory at all to be built, which might not always be the case. (E.g. in web-v2023.8.0 to web-v2023.9.2 the secrets manager logo was technically included as part of the compilation when it was located in the bitwarden_license directory)

It also enables third party vendors to be able to ship the source code without bundling the non-free code into their packages as explained in #162. (If we were to create a soft fork, we could also easily remove the non-free code from our repository to be on the safe side.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precisely. For distros and probably others all assurances should be taken that no non-OSI code ends up in the distro by mistake. That said, it's standard practice to "rm -rf" anything you want to make sure isn't included or built against in RPM spec files.

My intent is to use the published/built sources for web vault since it's not binary, which means I can't rm -rf at build time with a Fedora-specific patch.

Since the patch does no harm and removes what's not being used anyway, it addresses the concern by having multiple things that would have to fail for the code to get into the build by mistake, while having 0 impact on existing functionality/expectations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm for the soft fork option but not currently in this repo. Though i still wonder if it isn't more work with upstream rebases etc. (But that is something i haven't looked at actually)

In general I agree that if possible without too much hassle to try and keep clear of any possible GPLv3 invalid build.

But seeing that upstream already made some changes regarding this i rather wait for a new release with those changes incorporated.

Copy link
Contributor

@stefan0xC stefan0xC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would remove the bitwarden_license references from all files for good measure but it should build just fine with only removing it from the apps/web/tsconfig.json.

Not sure if we really want to remove the bitwarden_license directory though as it would require additional handling in the scripts.

Comment on lines +56 to +58
# Make sure we don't use non-OSI code
# requires patching in next step
rm -rf bitwarden_license
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be done in the apply_patches.sh script so it will also be removed from the Docker build.

Also if you remove this directory you should also exclude it from the generated patch file:

':!apps/web/src/app/layouts/password-manager-logo.ts' \
> "../patches/${PATCH_FILENAME}"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's too much for something not used at all.

- "../../bitwarden_license/bit-web/src/main.ts",
"src/theme.ts"
],
"include": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I try to apply this patch file it will complain because of the line ending. If you generate the patch file with make generate-patch this should be corrected.

@BlackDex
Copy link
Collaborator

Personally I would remove the bitwarden_license references from all files for good measure but it should build just fine with only removing it from the apps/web/tsconfig.json.

Which is already done upstream, so i do not see a use case for this until a new released version of the web-vault, at which point it will be solved automatically.

Not sure if we really want to remove the bitwarden_license directory though as it would require additional handling in the scripts.

It will only complicate stuff with the current way of patching i think.

@BlackDex
Copy link
Collaborator

Btw, if it makes releasing your package really more useful in the short term. Then i do not have any strong feelings against it. But if not, then i would rather wait for a new release to at least add the directory removal.

@BlackDex
Copy link
Collaborator

BlackDex commented Aug 7, 2024

Closing as fixed via #169

@BlackDex BlackDex closed this Aug 7, 2024
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

Successfully merging this pull request may close these issues.

Is GPL-3.0 correct?
3 participants