]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoAdd a few more comments to the CONTRIBUTING.md document (#18469)
zeripath [Sun, 30 Jan 2022 18:56:48 +0000 (18:56 +0000)]
Add a few more comments to the CONTRIBUTING.md document (#18469)

* Explain how to title your Backport PR
* Advise that the first comment in a PR should explain the PR
* Include information about BREAKING changes
* Include information about backports/frontports
* Add reference command for creating backports
* Add reference commandline for creating large characters
* Add information about updating docs/config.yaml
* Update year in the copyright

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFrontport changelog 1.16.0 (#18468) (#18470)
zeripath [Sun, 30 Jan 2022 18:22:16 +0000 (18:22 +0000)]
Frontport changelog 1.16.0 (#18468) (#18470)

Frontport #18468

Frontport changelog for 1.16, frontport 1.15.11 changelog and update config.yaml

 ## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30

* BREAKING
  * Remove golang vendored directory (#18277)
  * Paginate releases page & set default page size to 10 (#16857)
  * Only allow webhook to send requests to allowed hosts (#17482)
* SECURITY
  * Disable content sniffing on `PlainTextBytes` (#18359) (#18365)
  * Only view milestones from current repo (#18414) (#18417)
  * Sanitize user-input on file name (#17666)
  * Use `hostmatcher` to replace `matchlist` to improve blocking of bad hosts in Webhooks (#17605)
* FEATURES
  * Add/update SMTP auth providers via cli (#18197)
  * Support webauthn (#17957)
  * Team permission allow different unit has different permission (#17811)
  * Implement Well-Known URL for password change (#17777)
  * Add support for ssh commit signing (#17743)
  * Allow Loading of Diffs that are too large (#17739)
  * Add copy button to markdown code blocks (#17638)
  * Add .gitattribute assisted language detection to blame, diff and render (#17590)
  * Add `PULL_LIMIT` and `PUSH_LIMIT` to cron.update_mirror task (#17568)
  * Add Reindex buttons to repository settings page (#17494)
  * Make SSL cipher suite configurable (#17440)
  * Add groups scope/claim to OIDC/OAuth2 Provider (#17367)
  * Add simple update checker to Gitea (#17212)
  * Migrated Repository will show modifications when possible (#17191)
  * Create pub/priv keypair for federation (#17071)
  * Make LDAP be able to skip local 2FA (#16954)
  * Add nodeinfo endpoint for federation purposes (#16953)
  * Save and view issue/comment content history (#16909)
  * Use git attributes to determine generated and vendored status for language stats and diffs (#16773)
  * Add migrate from Codebase (#16768)
  * Add migration from GitBucket (#16767)
  * Add OAuth2 introspection endpoint (#16752)
  * Add proxy settings and support for migration and webhook (#16704)
  * Add microsoft oauth2 providers (#16544)
  * Send registration email on user autoregistration (#16523)
  * Defer Last Commit Info (#16467)
  * Support unprotected file patterns (#16395)
  * Add migrate from OneDev (#16356)
  * Add option to update pull request by `rebase` (#16125)
  * Add RSS/Atom feed support for user actions (#16002)
  * Add support for corporate WeChat webhooks (#15910)
  * Add a simple way to rename branch like gh (#15870)
  * Add bundle download for repository (#14538)
  * Add agit flow support in gitea (#14295)
* API
  * Add MirrorUpdated field to Repository API type (#18267)
  * Adjust Fork API to allow setting a custom repository name (#18066)
  * Add API to manage repo tranfers (#17963)
  * Add API to get file commit history (#17652)
  * Add API to get issue/pull comments and events (timeline) (#17403)
  * Add API to get/edit wiki (#17278)
  * Add API for get user org permissions (#17232)
  * Add HTML urls to notification API (#17178)
  * Add API to get commit diff/patch (#17095)
  * Respond with updated notifications in API (#17064)
  * Add API to fetch git notes (#16649)
  * Generalize list header for API (#16551)
  * Add API Token Cache (#16547)
  * Allow Token API calls be authorized using the reverse-proxy header (#15119)
* ENHANCEMENTS
  * Make the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)
  * Return nicer error if trying to pull from non-existent user (#18288)
  * Show pull link for agit pull request also (#18235)
  * Enable partial clone by default (#18195)
  * Added replay of webhooks (#18191)
  * Show OAuth callback error message (#18185)
  * Increase Salt randomness (#18179)
  * Add MP4 as default allowed attachment type (#18170)
  * Include folders into size cost (#18158)
  * Remove `/email2user` endpoint (#18127)
  * Handle invalid issues (#18111)
  * Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (#18069)
  * Support open compare page directly (#17975)
  * Prefer "Hiragino Kaku Gothic ProN" in system-ui-ja (#17954)
  * Clean legacy SimpleMDE code (#17926)
  * Refactor install page (db type) (#17919)
  * Improve interface when comparing a branch which has created a pull request (#17911)
  * Allow default branch to be inferred on compare page (#17908)
  * Display issue/comment role even if repo archived (#17907)
  * Always set a message-id on mails (#17900)
  * Change `<a>` elements to underline on hover (#17898)
  * Render issue references in file table (#17897)
  * Handle relative unix socket paths (#17836)
  * Move accessmode into models/perm (#17828)
  * Fix some org style problems (#17807)
  * Add List-Unsubscribe header (#17804)
  * Create menus for organization pages (#17802)
  * Switch archive URL code back to href attributes (#17796)
  * Refactor "refs/*" string usage by using constants (#17784)
  * Allow forks to org if you can create repos (#17783)
  * Improve install code to avoid low-level mistakes. (#17779)
  * Improve ellipsis buttons (#17773)
  * Add restrict and no-user-rc to authorized_keys (#17772)
  * Add copy Commit ID button in commits list (#17759)
  * Make `bind` error more readable (#17750)
  * Fix navbar on project view (#17749)
  * More pleasantly handle broken or missing git repositories (#17747)
  * Use `*PushUpdateOptions` as receiver (#17724)
  * Remove unused `user` paramater (#17723)
  * Better builtin avatar generator (#17707)
  * Cleanup and use global style on popups (#17674)
  * Move user/org deletion to services (#17673)
  * Added comment for changing issue ref (#17672)
  * Allow admins to change user avatars (#17661)
  * Only set `data-path` once for each file in diff pages (#17657)
  * Add icon to vscode clone link (#17641)
  * Add download button for file viewer (#17640)
  * Add pagination to fork list (#17639)
  * Use a standalone struct name for Organization (#17632)
  * Minor readability patch. (#17627)
  * Add context support for GetUserByID (#17602)
  * Move merge-section to `> .content` (#17582)
  * Remove NewSession method from db.Engine interface (#17577)
  * Move unit into models/unit/ (#17576)
  * Restrict GetDeletedBranchByID to the repositories deleted branches (#17570)
  * Refactor commentTags functionality (#17558)
  * Make Repo Code Indexer an Unique Queue (#17515)
  * Simplify Gothic to use our session store instead of creating a different store (#17507)
  * Add settings to allow different SMTP envelope from address (#17479)
  * Properly determine CSV delimiter (#17459)
  * Hide label comments if labels were added and removed immediately (#17455)
  * Tune UI alignment for nav bar notification icon, avatar image, issue label (#17438)
  * Add appearance section in settings (#17433)
  * Move key forms before list and add cancel button (#17432)
  * When copying executables to the docker chmod them (#17423)
  * Remove deprecated `extendDefaultPlugins` method of svgo (#17399)
  * Fix the click behavior for <tr> and <td> with [data-href] (#17388)
  * Refactor update checker to use AppState (#17387)
  * Improve async/await usage, and sort init calls in `index.js` (#17386)
  * Use a variable but a function for IsProd because of a slight performance increment (#17368)
  * Frontend refactor, PascalCase to camelCase, remove unused code (#17365)
  * Hide command line merge instructions when user can't push (#17339)
  * Move session to models/login (#17338)
  * Sync gitea app path for git hooks and authorized keys when starting (#17335)
  * Make the Mirror Queue a queue (#17326)
  * Add "Copy branch name" button to pull request page (#17323)
  * Fix repository summary on mobile (#17322)
  * Split `index.js` to separate files (#17315)
  * Show direct match on top for user search (#17303)
  * Frontend refactor: move Vue related code from `index.js` to `components` dir, and remove unused codes. (#17301)
  * Upgrade chi to v5 (#17298)
  * Disable form autofill (#17291)
  * Improve behavior of "Fork" button (#17288)
  * Open markdown image links in new window (#17287)
  * Add hints for special Wiki pages (#17283)
  * Move add deploy key form before the list and add a cancel button (#17228)
  * Allow adding multiple issues to a project  (#17226)
  * Add metrics to get issues by repository (#17225)
  * Add specific event type to header (#17222)
  * Redirect on project after issue created (#17211)
  * Reference in new issue modal: dont pre-populate issue title (#17208)
  * Always set a unique Message-ID header (#17206)
  * Add projects and project boards in exposed metrics (#17202)
  * Add metrics to get issues by label (#17201)
  * Add protection to disable Gitea when run as root (#17168)
  * Don't return binary file changes in raw PR diffs by default (#17158)
  * Support sorting for project board issuses (#17152)
  * Force color-adjust for markdown checkboxes (#17146)
  * Add option to copy line permalink (#17145)
  * Move twofactor to models/login (#17143)
  * Multiple tokens support for migrating from github (#17134)
  * Unify issue and PR subtitles (#17133)
  * Make Requests Processes and create process hierarchy. Associate OpenRepository with context. (#17125)
  * Fix problem when database id is not increment as expected (#17124)
  * Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123)
  * Re-allow clipboard copy on non-https sites (#17118)
  * DBContext is just a Context (#17100)
  * Move login related structs and functions to models/login (#17093)
  * Add SkipLocal2FA option to pam and smtp sources (#17078)
  * Move db related basic functions to models/db (#17075)
  * Fixes username tagging in "Reference in new issue" (#17074)
  * Use light/dark theme based on system preference (#17051)
  * Always emit the configuration path (#17036)
  * Add `AbsoluteListOptions` (#17028)
  * Use common sessioner for API and Web (#17027)
  * Fix overflow label in small view (#17020)
  * Report the associated filter if there is an error in LDAP (#17014)
  * Add "new issue" btn on project (#17001)
  * Add doctor dbconsistency check for release and attachment (#16978)
  * Disable Fomantic's CSS tooltips (#16974)
  * Add Cache-Control to avatar redirects (#16973)
  * Make mirror feature more configurable (#16957)
  * Add skip and limit to git.GetTags (#16897)
  * Remove ParseQueueConnStr as it is unused (#16878)
  * Remove unused Fomantic sidebar module (#16853)
  * Allow LDAP Sources to provide Avatars (#16851)
  * Remove Dashboard/Home button from the navbar (#16844)
  * Use conditions but not repo ids as query condition (#16839)
  * Add user settings key/value DB table (#16834)
  * Add buttons to allow loading of incomplete diffs (#16829)
  * Add information for migrate failure (#16803)
  * Add EdDSA JWT signing algorithm (#16786)
  * Add user status filter to admin user management page (#16770)
  * Add Option to synchronize Admin & Restricted states from OIDC/OAuth2 along with Setting Scopes (#16766)
  * Do not use thin scrollbars on Firefox (#16738)
  * Download LFS in git and web workflow from minio/s3 directly (SERVE_DIRECT) (#16731)
  * Compute proper foreground color for labels (#16729)
  * Add edit button to wiki sidebar and footer (#16719)
  * Fix migration svg color (#16715)
  * Add link to vscode to repo header (#16664)
  * Add filter by owner and team to issue/pulls search endpoint (#16662)
  * Kanban colored boards (#16647)
  * Allow setting X-FRAME-OPTIONS (#16643)
  * Separate open and closed issue in metrics (#16637)
  * Support direct comparison (git diff a..b) as well merge comparison (a…b) (#16635)
  * Add setting to OAuth handlers to skip local 2FA authentication (#16594)
  * Make PR merge options more intuitive (#16582)
  * Show correct text when comparing commits on empty pull request (#16569)
  * Pre-fill suggested New File 'name' and 'content' with Query Params (#16556)
  * Add an abstract json layout to make it's easier to change json library (#16528)
  * Make Mermaid.js limit configurable (#16519)
  * Improve 2FA autofill (#16473)
  * Add modals to Organization and Team remove/leave (#16471)
  * Show tag name on dashboard items list (#16466)
  * Change default cron schedules from @every 24h to @midnight (#16431)
  * Prevent double sanitize (#16386)
  * Replace `list.List` with slices (#16311)
  * Add configuration option to restrict users by default (#16256)
  * Move login out of models (#16199)
  * Support pagination of organizations on user settings pages (#16083)
  * Switch migration icon to svg (#15954)
  * Add left padding for chunk header of split diff view (#13397)
  * Allow U2F 2FA without TOTP (#11573)
* BUGFIXES
  * GitLab reviews may not have the updated_at field set (#18450) (#18461)
  * Fix detection of no commits when the default branch is not master (#18422) (#18423)
  * Fix broken oauth2 authentication source edit page (#18412) (#18419)
  * Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404)
  * Fix restore without topic failure (#18387) (#18400)
  * Fix commit's time (#18375) (#18392)
  * Fix partial cloning a repo (#18373) (#18377)
  * Stop trimming preceding and suffixing spaces from editor filenames (#18334)
  * Prevent showing webauthn error for every time visiting `/user/settings/security` (#18386)
  * Fix mime-type detection for HTTP server (#18370) (#18371)
  * Stop trimming preceding and suffixing spaces from editor filenames (#18334)
  * Restore propagation of ErrDependenciesLeft (#18325)
  * Fix PR comments UI (#18323)
  * Use indirect comparison when showing pull requests (#18313)
  * Replace satori/go.uuid with gofrs/uuid (#18311)
  * Fix commit links on compare page (#18310)
  * Don't show double error response in git hook (#18292)
  * Handle missing default branch better in owner/repo/branches page (#18290)
  * Fix CheckRepoStats and reuse it during migration (#18264)
  * Prevent underline hover on cards (#18259)
  * Don't delete branch if other PRs with this branch are open (#18164)
  * Require codereview to have content (#18156)
  * Allow admin to associate missing LFS objects for repositories (#18143)
  * When attempting to subscribe other user to issue report why access denied (#18091)
  * Add option to convert CRLF to LF line endings for sendmail (#18075)
  * Only create pprof files for gitea serv if explicitly asked for (#18068)
  * Abort merge if head has been updated before pressing merge (#18032)
  * Improve TestPatch to use git read-tree -m and implement git-merge-one-file functionality (#18004)
  * Use JSON module instead of stdlib json (#18003)
  * Fixed issue merged/closed wording (#17973)
  * Return nicer error for ForcePrivate (#17971)
  * Fix overflow in commit graph (#17947)
  * Prevent services/mailer/mailer_test.go tests from deleteing data directory (#17941)
  * Use disable_form_autofill on Codebase and Gitbucket (#17936)
  * Fix a panic in NotifyCreateIssueComment (caused by string truncation) (#17928)
  * Fix markdown URL parsing (#17924)
  * Apply CSS Variables to all message elements (#17920)
  * Improve checkBranchName (#17901)
  * Update chi/middleware to chi/v5/middleware (#17888)
  * Fix position of label color picker colors (#17866)
  * Fix ListUnadoptedRepositories incorrect total count (#17865)
  * Remove whitespace inside rendered code `<td>` (#17859)
  * Make Co-committed-by and co-authored-by trailers optional (#17848)
  * Fix value of User.IsRestricted when oauth2 user registration (#17839)
  * Use new OneDev /milestones endpoint (#17782)
  * Prevent deadlock in TestPersistableChannelQueue (#17717)
  * Simplify code for writing SHA to name-rev (#17696)
  * Fix database deadlock when update issue labels (#17649)
  * Add warning for BIDI characters in page renders and in diffs (#17562)
  * Fix ipv6 parsing for builtin ssh server (#17561)
  * Multiple Escaping Improvements (#17551)
  * Fixes #16559 - Do not trim leading spaces for tab delimited (#17442)
  * Show client-side error if wiki page is empty (#17415)
  * Fix context popup error (#17398)
  * Stop sanitizing full name in API (#17396)
  * Fix issue close/comment buttons on mobile (#17317)
  * Fix navbar UI (#17235)
  * Fix problem when database id is not increment as expected (#17229)
  * Open the DingTalk link in browser (#17084)
  * Remove heads pointing to missing old refs (#17076)
  * Fix commit status index problem (#17061)
  * Handle broken references in mirror sync (#17013)
  * Fix for create repo page layout (#17012)
  * Improve LDAP synchronization efficiency (#16994)
  * Add repo_id for attachment (#16958)
  * Clean-up HookPreReceive and restore functionality for pushing non-standard refs (#16705)
  * Remove duplicate csv import in modules/csv/csv.go (#16631)
  * Improve SMTP authentication and Fix user creation bugs  (#16612)
  * Fixed emoji alias not parsed in links (#16221)
  * Calculate label URL on API  (#16186)
* TRANSLATION
  * Fix mispelling of starred as stared (#17465)
  * Re-separate the color translation strings (#17390)
  * Enable Malayalam, Greek, Persian, Hungarian & Indonesian by default (#16998)
* BUILD
  * Add lockfile-check (#18285)
  * Don't store assets modified time into generated files (#18193)
  * Use shadowing script for docker (#17846)
* MISC
  * Update JS dependencies (#17611)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoWarn at startup if the provided `SCRIPT_TYPE` is not on the PATH (#18467)
zeripath [Sun, 30 Jan 2022 16:33:36 +0000 (16:33 +0000)]
Warn at startup if the provided `SCRIPT_TYPE` is not on the PATH (#18467)

Several users run Gitea in situations whereby `bash` is not available.
If the `SCRIPT_TYPE` is not changed this will cause hooks to fail.
A simple test to check if the provided type is on the PATH should be
sufficient to warn them about this problem.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agouse next gen codecov uploader (#18443)
6543 [Sun, 30 Jan 2022 02:21:15 +0000 (03:21 +0100)]
use next gen codecov uploader (#18443)

2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 30 Jan 2022 00:28:19 +0000 (00:28 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoChange some logging levels (#18421)
zeripath [Sat, 29 Jan 2022 20:52:37 +0000 (20:52 +0000)]
Change some logging levels (#18421)

* Change some logging levels

* PlainTextWithBytes - 4xx/5xx this should just be TRACE
* notFoundInternal - the "error" here is too noisy and should be DEBUG
* WorkerPool - Worker pool scaling messages are normal and should be DEBUG

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoGitLab reviews may not have the updated_at field set (#18450)
Aravinth Manivannan [Sat, 29 Jan 2022 17:33:20 +0000 (17:33 +0000)]
GitLab reviews may not have the updated_at field set (#18450)

* GitLab reviews may not have the updated_at field set

Fallback to created_at if that the case and to time.Now() if it is
also missing.

Fixes: 18434
* use assert.WithinDuration

Co-authored-by: Loïc Dachary <loic@dachary.org>
2 years agoAttempt to prevent intermittent failure TestGit/xxx/BranchProtectMerge/MergePR (...
zeripath [Sat, 29 Jan 2022 15:35:36 +0000 (15:35 +0000)]
Attempt to prevent intermittent failure TestGit/xxx/BranchProtectMerge/MergePR (#18451)

One of the repeated intermittent failures we see in testing is a failure due to
branches not being ready to merge.

Prior to the immediate queue implementation we would attempt to flush all the queues
and this would prevent the issue. However, the immediate queue is not flushable so
the flushall is not successful at preventing this.

This PR proposes an alternative solution - wait some time and try again up to 5 times.

If this fails then there is a genuine issue and we should fail.

Related #17719

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUpdate Goldmark to Goldmark 1.4.4 (#18420)
zeripath [Sat, 29 Jan 2022 13:17:21 +0000 (13:17 +0000)]
Update Goldmark to Goldmark 1.4.4 (#18420)

* Update Goldmark to Goldmark 1.4.4
* nolint the deprecation

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoEnsure git tag tests and others create test repos in tmpdir (#18447)
zeripath [Sat, 29 Jan 2022 12:41:44 +0000 (12:41 +0000)]
Ensure git tag tests and others create test repos in tmpdir (#18447)

* Ensure git tag tests and other create test repos in tmpdir

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Fix #18444

* Change log root for integration tests to use the REPO_TEST_DIR

There is a potential race in the drone integration tests whereby test-mysql etc
will start writing to log files causing make test-check fail.

Fix #18077

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAttempt to prevent the deadlock in the QueueDiskChannel Test again (#18415)
zeripath [Sat, 29 Jan 2022 11:37:08 +0000 (11:37 +0000)]
Attempt to prevent the deadlock in the QueueDiskChannel Test again (#18415)

* Attempt to prevent the deadlock in the QueueDiskChannel Test again

This time we're going to adjust the pause tests to only test the right
flag.

* Only switch off pushback once we know that we are not pushing anything else
* Ensure full redirection occurs
* More nicely handle a closed datachan
* And handle similar problems in queue_channel_test

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 29 Jan 2022 00:28:21 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse explicit jQuery import, remove unused eslint globals (#18435)
silverwind [Fri, 28 Jan 2022 21:00:11 +0000 (13:00 -0800)]
Use explicit jQuery import, remove unused eslint globals (#18435)

- Don't rely on globals (window.$) for jQuery import
- Remove eslint globals no longer in use

2 years agoFix typo (#18436)
Gusted [Fri, 28 Jan 2022 13:56:31 +0000 (13:56 +0000)]
Fix typo (#18436)

As title

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoAllow to filter repositories by language in explore, user and organization repositori...
Lauris BH [Fri, 28 Jan 2022 11:29:04 +0000 (13:29 +0200)]
Allow to filter repositories by language in explore, user and organization repositories lists (#18430)

2 years agoFix broken when no commits and default branch is not master (#18422)
Lunny Xiao [Fri, 28 Jan 2022 02:51:16 +0000 (10:51 +0800)]
Fix broken when no commits and default branch is not master (#18422)

* Fix broken when no commits and default branch is not master

* Fix IsEmpty check

* Improve codes

* Add timeout

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 28 Jan 2022 00:28:20 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAutomatically pause queue if index service is unavailable (#15066)
Lauris BH [Thu, 27 Jan 2022 08:30:51 +0000 (10:30 +0200)]
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[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 27 Jan 2022 00:28:24 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoOnly view milestones from current repo (#18414)
zeripath [Wed, 26 Jan 2022 20:01:35 +0000 (20:01 +0000)]
Only view milestones from current repo (#18414)

The endpoint /{username}/{reponame}/milestone/{id} is not currently restricted to
the repo. This PR restricts the milestones to those within the repo.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoValidate migration files (#18203)
Aravinth Manivannan [Wed, 26 Jan 2022 09:45:51 +0000 (09:45 +0000)]
Validate migration files (#18203)

JSON Schema validation for data used by Gitea during migrations

Discussion at https://forum.forgefriends.org/t/common-json-schema-for-repository-information/563

Co-authored-by: Loïc Dachary <loic@dachary.org>
2 years agoUse base32 for 2FA scratch token (#18384)
wxiaoguang [Wed, 26 Jan 2022 04:10:10 +0000 (12:10 +0800)]
Use base32 for 2FA scratch token (#18384)

* Use base32 for 2FA scratch token
* rename Secure* to Crypto*, add comments

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 26 Jan 2022 00:28:46 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix broken oauth2 authentication source edit page (#18412)
zeripath [Wed, 26 Jan 2022 00:23:46 +0000 (00:23 +0000)]
Fix broken oauth2 authentication source edit page (#18412)

It appears that there was a broken merge of the edit.tmpl page during the merge
of #16594 - I am not entirely sure how this happened as the PR was correct.

This PR fixes the broken template.

Fix #18388

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent deadlocks in persistable channel pause test (#18410)
zeripath [Tue, 25 Jan 2022 23:09:57 +0000 (23:09 +0000)]
Prevent deadlocks in persistable channel pause test (#18410)

* Prevent deadlocks in persistable channel pause test

Because of reuse of the old paused/resumed channels in this test there
was a potential for deadlock. This PR ensures that the channels are always
reobtained.

It further adds some control code to detect hangs in future - and it
ensures that the pausing warning is not shown on shutdown.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* do not warn but do pause

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoBump golangci-lint version (#18411)
Gusted [Tue, 25 Jan 2022 22:09:49 +0000 (22:09 +0000)]
Bump golangci-lint version (#18411)

- Bump golangci-lint version to v1.44.0 (no new linter errors detected)

2 years agoUnexport git.GlobalCommandArgs (#18376)
6543 [Tue, 25 Jan 2022 18:15:58 +0000 (19:15 +0100)]
Unexport git.GlobalCommandArgs (#18376)

Unexport the git.GlobalCommandArgs variable.

2 years agoPlace inline diff comment dialogs on split diff in 4th and 8th columns (#18403)
zeripath [Tue, 25 Jan 2022 12:18:30 +0000 (12:18 +0000)]
Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403)

Fix #18391
Fix #18320

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAPI: Return primary language and repository language stats API URL (#18396)
Lauris BH [Tue, 25 Jan 2022 06:33:40 +0000 (08:33 +0200)]
API: Return primary language and repository language stats API URL (#18396)

2 years agoUpdate to work with latest VS Code go debugger (#18397)
Lauris BH [Tue, 25 Jan 2022 05:00:55 +0000 (07:00 +0200)]
Update to work with latest VS Code go debugger (#18397)

2 years agoFix restore without topic failure (#18387)
Lunny Xiao [Tue, 25 Jan 2022 02:44:12 +0000 (10:44 +0800)]
Fix restore without topic failure (#18387)

Co-authored-by: zeripath <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 25 Jan 2022 00:28:50 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMake WrappedQueues and PersistableChannelUniqueQueues Pausable (#18393)
zeripath [Mon, 24 Jan 2022 22:54:35 +0000 (22:54 +0000)]
Make WrappedQueues and PersistableChannelUniqueQueues Pausable (#18393)

Implements the Pausable interface on WrappedQueues and PersistableChannelUniqueQueues

Reference #15928

Signed-off-by: Andrew Thornton art27@cantab.net
2 years agoFix commit's time (#18375)
Gusted [Mon, 24 Jan 2022 22:11:40 +0000 (22:11 +0000)]
Fix commit's time (#18375)

* Fix commit's time

- Use the Committer's `when` as the CommitDate will be modified when the
commit is being moved around in the git tree(e.g. being rebased on top
of newer commits). The Author's `when` is created once and never touched
again.

* Update templates/repo/view_list.tmpl

* Commmt unstaged

* Add fallback

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoPrevent showing webauthn error for every time visiting `/user/settings/security`...
wxiaoguang [Mon, 24 Jan 2022 19:57:01 +0000 (03:57 +0800)]
Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385)

2 years agoRefactor webhooks i18n (#18380)
wxiaoguang [Mon, 24 Jan 2022 11:36:54 +0000 (19:36 +0800)]
Refactor webhooks i18n (#18380)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 24 Jan 2022 00:28:24 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix partial cloning a repo (#18373)
Gusted [Sun, 23 Jan 2022 21:19:32 +0000 (21:19 +0000)]
Fix partial cloning a repo (#18373)

- Pass the Global command args into serviceRPC.
- Fixes error with partial cloning.
- Add partial clone test
- Include diff

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoSwitch to non-deprecation setting (#18358)
Gusted [Sun, 23 Jan 2022 19:02:29 +0000 (19:02 +0000)]
Switch to non-deprecation setting (#18358)

* Switch to non-deprecation setting
  (Avoid by-default: "Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be removed in v1.18.0")

* Update all references

2 years agoUpdate the SSH passthrough documentation (#18366)
zeripath [Sun, 23 Jan 2022 17:25:25 +0000 (17:25 +0000)]
Update the SSH passthrough documentation (#18366)

2 years agoDon't underline commit status icon on hover (#18372)
Gusted [Sun, 23 Jan 2022 17:02:15 +0000 (17:02 +0000)]
Don't underline commit status icon on hover (#18372)

- Don't underline the commit status icon, as it isn't a link per-se.

2 years agoAdd packagist webhook (#18224)
Dr. Tobias Quathamer [Sun, 23 Jan 2022 13:46:30 +0000 (14:46 +0100)]
Add packagist webhook (#18224)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix mime-type detection for HTTP server (#18370)
wxiaoguang [Sun, 23 Jan 2022 12:19:49 +0000 (20:19 +0800)]
Fix mime-type detection for HTTP server (#18370)

Bypass the unstable behavior of Golang's mime.TypeByExtension

2 years agoAlways use git command but not os.Command (#18363)
Lunny Xiao [Sun, 23 Jan 2022 05:57:52 +0000 (13:57 +0800)]
Always use git command but not os.Command (#18363)

2 years agoAdd deprecated for LFS_CONTENT_PATH on zh-cn docs (#18362)
Lunny Xiao [Sun, 23 Jan 2022 05:03:26 +0000 (13:03 +0800)]
Add deprecated for LFS_CONTENT_PATH on zh-cn docs (#18362)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 23 Jan 2022 00:28:40 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMake gitea, gitea-vet future-proof (#18361)
Gusted [Sat, 22 Jan 2022 21:59:34 +0000 (21:59 +0000)]
Make gitea, gitea-vet future-proof (#18361)

* Make gitea, gitea-vet future-proof

- Ref: https://gitea.com/gitea/gitea-vet/pulls/18

* Correct order

Co-authored-by: zeripath <art27@cantab.net>
2 years agoPause queues (#15928)
zeripath [Sat, 22 Jan 2022 21:22:14 +0000 (21:22 +0000)]
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 agoDisable content sniffing on `PlainTextBytes` (#18359)
Gusted [Sat, 22 Jan 2022 18:32:35 +0000 (18:32 +0000)]
Disable content sniffing on `PlainTextBytes` (#18359)

- Disable the browser's function to "sniff" for the content-type on the
provided plain text, this will prevent the possible usage of
user-controlled data being sent, which could be malicious.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoUpdate github.com/duo-labs/webauthn (#18357)
6543 [Sat, 22 Jan 2022 17:01:40 +0000 (18:01 +0100)]
Update github.com/duo-labs/webauthn (#18357)

2 years agoFix route wrap (#18360)
wxiaoguang [Sat, 22 Jan 2022 15:05:22 +0000 (23:05 +0800)]
Fix route wrap (#18360)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 22 Jan 2022 00:28:20 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd config options to hide issue events (#17414)
qwerty287 [Fri, 21 Jan 2022 17:59:26 +0000 (18:59 +0100)]
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 agoAdd js vendor directory to .gitattributes (#18350)
silverwind [Fri, 21 Jan 2022 15:42:38 +0000 (07:42 -0800)]
Add js vendor directory to .gitattributes (#18350)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 21 Jan 2022 00:30:19 +0000 (00:30 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRefactor jwt.StandardClaims to RegisteredClaims (#18344)
zeripath [Thu, 20 Jan 2022 21:52:56 +0000 (21:52 +0000)]
Refactor jwt.StandardClaims to RegisteredClaims (#18344)

* Refactor jwt.StandardClaims to RegisteredClaims

go-jwt/jwt has deprecated the StandardClaims interface to use RegisteredClaims
instead. This PR migrates to use this new format.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Apply suggestions from code review

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
2 years agoformat with gofumpt (#18184)
6543 [Thu, 20 Jan 2022 17:46:10 +0000 (18:46 +0100)]
format with gofumpt (#18184)

* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt

2 years agoEnable deprecation error for v1.17.0 (#18341)
Gusted [Thu, 20 Jan 2022 17:00:38 +0000 (18:00 +0100)]
Enable deprecation error for v1.17.0 (#18341)

Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoUse correct translation key for errors (#18342)
Gusted [Thu, 20 Jan 2022 15:18:46 +0000 (16:18 +0100)]
Use correct translation key for errors (#18342)

- Noted by:
https://github.com/go-gitea/gitea/issues/17876#issuecomment-1017503614

2 years agoRefactor Router Logger (#17308)
wxiaoguang [Thu, 20 Jan 2022 11:41:25 +0000 (19:41 +0800)]
Refactor Router Logger (#17308)

Make router logger more friendly, show the related function name/file/line.

[BREAKING]
This PR substantially changes the logging format of the router logger. If you use this logging for monitoring e.g. fail2ban you will need to update this to match the new format.

2 years agoUpdated Chroma to v0.10.0 (#18270)
Jelle Hulter [Thu, 20 Jan 2022 09:59:15 +0000 (10:59 +0100)]
Updated Chroma to v0.10.0 (#18270)

2 years agoChange initial TrustModel to committer (#18335)
zeripath [Thu, 20 Jan 2022 02:41:59 +0000 (02:41 +0000)]
Change initial TrustModel to committer (#18335)

2 years agorefactor httplib (#18338)
Gusted [Thu, 20 Jan 2022 00:31:39 +0000 (01:31 +0100)]
refactor httplib (#18338)

- Remove a lot of unused code(most if not all were introduced in gogs
for webhooks usages).

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoPropagate context and ensure git commands run in request context (#17868)
zeripath [Wed, 19 Jan 2022 23:26:57 +0000 (23:26 +0000)]
Propagate context and ensure git commands run in request context (#17868)

This PR continues the work in #17125 by progressively ensuring that git
commands run within the request context.

This now means that the if there is a git repo already open in the context it will be used instead of reopening it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUpgrade Alpine from 3.13 to 3.15 (#18050) v1.17.0-dev
Grzegorz Alibożek [Wed, 19 Jan 2022 21:55:17 +0000 (22:55 +0100)]
Upgrade Alpine from 3.13 to 3.15 (#18050)

* Upgrade alpine to 3.15

* Add executability test to entrypoint for too old dockers

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update docker/rootless/usr/local/bin/docker-entrypoint.sh

Co-authored-by: zeripath <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 21:28:43 +0000 (21:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoStop trimming preceding and suffixing spaces from editor filenames (#18334) v1.16.0-rc1
zeripath [Wed, 19 Jan 2022 21:03:15 +0000 (21:03 +0000)]
Stop trimming preceding and suffixing spaces from editor filenames (#18334)

* Stop trimming preceding and suffixing spaces from editor filenames

In #5702 it was decided to trim preceding and suffixed spaces aswell as / from
editing file filenames. This was because at this point in time the url-safety of
Gitea was much poorer.

We can now drop this requirement and file editing should work correctly.

Fix #18176

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 20:29:22 +0000 (20:29 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoLeft-Align text in Unicode warning boxes (#18331)
silverwind [Wed, 19 Jan 2022 19:25:08 +0000 (11:25 -0800)]
Left-Align text in Unicode warning boxes (#18331)

Wrapped text is more readable when left-aligned.

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoOnly warn on bidi but still escape non-bidi (#18333)
zeripath [Wed, 19 Jan 2022 19:24:15 +0000 (19:24 +0000)]
Only warn on bidi but still escape non-bidi (#18333)

Fix #18324

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix incorrect OAuth message (#18332)
wxiaoguang [Wed, 19 Jan 2022 19:05:06 +0000 (03:05 +0800)]
Fix incorrect OAuth message (#18332)

As the title,

Fix #18327

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 18:28:18 +0000 (18:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoChangelog for 1.16.0-rc1 (#18309)
techknowlogick [Wed, 19 Jan 2022 17:08:23 +0000 (12:08 -0500)]
Changelog for 1.16.0-rc1 (#18309)

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoRestore propagation of ErrDependenciesLeft (#18325)
zeripath [Tue, 18 Jan 2022 23:26:42 +0000 (23:26 +0000)]
Restore propagation of ErrDependenciesLeft (#18325)

Unfortunately #17643 prevented all propagation of ErrDependenciesLeft meaning
that dependency errors that prevent closing of issues get swallowed.

This PR restores propagation of the error but instead swallows the error in the
places where it needs to be swallowed.

Fix #18223

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix PR comments UI (#18323)
wxiaoguang [Tue, 18 Jan 2022 17:28:38 +0000 (01:28 +0800)]
Fix PR comments UI (#18323)

Closes:
* Review comment cannot be edited #17768
* Changing PR Comment Resolved State Disables Further Changes #18315

2 years agoMake the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)
wxiaoguang [Tue, 18 Jan 2022 16:57:57 +0000 (00:57 +0800)]
Make the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)

And shrink the height of Dropzone.

2 years agoFix commit links on compare page (#18310)
Gusted [Tue, 18 Jan 2022 16:12:10 +0000 (16:12 +0000)]
Fix commit links on compare page (#18310)

* Fix commit links on compare page

- Use the correct repo link for each commit(the headrepo). As for
compare pages were baserepo != headrepo, it wouldn't have the correct
link.

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUpdate JS dependencies, remove eslint-plugin-github (#18317)
silverwind [Tue, 18 Jan 2022 15:01:36 +0000 (07:01 -0800)]
Update JS dependencies, remove eslint-plugin-github (#18317)

- Update all JS dependencies
- Add new lint rules
- Regenerate SVGs
- Tested Monaco and Mermaid
* Remove eslint-plugin-github

2 years agoAdd MirrorUpdated field to Repository API type (#18267)
Peter Gardfjäll [Tue, 18 Jan 2022 13:18:30 +0000 (14:18 +0100)]
Add MirrorUpdated field to Repository API type (#18267)

Add the last update time to the repository api type.

Close #18266

2 years agoreplace satori/go.uuid with gofrs/uuid (#18311)
zeripath [Tue, 18 Jan 2022 11:04:24 +0000 (11:04 +0000)]
replace satori/go.uuid with gofrs/uuid (#18311)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPlace inline diff comment dialogs in the 4th column. (#18321)
JonRB [Tue, 18 Jan 2022 10:28:45 +0000 (10:28 +0000)]
Place inline diff comment dialogs in the 4th column. (#18321)

Comment dialogs for inline comments should appear in 4th column (not 3rd column), this PR changes the column that the inline review comment is associated with.

This problem has occurred due to an unrecognised conflict between #17562 and #17315.

Fix as zeripath suggested in #18320

Fix #18320

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUse indirect comparison when showing pull requests (#18313)
zeripath [Tue, 18 Jan 2022 07:45:43 +0000 (07:45 +0000)]
Use indirect comparison when showing pull requests (#18313)

When generating the commits list and number of files changed for PRs and
compare we should use "..." always not "..".

Fix #18303

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent ambiguous column error in organizations page (#18314)
zeripath [Tue, 18 Jan 2022 07:45:14 +0000 (07:45 +0000)]
Prevent ambiguous column error in organizations page (#18314)

Explicitly set the table for the org_id column queries on the organizations pages.

Fix #18229

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoCorrectly upload LFS files (#18316)
zeripath [Tue, 18 Jan 2022 07:44:30 +0000 (07:44 +0000)]
Correctly upload LFS files (#18316)

We need to use the cached .gitattributes file for checking if a file
should be stored in the lfs.

Fix #18297

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 18 Jan 2022 00:31:56 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoupdate description about vendoring in CONTRIBUTING.md (#18280)
a1012112796 [Mon, 17 Jan 2022 18:39:07 +0000 (02:39 +0800)]
update description about vendoring in CONTRIBUTING.md (#18280)

* update description about vendoring in CONTRIBUTING.md

follow #18277

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update CONTRIBUTING.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix and readd test-vendor step

* remove vendor from .gitattributes @silverwind

* simplify go mod check

Signed-off-by: a1012112796 <1012112796@qq.com>
* Revert "remove vendor from .gitattributes @silverwind"

This reverts commit 4789e704cb7a2c80934e4a4cd31efb161e6c8666.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix CheckRepoStats and reuse it during migration (#18264)
Aravinth Manivannan [Mon, 17 Jan 2022 18:31:58 +0000 (18:31 +0000)]
Fix CheckRepoStats and reuse it during migration (#18264)

The CheckRepoStats function missed the following counters:

- label num_closed_issues & num_closed_pulls
- milestone num_closed_issues & num_closed_pulls

The update SQL statements for updating the repository
num_closed_issues & num_closed_pulls fields were repeated in three
functions (repo.CheckRepoStats, migrate.insertIssues and
models.Issue.updateClosedNum) and were moved to a single helper.

The UpdateRepoStats is implemented and called in the Finish migration method so that it happens immediately instead of wating for the
CheckRepoStats to run.

Signed-off-by: Loïc Dachary loic@dachary.org
---
[source](https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/34)

2 years agoMinor tweak to tag list (#18295)
silverwind [Mon, 17 Jan 2022 13:26:35 +0000 (05:26 -0800)]
Minor tweak to tag list (#18295)

Slightly reduce the font size and padding in the tags table, it seemed a bit too big to me.

2 years agoshow pull link for agit pull request also (#18235)
a1012112796 [Mon, 17 Jan 2022 05:56:43 +0000 (13:56 +0800)]
show pull link for agit pull request also (#18235)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 17 Jan 2022 00:28:33 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd some .ignore entries (#18296)
silverwind [Sun, 16 Jan 2022 17:26:15 +0000 (09:26 -0800)]
Add some .ignore entries (#18296)

Exclude node_modules and minified files from search tools like `rg` and `ag`.

2 years agoRemove unneeded debug messages to stdout. (#18298)
Ben Niemann [Sun, 16 Jan 2022 15:42:06 +0000 (16:42 +0100)]
Remove unneeded debug messages to stdout. (#18298)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoHandle missing default branch better in owner/repo/branches page (#18290)
zeripath [Sun, 16 Jan 2022 14:59:16 +0000 (14:59 +0000)]
Handle missing default branch better in owner/repo/branches page (#18290)

This PR more nicely handles a missing default branch in owner/repo/branches

Fix #18265

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoRevert "Prevent possible XSS when using jQuery (#18289)" (#18293)
wxiaoguang [Sun, 16 Jan 2022 11:19:26 +0000 (19:19 +0800)]
Revert "Prevent possible XSS when using jQuery (#18289)" (#18293)

This reverts commit 661d3d28e97bb49bef075c0314edad5879148aaa.

2 years agonot show double error response in git hook (#18292)
a1012112796 [Sun, 16 Jan 2022 09:32:32 +0000 (17:32 +0800)]
not show double error response in git hook (#18292)

if return a error message to cli, it will print it
to stderr which is duplicate with our code (line 82
in same file). so user will see two line same
error message in git output. I think it's not mecessary,
so suggerst not return error message to cli. Thanks.

Signed-off-by: a1012112796 <1012112796@qq.com>
2 years agoRemove accidental debugging in blob_excerpt.tmpl (#18287)
zeripath [Sun, 16 Jan 2022 09:31:41 +0000 (09:31 +0000)]
Remove accidental debugging in blob_excerpt.tmpl (#18287)

* Remove accidental debugging in blob_excerpt.tmpl

Unfortunately it appears that a small bit of debugging code was left in blob_excerpt.tmpl
This breaks diff expansion causing #18281.

Fix #18281

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoPrevent possible XSS when using jQuery (#18289)
Gusted [Sun, 16 Jan 2022 05:14:32 +0000 (05:14 +0000)]
Prevent possible XSS when using jQuery (#18289)

In the case of misuse or misunderstanding from a developer whereby,
if `sel` can receive user-controlled data, jQuery `$(sel)` can lead to the
creation of a new element. Current usage is using hard-coded selectors
in the templates, but nobody prevents that from expanding to
user-controlled somehow.

2 years agoReturn nicer error if trying to pull from non-existent user (#18288)
zeripath [Sun, 16 Jan 2022 03:44:11 +0000 (03:44 +0000)]
Return nicer error if trying to pull from non-existent user (#18288)

* Return nicer error if trying to pull from non-existent user

Gitea serv will currently return an 500 if we try to pull from a repository where
the owner does not exist.

This PR checks for the UserNotExist Error when checking for the user and will
return a NotFound error instead.

Fix #18225

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 16 Jan 2022 00:28:39 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agodocs: mention client_max_body_size affects LFS (#18291)
Jan Tojnar [Sat, 15 Jan 2022 22:26:01 +0000 (23:26 +0100)]
docs: mention client_max_body_size affects LFS (#18291)