Codeberg/Community
54
325
Fork
You've already forked Community
12

GNU LibreJS detects some unlicensed JS #64

Open
opened 2019年07月18日 19:59:28 +02:00 by Ghost · 20 comments

I didn't test every page, but some pages have some unlicensed JS.
The following JS was blocked by GNU LibreJS:

Fixing it is pretty easy, so I will go ahead and create a pull-request.

I didn't test every page, but some pages have some unlicensed JS. The following JS was blocked by GNU LibreJS: - https://codeberg.org/vendor/plugins/promise-polyfill/polyfill.min.js - https://codeberg.org/vendor/plugins/highlight/highlight.pack.js Fixing it is pretty easy, so I will go ahead and create a pull-request.

Hmm, I can't immediately see what's wrong.
The scripts are listed in the Javascript list.

Hmm, I can't immediately see what's wrong. The scripts are listed in the Javascript list.
Member
Copy link

Can you please keep us updated if you find out more?

Can you please keep us updated if you find out more?

Sure, here are some things which I noticed:

  • The GNU website mentions that the JavaScript licenses link should have a rel="jslicense", which is currently missing on this website;

  • I am pretty sure that MIT is not a valid license. It is not specific enough. The people of GNU prefer the term Expat or X11. Both of these are known as MIT, but the licenses are not the same. Expat is the one that people usually use;

  • The polyfill JavaScript link does not seem to link to a JavaScript file. It links to a directory;

I couldn't seem to fix the specific issue locally, even with some changes.
I might look more into the issue. I am also not sure how that I exactly run this project locally, but I tried to play with some html code.

