]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoFix disabled open in vscode menu when disabling download source from UI (#20713)
Lunny Xiao [Fri, 12 Aug 2022 05:16:05 +0000 (13:16 +0800)]
Fix disabled open in vscode menu when disabling download source from UI (#20713)

2 years agorefactor webhook *NewPost (#20729)
oliverpool [Thu, 11 Aug 2022 15:48:23 +0000 (17:48 +0200)]
refactor webhook *NewPost (#20729)

* refactor webhook *NewPost

* remove empty values

* always show errs.Message

* remove utils.IsValidSlackChannel

* move IsValidSlackChannel to services/webhook package

* binding: handle empty Message case

* make IsValidSlackChannel more strict

2 years agoAdd SAML SP status to Feature Comparison docs (#20743)
Kiel Hurley [Thu, 11 Aug 2022 05:04:09 +0000 (17:04 +1200)]
Add SAML SP status to Feature Comparison docs (#20743)

* Add SAML SP integration

Add current SAML 2.0 Service Provider (SP) status. RhodeCode EE supports SAML, CE does not.

Included issue links for both Gitea and Gogs, as corporate users will likely be interested in the status of both.

* Add SAML SP status to comparison for other translations

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix loading button with invalid form (#20754)
silverwind [Thu, 11 Aug 2022 03:54:34 +0000 (05:54 +0200)]
Fix loading button with invalid form (#20754)

Previously, if a invalid form was submitted (for example issue with no
title), the form could not be re-submitted again because the button
would not stay stuck in loading state. Fix that by hooking the 'submit'
event instead which triggers only when the form is valid.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
Gusted [Thu, 11 Aug 2022 00:20:58 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMake branch icon stand out more (#20726)
Gusted [Wed, 10 Aug 2022 19:23:11 +0000 (19:23 +0000)]
Make branch icon stand out more (#20726)

* Make branch icon stand out more

- Currently the branch icon is "squashed" between the two branch names
and feels a bit "amateur-ish" to my feeling(relative to other UI
elements).
- This patch tries to improve that by making the icon bigger
and by adding some margin to not have a "squashed" icon.
- This patch also includes a "fix", for some reason this symbol is not
centering correctly within the span(or without for that matter), so
simply manually patch this by adding `bottom: 1.px`.

* Use svg

* Apply suggestion

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoUpdate docs for versions (#20750)
wxiaoguang [Wed, 10 Aug 2022 17:37:15 +0000 (01:37 +0800)]
Update docs for versions (#20750)

2 years agoReplace some icons with SVG (#20741)
silverwind [Wed, 10 Aug 2022 16:30:40 +0000 (18:30 +0200)]
Replace some icons with SVG (#20741)

- Replace some icons with SVG
- Create teams help page
- Application and SSH keys icons
- Add new icon for app token
- Use fontawesom-send

2 years agoUse separate class for tippy targets (#20742)
silverwind [Wed, 10 Aug 2022 14:47:28 +0000 (16:47 +0200)]
Use separate class for tippy targets (#20742)

Previous solution that re-purposed the 'hide' class by making it
`!important` had various unintended side-effects where jQuery .show() was
not able to outweight it. Use a separate class to prevent these
interactions.

2 years agoAdd support mCaptcha as captcha provider (#20458)
Gusted [Wed, 10 Aug 2022 13:20:10 +0000 (13:20 +0000)]
Add support mCaptcha as captcha provider (#20458)

https://mcaptcha.org/

Co-authored-by: Felipe Leopoldo Sologuren Gutiérrez <fsologureng@users.noreply.github.com>
2 years agoFix CI status popup (#20737)
silverwind [Wed, 10 Aug 2022 04:08:06 +0000 (06:08 +0200)]
Fix CI status popup (#20737)

2 years agoAdd documentation about pagination of the API (#20740)
techknowlogick [Wed, 10 Aug 2022 01:58:55 +0000 (21:58 -0400)]
Add documentation about pagination of the API (#20740)

* Add documentation about pagination of the API

* Update docs/content/doc/developers/api-usage.en-us.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
silverwind [Wed, 10 Aug 2022 00:20:57 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoChange commit status icons to SVG (#20736)
silverwind [Tue, 9 Aug 2022 21:55:29 +0000 (23:55 +0200)]
Change commit status icons to SVG (#20736)

* Fix commit status popover and switch to svg icons

* margin tweak

* fix integration, use warning sign for error to match previous

* remove fix from here, will be a new pr

* use top/bottom positioning

* vertically center

* use no-entry over alert oction

* add exclamation icon

* fix test selector

* more test fixes

2 years agoAdd support for NuGet API keys (#20721)
KN4CK3R [Tue, 9 Aug 2022 14:36:49 +0000 (16:36 +0200)]
Add support for NuGet API keys (#20721)

* Add support for NuGet API key.

* lint

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoKeep download count on Container tag overwrite (#20728)
KN4CK3R [Tue, 9 Aug 2022 13:47:57 +0000 (15:47 +0200)]
Keep download count on Container tag overwrite (#20728)

Co-authored-by: 6543 <6543@obermui.de>
2 years agoReplace fomantic popup module with tippy.js (#20428)
silverwind [Tue, 9 Aug 2022 12:37:34 +0000 (14:37 +0200)]
Replace fomantic popup module with tippy.js (#20428)

- replace fomantic popup module with tippy.js
- fix chaining and add comment
- add 100ms delay to tooltips
- stopwatch improvments, raise default maxWidth
- update web_src/js/features/common-global.js
- use type=submit instead of js

2 years agoAdd an option to create new issues from "/issues" page (#20650)
CodeDoctor [Tue, 9 Aug 2022 11:30:09 +0000 (13:30 +0200)]
Add an option to create new issues from "/issues" page (#20650)

2 years agoRestore history button and hide add button when unable to add (#20718)
silverwind [Tue, 9 Aug 2022 10:32:41 +0000 (12:32 +0200)]
Restore history button and hide add button when unable to add (#20718)

Fix two regressions from #20602:

- Restore the 'History' button that was previously unable to render
  because it's show condition was never hit
- Hide the 'Add File' button when there would be no items in the
  dropdown.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRemove manual rollback for failed generated repositories (#20639)
Gabriel Vasile [Tue, 9 Aug 2022 09:41:52 +0000 (12:41 +0300)]
Remove manual rollback for failed generated repositories (#20639)

Generating repositories from a template is done inside a transaction.
Manual rollback on error is not needed and it always results in error
"repository does not exist".

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd support for `npm unpublish` (#20688)
KN4CK3R [Tue, 9 Aug 2022 07:23:43 +0000 (09:23 +0200)]
Add support for `npm unpublish` (#20688)

2 years agoAllow multiple files in generic packages (#20661)
KN4CK3R [Tue, 9 Aug 2022 04:39:24 +0000 (06:39 +0200)]
Allow multiple files in generic packages (#20661)

* Allow multiple files in generic packages.
* Add deletion of a single file.
* Update docs.
* Change version check.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRefactor legacy git init (#20376)
wxiaoguang [Tue, 9 Aug 2022 03:22:24 +0000 (11:22 +0800)]
Refactor legacy git init (#20376)

* merge `CheckLFSVersion` into `InitFull` (renamed from `InitWithSyncOnce`)
* remove the `Once` during git init, no data-race now
* for doctor sub-commands, `InitFull` should only be called in initialization stage

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix typo in source (#20723)
luzpaz [Tue, 9 Aug 2022 01:53:40 +0000 (21:53 -0400)]
Fix typo in source (#20723)

Algorightm -> Algorithm

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
parnic [Tue, 9 Aug 2022 00:21:27 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd issue filter for Author (#20578)
parnic [Mon, 8 Aug 2022 20:03:58 +0000 (15:03 -0500)]
Add issue filter for Author (#20578)

This adds a new filter option on the issues and pulls pages to filter by the author/poster/creator of the issue or PR

2 years agoFix init mail render logic (#20704)
KN4CK3R [Mon, 8 Aug 2022 18:04:28 +0000 (20:04 +0200)]
Fix init mail render logic (#20704)

This bug affects tests which are sending emails (#20307). Some tests reinitialise the web routes (like `TestNodeinfo`) which messed up the mail templates. There is no reason why the templates should be loaded in the routes method.

2 years agoFrontport changelog v1.17.0 (#20712)
6543 [Mon, 8 Aug 2022 15:21:57 +0000 (17:21 +0200)]
Frontport changelog v1.17.0 (#20712)

* fix

* add

2 years agoFix disable download button (#20701)
Lunny Xiao [Mon, 8 Aug 2022 13:42:36 +0000 (21:42 +0800)]
Fix disable download button (#20701)

2 years agodocs: move search input to navbar (#20551)
Norwin [Mon, 8 Aug 2022 07:27:04 +0000 (09:27 +0200)]
docs: move search input to navbar (#20551)

* remove search item from sidebar
* fix search for some docs languages

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix SecToTime edge-cases (#20610)
Gusted [Mon, 8 Aug 2022 05:07:42 +0000 (05:07 +0000)]
Fix SecToTime edge-cases (#20610)

2 years ago[skip ci] Updated translations via Crowdin
Lunny Xiao [Mon, 8 Aug 2022 00:21:03 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix v220 migration to be compatible for MSSQL 2008 r2 (#20702)
Lunny Xiao [Mon, 8 Aug 2022 00:16:22 +0000 (08:16 +0800)]
Fix v220 migration to be compatible for MSSQL 2008 r2 (#20702)

2 years agoRework repo buttons (#20602)
silverwind [Sun, 7 Aug 2022 23:15:11 +0000 (01:15 +0200)]
Rework repo buttons (#20602)

* Rework repo buttons

- Replace "New PR" and "Go to File" button with Icon Button
- Move all "Add File" actions into a dropdown button
- Remove most custom styling of clone buttons
- Margin and wiki tweaks

Buttons are now all equal height, mobile layout wraps gracefully.

Fixes: https://github.com/go-gitea/gitea/issues/13671
Replaces: https://github.com/go-gitea/gitea/pull/20375

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoSwitch to building with go1.19 (#20695)
techknowlogick [Sun, 7 Aug 2022 16:25:03 +0000 (12:25 -0400)]
Switch to building with go1.19 (#20695)

2 years agoUpdate maven deploy docs (#20691)
KN4CK3R [Sun, 7 Aug 2022 13:58:03 +0000 (15:58 +0200)]
Update maven deploy docs (#20691)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd support for Pub packages (#20560)
KN4CK3R [Sun, 7 Aug 2022 10:09:54 +0000 (12:09 +0200)]
Add support for Pub packages (#20560)

* Added support for Pub packages.

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

Co-authored-by: Gergely Nagy <algernon@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gergely Nagy <algernon@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoFix typo overrided -> overridden (#20687)
luzpaz [Sun, 7 Aug 2022 00:54:26 +0000 (20:54 -0400)]
Fix typo overrided -> overridden (#20687)

2 years ago[skip ci] Updated licenses and gitignores
silverwind [Sun, 7 Aug 2022 00:20:52 +0000 (00:20 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoUpdate JS dependencies, adjust eslint (#20659)
silverwind [Sat, 6 Aug 2022 15:30:13 +0000 (17:30 +0200)]
Update JS dependencies, adjust eslint (#20659)

* Update JS dependencies

- Update all JS dependencies minus vue-*
- Improve eslint restricted globals
- Tested build, lint and swagger

* few more lint improvements

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoBackground color of private list-items updated (#20630)
Luke Wyatt [Sat, 6 Aug 2022 14:25:58 +0000 (10:25 -0400)]
Background color of private list-items updated (#20630)

A minor color update on the dashboard. This PR simply changes the background from hard-coded light yellow to the theme colors (var).

2 years agoUse request timeout for git service rpc (#20689)
parnic [Sat, 6 Aug 2022 13:13:11 +0000 (08:13 -0500)]
Use request timeout for git service rpc (#20689)

This enables git.Command's Run to optionally use the given context directly so its deadline will be respected. Otherwise, it falls back to the previous behavior of using the supplied timeout or a default timeout value of 360 seconds.

repo's serviceRPC() calls now use the context's deadline (which is unset/unlimited) instead of the default 6-minute timeout. This means that large repo clones will no longer arbitrarily time out on the upload-pack step, and pushes can take longer than 6 minutes on the receive-pack step.

Fixes #20680

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoIncrease default item listing size `ISSUE_PAGING_NUM` to 20 (#20547)
Norwin [Sat, 6 Aug 2022 10:43:40 +0000 (12:43 +0200)]
Increase default item listing size `ISSUE_PAGING_NUM` to 20 (#20547)

* increase default page sizes to 20
* adjust docs to reflect that the setting is used all over the place
* fix tests

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
KN4CK3R [Sat, 6 Aug 2022 00:20:54 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAllow multiple metadata files for Maven packages (#20674)
KN4CK3R [Fri, 5 Aug 2022 19:00:47 +0000 (21:00 +0200)]
Allow multiple metadata files for Maven packages (#20674)

* Allow file overwrite for meta files.

* Added tests.

* lint

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agodocs: update comparison.zh-cn.md (#20656)
PEN² [Fri, 5 Aug 2022 18:56:09 +0000 (02:56 +0800)]
docs: update comparison.zh-cn.md (#20656)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd a notice for breaking check in upgrade document (#20682)
wxiaoguang [Fri, 5 Aug 2022 14:20:13 +0000 (22:20 +0800)]
Add a notice for breaking check in upgrade document (#20682)

2 years agomove handleGlobalEnterQuickSubmit into a separate file to avoid cycle-import (#20679)
wxiaoguang [Fri, 5 Aug 2022 10:08:29 +0000 (18:08 +0800)]
move handleGlobalEnterQuickSubmit into a separate file to avoid cycle-import (#20679)

2 years agoUse correct field name. (#20675)
KN4CK3R [Fri, 5 Aug 2022 06:49:03 +0000 (08:49 +0200)]
Use correct field name. (#20675)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
KN4CK3R [Fri, 5 Aug 2022 00:20:59 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse correct context to get package content (#20673)
KN4CK3R [Thu, 4 Aug 2022 21:14:47 +0000 (23:14 +0200)]
Use correct context to get package content (#20673)

2 years agoExecutable check always returns true for windows (#20637)
JonRB [Thu, 4 Aug 2022 07:28:32 +0000 (08:28 +0100)]
Executable check always returns true for windows (#20637)

* Executable check always returns true for windows

Windows doesn't have the concept of "executable" POSIX bits so for now always return true to minimise doctor and logging noise. Addresses #20636

* gofmt tweak

* Update modules/repository/hooks.go

Co-authored-by: silverwind <me@silverwind.io>
* gofmt comment line

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoCheck webhooks slice length before calling xorm (#20642)
Gabriel Vasile [Thu, 4 Aug 2022 04:22:50 +0000 (07:22 +0300)]
Check webhooks slice length before calling xorm (#20642)

xorm.db.Insert errors for empty slices. Fixes: #20641

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoCheck issue labels slice length before calling xorm Insert; fixes #20654 (#20655)
Gabriel Vasile [Thu, 4 Aug 2022 03:20:22 +0000 (06:20 +0300)]
Check issue labels slice length before calling xorm Insert; fixes #20654 (#20655)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago[skip ci] Updated translations via Crowdin
wxiaoguang [Thu, 4 Aug 2022 00:20:55 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix the JS error "EventSource is not defined" caused by some non-standard browsers...
wxiaoguang [Wed, 3 Aug 2022 19:58:27 +0000 (03:58 +0800)]
Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584)

* fall back to periodic poller

Co-authored-by: silverwind <me@silverwind.io>
2 years agoSend correct NuGet status codes (#20647)
KN4CK3R [Wed, 3 Aug 2022 15:22:32 +0000 (17:22 +0200)]
Send correct NuGet status codes (#20647)

* Fixed status codes.

* Fixed status codes.

2 years agoAdd default commit messages to PR for squash merge (#20618)
Tyrone Yeh [Wed, 3 Aug 2022 04:56:59 +0000 (12:56 +0800)]
Add default commit messages to PR for squash merge (#20618)

Keep the same behavior as 1.16

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
Gusted [Wed, 3 Aug 2022 00:21:26 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse `strings.Cut` for GIT_PROTOCOL value (#20638)
Gusted [Tue, 2 Aug 2022 22:34:50 +0000 (00:34 +0200)]
Use `strings.Cut` for GIT_PROTOCOL value (#20638)

- As per https://github.com/go-gitea/gitea/pull/20616#discussion_r935612542

2 years agoFix the admin mailer config display (#20633)
wxiaoguang [Tue, 2 Aug 2022 16:43:27 +0000 (00:43 +0800)]
Fix the admin mailer config display (#20633)

2 years agoUse correct page size for link header pagination (#20546)
Norwin [Tue, 2 Aug 2022 14:59:44 +0000 (16:59 +0200)]
Use correct page size for link header pagination (#20546)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix package upload for files >32mb (#20622)
KN4CK3R [Tue, 2 Aug 2022 13:35:48 +0000 (15:35 +0200)]
Fix package upload for files >32mb (#20622)

* Rewind file before first read.
* Added tests.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd info about Wire 2 when Git over SSH (#20619)
Gusted [Tue, 2 Aug 2022 10:25:26 +0000 (12:25 +0200)]
Add info about Wire 2 when Git over SSH (#20619)

- Follow up of #20616. Add a note about this in the config cheat
sheet, given there's no dedicated page for this.

2 years agoEnable Wire 2 for Internal SSH Server (#20616)
Gusted [Tue, 2 Aug 2022 07:56:38 +0000 (09:56 +0200)]
Enable Wire 2 for Internal SSH Server (#20616)

- Git only decides to use the Wire 2 protocol when `git
{receive,upload}-pack` receive the `GIT_PROTOCOL` environment with as
value `version=2`. Currently the internal SSH Server wasn't passing this
environment through. The `gitea serv` code already passed all received
environments to the git command, so no code changes there.

2 years agoRework mailer settings (#18982)
Clar Fon [Tue, 2 Aug 2022 05:24:18 +0000 (01:24 -0400)]
Rework mailer settings (#18982)

* `PROTOCOL`: can be smtp, smtps, smtp+startls, smtp+unix, sendmail, dummy
* `SMTP_ADDR`: domain for SMTP, or path to unix socket
* `SMTP_PORT`: port for SMTP; defaults to 25 for `smtp`, 465 for `smtps`, and 587 for `smtp+startls`
* `ENABLE_HELO`, `HELO_HOSTNAME`: reverse `DISABLE_HELO` to `ENABLE_HELO`; default to false + system hostname
* `FORCE_TRUST_SERVER_CERT`: replace the unclear `SKIP_VERIFY`
* `CLIENT_CERT_FILE`, `CLIENT_KEY_FILE`, `USE_CLIENT_CERT`: clarify client certificates here

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd default value for clone URLs (#20600)
silverwind [Tue, 2 Aug 2022 02:52:05 +0000 (04:52 +0200)]
Add default value for clone URLs (#20600)

Default clone URLs to HTTP(S) in DOM rendering. JS will immediately
replace this if the user preference is SSH.

Fixes: https://github.com/go-gitea/gitea/issues/20558
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
PEN² [Tue, 2 Aug 2022 00:20:59 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agodocs: zh-cn translations for fail2ban setup (#20588)
PEN² [Mon, 1 Aug 2022 15:36:50 +0000 (23:36 +0800)]
docs: zh-cn translations for fail2ban setup (#20588)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoShould also support upper-case README files (#20581)
Gary Wang [Mon, 1 Aug 2022 12:15:40 +0000 (20:15 +0800)]
Should also support upper-case README files (#20581)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix typos in backup documentation (#20567)
tryfail [Mon, 1 Aug 2022 05:16:38 +0000 (06:16 +0100)]
Fix typos in backup documentation (#20567)

Fixed multiple typos "/user/local/bin" to the proper path "/usr/local/bin"

2 years ago[skip ci] Updated translations via Crowdin
Gary Wang [Mon, 1 Aug 2022 00:20:39 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoSupport localized README (#20508)
Gary Wang [Sun, 31 Jul 2022 22:36:58 +0000 (06:36 +0800)]
Support localized README (#20508)

* Support localized README

* Slightly simplify getting the readme file and add some tests. Ensure that i18n also
works for docs/ etc.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/markup/renderer.go

* Update modules/markup/renderer.go

* Update modules/markup/renderer.go

Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoClean up and fix clone button script (#20415)
silverwind [Sun, 31 Jul 2022 18:29:55 +0000 (20:29 +0200)]
Clean up and fix clone button script (#20415)

The button 'primary' class needs to be set in a synchronous script to prevent flicker of the button which was regressed recently, fixed that.

Additionally, reduced the two script tags to just one, the previous scripts were actually initializing the buttons thrice on the empty repo page, now it only initializes once. Finally, removed duplicate code and re-used the inline function in the update code as well.

I had to split out the script into a separate template as on the empty repo page, the script needs access to the clone URL span in the example text, which is rendered below the clone buttons, so buttons and script could not be combined.

2 years agoAdd disable download source configuration (#20548)
Lunny Xiao [Sun, 31 Jul 2022 16:57:02 +0000 (00:57 +0800)]
Add disable download source configuration (#20548)

Add configuration to enable/disable download source from UI.

Co-authored-by: zeripath <art27@cantab.net>
2 years agoFix default merge style (#20564)
wxiaoguang [Sun, 31 Jul 2022 15:13:31 +0000 (23:13 +0800)]
Fix default merge style (#20564)

2 years agoUpdate login methods in package docs (#20561)
KN4CK3R [Sun, 31 Jul 2022 13:41:25 +0000 (15:41 +0200)]
Update login methods in package docs (#20561)

2 years agoAdd missing Tabs on organisation/package view (Frontport #20539) (#20540)
6543 [Sun, 31 Jul 2022 12:32:51 +0000 (14:32 +0200)]
Add missing Tabs on organisation/package view (Frontport #20539) (#20540)

hotfix #20106

2 years ago[skip ci] Updated licenses and gitignores
Norwin [Sun, 31 Jul 2022 00:20:42 +0000 (00:20 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoAdd setting `SQLITE_JOURNAL_MODE` to enable WAL (#20535)
Norwin [Sat, 30 Jul 2022 19:57:41 +0000 (21:57 +0200)]
Add setting `SQLITE_JOURNAL_MODE` to enable WAL (#20535)

Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoRework file highlight rendering and fix yaml copy-paste (#19967)
silverwind [Sat, 30 Jul 2022 19:17:43 +0000 (21:17 +0200)]
Rework file highlight rendering and fix yaml copy-paste (#19967)

* Rework file highlight rendering and fix yaml copy-paste

* use Split+Trim to replace tag parser

* remove unnecessary bytes.Count

* remove newLineInHTML = "&#10;"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd new API endpoints for push mirrors management (#19841)
Mohamed Sekour [Sat, 30 Jul 2022 16:45:59 +0000 (18:45 +0200)]
Add new API endpoints for push mirrors management (#19841)

- Add a new push mirror to specific repository
- Sync now ( send all the changes to the configured push mirrors )
- Get list of all push mirrors of a repository
- Get a push mirror by ID
- Delete push mirror by ID

Signed-off-by: Mohamed Sekour <mohamed.sekour@exfo.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoWebAuthn CredentialID field needs to be increased in size (#20530)
zeripath [Sat, 30 Jul 2022 13:25:26 +0000 (14:25 +0100)]
WebAuthn CredentialID field needs to be increased in size (#20530)

WebAuthn have updated their specification to set the maximum size of the
CredentialID to 1023 bytes. This is somewhat larger than our current
size and therefore we need to migrate.

The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string
to the bytes field before another migration drops the old CredentialID field. Another migration
renames this field back.

Fix #20457

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd latest commit's SHA to content response (#20398)
Gusted [Sat, 30 Jul 2022 08:09:04 +0000 (10:09 +0200)]
Add latest commit's SHA to content response (#20398)

* Add latest commit's SHA to content response

- When requesting the contents of a filepath, add the latest commit's
SHA to the requested file.
- Resolves #12840

* Add swagger

* Fix NPE

* Fix tests

* Hook into LastCommitCache

* Move AddLastCommitCache to a common nogogit and gogit file

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

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoImprove token and secret key generation docs (#20387)
Ben Yanke [Sat, 30 Jul 2022 05:28:50 +0000 (01:28 -0400)]
Improve token and secret key generation docs (#20387)

This PR proposes a minor improvement to the docs which allows a user to paste a single command into their terminal and get the needed tokens and keys.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
silverwind [Sat, 30 Jul 2022 00:21:27 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRework raw file http header logic (#20484)
silverwind [Fri, 29 Jul 2022 15:26:55 +0000 (17:26 +0200)]
Rework raw file http header logic (#20484)

- Always respect the user's configured mime type map
- Allow more types like image/pdf/video/audio to serve with correct content-type
- Shorten cache duration of raw files to 5 minutes, matching GitHub
- Don't set `content-disposition: attachment`, let the browser decide whether it wants to download or display a file directly
- Implement rfc5987 for filenames, remove previous hack. Confirmed it working in Safari.
- Make PDF attachment work in Safari by removing `sandbox` attribute.

This change will make a lot more file types open directly in browser now. Logic should generally be more readable than before with less `if` nesting and such.

Replaces: https://github.com/go-gitea/gitea/pull/20460
Replaces: https://github.com/go-gitea/gitea/pull/20455
Fixes: https://github.com/go-gitea/gitea/issues/20404
2 years agoUpdate lunny/levelqueue to prevent NPE when reads are performed after close (#20534)
zeripath [Fri, 29 Jul 2022 11:41:13 +0000 (12:41 +0100)]
Update lunny/levelqueue to prevent NPE when reads are performed after close (#20534)

2 years agoAdded guidance on file to choose to download (#20474)
Alex Papadimoulis [Fri, 29 Jul 2022 06:07:52 +0000 (02:07 -0400)]
Added guidance on file to choose to download (#20474)

* Added guidance on file to choose to download

* Update from-binary.en-us.md

* Update from-binary.en-us.md

* Update from-binary.en-us.md

* Update docs/content/doc/installation/from-binary.en-us.md

* Update docs/content/doc/installation/from-binary.en-us.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years ago[skip ci] Updated translations via Crowdin
zeripath [Fri, 29 Jul 2022 00:21:37 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoEnsure that all unmerged files are merged when conflict checking (#20528)
zeripath [Thu, 28 Jul 2022 23:19:55 +0000 (00:19 +0100)]
Ensure that all unmerged files are merged when conflict checking (#20528)

There is a subtle bug in the code relating to collating the results of
`git ls-files -u -z` in `unmergedFiles()`. The code here makes the
mistake of assuming that every unmerged file will always have a stage 1
conflict, and this results in conflicts that occur in stage 3 only being
dropped.

This PR simply adjusts this code to ensure that any empty unmergedFile
will always be passed down the channel.

The PR also adds a lot of Trace commands to attempt to help find future
bugs in this code.

Fix #19527

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agopackages/generic: Do not restrict package versions to SemVer (#20414)
Gergely Nagy [Thu, 28 Jul 2022 22:09:54 +0000 (00:09 +0200)]
packages/generic: Do not restrict package versions to SemVer (#20414)

There are existing packages out there whose version do not conform to SemVer, yet, one would like to have them available in a generic package repository. To this end, remove the SemVer restriction on package versions when using the Generic package registry, and replace it with a check that simply makes sure the version isn't empty.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoStop logging EOFs and exit(1)s in ssh handler (#20476)
zeripath [Thu, 28 Jul 2022 19:56:55 +0000 (20:56 +0100)]
Stop logging EOFs and exit(1)s in ssh handler (#20476)

The code in modules/ssh/ssh.go:sessionHandler() currently cause an error to be
logged if `gitea serv` exits with a exit(1). This logging is useless because the
accompanying stderr is not provided and in any case the exit(1) is most likely due
to permissions errors.

Further it then causes the EOF to be logged - even though this is not helpful.

This PR simply checks the errors returned and stops logging them.

In the case of misconfigurations causing `gitea serv` to fail with exit(1)
the current logging is not helpful at determining this and users should simply
review the message passed over the ssh connection.

Fix #20473

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix dashboard switching on Mobile (#20238)
Gusted [Thu, 28 Jul 2022 18:40:23 +0000 (20:40 +0200)]
Fix dashboard switching on Mobile (#20238)

- This is a regression of improving mobile experience on Gitea, currently organization dashboard aren't readable and the popup won't show up when you want to switch between users/organization(as we saw in #19978).
- This patch fixes that, by allowing the popup to allocate the required pixels(for some absurd reason, z-index doesn't work on the popup, so it's not able to render over the existing elements, we can investigate later of why this is). And also remove the additional dropdown menu for the pages link, so it's one unified list which then can be displayed as rows.

2 years agoModify milestone search keywords to be case insensitive again (#20513)
Tyrone Yeh [Thu, 28 Jul 2022 16:58:04 +0000 (00:58 +0800)]
Modify milestone search keywords to be case insensitive again (#20513)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
2 years agoFix i18n for email notifications (#20518)
wxiaoguang [Thu, 28 Jul 2022 15:28:46 +0000 (23:28 +0800)]
Fix i18n for email notifications (#20518)

2 years agoExtended permission checks. (#20517)
KN4CK3R [Thu, 28 Jul 2022 13:04:03 +0000 (15:04 +0200)]
Extended permission checks. (#20517)

2 years agoAdd a checkbox to select all issues/PRs (#20177)
Tyrone Yeh [Thu, 28 Jul 2022 10:25:18 +0000 (18:25 +0800)]
Add a checkbox to select all issues/PRs (#20177)

2 years agoAdded email notification option to receive all own messages (#20179)
Tyrone Yeh [Thu, 28 Jul 2022 08:30:12 +0000 (16:30 +0800)]
Added email notification option to receive all own messages (#20179)

Sometimes users want to receive email notifications of messages they create or reply to,
Added an option to personal preferences to allow users to choose

Closes #20149

2 years agoAdd Docker /v2/_catalog endpoint (#20469)
KN4CK3R [Thu, 28 Jul 2022 03:59:39 +0000 (05:59 +0200)]
Add Docker /v2/_catalog endpoint (#20469)

* Added properties for packages.
* Fixed authenticate header format.
* Added _catalog endpoint.
* Check owner visibility.
* Extracted condition.
* Added test for _catalog.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>