Commit Graph
10378 Commits
Author SHA1 Message Date
07629bd55c Add Allow-/Block-List for Migrate & Mirrors (#13610) (#13776)
* add black list and white list support for migrating repositories

* specify log message

* use blocklist/allowlist

* allways use lowercase to match url

* Apply allow/block

* Settings: use existing "migrations" section

* convert domains lower case

* dont store unused value

* Block private addresses for migration by default

* use proposed-upstream func to detect private IP addr

* add own error for blocked migration, add tests, imprufe api

* fix test

* fix-if-localhost-is-ipv4

* rename error & error message

* rename setting options

* Apply suggestions from code review

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-12-01 19:28:34 -05:00
d475b656b1 Set RUN_MODE prod by default (#13765) (#13767)
* Set RUN_MODE prod by default (#13765)

I think it's a bad default to have "dev" as the default run mode which
enables debugging and now also disables HTTP caching. It's better to
just default to a value suitable for general deployments.

Co-authored-by: techknowlogick <[email protected]>

* flip default in checkRunMode

Co-authored-by: techknowlogick <[email protected]>
2020-12-01 09:55:38 +08:00
silverwindandGitHub 6e14773c44 Fix bogus http requests on diffs (#13760) (#13761)
The .blob-excerpt elements don't have these data attributes in some
cases resulting in bogus http request when expanding a diff and clicking
into the expanded area. This prevents those.

Should backport to 1.13.

Fixes: https://github.com/go-gitea/gitea/issues/13759
2020-11-30 14:51:48 -05:00
25421f08c0 ui: show 'owner' tag for real owner (#13689) (#13743)
* ui: show 'owner' tag for real owner

Signed-off-by: a1012112796 <[email protected]>

* Update custom/conf/app.example.ini

* simplify logic

fix logic
fix a small bug about original author

* remove system manager tag

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-11-29 14:50:58 +02:00
bdb491e764 Push HEAD instead of master when initialising repositories (#13719) (#13740)
* Push HEAD instead of master when initialising repositories

It is possible on modern gits to change the initial branch to something other than
master. This breaks initialising repositories because we assume that the initial
branch is going to be master unless specifically changed.

This PR simply bypasses this issue by pushing the HEAD rather than the master branch.

Signed-off-by: Andrew Thornton <[email protected]>

* Update modules/repository/init.go

Co-authored-by: mrsdizzie <[email protected]>

Co-authored-by: mrsdizzie <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: mrsdizzie <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-28 16:59:32 -05:00
a82c7d4323 Increment skip to avoid infini-loop (#13703) (#13727)
Signed-off-by: jolheiser <[email protected]>

Co-authored-by: Lauris BH <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-11-28 04:55:53 +00:00
silverwindandGitHub 7ec1c13f53 CSS table fixes (#13693)
Backport https://github.com/go-gitea/gitea/pull/13692 to 1.13.
2020-11-24 19:45:24 +02:00
4c9d00cf78 finaly fix gitlab migration with subdir 2.0 (#13646) (#13678)
* final fix 2.0?

* ignore Approvals for pulls if not found

* CI.restart()

Co-authored-by: Lauris BH <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-11-23 16:40:58 +00:00
33431fcbd3 Validate email before inserting/updating (#13475) (#13666)
* Add email validity check (#13475)

* Improve error feedback for duplicate deploy keys

Instead of a generic HTTP 500 error page, a flash message is rendered
with the deploy key page template so inform the user that a key with the
intended title already exists.

* API returns 422 error when key with name exists

* Add email validity checking

Add email validity checking for the following routes:
[Web interface]
1. User registration
2. User creation by admin
3. Adding an email through user settings
[API]
1. POST /admin/users
2. PATCH /admin/users/:username
3. POST /user/emails

* Add further tests

* Add signup email tests

* Add email validity check for linking existing account

* Address PR comments

* Remove unneeded DB session

* Move email check to updateUser

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

* skip email validation on empty string (#13627)

- move validation into its own function
- use a session for UpdateUserSetting

* rm TODO for backport

Co-authored-by: Chris Shyi <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-22 12:31:35 -05:00
f2a3a9117e * Handle incomplete diff files properly (#13668)
The code for parsing diff hunks has a bug whereby a very long line in a very long diff would not be completely read leading to an unexpected character.

  This PR ensures that the line is completely cleared

* Also allow git max line length <4096

* Add test case

Fix #13602

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Andrew Thornton <[email protected]>
2020-11-22 16:51:39 +00:00
Karl Heinz MarbaiseandGitHub ef7a52826d Fix issue/pull request list assignee filter (#13647) (#13651)
* Fixes #13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.

Signed-off-by: Karl Heinz Marbaise <[email protected]>

* Followup Fixes #13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.
 - The same behaviour was observed issues viewed via milestones.

Signed-off-by: Karl Heinz Marbaise <[email protected]>
2020-11-19 16:58:35 -06:00
e0d28e2026 finaly fix gitlab migration with subdir (#13629) (#13633)
* finaly fix #13535

* add logging

Co-authored-by: 6543 <[email protected]>
2020-11-19 11:20:12 -05:00
6543andGitHub 2f6dad2e34 API: Fix GetQueryBeforeSince (#13561) 2020-11-19 02:21:21 +00:00
Lunny XiaoandGitHub bcde51f4c2 Fix a bug when check if owner is active (#13613) 2020-11-18 11:59:24 +02:00
ed3a4cd103 Migration: Gitlab: Support Subdirectory (#13563) (#13591)
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-11-17 15:01:33 +08:00
silverwindandGitHub c6ab79ee3c Fix Fomatic Build (#13596)
Port of #13593 to 1.13
2020-11-16 18:01:05 -05:00
48fca01b0d [API] Only Return Json (#13511) (#13565)
Backport #13511 

Co-authored-by: zeripath <[email protected]>
2020-11-15 16:29:16 +00:00
9a8e02ce30 missing quotes in default value slice (#13550) (#13557)
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: Patrick Aljord <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2020-11-14 14:12:01 +02:00
159a4db30a Add missed sync branch/tag webhook (#13538) (#13556)
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-13 22:04:58 -05:00
b4d18dae19 Use existing analyzer module for language detection for highlighting (#13522) (#13551)
* Use existing analyzer module for language detction for highlighting

Thanks @lafriks for pointing out we can reuse existing code for more reliable language detection here.

* Update modules/highlight/highlight.go

Co-authored-by: Lauris BH <[email protected]>

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-13 18:05:51 -05:00
ee0097f97d Prevent git operations for inactive users (#13527) (#13536)
* prevent git operations for inactive users

* Some fixes

* Deny push to the repositories which's owner is inactive

* deny operations also when user is ProhibitLogin

Co-authored-by: zeripath <[email protected]>

Co-authored-by: zeripath <[email protected]>
2020-11-13 09:28:32 +08:00
122f8f86d5 Disallow urlencoded new lines in git protocol paths if there is a port (#13521) (#13524)
Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: zeripath <[email protected]>
2020-11-11 23:47:42 +02:00
6543andGitHub 1f72656892 Migration not fail on notmigrated reactions (#13507)
* Refactor: dedub code

* skip Reactions with Invalid ID
2020-11-11 11:01:27 +00:00
techknowlogickandGitHub 5a32224a2c 1.13.0-rc2 changelog (#13503) v1.13.0-rc2 2020-11-10 16:09:05 -05:00
8049de82f9 Prevent panic on git blame by limiting lines to 4096 bytes at most (#13491)
Fix #12440
Closes #13192

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Andrew Thornton <[email protected]>
2020-11-10 08:00:20 +00:00
797cb38a4a 2nd attempt at re-request APIMergePullRequest (#13468) (#13490)
Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: zeripath <[email protected]>
2020-11-09 21:55:48 -05:00
ae4955999e Fix panic bug in handling multiple references in commit (#13486) (#13487)
* Fix panic bug in handling multiple references in commit (#13486)

The issue lay in determining the position of matches on a second run round
a commit message in FindAllIssueReferences.

Fix #13483

Signed-off-by: Andrew Thornton <[email protected]>

* CI.restart()

Co-authored-by: Andrew Thornton <[email protected]>
2020-11-09 21:16:34 -05:00
1e446bb176 use registry mirror for docker-in-docker (#13438) (#13445)
Co-authored-by: Lauris BH <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-11-06 20:42:56 +00:00
9aa580ce0e Replies to outdated code comments should also be outdated (#13217) (#13433)
* When replying to an outdated comment it should not appear on the files page

This happened because the comment took the latest commitID as its base instead of the
reviewID that it was replying to.

There was also no way of creating an already outdated comment - and a
reply to a review on an outdated line should be outdated.

Signed-off-by: Andrew Thornton <[email protected]>

* fix test

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-05 15:14:55 -05:00
mrsdizzieandGitHub 3421e4b756 Alternative fix for HTML diff entity split (#13425) (#13427)
* Alternative fix for HTML diff entity split

This commit both reverts PR #13357 and uses the exiting implementation alredy used for spans to fix the same issue. That PR duplicates most of logic that is already present elsewhere and still was failing for some cases. This should be simpler as it uses the existing logic that already works for <span>s being split apart.

Added both test cases as well.

* Update gitdiff_test.go

* fmt

* entity can have uppercase letter, also add detailed comment per @zeripath
2020-11-05 11:54:03 -05:00
WimandGitHub 6086a9061b Add missing full names when DEFAULT_SHOW_FULL_NAME is enabled (#13424) 2020-11-04 09:51:07 -05:00
6543andGitHub 4ad10ac015 Vendor: mvdan.cc/xurls v2.1.0 -> v2.2.0 (#13407) 2020-11-02 20:56:51 -05:00
Cirno the StrongestandGitHub cbdbae2925 Fix 'add code comment' button being invisible all the time (#13389) (#13402)
* Fix 'add code comment' button being invisible all the time

* Fix off-center icon

* Remove old JS hover hack

* Show on full-line hover

Co-authored-by: techknowlogick <[email protected]>

(cherry picked from commit 7f7e7f3ca4)
2020-11-02 18:09:29 -05:00
Cirno the StrongestandGitHub 350c10fe5b Fix reactions on code comments (#13390) (#13401)
Co-authored-by: Lunny Xiao <[email protected]>

(cherry picked from commit 06268dcf53)
2020-11-02 22:05:41 +08:00
02259a0f3a Storage configuration support [storage] (#13314) (#13379)
* Fix minio bug

* Add tests for storage configuration

* Change the Seek flag to keep compitable minio?

* Fix test when first-byte-pos of all ranges is greater than the resource length

Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-11-01 23:12:50 +08:00
Lunny XiaoandGitHub c3e752ae29 Fix typo (#13380) (#13382) 2020-11-01 15:14:39 +08:00
3f94dffca1 When creating line diffs do not split within an html entity (#13357) (#13375)
Backport #13357

* When creating line diffs do not split within an html entity

Fix #13342

Signed-off-by: Andrew Thornton <[email protected]>

* Add test case

Signed-off-by: Andrew Thornton <[email protected]>

* improve test

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-10-31 21:30:23 +02:00
52b4b984a5 Comment Header fixes (#13356) (#13374)
Apply more flexboxes on comment header and remove float hacks. Needs
1.13 backport.

Fixes: https://github.com/go-gitea/gitea/issues/13316

Co-authored-by: Lauris BH <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-10-31 13:25:10 -04:00
77a2d75639 Fix scrolling to resolved comment anchors (#13343) (#13371)
* Fix scrolling to resolved comment anchors

As described on discord, when the window.location.hash refers to a
resolved comment then the scroll to functionality does not work.

This PR fixes this.

Signed-off-by: Andrew Thornton <[email protected]>

* Apply suggestions from code review

Co-authored-by: silverwind <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-10-31 13:51:51 +02:00
zeripathandGitHub 79d9cda993 Fix links to repositories in /user/setting/repos (#13360) (#13362)
* Fix links to repositories in /user/setting/repos

somehow the links gained a spurious $ in the links.

Signed-off-by: Andrew Thornton <[email protected]>

* And fix #13359

Signed-off-by: Andrew Thornton <[email protected]>
2020-10-30 17:51:52 +00:00
zeripathandGitHub 02edb9df52 Migrations should not fail for comment reactions (#13352) (#13355)
An extension to #13444 - where we now ensure that comment reaction failures do not cause migrations failure

Signed-off-by: Andrew Thornton <[email protected]>
2020-10-29 20:05:15 -04:00
zeripathandGitHub f825e2a568 And there is another one ... (#13350)
Signed-off-by: Andrew Thornton <[email protected]>
2020-10-29 20:48:58 +08:00
8e38bd154f Remove obsolete change of email on profile page (#13341) (#13347)
* Remove obsolete change of email on profile page

The change email on the account profile page is out-of-date
and unnecessary.

Changing email should be done using the account page.

Fix #13336

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-10-29 02:44:45 -04:00
0b0456310f Migration failure during reaction migration from gitea (#13344) (#13345)
* Migrating reactions is just not that important

A failure during migrating reactions should not cause failure of
migration.

Signed-off-by: Andrew Thornton <[email protected]>

* When checking issue reactions check the correct permission

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: zeripath <[email protected]>
2020-10-28 23:57:15 -04:00
JustAnotherArchivistandGitHub 639c737648 Add deprecation notice for webhook payload's secret field (#13329) 2020-10-28 23:14:26 -04:00
adfe13f1a2 Add migrated pulls to pull request task queue (#13331) (#13334)
* Add migrated pulls to pull request task queue

Fix #13321

Signed-off-by: Andrew Thornton <[email protected]>

* Improve error reports

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-10-27 19:44:21 -04:00
47cb9b3de2 Deny wrong pull (#13308) (#13326)
* Deny wrong pull (#13308)

* Deny wrong pull

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

Co-authored-by: zeripath <[email protected]>

Co-authored-by: Markus <[email protected]>
Co-authored-by: zeripath <[email protected]>

* CI.restart()

Co-authored-by: Markus <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: 6543 <[email protected]>
2020-10-27 16:26:07 -04:00
Paweł BogusławskiandGitHub 28133a801a Avatar autogeneration fixed (#13282)
This mod fixes problem with initial avatar autogeneration and
avatar autogneration after deleting previous avatar.

Related: https://github.com/go-gitea/gitea/issues/13159
Fixes: 80a6b0f5bc
Author-Change-Id: IB#1105243
2020-10-26 15:56:14 +02:00
3d272b899d Ensure topics added using the API are added to the repository (#13285) (#13302)
Partial Backport #13285

Fix #12426

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-10-26 14:14:40 +02:00
5178aa2130 Attempt to handle unready PR in tests (#13305) (#13310)
Backport #13305

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-10-26 19:13:39 +08:00