Sure, here are some things which I noticed: - The [GNU website](https://www.gnu.org/licenses/javascript-labels.en.html) mentions that the JavaScript licenses link should have a rel="jslicense", which is currently missing on this website; - I am pretty sure that MIT is not a valid license. It is not specific enough. The people of GNU prefer the term Expat or X11. Both of these are known as MIT, but the licenses are not the same. Expat is the one that people usually use; - The polyfill JavaScript link does not seem to link to a JavaScript file. It links to a directory; I couldn't seem to fix the specific issue locally, even with some changes. I might look more into the issue. I am also not sure how that I exactly run this project locally, but I tried to play with some html code.
Member
Copy link

Please ask all questions related to build-deploy-gitea (test), we know the documentation is far from perfect, and want to improve.

Please ask all questions related to build-deploy-gitea (test), we know the documentation is far from perfect, and want to improve.

I hadn't read the documentation yet. The createVM script seems to fail though. I currently don't have the time to setup a VM either.

I might try again during September.

The error is:
cp: cannot stat '/home/rmw/.ssh/authorized_keys': No such file or directory

I hadn't read the documentation yet. The createVM script seems to fail though. I currently don't have the time to setup a VM either. I might try again during September. The error is: ```cp: cannot stat '/home/rmw/.ssh/authorized_keys': No such file or directory```
Member
Copy link

This script line merely tries to copy your public ssh key onto the newly created machine, so that you can log in. the authorized_keys file is a common place for those, but finally mere heuristic, of course not everybody has this set up.

You can safely disable this line (or copy your public ssh key into this file).

This script line merely tries to copy your public ssh key onto the newly created machine, so that you can log in. the authorized_keys file is a common place for those, but finally mere heuristic, of course not everybody has this set up. You can safely disable this line (or copy your public ssh key into this file).

Hmmm, gitea has the same problem with the same scripts. I haven't checked all scripts, but the problems look alike. I think that it might be better to fix the issue there, so that it can be fixed for everyone who forks or uses gitea.

Anyway, I don't have much time to look into everything at the moment.
I should have more time during September.

Hmmm, gitea has the same problem with the same scripts. I haven't checked all scripts, but the problems look alike. I think that it might be better to fix the issue there, so that it can be fixed for everyone who forks or uses gitea. Anyway, I don't have much time to look into everything at the moment. I *should* have more time during September.

I haven't looked into this problem yet, but I will try to do so soon. Sorry for the late reply.

Edit: I receive the following error Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory when I execute the createVM.sh script.

I commented the .ssh cp in the script, since it does not run when I don't do that (see previous comment).

I have virt-manager installed. I don't have systemd on my OS, so I can't create the KVM if that service requires that. I use Devuan, so I use systemv.

Edit 2: I don't have the libvirt-daemon it conflicts with other packages. Is there another way to test this? I do have a working virtualbox if there are images available for that.

I haven't looked into this problem yet, but I will try to do so soon. Sorry for the late reply. Edit: I receive the following error `Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory` when I execute the createVM.sh script. I commented the .ssh cp in the script, since it does not run when I don't do that (see [previous comment](https://codeberg.org/Codeberg/Community/issues/64#issuecomment-4474)). I have virt-manager installed. I don't have systemd on my OS, so I can't create the KVM if that service requires that. I use Devuan, so I use systemv. Edit 2: I don't have the libvirt-daemon it conflicts with other packages. Is there another way to test this? I do have a working virtualbox if there are images available for that.
Member
Copy link

You can run the gitea binary after building native on the host without VM. Please check the Gitea documentation for the flags and environment variables needed to point to the config files etc; you can also look into the systemd service file for an example: https://codeberg.org/Codeberg/build-deploy-gitea/src/branch/master/etc/systemd/system/gitea.service

You can run the gitea binary after building native on the host without VM. Please check the Gitea documentation for the flags and environment variables needed to point to the config files etc; you can also look into the systemd service file for an example: https://codeberg.org/Codeberg/build-deploy-gitea/src/branch/master/etc/systemd/system/gitea.service
Upstream issue: https://github.com/go-gitea/gitea/issues/13393

Also, newer issue exists in the Forgejo issues forgejo/forgejo#1654

So, could be resolved at Gitea, Forgejo, or Codeberg levels, whatever is appropriate.

Also, newer issue exists in the Forgejo issues https://codeberg.org/forgejo/forgejo/issues/1654 So, could be resolved at Gitea, Forgejo, or Codeberg levels, whatever is appropriate.

I should add that this is one of the only issues blocking Codeberg from getting a better grade in the in-progress official GNU review of Codeberg for https://www.gnu.org/software/repo-criteria-evaluation.html

So, while I'd most like to see this resolved all the way upstream at Gitea (so that LibreJS works with all Gitea instances and derivatives), it would make a difference if Codeberg would just resolve it directly for now.

I should add that this is one of the only issues blocking Codeberg from getting a better grade in the in-progress official GNU review of Codeberg for https://www.gnu.org/software/repo-criteria-evaluation.html So, while I'd most like to see this resolved all the way upstream at Gitea (so that LibreJS works with all Gitea instances and derivatives), it would make a difference if Codeberg would just resolve it directly for now.

Although full LibreJS recognition is ideal, here's a proposed step in the right direction:

Make some appropriate web-labels page or similar, as in https://www.gnu.org/licenses/javascript-labels.html (see example: https://weblabels.fsf.org/www.fsf.org/CURRENT/ )

The goal in practice is that someone can get directed to the un-minified source files for the JS. So, even if LibreJS doesn't recognize it, some documentation that says "Codeberg uses these JS libraries" with links to the sources and licenses, that would facilitate people whitelisting Codeberg in LibreJS with confidence that they can indeed study what the JS is doing.

(Side-note: I personally trust Codeberg here and am not interested in such investigations, but I support best-practices and am passing on perspectives from others with whom I've discussed the issues around them trusting Codeberg)

Although full LibreJS recognition is ideal, here's a proposed step in the right direction: Make some appropriate web-labels page or similar, as in https://www.gnu.org/licenses/javascript-labels.html (see example: https://weblabels.fsf.org/www.fsf.org/CURRENT/ ) The goal in practice is that someone can get directed to the un-minified source files for the JS. So, even if LibreJS doesn't recognize it, some documentation that says "Codeberg uses these JS libraries" with links to the sources and licenses, that would facilitate people whitelisting Codeberg in LibreJS with confidence that they can indeed study what the JS is doing. (Side-note: I personally trust Codeberg here and am not interested in such investigations, but I support best-practices and am passing on perspectives from others with whom I've discussed the issues around them trusting Codeberg)

This example given in:

Make some appropriate web-labels page or similar, as in https://www.gnu.org/licenses/javascript-labels.html (see example: https://weblabels.fsf.org/www.fsf.org/CURRENT/ )

to me looks weird and I cannot even imagine how that should build trust that is not already given to the service.

Why not offer a software bill of materials in a recognized format like SPDX or CycloneDX or even SWID?

An SBOM tracing upstream is what I would expect from FSF service endpoints not a three column table with a few links pointing to some source without any license info included and some links not even resolving for the public (as eg. https://static.fsf.org/nosvn/modified-battleforthenet-widget/ which gives me an HTTP/403).

This example given in: > Make some appropriate web-labels page or similar, as in https://www.gnu.org/licenses/javascript-labels.html (see example: https://weblabels.fsf.org/www.fsf.org/CURRENT/ ) to me looks weird and I cannot even imagine how that should build trust that is not already given to the service. Why not offer a software bill of materials in a recognized format like SPDX or CycloneDX or even SWID? An SBOM tracing upstream is what I would expect from FSF service endpoints not a three column table with a few links pointing to some source without any license info included and some links not even resolving for the public (as eg. <https://static.fsf.org/nosvn/modified-battleforthenet-widget/> which gives me an HTTP/403).
Owner
Copy link

some documentation that says "Codeberg uses these JS libraries"

The footer has a link below "Legal": Licenses. Is this what you have in mind or is something missing for it?

> some documentation that says "Codeberg uses these JS libraries" The footer has a link below "Legal": [Licenses](https://codeberg.org/assets/licenses.txt). Is this what you have in mind or is something missing for it?

@fnetX I am aware of that, and it has entries like brace-expansion@2.0.1 and licenses, but there's no link to source files

@fnetX I am aware of that, and it has entries like `brace-expansion@2.0.1` and licenses, but there's no link to *source files*

@sthagen SPDX is not evidently a suitable replacement. Web labels have three simple columns: object, license, source. I reckon SPDX may be suitable for the first two, but I don't find it is for the third (which is the main problem, since Codeberg already posts licenses.) I have not seen any website use it, so it is a strange suggestion. It is also a far more complicated thing to generate and consume.

@sthagen SPDX is not evidently a suitable replacement. Web labels have three simple columns: object, license, source. I reckon SPDX may be suitable for the first two, but I don't find it is for the third (which is the main problem, since Codeberg already posts licenses.) I have not seen any website use it, so it is a strange suggestion. It is also a far more complicated thing to generate and consume.

I got a reply at https://github.com/go-gitea/gitea/issues/13393 (which someone else opened way back in 2020)

The idea of searching npmjs.org for the JS files with associated versions at least is clear enough to be usable as a human workaround... I'm adding a comment there too. Maybe this can be at least improved upstream in Gitea overall.

I got a reply at https://github.com/go-gitea/gitea/issues/13393 (which someone else opened way back in 2020) The idea of searching npmjs.org for the JS files with associated versions at least is clear enough to be usable as a human workaround... I'm adding a comment there too. Maybe this can be at least improved upstream in Gitea overall.

@sthagen SPDX is not evidently a suitable replacement. Web labels have three simple columns: object, license, source. I reckon SPDX may be suitable for the first two, but I don't find it is for the third (which is the main problem, since Codeberg already posts licenses.) I have not seen any website use it, so it is a strange suggestion. It is also a far more complicated thing to generate and consume.

Well, SBOMs in SPDX and CycloneDX are the way to go then, as they provide a machine readable and openly standardized way for obtaining and following the exact coordinates for source, license, revision used, possibly all 3rd party included from the direct library used.

These "alternative" triplets of unrelated information as on that example web page are to me a strange way of building trust.

A publicly accessible bill of materials - esp. for an online service that may continuously update the effective components - is what builds trust. Esp. CycloneDX when using purl to locate the package of a component within the packaging namespace as nom, pypi, and others. is much clearer for the user who is really interested in the assembly of a service at any point in time.

The doable and the easy are not really a concern around these "libre" or "free as in x not in y" questions. Or are they?

> @sthagen SPDX is not evidently a suitable replacement. Web labels have three simple columns: object, license, source. I reckon SPDX may be suitable for the first two, but I don't find it is for the third (which is the main problem, since Codeberg already posts licenses.) I have not seen any website use it, so it is a strange suggestion. It is also a far more complicated thing to generate and consume. Well, SBOMs in SPDX and CycloneDX are the way to go then, as they provide a machine readable and openly standardized way for obtaining and following the exact coordinates for source, license, revision used, possibly all 3rd party included from the direct library used. These "alternative" triplets of unrelated information as on that example web page are to me a strange way of building trust. A publicly accessible bill of materials - esp. for an online service that may continuously update the effective components - is what builds trust. Esp. CycloneDX when using purl to locate the package of a component within the packaging namespace as nom, pypi, and others. is much clearer for the user who is really interested in the assembly of a service at any point in time. The doable and the easy are not really a concern around these "libre" or "free as in x not in y" questions. Or are they?

This was also discussed at GNU Guix's Codeberg migration discussion.

https://mail.gnu.org/archive/html/guix-patches/2025-03/msg00156.html

This was also discussed at GNU Guix's Codeberg migration discussion. https://mail.gnu.org/archive/html/guix-patches/2025-03/msg00156.html
Sign in to join this conversation.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
8 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#64
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?