You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models/fixtures
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>
4 months ago
..
access.yml Add user blocking (#29028) 12 months ago
access_token.yml Fix more yaml lint errors (#27284) 1 year ago
action.yml Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874) 2 years ago
action_run.yml Actions Artifacts v4 backend (#28965) 12 months ago
action_run_job.yml Actions Artifacts v4 backend (#28965) 12 months ago
action_runner_token.yml Add unit tests for action runner token (#27670) 1 year ago
action_task.yml Actions Artifacts v4 backend (#28965) 12 months ago
attachment.yml Allow get release download files and lfs files with oauth2 token format (#26430) 1 year ago
branch.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
collaboration.yml Add user blocking (#29028) 12 months ago
comment.yml Fix the logic of finding the latest pull review commit ID (#32139) 4 months ago
commit_status.yml
commit_status_index.yml Fix more yaml lint errors (#27284) 1 year ago
deploy_key.yml Writable deploy keys (closes #671) (#3225) 7 years ago
email_address.yml Allow non-admin users to delete review requests (#29057) 12 months ago
external_login_user.yml add test coverage for original author conversion during migrations (#18506) 3 years ago
follow.yml Fix user visible check (#21210) 2 years ago
gpg_key.yml Fix verifyCommits error when push a new branch (#26664) 1 year ago
gpg_key_import.yml add .gpg url (match github behaviour) (#6610) 6 years ago
hook_task.yml Store webhook event in database (#29145) 11 months ago
issue.yml Allow non-admin users to delete review requests (#29057) 12 months ago
issue_assignees.yml Add user blocking (#29028) 12 months ago
issue_index.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
issue_label.yml Add Organization Wide Labels (#10814) 5 years ago
issue_user.yml [API] ListIssues add more filters (#16174) 4 years ago
issue_watch.yml Refactor Issues Subscription (#8738) 5 years ago
label.yml Allow to archive labels (#26478) 2 years ago
lfs_meta_object.yml Test views of LFS files (#22196) 2 years ago
login_source.yml Add LDAP integration tests (#3897) 7 years ago
milestone.yml Add some api integration tests (#18872) 2 years ago
mirror.yml Fix bug of branches API with tests (#25578) 2 years ago
notice.yml
notification.yml [API] Add notification endpoint (#9488) 5 years ago
oauth2_application.yml Record OAuth client type at registration (#21316) 2 years ago
oauth2_authorization_code.yml Record OAuth client type at registration (#21316) 2 years ago
oauth2_grant.yml Record OAuth client type at registration (#21316) 2 years ago
org_user.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
project.yml Add default board to new projects, remove uncategorized pseudo-board (#29874) 11 months ago
project_board.yml Add default board to new projects, remove uncategorized pseudo-board (#29874) 11 months ago
project_issue.yml Kanban board (#8346) 5 years ago
protected_branch.yml
protected_tag.yml Protected tag is no internal server error (#30962) 9 months ago
public_key.yml Fix more yaml lint errors (#27284) 1 year ago
pull_request.yml Update misspell to 0.5.1 and add `misspellings.csv` (#30573) 10 months ago
reaction.yml Fix more yaml lint errors (#27284) 1 year ago
release.yml Allow get release download files and lfs files with oauth2 token format (#26430) 1 year ago
renamed_branch.yml Add a simple way to rename branch like gh (#15870) 3 years ago
repo_archiver.yml Rework repository archive (#14723) 4 years ago
repo_indexer_status.yml Code/repo search (#2582) 7 years ago
repo_license.yml Support repo license (#24872) 4 months ago
repo_redirect.yml
repo_topic.yml Add API endpoint for accessing repo topics (#7963) 6 years ago
repo_transfer.yml Add user blocking (#29028) 12 months ago
repo_unit.yml Fix projects mode bugs (#29593) 11 months ago
repository.yml Support repo license (#24872) 4 months ago
review.yml Fix the logic of finding the latest pull review commit ID (#32139) 4 months ago
star.yml Add user blocking (#29028) 12 months ago
stopwatch.yml [API] extend StopWatch (#9196) 5 years ago
system_setting.yml Fix context cache bug & enable context cache for dashabord commits' authors (#26991) 1 year ago
team.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
team_repo.yml Allow non-admin users to delete review requests (#29057) 12 months ago
team_unit.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
team_user.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
topic.yml Add some api integration tests (#18872) 2 years ago
tracked_time.yml [API] Extend times API (#9200) 5 years ago
two_factor.yml org/members: display 2FA members states + optimize sql requests (#7621) 6 years ago
user.yml Fix wrong display of recently pushed notification (#25812) 9 months ago
user_blocking.yml Add user blocking (#29028) 12 months ago
user_open_id.yml
user_redirect.yml Redirect on changed user and org name (#11649) 4 years ago
watch.yml Add user blocking (#29028) 12 months ago
webauthn_credential.yml Add some api integration tests (#18872) 2 years ago
webhook.yml Add user webhooks (#21563) 2 years ago