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

Display a License tab #278

Closed
give-me-my-toblerone opened this issue Nov 27, 2016 · 21 comments · Fixed by #24872
Closed

Display a License tab #278

give-me-my-toblerone opened this issue Nov 27, 2016 · 21 comments · Fixed by #24872
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Milestone

Comments

@give-me-my-toblerone
Copy link

give-me-my-toblerone commented Nov 27, 2016

Like GitHub does. It shows a tab with the project license, so it's immediate to see what it is

@tboerger
Copy link
Member

I don't understand what you want to request, please explain it properly.

@tboerger tboerger added type/feature Completely new functionality. Can only be merged if feature freeze is not active. issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Nov 27, 2016
@tboerger tboerger added this to the 1.x.x milestone Nov 27, 2016
@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Nov 27, 2016

Maybe he speak about this?

image

@tboerger
Copy link
Member

Ah, that makes more sense.

@lunny
Copy link
Member

lunny commented Nov 27, 2016

But for a self-hosted server, I seems there is no requirement.

@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Nov 27, 2016

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 ?

@tboerger
Copy link
Member

This is something we can integrate at some point, so I moved it to a future milestone

@bkcsoft
Copy link
Member

bkcsoft commented Nov 28, 2016

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)

[1] https://github.com/ryanuber/go-license

@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Nov 28, 2016

yes we could add a new field on repo model and update it at each push / merge event.

@bkcsoft
Copy link
Member

bkcsoft commented Nov 29, 2016

@0xBAADF00D preferably only update when LICENSE* have been updated ;)

@bamboleeeero-bamboleeeero

@bkcsoft that may not be always he case... some projects use COPYING for instance

@bamboleeeero-bamboleeeero

LICENSE files my also not necessarily contain a single license, but a list of licenses for various components

@bkcsoft
Copy link
Member

bkcsoft commented Dec 2, 2016

@bamboleeeero-bamboleeeero

some projects use COPYING for instance

How does GitHub handle this?

but a list of licenses for various components

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 :)

@nogweii
Copy link

nogweii commented Jan 6, 2017

Github handles this through the gem licensee.

some projects use COPYING for instance

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.

but a list of licenses for various components

The first license that Licensee detects and knows about is used. A better solution is being discussed at licensee/licensee#57

@gsantner
Copy link

I can agree to @bamboleeeero-bamboleeeero - the filename is not always LICENSE. E.g. LICENSE.txt, LICENSE.md, COPYING are often used too

@stale
Copy link

stale bot commented Feb 10, 2019

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.

@stale stale bot added issue/stale and removed issue/stale labels Feb 10, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Feb 11, 2019
@lunny
Copy link
Member

lunny commented Mar 17, 2020

ref. https://github.com/src-d/go-license-detector

@hendrikbl
Copy link

@lunny Any plans to implement this? The library looks promising.

@lafriks
Copy link
Member

lafriks commented Jul 20, 2020

Library moved to https://github.com/go-enry/go-license-detector

@mxmehl
Copy link

mxmehl commented May 21, 2021

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 LICENSES directory. For instance, check this.

The files names (without .txt) indicate the unique SPDX license identifiers, and save everyone from interpreting the often diverging text in files like LICENSE or COPYING.

@6543
Copy link
Member

6543 commented Sep 25, 2021

google did start developing a licence detector: https://github.com/google/licensecheck

@wxiaoguang wxiaoguang removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Apr 16, 2022
@quackerd

This comment was marked as duplicate.

@lunny lunny removed this from the 1.x.x milestone Mar 20, 2023
@yp05327 yp05327 mentioned this issue May 23, 2023
10 tasks
techknowlogick added a commit that referenced this issue Oct 1, 2024
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>
@lunny lunny added this to the 1.23.0 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging a pull request may close this issue.