-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Display a License tab #278
Comments
I don't understand what you want to request, please explain it properly. |
Ah, that makes more sense. |
But for a self-hosted server, I seems there is no requirement. |
we are no forced to do something like github who scan repo to determine license. maybe just a selectbox field on repo settings page is enough ? |
This is something we can integrate at some point, so I moved it to a future milestone |
Using something like go-license[1] it'd be fairly simple to implement, just remember to cache the result until the license-file changes (just add another column in the repo-table) |
yes we could add a new field on repo model and update it at each push / merge event. |
@0xBAADF00D preferably only update when |
@bkcsoft that may not be always he case... some projects use COPYING for instance |
LICENSE files my also not necessarily contain a single license, but a list of licenses for various components |
How does GitHub handle this?
Same here. How does others handle that? As I see it, it's a new feature, do the smallest amount of work first then extend on that in a later version :) |
Github handles this through the gem licensee.
Github scans the root of a project, and matches the files in that directory against a series of regular expressions with scores. High enough and it's treated as a file that likely contains the license text.
The first license that Licensee detects and knows about is used. A better solution is being discussed at licensee/licensee#57 |
I can agree to @bamboleeeero-bamboleeeero - the filename is not always LICENSE. E.g. LICENSE.txt, LICENSE.md, COPYING are often used too |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
@lunny Any plans to implement this? The library looks promising. |
Library moved to https://github.com/go-enry/go-license-detector |
May I suggest to also support the more flexible REUSE standard when implementing this important feature? License detection would become really easy, especially if multiple licenses are in use. All you have to do is fetching the file names from the The files names (without |
google did start developing a licence detector: https://github.com/google/licensecheck |
This comment was marked as duplicate.
This comment was marked as duplicate.
Close #278 Close #24076 ## Solutions: - Use [google/licenseclassifier](https://github.com/google/licenseclassifier/) Test result between [google/licensecheck](https://github.com/google/licensecheck) and [go-license-detector](https://github.com/go-enry/go-license-detector): #24872 (comment) Test result between [google/licensecheck](https://github.com/google/licensecheck) and [google/licenseclassifier](https://github.com/google/licenseclassifier/): #24872 (comment) - Generate License Convert Name List to avoid import license templates with same contents Gitea automatically get latest license data from[ spdx/license-list-data](https://github.com/spdx/license-list-data). But unfortunately, some license templates have same contents. #20915 [click here to see the list](#24872 (comment)) So we will generate a list of these license templates with same contents and create a new file to save the result when using `make generate-license`. (Need to decide the save path) - Save License info into a new table `repo_license` Can easily support searching repo by license in the future. ## Screen shot Single License: ![image](https://github.com/go-gitea/gitea/assets/18380374/41260bd7-0b4c-4038-8592-508706cffa9f) Multiple Licenses: ![image](https://github.com/go-gitea/gitea/assets/18380374/34ce2f73-7e18-446b-9b96-ecc4fb61bd70) Triggers: - [x] Push commit to default branch - [x] Create repo - [x] Mirror repo - [x] When Default Branch is changed, licenses should be updated Todo: - [x] Save Licenses info in to DB when there's a change to license file in the commit - [x] DB Migration - [x] A nominal test? - [x] Select which library to use(#24872 (comment)) - [x] API Support - [x] Add repo license table - ~Select license in settings if there are several licenses(Not recommended)~ - License board(later, not in this PR) ![image](https://github.com/go-gitea/gitea/assets/18380374/2c3c3bf8-bcc2-4c6d-8ce0-81d1a9733878) --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Like GitHub does. It shows a tab with the project license, so it's immediate to see what it is
The text was updated successfully, but these errors were encountered: