]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoFix oauth docs usage for 2fa (#18581)
Sambhav Saggi [Thu, 3 Feb 2022 17:00:34 +0000 (12:00 -0500)]
Fix oauth docs usage for 2fa (#18581)

2 years agoUpdate .gitattributes for .tmpl files (#18576)
silverwind [Thu, 3 Feb 2022 15:30:26 +0000 (07:30 -0800)]
Update .gitattributes for .tmpl files (#18576)

There are a few .tmpl files outside the templates directory. Match these
as well by using `*.tmpl` glob in `.gitattributes`. Also, sort the file
alphabetically.

2 years agoPrevent panic on prohibited user login with oauth2 (#18562)
zeripath [Thu, 3 Feb 2022 10:44:18 +0000 (10:44 +0000)]
Prevent panic on prohibited user login with oauth2 (#18562)

There was an unfortunate regression in #17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix #18561

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix manifest.tmpl (#18573)
zeripath [Thu, 3 Feb 2022 09:51:01 +0000 (09:51 +0000)]
Fix manifest.tmpl (#18573)

A spurious {{/if}} appeared on the manifest.tmpl - this PR simply
removes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoMake docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (...
zeripath [Thu, 3 Feb 2022 08:47:27 +0000 (08:47 +0000)]
Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (#18551)

* Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch

One of the problems with our current docker tagging is that although we
have strict version tags, latest and dev we do not have a way for docker
users to track the current release branch. This PR simply suggests that
we use the 1.x-dev tag for these and we build and push these. This will
give users who want or need unreleased bug fixes the option of tracking
the pre-release version instead of simply jumping to dev.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd dropdown icon to template loading dropdown (#18564)
fnetX (aka fralix) [Thu, 3 Feb 2022 08:13:22 +0000 (09:13 +0100)]
Add dropdown icon to template loading dropdown (#18564)

Fixes #15679 and the dupe of it: Fixes #16364.

Also removes a comment that links to a gogs forum thread.

2 years agoCollaborator trust model should trust collaborators (#18539)
zeripath [Wed, 2 Feb 2022 10:10:06 +0000 (10:10 +0000)]
Collaborator trust model should trust collaborators (#18539)

* Collaborator trust model should trust collaborators

There was an unintended regression in #17917 which leads to only
repository admin commits being trusted. This PR restores the old logic.

Fix #18501

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoDetect conflicts with 3way merge (#18536)
zeripath [Wed, 2 Feb 2022 04:46:10 +0000 (04:46 +0000)]
Detect conflicts with 3way merge (#18536)

* Detect conflicts with 3way merge

Unforunately git apply --3way reports conflicts differently than standard patches
resulting in conflicts being missed.

Adjust the conflict detection code to account for this different error reporting.

Fix #18514

Signed-off-by: Andrew Thornton <art27@cantab.net>
* and three-way failed

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 2 Feb 2022 00:16:04 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUpdate 1.16.0 changelog to set #17846 as breaking (#18533)
zeripath [Tue, 1 Feb 2022 22:09:32 +0000 (22:09 +0000)]
Update 1.16.0 changelog to set #17846 as breaking (#18533)

Unfortunately #17846 was determined to be breaking due to affecting ssh passthrough
however, this discovery happened after the changelog was created. Update the
Changelog to mark this as breaking.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoIn docker rootless use $GITEA_APP_INI if provided (#18524)
Michael Kriese [Tue, 1 Feb 2022 20:18:57 +0000 (21:18 +0100)]
In docker rootless use $GITEA_APP_INI if provided (#18524)

2 years agorevert to node14 for snapcraft
techknowlogick [Tue, 1 Feb 2022 20:10:55 +0000 (15:10 -0500)]
revert to node14 for snapcraft

2 years agoAdd `GetUserTeams` (#18499)
Gusted [Tue, 1 Feb 2022 19:09:24 +0000 (20:09 +0100)]
Add `GetUserTeams` (#18499)

* COrrect use `UserID` in `SearchTeams`

- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves #18484

* Seperate searching specific user

* Add condition back

* Use correct struct type

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoFix review excerpt (#18502)
confusedsushi [Tue, 1 Feb 2022 19:08:33 +0000 (20:08 +0100)]
Fix review excerpt (#18502)

Currently the "File Changed" tab of a PR is somehow broken. This is also true for the current release 1.16.0.

When you are on the "File Changed" tab, and want to look at code excerpt before or after the code changes, the layout breaks. You can test this on try.gitea.io here: https://try.gitea.io/testnotexisting/magic_enum/pulls/2/files

The problem occurs for the unified view and for the split view.

Kind of the same problem was there for commenting a line of code, this was fixed in #18321 and #18403.

For consistency, I changed the solution of #18321, I removed the ``colspan`` and instead added a ``<td>``. The goal was to have code similarly with the split view.

Also the separator line in the split view was in the wrong column, this was fixed too.* more consistent unified review comment

Fix #18516

Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoUpdate JS dependencies, fix lint (#18389)
silverwind [Tue, 1 Feb 2022 18:21:08 +0000 (10:21 -0800)]
Update JS dependencies, fix lint (#18389)

- Update all JS dependencies, including a security issue in mermaid
- Fix new linter errors related to value-keyword-case
- Tested Mermaid and Swagger

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoadd test coverage for original author conversion during migrations (#18506)
singuliere [Tue, 1 Feb 2022 18:20:28 +0000 (19:20 +0100)]
add test coverage for original author conversion during migrations (#18506)

* add test coverage for original author conversion during migrations

And create a function to factorize a code snippet that is repeated
five times and would otherwise be more difficult to test and maintain
consistently.

Signed-off-by: Loïc Dachary <loic@dachary.org>
* fix variable scope and int64 formatting

* add missing calls to remapExternalUser and fix misplaced %d

Co-authored-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoadd gitea-fmt back (#18526)
6543 [Tue, 1 Feb 2022 17:43:09 +0000 (18:43 +0100)]
add gitea-fmt back (#18526)

2 years agoFix non-ASCII search on database (#18437)
Gusted [Tue, 1 Feb 2022 12:59:25 +0000 (13:59 +0100)]
Fix non-ASCII search on database  (#18437)

Use `ToASCIIUpper` for SQLite database on issues search, this because `UPPER(x)` on SQLite only transforms ASCII letters. Resolves #18429

2 years agoUse "read" value for General Access (#18496)
Gusted [Tue, 1 Feb 2022 08:41:43 +0000 (09:41 +0100)]
Use "read" value for General Access (#18496)

- Currently the `.Team.AccessMode` is being used when editing a team, if
you want to admin -> General Access, the value of General Access is
"admin" which is incorrect.
- Resolves #18483 (First bug mentioned)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix for AvatarURL database type (#18487)
Viktor Kuzmin [Tue, 1 Feb 2022 05:40:23 +0000 (08:40 +0300)]
Fix for AvatarURL database type (#18487)

2 years agoRemove go 1.15 support (#18511)
Gusted [Tue, 1 Feb 2022 02:46:45 +0000 (03:46 +0100)]
Remove go 1.15 support (#18511)

- Remove support for go 1.15(go.mod already requires go 1.16).

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 1 Feb 2022 00:16:43 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse `ImagedProvider` for gplus oauth2 provider (#18504)
Gusted [Tue, 1 Feb 2022 00:02:56 +0000 (01:02 +0100)]
Use `ImagedProvider` for gplus oauth2 provider (#18504)

Use `ImagedProvider` for gplus' oauthv2 provider, as the image isn't "gplus.png" but "google.png".

Resolves #18494

2 years agobuild with node16 in snap (#18508)
techknowlogick [Mon, 31 Jan 2022 22:52:12 +0000 (17:52 -0500)]
build with node16 in snap (#18508)

2 years agopoint to s3 endpoint directly (#18497)
techknowlogick [Mon, 31 Jan 2022 22:39:39 +0000 (17:39 -0500)]
point to s3 endpoint directly (#18497)

Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix OAuth Source Edit Page (#18495)
zeripath [Mon, 31 Jan 2022 20:41:11 +0000 (20:41 +0000)]
Fix OAuth Source Edit Page (#18495)

* Fix OAuth Source Edit Page to ensure restricted and group settings are set
* Also tolerate []interface in the groups

Fix #18432

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

2 years agoPrevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472)
Gusted [Sun, 30 Jan 2022 23:48:47 +0000 (00:48 +0100)]
Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472)

* Don't panic & allow shorter sha1

- Don't panic when the full regex isn't matched and allow the usage of a
shorter sha1 being used.
- Resolves #18471

* Update modules/markup/html.go

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoupload to github & s3 at same time (#18475)
techknowlogick [Sun, 30 Jan 2022 22:40:44 +0000 (17:40 -0500)]
upload to github & s3 at same time (#18475)

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