[FEAT] use PREFERRED_LICENSES when creating a repository #1404
Labels
No Label
backport/v1.19
backport/v1.20
backport/v1.21
bug
dependency
Chi
dependency
Chroma
dependency
citation.js
dependency
devcontainers
dependency
dropzone
dependency
F3
dependency
ForgeFed
dependency
garage
dependency
Git
dependency
Gitea
dependency
gitignore
dependency
go-enry
dependency
Go-org
dependency
go-sql-driver mysql
dependency
go-webauthn
dependency
Golang
dependency
goldmark
dependency
Goth
dependency
Helm
dependency
MariaDB
dependency
Mermaid
dependency
minio-go
dependency
Monaco
dependency
PDFobject
dependency
ssh
dependency
urfave
dependency
Woodpecker CI
dependency
XORM
Discussion
duplicate
enhancement/feature
forgejo/accessibility
forgejo/actions
forgejo/api
forgejo/branding
forgejo/ci
forgejo/documentation
forgejo/federation
forgejo/furnace cleanup
forgejo/internationalization
forgejo/moderation
forgejo/privacy
forgejo/release
forgejo/scaling
forgejo/security
forgejo/ui
issue
closed
issue
do-not-exist-yet
issue
open
manual test
OS
FreeBSD
OS
Linux
OS
MacOS
OS
Windows
run-end-to-end-tests
untested
User Research - bug
User Research - communication
User Research - documentation
User Research - feature
User Research - federation
User Research - governance
User Research - release
User Research - security
User Research - testing
User Research - UI
User Research - UX
No Milestone
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: forgejo/forgejo#1404
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Needs and benefits
When creating a repository it is common to associate it with a license. Although there are hundreds of licenses, a dozen are most commonly used and should be presented first so the user does not need to search for the license name.
Feature Description
When creating a repository, a list of licenses is presented alphabetically sorted in a menu.
They originate from the license directory, extracted from https://github.com/spdx/license-list-data/ with
make generate-license. The licenses listed inPREFERRED_LICENSESshould be displayed first.Is
PREFERRED_LICENSESan existing setting which is used elsewhere, or one that should be added specifically for this purpose?It exists:
FYI, I am reviewing Codeberg specifically (and by extension Forgejo) for official GNU endorsement at https://www.gnu.org/software/repo-criteria-evaluation.html
Resolving this issue would make it clearer in passing criterion B2. That criterion is generally about whether the system encourages "bad licensing practices", and it calls out specifically no-license and unclear license which are not a problem for Forgejo. However, it also calls out as "bad" the use of GPL-N-only because "good" practice is to use GPL-N-or-later. Although the GNU criterion should be updated to add non-free licenses and outdated-versions as also bad practice.
On PREFERRED_LICENSES:
That is itself a problem. Forgejo should not prefer Apache2 and MIT over other well-respected licenses. That list should be expanded to include at least the full GPL family (with the -or-later tags specifically) and the free-culture variants of CC (i.e. without the ND or NC limitations) licenses (using v4). Perhaps some others are also appropriate to add.
The limited Apache and MIT preference is inherited from Gitea, which I think is a project and community that cares less about software freedom for the world compared to Forgejo and Codeberg.
While Forgejo does not itself have the limitations of licensing that Codeberg specifies at https://codeberg.org/Codeberg/org/src/branch/main/TermsOfUse.md#2-allowed-content-usage perhaps it makes sense to also have a separate list of approved Free/Libre/Open licenses so that there is a medium between the enormous-everything list and the preferred list?
I'm not sure I understand the issue... on my instance running Forgejo 1.21.3-0, I have
[repository].PREFERRED_LICENSES = GPL-3.0-only,GPL-3.0-or-later,BSD-3-Clause,CC-BY-SA-4.0,MITin my config, and when creating a repo, they are listed at the top of the list:As far as GNU endorsement is concerned, I suppose all that would take is changing the default for this for Forgejo.
I can submit a PR to do that, but to clarify, @wolftune, would the following preference list be fine?
AGPL-3.0-or-later,GPL-3.0-or-later,LGPL-3.0-or-later,CC-BY-SA-4.0,CC0-1.0,MITI did not include
CC-BY-4.0, to limit the list of default licenses, but included MIT, because that's the Gitea/Forgejo license. It might make sense to dropCC0-1.0, and addApache-2.0instead, because the latter is likely more practical. The list would still prefer the GPL family over the others.@algernon thanks for clarifying. I guess I haven't investigated fully. Could it be that Forgejo already uses
PREFERRED_LICENSESin the repo-creation form while Codeberg's instance specifically does not? I assumed by this issue being open that it was a Forgejo unresolved issue.Your screenshot looks much better. If appropriate, I'm happy to open a Codeberg issue about Codeberg setting preferred licenses.
For the GNU endorsement, the list you gave would technically qualify (get a passing grade on the relevant items). Though I would suggest the variant of
AGPL-3.0-or-later,GPL-3.0-or-later,LGPL-3.0-or-later,Apache-2.0,MIT,CC-BY-SA-4.0,CC-BY-4.0,CC0-1.0because all those are compatible, the whole set. My suggested order is software-first, non-code (CC) licenses later; most-copyleft to most-permissive. A collection of repos under a mix of all those licenses would all be allowed to be combined into a single AGPL-3.0-or-later derivative (even the CC ones, as those have been declared GPL-compatible). And while it gives preference to GNU licenses, it includes the full range of permissiveness for both software and non-software repos. I think BSD-3-Clause could be included as well, next to MIT.If this were set correctly for Codeberg, it would pass the GNU criteria for license-suggestions with no question. It seems still preferable as well for Forgejo in general at any instance to default to to the same short list, which individual hosts could change as they wish.
ADDENDUM: to be explicit about GNU criteria (which really is for Codeberg, not Forgejo): Grade C level requires that no other license be promoted or favored more than GPL-3.0-or-later. Grade B requires that GPL-N-only not be encouraged. Grade A requires that GPL-3.0-or-later be actively encouraged as well as AGPL-3.0-or-later being offered and supported (and for the service to prohibit non-free licensing).
By "I don't understand the issue", I meant the original issue, which in my reading meant that
PREFERRED_LICENSESshould be taken into account when sorting the licenses in the selector, and it is, so that problem seems to be gone now. (For both Forgejo and Codeberg; Codeberg lists Apache-2.0 and MIT on top, thePREFERRED_LICENSESdefault)I think that would be the best, because as you said, the endorsement criteria is for Codeberg, not Forgejo, so Forgejo is fine with sticking with the Gitea default. Nevertheless, if Forgejo wants to change their defaults, I'm happy to submit a PR against Forgejo too. =)
That ordering makes sense, and including BSD-3-Clause - as you said - would be great, too.
Okay, I think this issue as-is might be partly fixed. It looks like
PREFERRED_LICENSESis used indeed, but it is used just to put those licenses at the top and then still show the rest of the enormous list. The outstanding questions seem to be:I did go ahead and open a Codeberg-specific issue now: Codeberg/Community#1393
I think
PREFERRED_LICENSESshould work as it does now, and put those on the top, while also showing the long list after. If we want to trim the list, a separate setting, say,ALLOWED_LICENSES(or simplyLICENSES, because using an unlisted license is still fine and supported) could be used instead - but that should probably be a separate issue.So should the question of whether to change the
PREFERRED_LICENSESdefault for Forgejo/Codeberg, just so that we can track different issues separately, even if they're somewhat related.There has been a previous related discussion about this: #1409
Sounds like this specific issue should be closed because the top-level (initial) concern is resolved.
I support @algernon 's suggestion of having a
LICENSESlist that instances can easily customize which amounts to what additional licenses are shown beyond the preferred ones.Regarding that other discussion on the PR about ethical-licenses, I saw nobody suggesting that it is good to show an extensive list of obscure and outdated licenses. The debate seems only about whether or not to include newer licenses that FSF and OSI do not support. Everyone seems to support the set that FSF and OSI supports also, it's only a question of whether or not to limit to that.