]> source.dussan.org Git - gitea.git/log
gitea.git
4 years agoDisable Git Hooks by default (#13064)
techknowlogick [Wed, 7 Oct 2020 18:24:14 +0000 (14:24 -0400)]
Disable Git Hooks by default (#13064)

* Disable Git Hooks by default

Related #13058

* pass tests

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 7 Oct 2020 09:56:17 +0000 (09:56 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoMitigate Security vulnerability in the git hook feature (#13058)
Niklas Goerke [Wed, 7 Oct 2020 09:55:13 +0000 (11:55 +0200)]
Mitigate Security vulnerability in the git hook feature (#13058)

* Extend git hook warning in the UI.

Git hooks are a dangerous feature, administrators should be warned before giving
the git hook privilege to users.

* Disable Git hooks by default and add warning.

Git hooks are a dangerous features (see warning text) that should only
be enabled if the administrator was informed about the risk involved.

Co-authored-by: Niklas Goerke <goerke@fzi.de>
4 years agoUpdate third-party-tools.en-us.md (#13046)
Rongjian Zhang [Tue, 6 Oct 2020 16:55:51 +0000 (00:55 +0800)]
Update third-party-tools.en-us.md (#13046)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 6 Oct 2020 16:17:17 +0000 (16:17 +0000)]
[skip ci] Updated translations via Crowdin

4 years agofix: case typo (#13049)
Rongjian Zhang [Tue, 6 Oct 2020 16:16:16 +0000 (00:16 +0800)]
fix: case typo (#13049)

* Update settings.go

* Run swagger generate

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 6 Oct 2020 07:24:15 +0000 (07:24 +0000)]
[skip ci] Updated translations via Crowdin

4 years ago[Docs] Update GitNex Link (#13050)
6543 [Tue, 6 Oct 2020 07:23:10 +0000 (09:23 +0200)]
[Docs] Update GitNex Link (#13050)

4 years agoAdding visual cue for "Limited" & "Private" organizations. (#13040)
Spencer Taylor [Tue, 6 Oct 2020 06:25:43 +0000 (01:25 -0500)]
Adding visual cue for "Limited" & "Private" organizations. (#13040)

* Adding visual cue for "Limited" & "Private" organizations.

* Moving org visibility CSS styles to .less files.

Co-authored-by: Gitea <gitea@fake.local>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix error create comment on outdated file (#13041)
6543 [Tue, 6 Oct 2020 00:18:55 +0000 (02:18 +0200)]
Fix error create comment on outdated file (#13041)

* FIX

* more specific

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix Pull Request merge buttons on mobile (#13035)
kolaente [Mon, 5 Oct 2020 23:31:25 +0000 (01:31 +0200)]
Fix Pull Request merge buttons on mobile (#13035)

Signed-off-by: kolaente <k@knt.li>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 5 Oct 2020 22:47:15 +0000 (22:47 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix Issue & Pull Request comment headers on mobile (#13039)
kolaente [Mon, 5 Oct 2020 22:46:11 +0000 (00:46 +0200)]
Fix Issue & Pull Request comment headers on mobile (#13039)

Signed-off-by: kolaente <k@knt.li>
4 years ago(Re)Load issue labels when changing them (#13007)
zeripath [Mon, 5 Oct 2020 06:49:11 +0000 (07:49 +0100)]
(Re)Load issue labels when changing them (#13007)

(Re)Load issue labels when labels are added or removed

This means that the label state that the webhooks produce accurately matches
the changes that they are reporting.

Fix #10660

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoAttachments: Add extension support, allow all types for releases (#12465)
silverwind [Mon, 5 Oct 2020 05:49:33 +0000 (07:49 +0200)]
Attachments: Add extension support, allow all types for releases (#12465)

* Attachments: Add extension support, allow all types for releases

- Add support for file extensions, matching the `accept` attribute of `<input type="file">`
- Add support for type wildcard mime types, e.g. `image/*`
- Create repository.release.ALLOWED_TYPES setting (default unrestricted)
- Change default for attachment.ALLOWED_TYPES to a list of extensions
- Split out POST /attachments into two endpoints for issue/pr and
  releases to prevent circumvention of allowed types check

Fixes: https://github.com/go-gitea/gitea/pull/10172
Fixes: https://github.com/go-gitea/gitea/issues/7266
Fixes: https://github.com/go-gitea/gitea/pull/12460
Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers

* rename function

* extract GET routes out of RepoMustNotBeArchived

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[#13004] Add Timestamp to Tag list API (#13026)
Lucas Queiroz [Mon, 5 Oct 2020 04:07:54 +0000 (01:07 -0300)]
[#13004] Add Timestamp to Tag list API (#13026)

* Add Timestamp to Tag list API

* Add unit test for ToCommitMeta

* Rename timestamp to created

* Reformat files

4 years agoupdated docs with caveat for authorized_keys (#13030)
Divyam Bhasin [Sun, 4 Oct 2020 23:52:40 +0000 (19:52 -0400)]
updated docs with caveat for authorized_keys (#13030)

* updated docs with caveat for authorized_keys

* wrapped authorized_keys in ticks

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoReturn sample message for login error in api context (#12994)
赵智超 [Sun, 4 Oct 2020 21:39:31 +0000 (05:39 +0800)]
Return sample message for login error in api context (#12994)

* Return sample message for login error in api context

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update modules/context/auth.go

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

Co-authored-by: Lauris BH <lauris@nix.lv>
* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoCSS tweaks to warning/error segments and misc fixes (#13024)
silverwind [Sun, 4 Oct 2020 20:54:22 +0000 (22:54 +0200)]
CSS tweaks to warning/error segments and misc fixes (#13024)

* CSS tweaks to warning/error segments and misc fixes

- Adjust styling for warning/error in arc-green
- Change danger boxes from orange to red
- Fix code highlight text color in arc-green
- Fix warning message in arc-green
- Fix border in org member list in arc-green
- Fix disabled checkbox text in arc-green

* use same selector in gitea theme

* fix blame highlight

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 4 Oct 2020 17:13:45 +0000 (17:13 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAvoid setitng the CONN_STR in queues unless it is meant to be set (#13025)
zeripath [Sun, 4 Oct 2020 17:12:26 +0000 (18:12 +0100)]
Avoid setitng the CONN_STR in queues unless it is meant to be set (#13025)

Since the move to common leveldb and common redis the disk queue code
will check the connection string before defaulting to the DATADIR.

Therefore we should ensure that the connection string is kept empty
unless it is actually set.

Fix #13023

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agohCaptcha Support (#12594)
John Olheiser [Sat, 3 Oct 2020 03:37:53 +0000 (22:37 -0500)]
hCaptcha Support (#12594)

* Initial work on hCaptcha

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Use module

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Format

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* At least return and debug log a captcha error

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Pass context to hCaptcha

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add context to recaptcha

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* fix lint

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

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update example config

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Apply error fix for recaptcha

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Change recaptcha ChallengeTS to string

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
4 years agoFix formatting of branches ahead-behind on narrow windows (#12989)
zeripath [Fri, 2 Oct 2020 23:10:43 +0000 (00:10 +0100)]
Fix formatting of branches ahead-behind on narrow windows (#12989)

Make the bar-groups width 50% with max-width of 90px

Fix #12252

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoUpdate comparison for GitLab CE (#13019)
Claudius Ellsel [Fri, 2 Oct 2020 22:08:17 +0000 (00:08 +0200)]
Update comparison for GitLab CE (#13019)

* Update comparison for GitLab CE

Fixes #13018.

* Update docs/content/doc/features/comparison.en-us.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update comparison.en-us.md

According to the linked issue it is there and just the documentation is lacking.

* Update docs/content/doc/features/comparison.en-us.md

Co-authored-by: techknowlogick <matti@mdranta.net>
* Update docs/content/doc/features/comparison.en-us.md

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
4 years agoFix comment header span. (#13009)
rebeckanylander [Fri, 2 Oct 2020 15:13:46 +0000 (17:13 +0200)]
Fix comment header span. (#13009)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoRemove code-view class from diff view (#13011)
mrsdizzie [Fri, 2 Oct 2020 14:38:38 +0000 (10:38 -0400)]
Remove code-view class from diff view (#13011)

code-view class seems unecessary here as everything needed style wise comes from various diff classes. This allows comments and comment editor to be styled properly and fixes linked bug.

Fixes #13010

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix 500 on README in submodule (#13006)
zeripath [Fri, 2 Oct 2020 13:27:44 +0000 (14:27 +0100)]
Fix 500 on README in submodule (#13006)

If a README file is a symlink to a submodule Gitea the view branch page
will return a 500.

The underlying problem is a missed conversion of an
plumbing.ErrObjectNotFound in git/tree_blob.go.

Fix #12599

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 2 Oct 2020 09:38:47 +0000 (09:38 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix repository create/delete event webhooks (#13008)
James Lakin [Fri, 2 Oct 2020 09:37:46 +0000 (09:37 +0000)]
Fix repository create/delete event webhooks (#13008)

This small PR changes the webhook trigger behaviour to be more in line with what's expected. (When 'repository' events are enabled, of course)

In other words:

For system-wide or default webhooks, repository events will now trigger said webhook. Previously it had to be under an organization for create events to be visible - a tad unexpected!
Deleting a repository will now fire its own defined webhooks, not just organisational and system ones.
In order to enable the latter the webhook has to now be triggered before the actual repo undergoes deletion. I'm willing to tweak this to try and 'grab' the webhook model beforehand and trigger the webhook notifier directly afterwards, but this may make the code more complex for little benefit.

Closes #11766, #9180.

4 years agolatest version is 1.12.5 (#13005)
techknowlogick [Thu, 1 Oct 2020 19:21:25 +0000 (15:21 -0400)]
latest version is 1.12.5 (#13005)

4 years agoChangelog 1.12.5 (#13002) (#13003)
John Olheiser [Thu, 1 Oct 2020 18:47:54 +0000 (13:47 -0500)]
Changelog 1.12.5 (#13002) (#13003)

* Changelog 1.12.5

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: techknowlogick <matti@mdranta.net>
* Apply suggestions from code review

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
4 years agofix: media links in org files not liked to media files (#12997)
Pranav Nachnekar [Thu, 1 Oct 2020 15:22:34 +0000 (20:52 +0530)]
fix: media links in org files not liked to media files (#12997)

* fix: media links in org files not liked to media files

* fix: write directly to io.Writer r

as suggested by code review

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 1 Oct 2020 12:50:55 +0000 (12:50 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoallow U2F with default settings for gitea in subpath (#12990)
techknowlogick [Thu, 1 Oct 2020 12:49:49 +0000 (08:49 -0400)]
allow U2F with default settings for gitea in subpath (#12990)

* allow U2F with default settings for gitea in subpath

* use trim suffix

Co-authored-by: zeripath <art27@cantab.net>
4 years agoCopy missing things from app.example.ini to Cheat Sheet (#12988)
zeripath [Thu, 1 Oct 2020 06:57:57 +0000 (07:57 +0100)]
Copy missing things from app.example.ini to Cheat Sheet (#12988)

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 1 Oct 2020 05:55:40 +0000 (05:55 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoRefactor use TrimSuffix instead of TrimRight (#12993)
6543 [Thu, 1 Oct 2020 05:54:34 +0000 (07:54 +0200)]
Refactor use TrimSuffix instead of TrimRight (#12993)

* Refactor use TrimSuffix instead of TrimRight

* TrimRight right

* has #12990

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 30 Sep 2020 21:00:33 +0000 (21:00 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix hugo shortcode typo in faq (#12987)
raoulb [Wed, 30 Sep 2020 20:59:30 +0000 (22:59 +0200)]
Fix hugo shortcode typo in faq (#12987)

* Fix hugo shortcode typo in faq

* Switch to using language tags

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 30 Sep 2020 16:17:15 +0000 (16:17 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoClarification on the use of certificate chains (#12986)
PE1NUT [Wed, 30 Sep 2020 16:16:13 +0000 (18:16 +0200)]
Clarification on the use of certificate chains (#12986)

* Clarification on the use of certificate chains

* As per @bagasme

Co-authored-by: Bagas Sanjaya <bagasdotme@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Bagas Sanjaya <bagasdotme@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 30 Sep 2020 12:28:46 +0000 (12:28 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix typo on Chinese documents (#12982)
Lunny Xiao [Wed, 30 Sep 2020 12:27:41 +0000 (20:27 +0800)]
Fix typo on Chinese documents (#12982)

4 years agoAlways return a list from GetCommitsFromIDs (#12981)
zeripath [Tue, 29 Sep 2020 21:26:54 +0000 (22:26 +0100)]
Always return a list from GetCommitsFromIDs (#12981)

`GetCommitsFromIDs` is only used in one place: `LoadPushCommits` where
it expects that `c.Commits` is not nil.

This potentially nil set causes a NPE in in #12953

Fix #12953

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoOnly set the user password if the password field would have been shown (#12980)
zeripath [Tue, 29 Sep 2020 20:27:03 +0000 (21:27 +0100)]
Only set the user password if the password field would have been shown (#12980)

POSTing to /admin/users/:id should only set the password if the the user
IsLocal or IsOauth2

Fix #12952

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 29 Sep 2020 19:27:47 +0000 (19:27 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix admin/config page (#12979)
zeripath [Tue, 29 Sep 2020 19:26:45 +0000 (20:26 +0100)]
Fix admin/config page (#12979)

Change `.LFS.ContentPath` to `.LFS.Path`

Fix #12975

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoAdd default storage configurations (#12813)
Lunny Xiao [Tue, 29 Sep 2020 09:05:13 +0000 (17:05 +0800)]
Add default storage configurations (#12813)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoCompletely quote AppPath and CustomConf paths (#12955)
zeripath [Tue, 29 Sep 2020 01:16:52 +0000 (02:16 +0100)]
Completely quote AppPath and CustomConf paths (#12955)

* Completely quote AppPath and CustomConf paths

Properly handle spaces in AppPath and CustomConf within hooks and
authorized_keys. Unfortunately here we don't seem to be able to get away
with using go-shellquote as it appears that Windows doesn't play too
well with singlequote quoting - therefore we will avoid singlequote
quoting unless we absolutely cannot get away without it, e.g. \n or !.

Fix #10813

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoFix the issue reported on #12385 (#12969)
zeripath [Mon, 28 Sep 2020 23:00:54 +0000 (00:00 +0100)]
Fix the issue reported on #12385 (#12969)

Missed setting ConnectionString on queuesettings

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoDocs: Add missing SESSION_LIFE_TIME to Config Cheat Sheet (#12968)
6543 [Mon, 28 Sep 2020 20:39:54 +0000 (22:39 +0200)]
Docs: Add missing SESSION_LIFE_TIME to Config Cheat Sheet (#12968)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoChanged width of signature avatar from auto to 16px (#12961)
Victor [Mon, 28 Sep 2020 20:39:22 +0000 (22:39 +0200)]
Changed width of signature avatar from auto to 16px (#12961)

Signed-off-by: Victor Roest <victor@xirion.net>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 28 Sep 2020 19:01:59 +0000 (19:01 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoMirror: Update DB on Address-Update too (#12964)
6543 [Mon, 28 Sep 2020 19:00:52 +0000 (21:00 +0200)]
Mirror: Update DB on Address-Update too (#12964)

* Mirror: Update DB on Address-Update too

* new name for function to better describe

4 years agoUpdate Dockerfile (#12922)
Antoine GIRARD [Sun, 27 Sep 2020 22:52:22 +0000 (00:52 +0200)]
Update Dockerfile (#12922)

4 years agoAllow common redis and leveldb connections (#12385)
zeripath [Sun, 27 Sep 2020 21:09:46 +0000 (22:09 +0100)]
Allow common redis and leveldb connections (#12385)

* Allow common redis and leveldb connections

Prevents multiple reopening of redis and leveldb connections to the same
place by sharing connections.

Further allows for more configurable redis connection type using the
redisURI and a leveldbURI scheme.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add unit-test

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

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

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

* Update modules/queue/queue_disk.go

* Update modules/cache/cache_redis.go

* Update modules/cache/cache_redis.go

* Update modules/queue/unique_queue_disk.go

* Update modules/queue/queue_disk.go

* Update modules/queue/unique_queue_disk.go

* Update modules/session/redis.go

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 27 Sep 2020 19:21:50 +0000 (19:21 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdd config option to make create-on-push repositories public by default (#12936)
Tait Hoyem [Sun, 27 Sep 2020 19:20:52 +0000 (19:20 +0000)]
Add config option to make create-on-push repositories public by default (#12936)

* Add config option to make create-on-push repositories public by default

* Fix linting

* Add option to 'config cheat sheet' page

* Chinese translation

Signed-off-by: a1012112796 <1012112796@qq.com>
* Fix typo in docs

* fix typo

* Add option to example config

Co-authored-by: Tait Hoyem <code@tait.tech>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 27 Sep 2020 02:11:47 +0000 (02:11 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoUpdate GitHub docs links for SSH & GPG (#12947)
Bagas Sanjaya [Sun, 27 Sep 2020 02:10:41 +0000 (09:10 +0700)]
Update GitHub docs links for SSH & GPG (#12947)

The links now redirected to docs.github.com. `common SSH problems` link
is misredirected to `Authenticating to GitHub` page, so it has been
corrected to the proper `troubleshooting SSH` page.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 26 Sep 2020 17:57:16 +0000 (17:57 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdd a step for binding IP address for listening on remote database (#12898)
Bagas Sanjaya [Sat, 26 Sep 2020 17:56:13 +0000 (00:56 +0700)]
Add a step for binding IP address for listening on remote database (#12898)

* Add listen address configuration step
  * Fix numbering order

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoProposals for cheat-sheet docs (#12946)
Melroy van den Berg [Sat, 26 Sep 2020 06:05:49 +0000 (08:05 +0200)]
Proposals for cheat-sheet docs (#12946)

* Propose additional settings in cheat sheet

Add most used settings of app.ini to cheat sheet docs.

* Fix small typo

4 years agoAPI: Get release by tags endpoint (#12932)
Johan Van de Wauw [Fri, 25 Sep 2020 19:11:43 +0000 (21:11 +0200)]
API: Get release by tags endpoint (#12932)

Get a release based on a tag name (for which a release exists).
Based on:
https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name

Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
4 years ago[Docs] Add all chooseable cron config options to 'app.example.ini' (#12931)
赵智超 [Fri, 25 Sep 2020 17:37:33 +0000 (01:37 +0800)]
[Docs] Add all chooseable cron config options to 'app.example.ini' (#12931)

As title.

ref:
https://github.com/go-gitea/gitea/blob/master/modules/cron/tasks_basic.go
https://github.com/go-gitea/gitea/blob/master/modules/cron/tasks_extended.go
https://github.com/go-gitea/gitea/blob/ba20dd7a7b59157d9232de7dfa99a23b0fb0d2aa/modules/setting/cron.go#L7-L11

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 25 Sep 2020 08:59:15 +0000 (08:59 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAllow extended config on cron settings (#12939)
zeripath [Fri, 25 Sep 2020 08:58:09 +0000 (09:58 +0100)]
Allow extended config on cron settings (#12939)

* Allow extended config on cron settings

Fix #12934

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoAdd IsTemplate option in create repo ui and api (#12942)
赵智超 [Fri, 25 Sep 2020 05:18:37 +0000 (13:18 +0800)]
Add IsTemplate option in create repo ui and api (#12942)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoAdopt repositories (#12920)
zeripath [Fri, 25 Sep 2020 04:09:23 +0000 (05:09 +0100)]
Adopt repositories (#12920)

* Don't automatically delete repository files if they are present

Prior to this PR Gitea would delete any repository files if they are
present during creation or migration. This can in certain circumstances
lead to data-loss and is slightly unpleasant.

This PR provides a mechanism for Gitea to adopt repositories on creation
and otherwise requires an explicit flag for deletion.

PushCreate is slightly different - the create will cause adoption if
that is allowed otherwise it will delete the data if that is allowed.

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix tests and migrate overwrite

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

Only offer to adopt or overwrite if the user can do that.

Allow the site administrator to adopt or overwrite in all
circumstances

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use setting.Repository.DefaultBranch for the default branch

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Always set setting.Repository.DefaultBranch

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* ensure repo closed

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Rewrite of adoption as per @6543 and @lunny

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

* update swagger

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add modals and flash reporting

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make the unadopted page searchable

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

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Handle empty and non-master branched repositories

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove commented out code

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFixed count of filtered issues when api request. (#12275)
ひのしば / hinoshiba [Thu, 24 Sep 2020 23:30:40 +0000 (08:30 +0900)]
Fixed count of filtered issues when api request. (#12275)

* Improved total count of issue when filtered.

* Fixed size of slice when  selected 1 repository.

* Improved function of error check.

* improved comment

* Added parameter of return header.

Co-authored-by: 6543 <6543@obermui.de>
* Updated corresponded to the current vendored of "xorm.io/xorm".

* Dedublicated it by store the Options Struct into a variable.

* format code

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

Co-authored-by: 6543 <6543@obermui.de>
* Update routers/api/v1/repo/issue.go

Co-authored-by: 6543 <6543@obermui.de>
* Updated number of range.

Co-authored-by: 6543 <6543@obermui.de>
* Updated number of range.

Co-authored-by: 6543 <6543@obermui.de>
* Removed total value.

* make fmt

* Improved value of sql.

Co-authored-by: zeripath <art27@cantab.net>
* Improved value of sql.

* improved message

* improved message

* improved message

* fixed message

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 24 Sep 2020 22:38:04 +0000 (22:38 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAPI: GetReleaseByID return 404 if not found (#12933)
6543 [Thu, 24 Sep 2020 22:36:56 +0000 (00:36 +0200)]
API: GetReleaseByID return 404 if not found (#12933)

* API: GetReleaseByID return 404 if not found

* update swagger docs

4 years agoFix Create Repository Template (#12924)
6543 [Wed, 23 Sep 2020 21:53:06 +0000 (23:53 +0200)]
Fix Create Repository Template (#12924)

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 23 Sep 2020 20:26:51 +0000 (20:26 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix handling of migration errors (#12928)
zeripath [Wed, 23 Sep 2020 20:25:46 +0000 (21:25 +0100)]
Fix handling of migration errors (#12928)

* Fix handling of migration errors

The migration type selection screen PR did not correctly handle errors
and any user input error on the migration page would simply redirect
back to the selection page. This meant that the error would simply be
lost and the user would be none the wiser as to what happened.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* make gen-swagger

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 22 Sep 2020 17:03:23 +0000 (17:03 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoupdate revive lint to latest commit (#12921)
techknowlogick [Tue, 22 Sep 2020 17:02:16 +0000 (13:02 -0400)]
update revive lint to latest commit (#12921)

* update revive lint to latest commit

* make fmt

* change import

4 years agoDisable migration items when mirror is selected (#12918)
mrsdizzie [Mon, 21 Sep 2020 22:42:22 +0000 (18:42 -0400)]
Disable migration items when mirror is selected (#12918)

* Disable migration items when mirror is selected

Disable migration items when mirror option is selected to make it more clear that it isn't possible to mirror anything other than code.

* allow wiki checkbox for mirrors

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Sep 2020 14:37:57 +0000 (14:37 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoHopefully support GH enterprise (#12863)
John Olheiser [Mon, 21 Sep 2020 14:36:51 +0000 (09:36 -0500)]
Hopefully support GH enterprise (#12863)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoAPI: NotificationSubject show Issue/Pull State (#12901)
6543 [Sun, 20 Sep 2020 23:10:53 +0000 (01:10 +0200)]
API: NotificationSubject show Issue/Pull State (#12901)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 20 Sep 2020 21:56:51 +0000 (21:56 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix ListUserOrgs (#12910)
赵智超 [Sun, 20 Sep 2020 21:55:48 +0000 (05:55 +0800)]
Fix ListUserOrgs (#12910)

fix #12891

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 20 Sep 2020 20:21:12 +0000 (20:21 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoNot using "ctx.ServerError" in api (#12907)
赵智超 [Sun, 20 Sep 2020 20:20:14 +0000 (04:20 +0800)]
Not using "ctx.ServerError" in api (#12907)

This function will render a whole html page which is not useful for API.

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 20 Sep 2020 17:56:20 +0000 (17:56 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoUpdate only the repository columns that need updating (#12900)
zeripath [Sun, 20 Sep 2020 17:55:15 +0000 (18:55 +0100)]
Update only the repository columns that need updating (#12900)

We should only update is_empty, default_branch and updated time columns
during commitRepoAction and not update other columns as we risk
overwriting incorrect information.

Fix #11823
Fix #10536

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 19 Sep 2020 23:22:29 +0000 (23:22 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdd the checkbox quick button to the comment tool bar also (#12885)
赵智超 [Sat, 19 Sep 2020 23:21:22 +0000 (07:21 +0800)]
Add the checkbox quick button to the comment tool bar also (#12885)

Just copy it from the WIKI tool bar :)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 19 Sep 2020 16:45:53 +0000 (16:45 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdd configurable Trust Models (#11712)
zeripath [Sat, 19 Sep 2020 16:44:55 +0000 (17:44 +0100)]
Add configurable Trust Models (#11712)

* Add configurable Trust Models

Gitea's default signature verification model differs from GitHub. GitHub
uses signatures to verify that the committer is who they say they are -
meaning that when GitHub makes a signed commit it must be the committer.
The GitHub model prevents re-publishing of commits after revocation of a
key and prevents re-signing of other people's commits to create a
completely trusted repository signed by one key or a set of trusted
keys.

The default behaviour of Gitea in contrast is to always display the
avatar and information related to a signature. This allows signatures to
be decoupled from the committer. That being said, allowing arbitary
users to present other peoples commits as theirs is not necessarily
desired therefore we have a trust model whereby signatures from
collaborators are marked trusted, signatures matching the commit line
are marked untrusted and signatures that match a user in the db but not
the committer line are marked unmatched.

The problem with this model is that this conflicts with Github therefore
we need to provide an option to allow users to choose the Github model
should they wish to.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Adjust locale strings

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

Co-authored-by: 6543 <6543@obermui.de>
* Update models/gpg_key.go

* Add migration for repository

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 18 Sep 2020 17:51:09 +0000 (17:51 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix panic when adding long comment (#12892)
mrsdizzie [Fri, 18 Sep 2020 17:50:06 +0000 (13:50 -0400)]
Fix panic when adding long comment (#12892)

Previous PR #12881 causes out of bounds panic by working on wrong string.

4 years agoSwitch to absolute latest pq driver (#12859)
zeripath [Fri, 18 Sep 2020 14:38:46 +0000 (15:38 +0100)]
Switch to absolute latest pq driver (#12859)

This PR updates the lib/pq driver to the current master head to
pick up the deadlock fix in lib/pq#993

Hopefully this will resolve our CI issues.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 18 Sep 2020 12:10:52 +0000 (12:10 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoRefactor: move Commit To APIFormat Code & Lot of StopWatch related things (#12729)
6543 [Fri, 18 Sep 2020 12:09:26 +0000 (14:09 +0200)]
Refactor: move Commit To APIFormat Code & Lot of StopWatch related things (#12729)

* move GitCommit to APIFormat convertion into convert package

* rename Commit convert functions

* move stopwatch to api convertion into convert package & rm unused code & extend test

* fix compare time

* Gitea not Gogs ;)

4 years agoAdd size limit for content of comment on action ui (#12881)
赵智超 [Fri, 18 Sep 2020 07:38:21 +0000 (15:38 +0800)]
Add size limit for content of comment on action ui (#12881)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoFix pgsql migration test (#12844)
Lunny Xiao [Fri, 18 Sep 2020 01:36:14 +0000 (09:36 +0800)]
Fix pgsql migration test (#12844)

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoConvert User expose ID each time (#12855)
6543 [Thu, 17 Sep 2020 21:33:23 +0000 (23:33 +0200)]
Convert User expose ID each time (#12855)

* git blame tells me a lot of gitea things happen here around 2018, add header

* move user code int its own file

* expose user id

* adopt things from APIFormat

* fix test

* CI.restart()

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 17 Sep 2020 18:25:33 +0000 (18:25 +0000)]
[skip ci] Updated translations via Crowdin