]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoRemove appSubUrl from pasted images (#17572)
zeripath [Mon, 8 Nov 2021 06:27:40 +0000 (06:27 +0000)]
Remove appSubUrl from pasted images (#17572)

* Remove appSubUrl from pasted images

Since we fixed the url base for the links in repositories we no longer need to add
the appsuburl to pasted image links.

Fix #17057

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1...
wxiaoguang [Mon, 8 Nov 2021 03:25:41 +0000 (11:25 +0800)]
Fix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1.16 (#17530)

* fix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1.16

2 years agoAdd @Gusted to maintainers filer (#17581)
Gusted [Sun, 7 Nov 2021 19:23:39 +0000 (20:23 +0100)]
Add @Gusted to maintainers filer (#17581)

2 years agoMake ParsePatch more robust (#17573)
Gusted [Sun, 7 Nov 2021 17:52:50 +0000 (18:52 +0100)]
Make ParsePatch more robust (#17573)

2 years agoFix bug on admin subcommand (#17533)
Lunny Xiao [Sun, 7 Nov 2021 03:11:27 +0000 (11:11 +0800)]
Fix bug on admin subcommand (#17533)

* Fix bug on admin subcommand

* Add signals for all initDB

Co-authored-by: Lauris BH <lauris@nix.lv>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 7 Nov 2021 00:25:43 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix ipv6 parsing for builtin ssh server (#17561)
Wim [Sat, 6 Nov 2021 06:23:32 +0000 (07:23 +0100)]
Fix ipv6 parsing for builtin ssh server (#17561)

2 years agoUpdate locale_en-US.ini (#17553)
Yuwei Ba [Fri, 5 Nov 2021 19:23:55 +0000 (06:23 +1100)]
Update locale_en-US.ini (#17553)

2 years agoEscape issue titles in comments list (#17555)
zeripath [Fri, 5 Nov 2021 14:56:40 +0000 (14:56 +0000)]
Escape issue titles in comments list (#17555)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUse correct defaultValue for stracktrace (#17552)
Gusted [Fri, 5 Nov 2021 11:25:05 +0000 (12:25 +0100)]
Use correct defaultValue for stracktrace (#17552)

2 years agoFix zero created time bug on commit api (#17546)
Lunny Xiao [Fri, 5 Nov 2021 05:30:46 +0000 (13:30 +0800)]
Fix zero created time bug on commit api (#17546)

Fix #17543

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 5 Nov 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix database keyword quote problem on migration v161 (#17522)
Lunny Xiao [Thu, 4 Nov 2021 22:47:01 +0000 (06:47 +0800)]
Fix database keyword quote problem on migration v161 (#17522)

* support rerun migration v161

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoHide label comments if labels were added and removed immediately (#17455)
qwerty287 [Thu, 4 Nov 2021 14:51:30 +0000 (15:51 +0100)]
Hide label comments if labels were added and removed immediately (#17455)

* Hide label comments if labels were added and removed immediately

* Add comment and rename var

* Fix unit test

* Add test case

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoShow correct "No" icon (#17537)
delvh [Thu, 4 Nov 2021 02:09:03 +0000 (03:09 +0100)]
Show correct "No" icon (#17537)

2 years agoUse exec -a in the FHS compliant script (#17513)
zeripath [Wed, 3 Nov 2021 08:13:07 +0000 (08:13 +0000)]
Use exec -a in the FHS compliant script (#17513)

2 years agoFix list for options under cli->user->admin->create (#17382)
SahAssar [Wed, 3 Nov 2021 05:27:35 +0000 (06:27 +0100)]
Fix list for options under cli->user->admin->create (#17382)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agohide note message for pull request template (#17529)
a1012112796 [Wed, 3 Nov 2021 03:43:16 +0000 (11:43 +0800)]
hide note message for pull request template (#17529)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2 years agoSimplify Gothic to use our session store instead of creating a different store (...
zeripath [Wed, 3 Nov 2021 00:33:54 +0000 (00:33 +0000)]
Simplify Gothic to use our session store instead of creating a different store (#17507)

* Simplify Gothic to use our session store instead of creating a different store

We have been using xormstore to provide a separate session store for our OAuth2 logins
however, this relies on using gorilla context and some doubling of our session storing.
We can however, simplify and simply use our own chi-based session store. Thus removing
a cookie and some of the weirdness with missing contexts.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per review

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per review

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoAdd QueryEscape to general funcmap (#17526)
zeripath [Tue, 2 Nov 2021 15:00:30 +0000 (15:00 +0000)]
Add QueryEscape to general funcmap (#17526)

QueryEscape was only added to the text funcmap. Add this to the main template funcmap
too.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agofix email with + when active (#17518)
Lunny Xiao [Tue, 2 Nov 2021 06:26:13 +0000 (14:26 +0800)]
fix email with + when active (#17518)

Co-authored-by: zeripath <art27@cantab.net>
2 years agoMake Repo Code Indexer an Unique Queue (#17515)
zeripath [Tue, 2 Nov 2021 03:14:24 +0000 (03:14 +0000)]
Make Repo Code Indexer an Unique Queue (#17515)

The functioning of the code indexer queue really only makes sense as an unique queue
and doing this allows use to simplify the indexer data to simply delete the data if
the repo is no longer in the db.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agodocs: add SSH passthrough instructions to with-docker-rootless (#17505) (#17508)
Renato Caldas [Mon, 1 Nov 2021 12:34:12 +0000 (12:34 +0000)]
docs: add SSH passthrough instructions to with-docker-rootless (#17505) (#17508)

The passthrough is based upon AuthorizedKeysCommand and a custom shell wrapper that forwards commands to the container over the docker pipe.

2 years agoOnly allow webhook to send requests to allowed hosts (#17482)
wxiaoguang [Mon, 1 Nov 2021 08:39:52 +0000 (16:39 +0800)]
Only allow webhook to send requests to allowed hosts (#17482)

2 years agoStop double encoding blame commit messages (#17498)
zeripath [Sun, 31 Oct 2021 08:25:24 +0000 (08:25 +0000)]
Stop double encoding blame commit messages (#17498)

The call to html.EscapeString in routers/web/repo/blame.go:renderBlame is extraneous
as the commit message is now rendered by the template. The template will correctly
escape strings - therefore we are currently double escaping.

This PR fixes this.

Fix #17492

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 31 Oct 2021 00:25:12 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoProperly determine CSV delimiter (#17459)
Richard Mahn [Sat, 30 Oct 2021 15:50:40 +0000 (09:50 -0600)]
Properly determine CSV delimiter (#17459)

* Fixes #16558 CSV delimiter determiner

* Fixes #16558 - properly determine CSV delmiiter

* Moves quoteString to a new function

* Adds big test with lots of commas for tab delimited csv

* Adds comments

* Shortens the text of the test

* Removes single quotes from regexp as only double quotes need to be searched

* Fixes spelling

* Fixes check of length as it probalby will only be 1e4, not greater

* Makes sample size a const, properly removes truncated line

* Makes sample size a const, properly removes truncated line

* Fixes comment

* Fixes comment

* tests for FormatError() function

* Adds logic to find the limiter before or after a quoted value

* Simplifies regex

* Error tests

* Error tests

* Update modules/csv/csv.go

Co-authored-by: delvh <dev.lh@web.de>
* Update modules/csv/csv.go

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

* Update modules/csv/csv.go

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
2 years agoRename db Engines related functions (#17481)
Lunny Xiao [Sat, 30 Oct 2021 14:32:11 +0000 (22:32 +0800)]
Rename db Engines related functions (#17481)

* Rename db Engines related functions

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoQuote the table name in CountOrphanedObjects (#17487)
zeripath [Sat, 30 Oct 2021 09:17:40 +0000 (10:17 +0100)]
Quote the table name in CountOrphanedObjects (#17487)

CountOrphanedObjects needs to quote the table it is joining with as this table may
be `user`.

Fix #17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 30 Oct 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRun Migrate in Install rather than just SyncTables (#17475)
zeripath [Fri, 29 Oct 2021 08:23:10 +0000 (09:23 +0100)]
Run Migrate in Install rather than just SyncTables (#17475)

* Run Migrate in Install rather than just SyncTables

The underlying problem in #17328 appears to be that users are re-running the install
page during upgrades. The function that tests and creates the db did not intend for
this and thus instead the migration scripts being run - a simple sync tables occurs.

This then causes a weird partially migrated DB which causes, in this release cycle,
the duplicate column in task table error. It is likely the cause of some weird
partial migration errors in other cycles too.

This PR simply ensures that the migration scripts are also run at this point too.

Fix #17328

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 29 Oct 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUpdate docs/config.yaml to 1.15.6 (#17472)
zeripath [Thu, 28 Oct 2021 13:44:33 +0000 (14:44 +0100)]
Update docs/config.yaml to 1.15.6 (#17472)

Update the version in docs/config.yaml to 1.15.6

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoMove key forms before list and add cancel button (#17432)
qwerty287 [Thu, 28 Oct 2021 10:55:48 +0000 (12:55 +0200)]
Move key forms before list and add cancel button (#17432)

* Move GPG form before list and add cancel button
* Move SSH form before list and add cancel button

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix login redirection links (#17451)
qwerty287 [Thu, 28 Oct 2021 10:09:25 +0000 (12:09 +0200)]
Fix login redirection links (#17451)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoChangelog 1.15.6 (#17457) (#17468)
zeripath [Thu, 28 Oct 2021 09:22:27 +0000 (10:22 +0100)]
Changelog 1.15.6 (#17457) (#17468)

Frontport #17457

 ## [1.15.6](https://github.com/go-gitea/gitea/releases/tag/v1.15.6) - 2021-10-28

* BUGFIXES
  * Prevent panic in serv.go with Deploy Keys (#17434) (#17435)
  * Fix CSV render error (#17406) (#17431)
  * Read expected buffer size (#17409) (#17430)
  * Ensure that restricted users can access repos for which they are members (#17460) (#17464)
  * Make commit-statuses popup show correctly (#17447) (#17466)
* TESTING
  * Add integration tests for private.NoServCommand and private.ServCommand (#17456) (#17463)

2 years agoFix mispelling of starred as stared (#17465)
zeripath [Thu, 28 Oct 2021 07:05:00 +0000 (08:05 +0100)]
Fix mispelling of starred as stared (#17465)

There was a recent spelling mistake added to the locale file where stared was used
instead of starred.

This PR changes this to starred.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoEnsure that restricted users can access repos for which they are members (#17460)
zeripath [Thu, 28 Oct 2021 02:54:40 +0000 (03:54 +0100)]
Ensure that restricted users can access repos for which they are members (#17460)

There is a small bug in the way that repo access is checked in
repoAssignment: Accessibility is checked by checking if the user has a
marked access to the repository instead of checking if the user has any
team granted access.

This PR changes this permissions check to use HasAccess() which does the
correct test. There is also a fix in the release api ListReleases where
it should return draft releases if the user is a member of a team with
write access to the releases.

The PR also adds a testcase.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agomake commit-statuses popup can be shown correctly. (#17447)
wxiaoguang [Thu, 28 Oct 2021 01:34:18 +0000 (09:34 +0800)]
make commit-statuses popup can be shown correctly. (#17447)

Close #17443

Maybe we do not need to backport this PR, the bug doesn't break daily usage.

After the fix, the commit statuses popup can show a lot of lines with scroll bars:

![image](https://user-images.githubusercontent.com/2114189/139026160-f01b484c-6207-494a-a190-a6dd184ceb2b.png)

2 years agoAdd integration tests for private.NoServCommand and private.ServCommand (#17456)
zeripath [Thu, 28 Oct 2021 00:32:59 +0000 (01:32 +0100)]
Add integration tests for private.NoServCommand and private.ServCommand (#17456)

modules/private/serv.go has two major functions that are missing testcases to ensure
that Deploy and normal SSH keys work correctly.

This PR adds some basic integration tests for these.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd appearance section in settings (#17433)
qwerty287 [Wed, 27 Oct 2021 15:40:08 +0000 (17:40 +0200)]
Add appearance section in settings (#17433)

* Add appearance section in settings

* Fix lint

* Fix lint

* Apply suggestions from code review

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoFix a UI error when folding a file content in a commit view (#17446)
wxiaoguang [Wed, 27 Oct 2021 11:11:56 +0000 (19:11 +0800)]
Fix a UI error when folding a file content in a commit view (#17446)

2 years agoShow client-side error if wiki page is empty (#17415)
David Jimenez [Wed, 27 Oct 2021 04:33:22 +0000 (05:33 +0100)]
Show client-side error if wiki page is empty (#17415)

* fix: show client-side error if wiki page is empty

Implement a JS, client-side validation workaround for a bug in the upstream
editor library SimpleMDE which breaks HTML5 client-side validation when
a wiki page is submitted.

This allows native, client-side errors to appear if
the text editor contents are empty.

See upstream bugfix report: https://github.com/sparksuite/simplemde-markdown-editor/issues/324

Signed-off-by: David Jimenez <dvejmz@sgfault.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoFixes #16559 - Do not trim leading spaces for tab delimited (#17442)
Richard Mahn [Tue, 26 Oct 2021 21:46:56 +0000 (15:46 -0600)]
Fixes #16559 - Do not trim leading spaces for tab delimited (#17442)

* Fixes #16559 - Do not trim leading spaces for tab delimited

* Adds back semicolon delimited test

* Fixes linting

* Adds nolint directive to test because uses strings starting with spaces

Co-authored-by: zeripath <art27@cantab.net>
2 years agoFix docker rootless build (#17441)
wxiaoguang [Tue, 26 Oct 2021 16:21:01 +0000 (00:21 +0800)]
Fix docker rootless build (#17441)

2 years agoTune UI alignment for nav bar notification icon, avatar image, issue label (#17438)
wxiaoguang [Tue, 26 Oct 2021 12:29:48 +0000 (20:29 +0800)]
Tune UI alignment for nav bar notification icon, avatar image, issue label (#17438)

2 years agoUpgrade go-github to v39 (#17437)
Lunny Xiao [Tue, 26 Oct 2021 07:19:21 +0000 (15:19 +0800)]
Upgrade go-github to v39 (#17437)

2 years agoPrevent panic in serv.go with Deploy Keys (#17434)
zeripath [Mon, 25 Oct 2021 23:24:19 +0000 (00:24 +0100)]
Prevent panic in serv.go with Deploy Keys (#17434)

Unfortunately there was a regression in #17373 which missed that the user is not
for deploy keys. This leads to a panic when pushing with deploy keys.

Fix #17412

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agochmod executables when copying to the docker (#17423)
zeripath [Mon, 25 Oct 2021 18:32:03 +0000 (19:32 +0100)]
chmod executables when copying to the docker (#17423)

Run chmod on the executables and the entrypoint when copying them to the
docker in dockerfile.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: delvh <dev.lh@web.de>
2 years agoUpgrade webpack to 5.59.1 to resolve the `waitFor` bug with `watch-frontend` (#17428)
wxiaoguang [Mon, 25 Oct 2021 11:54:25 +0000 (19:54 +0800)]
Upgrade webpack to 5.59.1 to resolve the `waitFor` bug with `watch-frontend` (#17428)

Webpack < 5.59 has a bug, which makes watch-frontend fail when editing .less files.

2 years agofix markdown checkbox rendering (#17425)
wxiaoguang [Mon, 25 Oct 2021 07:40:38 +0000 (15:40 +0800)]
fix markdown checkbox rendering (#17425)

2 years agoIn many cases user avatar link should be an absolute URL with http host (#17420)
wxiaoguang [Mon, 25 Oct 2021 05:01:16 +0000 (13:01 +0800)]
In many cases user avatar link should be an absolute URL with http host (#17420)

2 years agoAdd API to get/edit wiki (#17278)
qwerty287 [Mon, 25 Oct 2021 03:43:40 +0000 (05:43 +0200)]
Add API to get/edit wiki (#17278)

* Add API to get/edit wiki

* Add swagger docs, various improvements

* fmt

* Fix lint and rm comment

* Add page parameter

* Add pagination to pages

* Add tests

* fmt

* Update func names

* Update error handling

* Update type name

* Fix lint

* Don't delete Home

* Update func name

* Update routers/api/v1/repo/wiki.go

Co-authored-by: delvh <dev.lh@web.de>
* Remove unnecessary check

* Fix lint

* Use English strings

* Update integrations/api_wiki_test.go

Co-authored-by: delvh <dev.lh@web.de>
* Update func and test names

* Remove unsed check and avoid duplicated error reports

* Improve error handling

* Return after error

* Document 404 error

* Update swagger

* Fix lint

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>
* Document file encoding

* fmt

* Apply suggestions

* Use convert

* Fix integration test

* simplify permissions

* unify duplicate key Title/Name

* improve types & return UTC timestamps

* improve types pt.2

- add WikiPageMetaData.LastCommit
- add WikiPageMetaData.HTMLURL
- replace WikiPageMetaData.Updated with .LastCommit.Committer.Created

also delete convert.ToWikiPage(), as it received too many arguments and
only had one callsite anyway. sorry for bad advice earlier ðŸ™ƒ

* WikiPage.Content is base64 encoded

* simplify error handling in wikiContentsByName()

* update swagger

* fix & DRY findWikiRepoCommit() error handling

ListWikiPages() previously wrote error twice when repo wiki didn't exist

* rename Content -> ContentBase64

* Fix test

* Fix tests

* Update var name

* suburl -> sub_url

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 25 Oct 2021 00:25:06 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix CSV render error (#17406)
KN4CK3R [Sun, 24 Oct 2021 22:42:32 +0000 (00:42 +0200)]
Fix CSV render error (#17406)

closed #17378

Both errors from #17378 were caused by  #15175.

Problem 1 (error with added file):
`ToUTF8WithFallbackReader` creates a `MultiReader` from a `byte[2048]` and the remaining reader. `CreateReaderAndGuessDelimiter` tries to read 10000 bytes from this reader but only gets 2048 because that's the first reader in the `MultiReader`. Then the `if size < 1e4` thinks the input is at EOF and just returns that.

Problem 2 (error with changed file):
The blob reader gets defer closed. That was fine because the old version reads the whole file into memory. Now with the streaming version the close needs to defer after the method.

2 years agoRead expected buffer size (#17409)
KN4CK3R [Sun, 24 Oct 2021 21:12:43 +0000 (23:12 +0200)]
Read expected buffer size (#17409)

* Read expected buffer size.

* Changed name.

2 years agoAdd HAProxy Config to reverse-proxies.en-us.md (#17407)
Kane [Sun, 24 Oct 2021 15:48:26 +0000 (17:48 +0200)]
Add HAProxy Config to reverse-proxies.en-us.md (#17407)

* Update reverse-proxies.en-us.md

Addition of HAProxy

* Update reverse-proxies.en-us.md

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 24 Oct 2021 00:25:14 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix issue content history problems, improve UI (#17404)
wxiaoguang [Sat, 23 Oct 2021 14:48:16 +0000 (22:48 +0800)]
Fix issue content history problems, improve UI (#17404)

* Improve: make diff result better, make the HTML element fit the full height in the content history diff dialog
* Bug fix: when edit the main issue, the poster is wrongly set to the issue poster

2 years agoFix issue content history problems, improve UI (#17404)
wxiaoguang [Sat, 23 Oct 2021 14:47:38 +0000 (22:47 +0800)]
Fix issue content history problems, improve UI (#17404)

* Improve: make diff result better, make the HTML element fit the full height in the content history diff dialog
* Bug fix: when edit the main issue, the poster is wrongly set to the issue poster

2 years agoFix issue markdown bugs (#17411)
wxiaoguang [Sat, 23 Oct 2021 13:38:12 +0000 (21:38 +0800)]
Fix issue markdown bugs (#17411)

* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close #17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close #17395

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 23 Oct 2021 00:28:47 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRemove deprecated `extendDefaultPlugins` method of svgo (#17399)
Mashiro [Fri, 22 Oct 2021 20:05:53 +0000 (04:05 +0800)]
Remove deprecated `extendDefaultPlugins` method of svgo (#17399)

2 years agoFrontport Changelog 1.15.5 (#17392) (#17401)
zeripath [Fri, 22 Oct 2021 16:32:08 +0000 (17:32 +0100)]
Frontport Changelog 1.15.5 (#17392) (#17401)

2 years agoFix context popup error (#17398)
wxiaoguang [Fri, 22 Oct 2021 14:34:01 +0000 (22:34 +0800)]
Fix context popup error (#17398)

* Fix context popup error

2 years agoAdd groups scope/claim to OIDC/OAuth2 Provider (#17367)
Nico Schieder [Fri, 22 Oct 2021 09:19:24 +0000 (11:19 +0200)]
Add groups scope/claim to OIDC/OAuth2 Provider (#17367)

* Add groups scope/claim to OICD/OAuth2

Add support for groups claim as part of the OIDC/OAuth2 flow.
Groups is a list of "org" and "org:team" strings to allow clients to
authorize based on the groups a user is part of.

Signed-off-by: Nico Schieder <code@nico-schieder.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoStop sanitizing full name in API (#17396)
zeripath [Fri, 22 Oct 2021 07:17:35 +0000 (08:17 +0100)]
Stop sanitizing full name in API (#17396)

The API convert.toUser function makes the incorrect assumption that full names could
be rendered as is without being escaped. It therefore runs the names through
markup.Sanitize which leads to a double escape of user full names. This
pr stops this.

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 [Fri, 22 Oct 2021 00:25:10 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRe-separate the color translation strings (#17390)
zeripath [Thu, 21 Oct 2021 21:51:03 +0000 (22:51 +0100)]
Re-separate the color translation strings (#17390)

Fix #17384

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix the click behavior for <tr> and <td> with [data-href] (#17388)
wxiaoguang [Thu, 21 Oct 2021 18:19:32 +0000 (02:19 +0800)]
Fix the click behavior for <tr> and <td> with [data-href] (#17388)

2 years agoRefactor update checker to use AppState (#17387)
wxiaoguang [Thu, 21 Oct 2021 16:10:49 +0000 (00:10 +0800)]
Refactor update checker to use AppState (#17387)

We have the `AppState` module now, it can store app related data easily. We do not need to create separate tables for each feature.

So the update checker can use `AppState` instead of a one-row dedicate table.

And the code of update checker is moved from `models` to `modules`.

2 years agoFix SVG side by side comparison link (#17375)
Mario Lubenka [Thu, 21 Oct 2021 10:43:26 +0000 (12:43 +0200)]
Fix SVG side by side comparison link (#17375)

* Remove swipe-bar z-index

Fixes position of swipe-bar so it does not overlay other UI components when scrolling.

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Unique names for image tabs in pull request

Define unique names for image tabs in pull requests, in order to toggle tabs correctly when multiple are displayed on one page.

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
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 history count failure (#17351)
Lunny Xiao [Thu, 21 Oct 2021 10:06:19 +0000 (18:06 +0800)]
Fix history count failure (#17351)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoSync gitea app path for git hooks and authorized keys when starting (#17335)
wxiaoguang [Thu, 21 Oct 2021 09:22:43 +0000 (17:22 +0800)]
Sync gitea app path for git hooks and authorized keys when starting (#17335)

Gitea writes its own AppPath into git hook scripts. If Gitea's AppPath changes, then the git push will fail.

This PR:

* Introduce an AppState module, it can persist app states into database
* During GlobalInit, Gitea will check if the current AppPath is the same as last one. If they don't match, Gitea will sync git hooks.
* Refactor some code to make them more clear.
* Also, "Detect if gitea binary's name changed" #11341 is related, we call models.RewriteAllPublicKeys to update ssh authorized_keys file

2 years agoHandle broken references in mirror sync (#17013)
zeripath [Thu, 21 Oct 2021 08:45:25 +0000 (09:45 +0100)]
Handle broken references in mirror sync (#17013)

* Handle broken references in mirror sync

If there are broken references during a mirror attempt to fix using `git remote prune`.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFrontend refactor, PascalCase to camelCase, remove unused code (#17365)
wxiaoguang [Thu, 21 Oct 2021 07:37:43 +0000 (15:37 +0800)]
Frontend refactor, PascalCase to camelCase, remove unused code (#17365)

* Frontend refactor, PascalCase to camelCase, remove unused code

* fix

2 years agoFix heatmap test (#17381)
Lunny Xiao [Thu, 21 Oct 2021 06:37:40 +0000 (14:37 +0800)]
Fix heatmap test (#17381)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 21 Oct 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoEnsure correct SSH permissions check for private and restricted users (#17370)
zeripath [Wed, 20 Oct 2021 20:59:05 +0000 (21:59 +0100)]
Ensure correct SSH permissions check for private and restricted users (#17370)

Repositories owned by private users and organisations and pulls by restricted users
need to have permissions checked. Previously Serv would simply assumed that if the
user could log in and the repository was not private then it would be visible.

Fix #17364

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoUpgrade Bluemonday to v1.0.16 (#17372)
zeripath [Wed, 20 Oct 2021 20:58:39 +0000 (21:58 +0100)]
Upgrade Bluemonday to v1.0.16 (#17372)

Upgrade Bluemonday to latest version

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoOffer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH (#17281)
zeripath [Wed, 20 Oct 2021 19:55:33 +0000 (20:55 +0100)]
Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH (#17281)

* Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH

There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect
assumption that the public key type is the same as the signature algorithm type.

This means that only ssh-rsa signatures are offered by default.

This PR adds a workaround around this problem.

Fix #17175

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per review

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent NPE in CSV diff rendering when column removed (#17018)
Richard Mahn [Wed, 20 Oct 2021 19:10:03 +0000 (13:10 -0600)]
Prevent NPE in CSV diff rendering when column removed (#17018)

Fixes #16837 if a column is deleted.

We were clobbering the columns that were added by looping through the aline (base) and then when bline (head) was looped through, it clobbered what was in the "cells" array that is show in the diff, and then left a nil cell because nothing was shifted.

This fix properly shifts the cells, and properly puts the b cell either at its location or after, according to what the aline placed in the cells.

This includes test, adding a new test function since adding/removing cells works best with three columns, not two, which results in 4 columns of the resulting cells because it has a deleted column and an added column. If you try this locally, you can try those cases and others, such as adding a column.

There was no need to do anything special for the rows when `aline == 0 || bline == 0` so that was removed. This allows the same code to be used for removed or added lines, with the bcell text always being the RightCell, acell text being the LeftCell.

I still added the patch zeripath gave at https://github.com/go-gitea/gitea/issues/16837#issuecomment-913007382 so that just in case for some reason a cell is nil (which shouldn't happen now) it doesn't throw a 500 error, so the user can at least view the raw diff.

Also fixes in the [view.go](https://github.com/go-gitea/gitea/pull/17018/files#diff-43a7f4747c7ba8bff888c9be11affaafd595fd55d27f3333840eb19df9fad393L521) file how if a CSV file is empty (either created empty or if you edit it and remove all contents) it throws a huge 500 error when you then save it (when you view the file). Since we allow creating, saving and pushing empty files, we shouldn't throw an error on an empty CSV file, but just show its empty contents. This doesn't happen if it is a Markdown file or other type of file that is empty.
EDIT: Now handled in the markup/csv renderer code

2 years agoUse a variable but a function for IsProd because of a slight performance increment...
Lunny Xiao [Wed, 20 Oct 2021 14:37:19 +0000 (22:37 +0800)]
Use a variable but a function for IsProd because of a slight performance increment (#17368)

2 years ago "Copy branch name" button in pull request (#17323)
Mario Lubenka [Tue, 19 Oct 2021 17:32:11 +0000 (19:32 +0200)]
 "Copy branch name" button in pull request (#17323)

* Drop data-original from clipboard

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

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* "Copy branch name" button in pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Update templates/repo/issue/view_title.tmpl

Co-authored-by: silverwind <me@silverwind.io>
* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoRename .air.conf to .air.toml (#17360)
silverwind [Tue, 19 Oct 2021 16:27:29 +0000 (18:27 +0200)]
Rename .air.conf to .air.toml (#17360)

As of https://github.com/cosmtrek/air/pull/90, the preferred file
extension is .toml. The file format was always toml itself.

2 years agoRe-allow clipboard copy on non-https sites (#17118)
Netduma Luke M [Tue, 19 Oct 2021 10:22:16 +0000 (11:22 +0100)]
Re-allow clipboard copy on non-https sites (#17118)

* Re-allow clipboard copy on non-https sites
* fallback clipboard functions

2 years agoUpdate JS dependencies (#17357)
silverwind [Tue, 19 Oct 2021 07:23:58 +0000 (09:23 +0200)]
Update JS dependencies (#17357)

* Update JS dependencies

- Upgrade to eslint 8 and add new plugin rules
- Adapt to various API changes
- Rebuild SVGs

* fix webpack warning on license

* order options alphabetically

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix dashboard repolist alignment and repolisting (#17355)
zeripath [Tue, 19 Oct 2021 04:38:33 +0000 (05:38 +0100)]
Fix dashboard repolist alignment and repolisting (#17355)

Unfortunately #17301 broke the restriction of the dashboard repolist to
the user's repos because it stopped passing in the uid for the current
user. This PR restores this.

There is also a weird alignment problem - not caused by that PR - where
the menu items in the repolist spread over multiple lines. This PR
simply reduces the padding on these items and switches the justification
of the flex elements to space-evenly.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 19 Oct 2021 00:25:06 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoDisable form autofill (#17291)
wxiaoguang [Mon, 18 Oct 2021 22:08:41 +0000 (06:08 +0800)]
Disable form autofill (#17291)

]* fix aria-hidden and tabindex

* use {{template "base/disable_form_autofill"}} instead of {{DisableFormAutofill}}

Co-authored-by: zeripath <art27@cantab.net>
2 years agoAllow mocking timeutil (#17354)
John Olheiser [Mon, 18 Oct 2021 20:12:26 +0000 (15:12 -0500)]
Allow mocking timeutil (#17354)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2 years agodocs: add permission notes to `SSH Container Passthrough` (#17347)
Mashiro [Mon, 18 Oct 2021 16:26:47 +0000 (00:26 +0800)]
docs: add permission notes to `SSH Container Passthrough` (#17347)

* Update with-docker.en-us.md

* Update with-docker.en-us.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years agoapi: integration test for nodeinfo (#17346)
techknowlogick [Mon, 18 Oct 2021 05:36:56 +0000 (01:36 -0400)]
api: integration test for nodeinfo (#17346)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 18 Oct 2021 00:25:12 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUse go1.16+ way of installing binaries (#17342)
techknowlogick [Sun, 17 Oct 2021 22:57:15 +0000 (18:57 -0400)]
Use go1.16+ way of installing binaries (#17342)

3 years agoFix some lints (#17337)
Lunny Xiao [Sun, 17 Oct 2021 19:47:12 +0000 (03:47 +0800)]
Fix some lints (#17337)

Fix some linting problems.

3 years agoMove session to models/login (#17338)
Lunny Xiao [Sun, 17 Oct 2021 18:51:56 +0000 (02:51 +0800)]
Move session to models/login (#17338)

Move model/session.go to models/login

3 years agoHide command line merge instructions when user can't push (#17339)
qwerty287 [Sun, 17 Oct 2021 16:58:36 +0000 (18:58 +0200)]
Hide command line merge instructions when user can't push (#17339)

Hides the command line instructions if the authenticated user can't push to the base branch.
Closes #17121

3 years agofix: repository summary on mobile (#17322)
kolaente [Sun, 17 Oct 2021 14:05:32 +0000 (16:05 +0200)]
fix: repository summary on mobile (#17322)

This PR fixes the repository summary on mobile. Most of it is vertically centering things and some spacing.

#### Before:
![Screen Shot 2021-10-15 at 19 12 25](https://user-images.githubusercontent.com/13721712/137528901-021867b5-73c3-4f48-8408-18bc573f5ee7.png)

#### After:
![Screen Shot 2021-10-15 at 19 28 06](https://user-images.githubusercontent.com/13721712/137528970-058a66fd-d5d9-44ea-ba5f-998bf8cbf4fe.png)

3 years agoMake the Mirror Queue a queue (#17326)
zeripath [Sun, 17 Oct 2021 11:43:25 +0000 (12:43 +0100)]
Make the Mirror Queue a queue (#17326)

Convert the old mirror syncing queue to the more modern queue format.

Fix a bug in the from the repo-archive queue PR - the assumption was made that uniqueness could be enforced with by checking equality in a map in channel unique queues - however this only works for primitive types - which was the initial intention but is an imperfect. This is fixed by marshalling the data and placing the martialled data in the unique map instead.

The documentation is also updated to add information about the deprecated configuration values.

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