yp05327
70b7df0e5e
Support repo license ( #24872 )
...
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 ):
https://github.com/go-gitea/gitea/pull/24872#issuecomment-1560361167
Test result between
[google/licensecheck](https://github.com/google/licensecheck ) and
[google/licenseclassifier](https://github.com/google/licenseclassifier/ ):
https://github.com/go-gitea/gitea/pull/24872#issuecomment-1576092178
- 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](https://github.com/go-gitea/gitea/pull/24872#issuecomment-1584141684 )
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(https://github.com/go-gitea/gitea/pull/24872#issuecomment-1560361167 )
- [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>
2 months ago
Gusted
353a5331d5
Remove deprecated licenses ( #20222 )
2 years ago
wxiaoguang
c18d8d6968
Remove legacy `+build:` constraint ( #19582 )
...
Go 1.17 and later use modern `//go:build` constraints, the old `// +build:` constraints should be removed.
3 years ago
6543
54e9ee37a7
format with gofumpt ( #18184 )
...
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
3 years ago
Eng Zer Jun
f2e7d5477f
refactor: move from io/ioutil to io and os package ( #17109 )
...
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil . This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago
John Olheiser
648464b504
Add bundle download for repository ( #14538 )
...
* Add bundle download
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix fmt
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix build tags
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Download specific commit
Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years ago
zeripath
4c557eff5d
Add github api token option to generate-license & generate-gitignore ( #12700 )
...
* Add github api token option to generate-license & generate-gitignore
Without api toke, Will face rate limit sometimes.
Signed-off-by: a1012112796 <1012112796@qq.com>
* Use Basic authentication with tokens
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago
zeripath
74bd9691c6
Re-attempt to delete temporary upload if the file is locked by another process ( #12447 )
...
Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util.
Fix #12339
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
4 years ago
Lunny Xiao
4f63f283c4
Rename scripts to build and add revive command as a new build tool command ( #10942 )
...
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
5 years ago
Jonas Franz
fbdc00f464
Updating generate-licenses.go to fetch licenses from maintained repository. ( #3484 )
...
Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Thomas Boerger
780cb692d6
Make sure both scripts/ can live side by side ( #1264 )
8 years ago
Thomas Boerger
42032fdecf
Synced licenses with github repo ( #1246 )
...
* Added script to download licenses from github
* Synced licenses with github repo
8 years ago
Thomas Boerger
a06c3ad2c0
Synced gitignores with github repo ( #1245 )
...
* Renamed scripts directory into contrib
* Added script to download gitignores from github
* Synced gitignores with github repo
8 years ago