2164 Commits (forgejo)

Author SHA1 Message Date
Wim 0a8c030600 [skip ci] Updated translations via Crowdin 2 years ago
André Jaenisch 73382d2132
Add alt text to logo (#19892)
The recommended way is to use the name of the organisation followed
by "logo". however, since this is my first contribution, I am not
entirely sure, whether this is the best approach here.

The organisation is different from the organisation you can create as
part of the application. Instead, it is more related to the site
hosting the instance. Plus, I don't know how to best handle it when
the logo image is swapped out. Therefore, I use plain "Logo" and hope
that the person visiting the site has enough context.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
Paweł Bogusławski 14d96ff7ac
Disable unnecessary mirroring elements (#18527)
* Disable unnecessary mirroring elements

This mod fixes disabling unnecessary mirroring elements.

Related: https://github.com/go-gitea/gitea/pull/16957
Related: https://github.com/go-gitea/gitea/pull/13084
Author-Change-Id: IB#1105104

* Checkbox rendering disabled instead of hiding it

Fixes: 02b45051503d4330da9757ff084c9cc5e6e60d84
Related: https://github.com/go-gitea/gitea/pull/18527#pullrequestreview-878061913
Author-Change-Id: IB#1105104

* Update custom/conf/app.example.ini

Co-authored-by: silverwind <me@silverwind.io>

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-authored-by: silverwind <me@silverwind.io>

* Mirror filter removed only when whole mirroring feature is disabled

Fixes: 02b45051503d4330da9757ff084c9cc5e6e60d84
Related: https://github.com/go-gitea/gitea/pull/18527#discussion_r883268890
Author-Change-Id: IB#1105104

Co-authored-by: silverwind <me@silverwind.io>
2 years ago
wxiaoguang 867b34d5e9 [skip ci] Updated translations via Crowdin 2 years ago
zeripath 808a780309 [skip ci] Updated translations via Crowdin 2 years ago
zeripath 5283d1ead5 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot e31c6166ee [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot fe4c846ccb [skip ci] Updated translations via Crowdin 2 years ago
wxiaoguang e0273bad72
Fix i18n for Link Account button, re-format tmpl (#19835) 2 years ago
GiteaBot 76681883ec [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot cfb4c23a50 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 7671a3322b [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot d2a91e5e59 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot fa5dec966c [skip ci] Updated licenses and gitignores 2 years ago
zeripath ffb7ab31f2
Estimate Action Count in Statistics (#19775) 2 years ago
GiteaBot 6d54799bbc [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 761d4f40be [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot cafa2dcb87 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot d985dcc922 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 9fc194d2d9 [skip ci] Updated translations via Crowdin 2 years ago
Jack Hay 7e19200e53
Add tooltip to pending PR comments (#19662) 2 years ago
GiteaBot cd99540cdc [skip ci] Updated translations via Crowdin 2 years ago
Lunny Xiao 9efa47131f
Admin should not delete himself (#19423)
Admin should not be able to delete themselves.

Also partially fix #15449
2 years ago
Lunny Xiao d4834071da
Repository level enable package or disable (#19323) 2 years ago
delvh 5ca224a789
Allow to mark files in a PR as viewed (#19007)
Users can now mark files in PRs as viewed, resulting in them not being shown again by default when they reopen the PR again.
2 years ago
kolaente 59b30f060a
Auto merge pull requests when all checks succeeded via API (#9307)
* Fix indention

Signed-off-by: kolaente <k@knt.li>

* Add option to merge a pr right now without waiting for the checks to succeed

Signed-off-by: kolaente <k@knt.li>

* Fix lint

Signed-off-by: kolaente <k@knt.li>

* Add scheduled pr merge to tables used for testing

Signed-off-by: kolaente <k@knt.li>

* Add status param to make GetPullRequestByHeadBranch reusable

Signed-off-by: kolaente <k@knt.li>

* Move "Merge now" to a seperate button to make the ui clearer

Signed-off-by: kolaente <k@knt.li>

* Update models/scheduled_pull_request_merge.go

Co-authored-by: 赵智超 <1012112796@qq.com>

* Update web_src/js/index.js

Co-authored-by: 赵智超 <1012112796@qq.com>

* Update web_src/js/index.js

Co-authored-by: 赵智超 <1012112796@qq.com>

* Re-add migration after merge

* Fix frontend lint

* Fix version compare

* Add vendored dependencies

* Add basic tets

* Make sure the api route is capable of scheduling PRs for merging

* Fix comparing version

* make vendor

* adopt refactor

* apply suggestion: User -> Doer

* init var once

* Fix Test

* Update templates/repo/issue/view_content/comments.tmpl

* adopt

* nits

* next

* code format

* lint

* use same name schema; rm CreateUnScheduledPRToAutoMergeComment

* API: can not create schedule twice

* Add TestGetBranchNamesForSha

* nits

* new go routine for each pull to merge

* Update models/pull.go

Co-authored-by: a1012112796 <1012112796@qq.com>

* Update models/scheduled_pull_request_merge.go

Co-authored-by: a1012112796 <1012112796@qq.com>

* fix & add renaming sugestions

* Update services/automerge/pull_auto_merge.go

Co-authored-by: a1012112796 <1012112796@qq.com>

* fix conflict relicts

* apply latest refactors

* fix: migration after merge

* Update models/error.go

Co-authored-by: delvh <dev.lh@web.de>

* Update options/locale/locale_en-US.ini

Co-authored-by: delvh <dev.lh@web.de>

* Update options/locale/locale_en-US.ini

Co-authored-by: delvh <dev.lh@web.de>

* adapt latest refactors

* fix test

* use more context

* skip potential edgecases

* document func usage

* GetBranchNamesForSha() -> GetRefsBySha()

* start refactoring

* ajust to new changes

* nit

* docu nit

* the great check move

* move checks for branchprotection into own package

* resolve todo now ...

* move & rename

* unexport if posible

* fix

* check if merge is allowed before merge on scheduled pull

* debugg

* wording

* improve SetDefaults & nits

* NotAllowedToMerge -> DisallowedToMerge

* fix test

* merge files

* use package "errors"

* merge files

* add string names

* other implementation for gogit

* adapt refactor

* more context for models/pull.go

* GetUserRepoPermission use context

* more ctx

* use context for loading pull head/base-repo

* more ctx

* more ctx

* models.LoadIssueCtx()

* models.LoadIssueCtx()

* Handle pull_service.Merge in one DB transaction

* add TODOs

* next

* next

* next

* more ctx

* more ctx

* Start refactoring structure of old pull code ...

* move code into new packages

* shorter names ... and finish **restructure**

* Update models/branches.go

Co-authored-by: zeripath <art27@cantab.net>

* finish UpdateProtectBranch

* more and fix

* update datum

* template: use "svg" helper

* rename prQueue 2 prPatchCheckerQueue

* handle automerge in queue

* lock pull on git&db actions ...

* lock pull on git&db actions ...

* add TODO notes

* the regex

* transaction in tests

* GetRepositoryByIDCtx

* shorter table name and lint fix

* close transaction bevore notify

* Update models/pull.go

* next

* CheckPullMergable check all branch protections!

* Update routers/web/repo/pull.go

* CheckPullMergable check all branch protections!

* Revert "PullService lock via pullID (#19520)" (for now...)

This reverts commit 6cde7c9159a5ea75a10356feb7b8c7ad4c434a9a.

* Update services/pull/check.go

* Use for a repo action one database transaction

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>

* Update services/issue/status.go

Co-authored-by: delvh <dev.lh@web.de>

* Update services/issue/status.go

Co-authored-by: delvh <dev.lh@web.de>

* use db.WithTx()

* gofmt

* make pr.GetDefaultMergeMessage() context aware

* make MergePullRequestForm.SetDefaults context aware

* use db.WithTx()

* pull.SetMerged only with context

* fix deadlock in `test-sqlite\#TestAPIBranchProtection`

* dont forget templates

* db.WithTx allow to set the parentCtx

* handle db transaction in service packages but not router

* issue_service.ChangeStatus just had caused another deadlock :/
it has to do something with how notification package is handled

* if we merge a pull in one database transaktion, we get a lock, because merge infoce internal api that cant handle open db sessions to the same repo

* ajust to current master

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>

* dont open db transaction in router

* make generate-swagger

* one _success less

* wording nit

* rm

* adapt

* remove not needed test files

* rm less diff & use attr in JS

* ...

* Update services/repository/files/commit.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

* ajust db schema for PullAutoMerge

* skip broken pull refs

* more context in error messages

* remove webUI part for another pull

* remove more WebUI only parts

* API: add CancleAutoMergePR

* Apply suggestions from code review

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

* fix lint

* Apply suggestions from code review

* cancle -> cancel

Co-authored-by: delvh <dev.lh@web.de>

* change queue identifyer

* fix swagger

* prevent nil issue

* fix and dont drop error

* as per @zeripath

* Update integrations/git_test.go

Co-authored-by: delvh <dev.lh@web.de>

* Update integrations/git_test.go

Co-authored-by: delvh <dev.lh@web.de>

* more declarative integration tests (dedup code)

* use assert.False/True helper

Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot 5a9c505e14 [skip ci] Updated translations via Crowdin 2 years ago
neon 0483ee8f69
Add "Reference" section to Issue view sidebar (#19609)
* Add "Reference" section to Issue view sidebar

* Removed unneeded tailored CSS, added Fomantic UI classes

* Removed tailored CSS in favour of HTML-only approach

Kindly provided by @Gusted

* Added i18 translation key for reference link string

* Corrected spelling of "References:" to "Reference:" for reference link text

* Removed `Issue.ReferenceLink` in favour of a local template variable
2 years ago
GiteaBot 5a75a5463e [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 05234adfa8 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 094c8fdc87 [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot bf7258be9c [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 53829b84f0 [skip ci] Updated translations via Crowdin 2 years ago
qwerty287 8eb1cd9264
Add "Allow edits from maintainer" feature (#18002)
Adds a feature [like GitHub has](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) (step 7).
If you create a new PR from a forked repo, you can select (and change later, but only if you are the PR creator/poster) the "Allow edits from maintainers" option.
Then users with write access to the base branch get more permissions on this branch:
* use the update pull request button
* push directly from the command line (`git push`)
* edit/delete/upload files via web UI
* use related API endpoints

You can't merge PRs to this branch with this enabled, you'll need "full" code write permissions.

This feature has a pretty big impact on the permission system. I might forgot changing some things or didn't find security vulnerabilities. In this case, please leave a review or comment on this PR.

Closes #17728

Co-authored-by: 6543 <6543@obermui.de>
2 years ago
GiteaBot 960b813a33 [skip ci] Updated translations via Crowdin 2 years ago
Lunny Xiao 03eba32bd9
Add a new menu in file view to open blame view and fix blame view select range bug (#19500) 2 years ago
GiteaBot 741c55b4ea [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 5e4134b117 [skip ci] Updated translations via Crowdin 2 years ago
ktprograms ef164d33c2
Add RSS Feed buttons to Repo, User and Org pages (#19370) 2 years ago
GiteaBot 0abd8b0abc [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 9550e5a23e [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 0dfc2e55ea [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot f7a8e5c8f2 [skip ci] Updated translations via Crowdin 2 years ago
KN4CK3R 18727df73a
Add Helm Chart registry (#19406) 2 years ago
GiteaBot b74322dfce [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 490065b93b [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 3255ba9305 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 72479bff89 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot c6531de3f5 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot bb7e0619c3 [skip ci] Updated translations via Crowdin 2 years ago
原俊杰 184302665f
Show ssh command directly in template instead of i18n translation (#19335)
* add missing space for generate ssh token command

Signed-off-by: Junjie Yuan <yuan@junjie.pro>

* Do not use i18n for ssh command

* Remove unnecessary settings.ssh_token_code

* Revert locale_zh-CN.ini

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot 8ddcd37f13 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 5ae875a1ae [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 256204befa [skip ci] Updated translations via Crowdin 2 years ago
Steven be9ef15f8a
Fix links to packages documentation (#19315) 2 years ago
GiteaBot 27c34dd011 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot ba2592c380 [skip ci] Updated translations via Crowdin 2 years ago
zeripath c88547ce71
Add Goroutine stack inspector to admin/monitor (#19207)
Continues on from #19202.

Following the addition of pprof labels we can now more easily understand the relationship between a goroutine and the requests that spawn them. 

This PR takes advantage of the labels and adds a few others, then provides a mechanism for the monitoring page to query the pprof goroutine profile.

The binary profile that results from this profile is immediately piped in to the google library for parsing this and then stack traces are formed for the goroutines.

If the goroutine is within a context or has been created from a goroutine within a process context it will acquire the process description labels for that process. 

The goroutines are mapped with there associate pids and any that do not have an associated pid are placed in a group at the bottom as unbound.

In this way we should be able to more easily examine goroutines that have been stuck.

A manager command `gitea manager processes` is also provided that can export the processes (with or without stacktraces) to the command line.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago
GiteaBot 84038f33f4 [skip ci] Updated translations via Crowdin 2 years ago
Norwin 9cbeab440e
fix link to package registry docs (#19268) 2 years ago
KN4CK3R 1d332342db
Add Package Registry (#16510)
* Added package store settings.

* Added models.

* Added generic package registry.

* Added tests.

* Added NuGet package registry.

* Moved service index to api file.

* Added NPM package registry.

* Added Maven package registry.

* Added PyPI package registry.

* Summary is deprecated.

* Changed npm name.

* Sanitize project url.

* Allow only scoped packages.

* Added user interface.

* Changed method name.

* Added missing migration file.

* Set page info.

* Added documentation.

* Added documentation links.

* Fixed wrong error message.

* Lint template files.

* Fixed merge errors.

* Fixed unit test storage path.

* Switch to json module.

* Added suggestions.

* Added package webhook.

* Add package api.

* Fixed swagger file.

* Fixed enum and comments.

* Fixed NuGet pagination.

* Print test names.

* Added api tests.

* Fixed access level.

* Fix User unmarshal.

* Added RubyGems package registry.

* Fix lint.

* Implemented io.Writer.

* Added support for sha256/sha512 checksum files.

* Improved maven-metadata.xml support.

* Added support for symbol package uploads.

* Added tests.

* Added overview docs.

* Added npm dependencies and keywords.

* Added no-packages information.

* Display file size.

* Display asset count.

* Fixed filter alignment.

* Added package icons.

* Formatted instructions.

* Allow anonymous package downloads.

* Fixed comments.

* Fixed postgres test.

* Moved file.

* Moved models to models/packages.

* Use correct error response format per client.

* Use simpler search form.

* Fixed IsProd.

* Restructured data model.

* Prevent empty filename.

* Fix swagger.

* Implemented user/org registry.

* Implemented UI.

* Use GetUserByIDCtx.

* Use table for dependencies.

* make svg

* Added support for unscoped npm packages.

* Add support for npm dist tags.

* Added tests for npm tags.

* Unlink packages if repository gets deleted.

* Prevent user/org delete if a packages exist.

* Use package unlink in repository service.

* Added support for composer packages.

* Restructured package docs.

* Added missing tests.

* Fixed generic content page.

* Fixed docs.

* Fixed swagger.

* Added missing type.

* Fixed ambiguous column.

* Organize content store by sha256 hash.

* Added admin package management.

* Added support for sorting.

* Add support for multiple identical versions/files.

* Added missing repository unlink.

* Added file properties.

* make fmt

* lint

* Added Conan package registry.

* Updated docs.

* Unify package names.

* Added swagger enum.

* Use longer TEXT column type.

* Removed version composite key.

* Merged package and container registry.

* Removed index.

* Use dedicated package router.

* Moved files to new location.

* Updated docs.

* Fixed JOIN order.

* Fixed GROUP BY statement.

* Fixed GROUP BY #2.

* Added symbol server support.

* Added more tests.

* Set NOT NULL.

* Added setting to disable package registries.

* Moved auth into service.

* refactor

* Use ctx everywhere.

* Added package cleanup task.

* Changed packages path.

* Added container registry.

* Refactoring

* Updated comparison.

* Fix swagger.

* Fixed table order.

* Use token auth for npm routes.

* Enabled ReverseProxy auth.

* Added packages link for orgs.

* Fixed anonymous org access.

* Enable copy button for setup instructions.

* Merge error

* Added suggestions.

* Fixed merge.

* Handle "generic".

* Added link for TODO.

* Added suggestions.

* Changed temporary buffer filename.

* Added suggestions.

* Apply suggestions from code review

Co-authored-by: Thomas Boerger <thomas@webhippie.de>

* Update docs/content/doc/packages/nuget.en-us.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Thomas Boerger <thomas@webhippie.de>
2 years ago
GiteaBot ea8622d454 [skip ci] Updated translations via Crowdin 2 years ago
zeripath 90e0a402c1
Show last cron messages on monitor page (#19223)
As discussed on #19221 we should store the results of the last task message on the
crontask and show them on the monitor page.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
Pilou 893c8938fc
New cron task: delete old system notices (#19219)
Add a new cron task which deletes the old system notices.
2 years ago
GiteaBot 04601d22f5 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 71a5aaef32 [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot e48f3b0527 [skip ci] Updated translations via Crowdin 2 years ago
MeIchthys f7883a6aec
Update issue_no_dependencies description (#19112)
To be more consistent and concise we could change the issue_no_dependencies from: `This issue currently doesn't have any dependencies. ` to `No dependencies set.` like we do for the due date and others.

Co-authored-by: delvh <dev.lh@web.de>
2 years ago
GiteaBot db6080f4f8 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 572c63d237 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 83a2f79d5d [skip ci] Updated licenses and gitignores 2 years ago
zeripath 7fc5fd6415
Do not send activation email if manual confirm is set (#19119)
If the mailer is configured then even if Manual confirm is set an activation email
is still being sent because `handleUserCreated` is not checking for this case.

Fix #17263

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
GiteaBot cc6ff74253 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 3ad6cf2069 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 780cf76f6e [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot a0c043f5c6 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 7443213707 [skip ci] Updated translations via Crowdin 2 years ago
Otto Richter (fnetX) ea46142bce
Add button for issue deletion (#19032)
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years ago
Roger Luo bbce905b6a
Feature: show issue assignee on project board (#15232)
* Show assignees in project boards.
2 years ago
GiteaBot 98f54081d6 [skip ci] Updated translations via Crowdin 2 years ago
Jimmy Praet 5184c83f6b
Add config option to disable "Update branch by rebase" (#18745) 2 years ago
GiteaBot 3ba9dcf4b4 [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 2f2f11e45d [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 15a4b1d42b [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot d5a4c5530a [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 833f291c40 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 1eb6bb9028 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 2be49dee71 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 27af864cc2 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot f1d8030310 [skip ci] Updated translations via Crowdin 2 years ago
zeripath 4e57bd1d30
Add number in queue status to monitor page (#18712)
Add number in queue status to the monitor page so that administrators can
assess how much work is left to be done in the queues.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot 5aa4eeb180 [skip ci] Updated translations via Crowdin 2 years ago
Sven Seeberg 832ce406ae
Add LDAP group sync to Teams, fixes #1395 (#16299)
* Add setting for a JSON that maps LDAP groups to Org Teams.
* Add log when removing or adding team members.
* Sync is being run on login and periodically.
* Existing group filter settings are reused.
* Adding and removing team members.
* Sync not existing LDAP group.
* Login with broken group map JSON.
2 years ago
GiteaBot f9e7edc5d9 [skip ci] Updated translations via Crowdin 2 years ago
Lunny Xiao 0c70b4c211
Fix bug for version update hint (#18701)
Co-authored-by: silverwind <me@silverwind.io>
2 years ago
GiteaBot e034d3a710 [skip ci] Updated translations via Crowdin 2 years ago
zeripath eb748f5f3c
Add apply-patch, basic revert and cherry-pick functionality (#17902)
This code adds a simple endpoint to apply patches to repositories and
branches on gitea. This is then used along with the conflicting checking
code in #18004 to provide a basic implementation of cherry-pick revert.

Now because the buttons necessary for cherry-pick and revert have 
required us to create a dropdown next to the Browse Source button
I've also implemented Create Branch and Create Tag operations.

Fix #3880 
Fix #17986 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago
GiteaBot 4160aff86e [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 8422b1c55c [skip ci] Updated translations via Crowdin 2 years ago
wxiaoguang c2a3e38194
Fix the missing i18n key for update checker (#18646) 2 years ago
GiteaBot 3b33507c73 [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 319d191afc [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 5469e61a8e [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 1de5028394 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot db7c3ecc1f [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 74dcdadf08 [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 726715fcfb [skip ci] Updated translations via Crowdin 2 years ago
Gusted 7b04c97b7b
Fix typo (#18436)
As title

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years ago
GiteaBot 668718c67e [skip ci] Updated translations via Crowdin 2 years ago
Lauris BH 8038610a42
Automatically pause queue if index service is unavailable (#15066)
* Handle keyword search error when issue indexer service is not available

* Implement automatic disabling and resume of code indexer queue
2 years ago
GiteaBot 2649eddcf0 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 4889ab52de [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 8053b60b4f [skip ci] Updated translations via Crowdin 2 years ago
wxiaoguang 5506cb92da
Refactor webhooks i18n (#18380) 2 years ago
GiteaBot 4bfd749fc5 [skip ci] Updated translations via Crowdin 2 years ago
Dr. Tobias Quathamer 3349fd8f79
Add packagist webhook (#18224)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot e040eca727 [skip ci] Updated translations via Crowdin 2 years ago
zeripath a82fd98d53
Pause queues (#15928)
* Start adding mechanism to return unhandled data

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Create pushback interface

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add Pausable interface to WorkerPool and Manager

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Implement Pausable and PushBack for the bytefifos

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Implement Pausable and Pushback for ChannelQueues and ChannelUniqueQueues

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Wire in UI for pausing

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add testcases and fix a few issues

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix build

Signed-off-by: Andrew Thornton <art27@cantab.net>

* prevent "race" in the test

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix jsoniter mismerge

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix conflicts

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix format

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add warnings for no worker configurations and prevent data-loss with redis/levelqueue

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Use StopTimer

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot f91092453e [skip ci] Updated translations via Crowdin 2 years ago
qwerty287 1f40933d38
Add config options to hide issue events (#17414)
* Add config option to hide issue events
Adds a config option `HIDE_ISSUE_EVENTS` to hide most issue events (changed labels, milestones, projects...) on the issue detail page.
If this is true, only the following events (comment types) are shown:
* plain comments
* closed/reopned/merged
* reviews

* Make configurable using a list

* Add docs

* Add missing newline

* Fix merge issues

* Allow changes per user settings

* Fix lint

* Rm old docs

* Apply suggestions from code review

* Use bitsets

* Rm comment

* fmt

* Fix lint

* Use variable/constant to provide key

* fmt

* fix lint

* refactor

* Add a prefix for user setting key

* Add license comment

* Add license comment

* Update services/forms/user_form_hidden_comments.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* check len == 0

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years ago
GiteaBot 6c7084cbee [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot b7c6457648 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot c68f1281f6 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 531b6d60e1 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot eed8633fb0 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot bd7680f450 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot a15353dc00 [skip ci] Updated translations via Crowdin 2 years ago
zeripath d7c2a2951c
Webauthn nits (#18284)
This contains some additional fixes and small nits related to #17957 

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
Lunny Xiao 35c3553870
Support webauthn (#17957)
Migrate from U2F to Webauthn

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot 8808293247 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot ed6757ecdc [skip ci] Updated translations via Crowdin 2 years ago
luzpaz 8c647bf0f6
Fix various typos (#18219)
Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby,te,unknwon`

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
GiteaBot 60b945565d [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot de578bff8c [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 69a4bd02f0 [skip ci] Updated translations via Crowdin 2 years ago
KN4CK3R e30b20dc68
Show OAuth callback error message (#18185)
* Show callback error message.

* lint

* Use error code to display a message.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
zeripath 21ed4fd8da
Add warning for BIDI characters in page renders and in diffs (#17562)
Fix #17514

Given the comments I've adjusted this somewhat. The numbers of characters detected are increased and include things like the use of U+300 to make à instead of à and non-breaking spaces.

There is a button which can be used to escape the content to show it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Gwyneth Morgan <gwymor@tilde.club>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot ee60f27aec [skip ci] Updated translations via Crowdin 2 years ago
KN4CK3R bf7b083cfe
Add replay of webhooks. (#18191) 2 years ago
Lunny Xiao 8760af752a
Team permission allow different unit has different permission (#17811)
* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* fix

* gofumpt

* Integration test for migration (#18124)

integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>

* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* Fix bug

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
2 years ago
GiteaBot 0848c716bf [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot f499f23039 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 6a3611cc3d [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot a3d685077f [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot ccb7978538 [skip ci] Updated translations via Crowdin 2 years ago
Gusted e4e3df6c66
Handle invalid issues (#18111)
* Handle invalid issues

- When you hover over a issue reference, and the issue doesn't exist, it
will just hang on the loading animation.
- This patch fixes that by showing them the pop-up with a "Error
occured" message.

* Add I18N

* refactor

* fix comment for lint

* fix unit test for i18n

* fix unit test for i18n

* add comments

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
GiteaBot d2fac636d1 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 13d002a755 [skip ci] Updated translations via Crowdin 2 years ago
Lunny Xiao d7770539f6
Improve interface when comparing a branch which has created a pull request (#17911)
* Improve interface when comparing a branch which has created a pull request

* Take the note back
2 years ago
qwerty287 5754080eb9
Fix various typos of software names (#18083)
* `git` -> `Git`
* `Github` and `github` -> `GitHub`
* `crowdin` -> `Crowdin`
* `git-lfs` -> `Git LFS`
* `githooks`, `git hooks`, `git-hooks` -> `Git Hooks`
* `discord` -> `Discord`
* `2fa` -> `2FA`
* `gitlab` and `Gitlab` -> `GitLab`
* `web hook` -> `webhook`
* `linux` -> `Linux`
* `sqlite` -> `SQLite`
* `MYSQL` and `mysql` -> `MySQL`
* rename refs to `master` branch -> `main`
* Fix English grammar
2 years ago
GiteaBot d155ffc610 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot be91df42d1 [skip ci] Updated translations via Crowdin 2 years ago
zeripath e4e411821d
Abort merge if head has been updated before pressing merge (#18032)
* Abort merge if head has been updated before pressing merge

It is possible that a PR head may be pushed to between the merge page being shown
and the merge button being pressed. Pass the current expected head in as a parameter
and cancel the merge if it has changed.

Fix #18028

Signed-off-by: Andrew Thornton <art27@cantab.net>

* adjust swagger

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago
Wim 6fe756dc93
Add support for ssh commit signing (#17743)
* Add support for ssh commit signing

* Split out ssh verification to separate file

* Show ssh key fingerprint on commit page

* Update sshsig lib

* Make sure we verify against correct namespace

* Add ssh public key verification via ssh signatures

When adding a public ssh key also validate that this user actually
owns the key by signing a token with the private key.

* Remove some gpg references and make verify key optional

* Fix spaces indentation

* Update options/locale/locale_en-US.ini

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Update templates/user/settings/keys_ssh.tmpl

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Update options/locale/locale_en-US.ini

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Update options/locale/locale_en-US.ini

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Update models/ssh_key_commit_verification.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Reword ssh/gpg_key_success message

* Change Badsignature to NoKeyFound

* Add sign/verify tests

* Fix upstream api changes to user_model User

* Match exact on SSH signature

* Fix code review remarks

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago
GiteaBot 487ce3b49e [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot 8662ff68da [skip ci] Updated translations via Crowdin 2 years ago
zeripath 8354670708
Prevent hang in git cat-file if repository is not a valid repository and other fixes (#17991)
This PR contains multiple fixes. The most important of which is:

* Prevent hang in git cat-file if the repository is not a valid repository 
    
    Unfortunately it appears that if git cat-file is run in an invalid
    repository it will hang until stdin is closed. This will result in
    deadlocked /pulls pages and dangling git cat-file calls if a broken
    repository is tried to be reviewed or pulls exists for a broken
    repository.

    Fix #14734
    Fix #9271
    Fix #16113

Otherwise there are a few small other fixes included which this PR was initially intending to fix:

* Fix panic on partial compares due to missing PullRequestWorkInProgressPrefixes
* Fix links on pulls pages  due to regression from #17551 - by making most /issues routes match /pulls too - Fix #17983
* Fix links on feeds pages due to another regression from #17551 but also fix issue with syncing tags - Fix #17943
* Add missing locale entries for oauth group claims
* Prevent NPEs if ColorFormat is called on nil users, repos or teams.
2 years ago
zeripath e0e3ba6c12
Add Reindex buttons to repository settings page (#17494)
This PR adds reindexing request buttons to the repository settings page.

Fix #3796

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
GiteaBot e78ee73d71 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 790e6cfeec [skip ci] Updated translations via Crowdin 2 years ago
zeripath 0981ec30c3
Add Option to synchronize Admin & Restricted states from OIDC/OAuth2 along with Setting Scopes (#16766)
* Add setting to OAuth handlers to override local 2FA settings

This PR adds a setting to OAuth and OpenID login sources to allow the source to
override local 2FA requirements.

Fix #13939

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix regression from #16544

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add scopes settings

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix trace logging in auth_openid

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add required claim options

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Move UpdateExternalUser to externalaccount

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Allow OAuth2/OIDC to set Admin/Restricted status

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Allow use of the same group claim name for the prohibit login value

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fixup! Move UpdateExternalUser to externalaccount

* as per wxiaoguang

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add label back in

Signed-off-by: Andrew Thornton <art27@cantab.net>

* adjust localisation

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago
zeripath b4782e24d2
Return nicer error for ForcePrivate (#17971) 2 years ago
KN4CK3R 8e9140dd69
Fixed wording. (#17973)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
GiteaBot bd475f5c9d [skip ci] Updated translations via Crowdin 2 years ago
qwerty287 c3eea2f8af
Improve behavior of "Fork" button (#17288)
* Improbe behaviour of fork button

* Apply suggestions from code review

* Remove old lines

* Apply suggestions

* Fix test

* Remove unnecessary or

* Update templates/repo/header.tmpl

Co-authored-by: silverwind <me@silverwind.io>

* Add comment

* Fix situation if you can't fork but don't have forks

* Fix lint

* Apply changes from #17783

* fmt

* fmt

* Apply tweaks

Co-authored by: silverwind <me@silverwind.io>

* Rm dupl css

* Fix build

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
GiteaBot 0a7e8327a0 [skip ci] Updated licenses and gitignores 2 years ago
GiteaBot fb8166c6c6 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 183175263d [skip ci] Updated translations via Crowdin 2 years ago
wxiaoguang a6f961fba4
Refactor install page (db type) (#17919)
* Refactor install page (db type)

* set correct default DB HOST for different DB TYPE
* remove legacy TiDB from documents
* unify the usage of DB TYPE, in code we only use "mysql". "MySQL" is only shown to users for friendly name.

* Gitea can use TiDB via MySQL protocol

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
GiteaBot b30870ef8b [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 6c34f6b954 [skip ci] Updated translations via Crowdin 2 years ago
GiteaBot 98d903a3c6 [skip ci] Updated licenses and gitignores 2 years ago
wxiaoguang a1dca00974
fix i18n (#17906) 2 years ago
GiteaBot c7c723c548 [skip ci] Updated translations via Crowdin 2 years ago
n 6791aae8de
Add hints for special Wiki pages (#17283)
* Add UI hints to create a Wiki sidebar and footer
2 years ago
GiteaBot 365b16cde1 [skip ci] Updated translations via Crowdin 2 years ago
KN4CK3R 87be76213a
Add migrate from Codebase (#16768)
This PR adds [Codebase](https://www.codebasehq.com/) as migration source.

Supported:
- Milestones
- Issues
- Pull Requests
- Comments
- Labels
2 years ago
GiteaBot 7026a30fdc [skip ci] Updated translations via Crowdin 2 years ago
wxiaoguang 042cac5fed
Improve install code to avoid low-level mistakes. (#17779)
* Improve install code to avoid low-level mistakes.

If a user tries to do a re-install in a Gitea database, they gets a warning and double check.
When Gitea runs, it never create empty app.ini automatically.

Also some small (related) refactoring:

* Refactor db.InitEngine related logic make it more clean (especially for the install code)
* Move some i18n strings out from setting.go to make the setting.go can be easily maintained.
* Show errors in CLI code if an incorrect app.ini is used.
* APP_DATA_PATH is created when installing, and checked when starting (no empty directory is created any more).
2 years ago
GiteaBot a3517d8668 [skip ci] Updated translations via Crowdin 2 years ago
zeripath 01087e9eef
Make Requests Processes and create process hierarchy. Associate OpenRepository with context. (#17125)
This PR registers requests with the process manager and manages hierarchy within the processes.

Git repos are then associated with a context, (usually the request's context) - with sub commands using this context as their base context.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago
GiteaBot eb8513a690 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 789d251ae4 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot f23851f690 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 4f99697888 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 3d996c85a5 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot c79cc2d3e8 [skip ci] Updated translations via Crowdin 3 years ago
zeripath 1dbc58f742
More pleasantly handle broken or missing git repositories (#17747)
* More pleasantly handle broken or missing git repositories

In #17742 it was noted that there a completely invalid git repository underlying a
repo on gitea.com. This happened due to a problem during a migration however, it
is not beyond the realms of possibility that a corruption could occur to another
user.

This PR adds a check to RepoAssignment that will detect if a repository loading has
failed due to an absent git repository. It will then show a page suggesting the user
contacts the administrator or deletes the repository.

Fix #17742

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update options/locale/locale_en-US.ini

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago
GiteaBot 55e9228866 [skip ci] Updated translations via Crowdin 3 years ago
zeripath 8511eec4d4
Allow Loading of Diffs that are too large (#17739)
* Allow Loading of Diffs that are too large

This PR allows the loading of diffs that are suppressed because the file
is too large. It does not handle diffs of files which have lines which
are too long.

Fix #17738

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago
GiteaBot ab09296d37 [skip ci] Updated licenses and gitignores 3 years ago
wxiaoguang 013fb73068
Use `hostmatcher` to replace `matchlist`, improve security (#17605)
Use hostmacher to replace matchlist.

And we introduce a better DialContext to do a full host/IP check, otherwise the attackers can still bypass the allow/block list by a 302 redirection.
3 years ago
GiteaBot 52869ef386 [skip ci] Updated translations via Crowdin 3 years ago
Gusted 381e131fc8
Added comment for changing issue ref (#17672)
* Added comment for changing issue ref
- Add a comment when someone changes the ref(erence?) of a issue.
3 years ago
GiteaBot 72b0882a45 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot b01f6c1a8c [skip ci] Updated translations via Crowdin 3 years ago
KN4CK3R ea42d3c04e
Fixed commit count. (#17698)
Added "Tag" label.
Unified branch, tag and commit name.
3 years ago
GiteaBot 171f2d066e [skip ci] Updated translations via Crowdin 3 years ago
qwerty287 3be156f66a
Allow admins to change user avatars (#17661)
Adds the avatar change panel to the edit user page (bottom) and allows admins to change it this way

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago
zeripath bbffcc3aec
Multiple Escaping Improvements (#17551)
There are multiple places where Gitea does not properly escape URLs that it is building and there are multiple places where it builds urls when there is already a simpler function available to use this.
    
This is an extensive PR attempting to fix these issues.

1. The first commit in this PR looks through all href, src and links in the Gitea codebase and has attempted to catch all the places where there is potentially incomplete escaping.
2. Whilst doing this we will prefer to use functions that create URLs over recreating them by hand.
3. All uses of strings should be directly escaped - even if they are not currently expected to contain escaping characters. The main benefit to doing this will be that we can consider relaxing the constraints on user names and reponames in future. 
4. The next commit looks at escaping in the wiki and re-considers the urls that are used there. Using the improved escaping here wiki files containing '/'. (This implementation will currently still place all of the wiki files the root directory of the repo but this would not be difficult to change.)
5. The title generation in feeds is now properly escaped.
6. EscapePound is no longer needed - urls should be PathEscaped / QueryEscaped as necessary but then re-escaped with Escape when creating html with locales Signed-off-by: Andrew Thornton <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago
silverwind 23bd7b1211
Add copy button to markdown code blocks (#17638)
* Add copy button to markdown code blocks

Done mostly in JS because I think it's better not to try getting buttons
past the markup sanitizer.

* add svg module tests

* fix sanitizer regexp

* remove outdated comment

* vertically center button in issue comments as well

* add comment to css

* fix undefined on view file line copy

* combine animation less files

* Update modules/markup/markdown/markdown.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

* add test for different sizes

* add cloneNode and add tests for it

* use deep clone

* remove useless optional chaining

* remove the svg node cache

* unify clipboard copy string and i18n

* remove unused var

* remove unused localization

* minor css tweaks to the button

* comment tweak

* remove useless attribute

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
GiteaBot 3a60e0ad89 [skip ci] Updated translations via Crowdin 3 years ago
KN4CK3R ff9564a679
Changed migration text. (#17654) 3 years ago
Gusted 562785ef4e
Add download button for file viewer (#17640)
- Resolves #17286
- Use the `download` attribute such that the browser will natively
initate a download dialog for the given URL.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago
GiteaBot 10db864c66 [skip ci] Updated translations via Crowdin 3 years ago
KN4CK3R 42ea0023a3
Add migration from GitBucket (#16767)
This PR adds [GitBucket](https://gitbucket.github.io/) as migration source.

Supported:
- Milestones
- Issues
- Pull Requests
- Comments
- Reviews
- Labels

There is no public usable instance so no integration tests added.
3 years ago
GiteaBot 424959e07c [skip ci] Updated licenses and gitignores 3 years ago
zeripath bab95c3a86
Correctly handle failed migrations (#17575)
* Correctly handle failed migrations

There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix #17571

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago
GiteaBot 465fb4169e [skip ci] Updated translations via Crowdin 3 years ago
Kamil Domański 021df29623
Allow U2F 2FA without TOTP (#11573)
This change enables the usage of U2F without being forced to enroll an TOTP authenticator.
The `/user/auth/u2f` has been changed to hide the "use TOTP instead" bar if TOTP is not enrolled.

Fixes #5410
Fixes #17495
3 years ago
GiteaBot c9110eb5e4 [skip ci] Updated translations via Crowdin 3 years ago
Yuwei Ba 5e0cf4b82e
Update locale_en-US.ini (#17553) 3 years ago
GiteaBot de9625e485 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 1ff944f698 [skip ci] Updated licenses and gitignores 3 years ago
GiteaBot f5bb788c4e [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 9733b60430 [skip ci] Updated translations via Crowdin 3 years ago
zeripath 3fc465ba5e
Fix mispelling of starred as stared (#17465)
There was a recent spelling mistake added to the locale file where stared was used
instead of starred.

This PR changes this to starred.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
qwerty287 01fc24c78c
Add appearance section in settings (#17433)
* Add appearance section in settings

* Fix lint

* Fix lint

* Apply suggestions from code review

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago
GiteaBot 843bc9deeb [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 07c7100c60 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 2a9aefdabb [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 23d36929bc [skip ci] Updated translations via Crowdin 3 years ago
zeripath 09938ccd99
Re-separate the color translation strings (#17390)
Fix #17384

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago
GiteaBot 9046c022d2 [skip ci] Updated translations via Crowdin 3 years ago
Mario Lubenka 0208ea0248
"Copy branch name" button in pull request (#17323)
* Drop data-original from clipboard

data-original attribute was removed. Instead, the original value from
data-content is set after success/fail message was displayed.

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* "Copy branch name" button in pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Update templates/repo/issue/view_title.tmpl

Co-authored-by: silverwind <me@silverwind.io>

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago
GiteaBot 1f41fcc342 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 62a6717701 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 8af5450cf7 [skip ci] Updated translations via Crowdin 3 years ago
6543 3728f1daa0
Add RSS/Atom feed support for user actions (#16002)
Return rss/atom feed for user based on rss url suffix or Content-Type header.
3 years ago
GiteaBot 74b6805225 [skip ci] Updated translations via Crowdin 3 years ago
zeripath a889d0cc8c
Add buttons to allow loading of incomplete diffs (#16829)
This PR adds two buttons to the stats and the end of the diffs list to load the (some of) the remaining incomplete diff sections.

Contains #16775
    
Signed-off-by: Andrew Thornton <art27@cantab.net>


## Screenshots

### Show more button at the end of the diff
![Screenshot from 2021-09-04 11-12-37](https://user-images.githubusercontent.com/1824502/132091009-b1f6113e-2c04-4be5-8a04-b8ecea56887b.png)

### Show more button at the end of the diff stats box
![Screenshot from 2021-09-04 11-14-54](https://user-images.githubusercontent.com/1824502/132091063-86da5a6d-6628-4b82-bea9-3655cd9f40f6.png)
3 years ago
Lunny Xiao bdfd751af8
Multiple tokens support for migrating from github (#17134)
* multiple tokens support for migrating from github

* improve code and token description

* Fix bug

* Add comment for get client
3 years ago
GiteaBot 96ff3e310f [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot bd14c40461 [skip ci] Updated translations via Crowdin 3 years ago
wxiaoguang 7bcbdd0707
Add user status filter to admin user management page (#16770)
It makes Admin's life easier to filter users by various status.

* introduce window.config.PageData to pass template data to javascript module and small refactor

move legacy window.ActivityTopAuthors to window.config.PageData.ActivityTopAuthors
make HTML structure more IDE-friendly in footer.tmpl and head.tmpl
remove incorrect <style class="list-search-style"></style> in head.tmpl
use log.Error instead of log.Critical in admin user search

* use LEFT JOIN instead of SubQuery when admin filters users by 2fa. revert non-en locale.

* use OptionalBool instead of status map

* refactor SearchUserOptions.toConds to SearchUserOptions.toSearchQueryBase

* add unit test for user search

* only allow admin to use filters to search users
3 years ago
GiteaBot 7b8723158e [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 758c8c8446 [skip ci] Updated translations via Crowdin 3 years ago
wxiaoguang c5c88f2f18
Save and view issue/comment content history (#16909)
* issue content history

* Use timeutil.TimeStampNow() for content history time instead of issue/comment.UpdatedUnix (which are not updated in time)

* i18n for frontend

* refactor

* clean up

* fix refactor

* re-format

* temp refactor

* follow db refactor

* rename IssueContentHistory to ContentHistory, remove empty model tags

* fix html

* use avatar refactor to generate avatar url

* add unit test, keep at most 20 history revisions.

* re-format

* syntax nit

* Add issue content history table

* Update models/migrations/v197.go

Co-authored-by: 6543 <6543@obermui.de>

* fix merge

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago
GiteaBot ff9a8a2231 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 6d30a00762 [skip ci] Updated translations via Crowdin 3 years ago
a1012112796 bb39359668
Add a simple way to rename branch like gh (#15870)
- Update default branch if needed
- Update protected branch if needed
- Update all not merged pull request base branch name
- Rename git branch
- Record this rename work and auto redirect for old branch on ui

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: delvh <dev.lh@web.de>
3 years ago
GiteaBot f4ea6cc4b4 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot dd22c65002 [skip ci] Updated translations via Crowdin 3 years ago
qwerty287 47193dbcd9
Add option to copy line permalink (#17145)
* Add option to copy line permalink

* Fix lint

* Apply review suggestions

* Update code and fix lint

* Use features/clipboard.js framework
3 years ago
GiteaBot 5b2b2cf923 [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot 347d48fdfe [skip ci] Updated translations via Crowdin 3 years ago
GiteaBot ac10c4ecc2 [skip ci] Updated translations via Crowdin 3 years ago
zeripath ddd3586c06
Fix missing repo link in issue/pull assigned emails (#17183)
There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English locale string.

Fix #17160

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
3 years ago
Romain ecfac78f6e
Kanban colored boards (#16647)
Add a column Color in ProjectBoard and color picker in new / edit project board form.
3 years ago
GiteaBot 51bfe62bd9 [skip ci] Updated translations via Crowdin 3 years ago