Commit Graph

2211 Commits

Author SHA1 Message Date
Lunny Xiao 22dec1cea6
Fix branch page pull request title and link error (#10092) (#10098)
* Fix branch page pull request title and link error (#10092)
* Fix tmpl
2020-02-01 17:37:52 +00:00
Lunny Xiao 0c5e2e2e4c
Fix milestone API state parameter unhandled (#10049) (#10053)
* Fix milestone API state parameter unhandled (#10049)

* Fix milestone API state parameter unhandled

* Fix test

* Fix test
2020-01-30 11:49:02 +08:00
Lunny Xiao 158b716387 Fix wiki raw view on sub path (#10002) (#10041)
* Fix wiki raw view on sub path

* Add test for subpath wiki raw file

* Fix bug

Co-authored-by: zeripath <art27@cantab.net>
2020-01-28 15:10:40 +00:00
dioss-Machiel 68bca621cd Prevent empty LDAP search from deactivating all users (#9879) (#9890)
* Backport of #9879 (Add option to prevent LDAP from deactivating everything on empty search)

* go fmtted

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
2020-01-20 15:02:35 -05:00
Lunny Xiao c4e0f717e7 fix bug about wrong dependencies permissions check and other wr… (#9884)
* fix bug about wrong dependencies permissions check and other wrong permissions check

* improve code
2020-01-20 16:45:42 +01:00
zeripath e3e024876e Ensure that 2fa is checked on reset-password (#9857) (#9877)
* Ensure that 2fa is checked on reset-password

* Apply suggestions from code review

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Properly manage scratch_code regeneration

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-19 18:37:28 -05:00
6543 c975287149 fix (#9838) 2020-01-17 23:25:46 +08:00
Lunny Xiao b31068652a Fix download file wrong content-type (#9825) (#9835)
* Fix download file wrong content-type

* change the error text to be more precise

* fix test

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-17 14:56:25 +01:00
Lunny Xiao 918e640590 Fix wrong identify poster on a migrated pull request when submi… (#9827) (#9831) 2020-01-17 13:38:53 +01:00
Lunny Xiao ed6a2f2e2e
Fix compare (#9808) (#9815)
Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-17 10:08:07 +08:00
Lunny Xiao a0435fcd63 Fix missing msteam webhook on organization (#9781) (#9795) 2020-01-16 07:36:05 +02:00
David Svantesson a2e2045a96 Fix #9662 (#9783) 2020-01-16 01:26:55 +01:00
Lauris BH b1a90f7286
Hide credentials when submitting migration (#9102) (#9704)
through API.
Same fix, using form.CloneAddr instead of opts.CloneAddr.

Co-authored-by: Jordan <eatsleepgame@gmail.com>
2020-01-11 17:25:16 +02:00
Lauris BH 45c8a3aeeb
Fix cache problem on dashboard (#9358) (#9703)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-11 16:23:40 +02:00
zeripath 319c92163f Branches not at ref commit ID should not be listed as Merged (#9614) (#9639)
Once a branch has been merged if the commit ID no longer equals that of
the pulls ref commit id don't offer to delete the branch on the pull screen
and don't list it as merged on branches.

Fix #9201

When looking at the pull page we should also get the commits from the refs/pulls/x/head

Fix #9158
2020-01-08 03:06:53 +02:00
6543 a15a644c05 [BugFix] Hide public repos owned by private orgs (#9616) 2020-01-06 10:12:55 +08:00
6543 17c691f8aa [Backport] [API] Allow only specific Colums to be updated on Issue (#9539) (#9580)
* Fix #9189 - API Allow only specific Colums to be updated on Issue (#9539)

* dont insert "-1" in any case to issue.poster_id

* Make sure API cant override importand fields

* code format

* add Test for IssueEdit

* load milestone and return it on IssueEdit via API

* extend Test for TestAPIEditIssue

* fix TEST

* make sure Poster is loaded

* keep code format on backport as it is
2020-01-02 02:38:42 -05:00
6543 cb3fe4cbf1 [Backport] Fix bug when migrate from API (#8631) (#9563)
* Fix bug when migrate from API (#8631)

* fix bug when migrate from API

* fix test

* fix test

* improve

* fix error message

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

* remove unrelated

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-02 01:36:00 +02:00
6543 b4b8c9679f fix 500 error for ghost avatar (#9537) 2019-12-30 18:55:51 +08:00
Lunny Xiao c0bb5ebc15 Fix repository issues pagination bug when there are more than one label filter (#9512) (#9528)
* Fix repository issues pagination bug when there are more than one label filter (#9512)

* fix merge
2019-12-28 23:54:24 +00:00
Lunny Xiao a3928fd820 Fix missing repository status when migrating repository via API (#9511)
* Fix API migration wrong repository status

* Force push for ci
2019-12-27 14:34:28 +02:00
Brad Albright f0bda12c49 when branch is deleted after a pull request is merged, trigger webhook (#9510) 2019-12-27 14:36:52 +08:00
John Olheiser a276aaf61e Fix NewCommitStatus (#9434) (#9435)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-12-19 23:49:47 +01:00
6543 f36efe0b54 Properly fix displaying virtual session provider in admin panel (#9137) (#9203)
* Properly fix #7147

Although #7300 properly shadows the password from the virtual session
provider, the template displaying the provider config still presumed
that the config was JSON.

This PR updates the template and properly hides the Virtual Session
provider.

Fixes #7147

* update per @silverwind's suggestion
2019-11-29 00:28:38 -05:00
Benno c01afd584d backport v1.10 - Always show Password field on link account sign in page (#9150) 2019-11-24 18:38:05 -05:00
guillep2k 1270e2ad85 Create PR on Current Repository by Default (#8670) (#9141)
* 'update'

* Send push tag event when release created

* send tag create event while release created in UI

* update to go v1.13

* fix gofmt error

* fix #8576 create pull request on current repository by default
2019-11-24 03:08:40 +01:00
Jordan ade5ec5aa7 Backport: Hide given credentials for migrated repos. (#9098)
CloneAddr was being used as OriginalURL.
Now passing OriginalURL through from the form and saving it.
2019-11-20 17:23:12 -05:00
guillep2k 261b19ced7 Backport: Fix password checks on admin create/edit user (#9076) (#9081)
* Fix password checks on admin create/edit user

* Remove incorrect trimspace
2019-11-20 00:08:53 +00:00
Lunny Xiao fd461ca555
fix wrong system notice when repository is empty (#9020) 2019-11-15 20:13:58 +08:00
zeripath 3487fb66a1
Shadow password correctly for session config (#8984) (#9002)
Fix #8718

This PR shadows passwords in session config correctly by detecting
the VirtualProvider, unmarshalling the original config and then
shadowing config within that.
2019-11-14 22:34:47 +00:00
guillep2k 023ae3c48c Hotfix for review actions and notifications (#8965) 2019-11-14 00:38:12 +00:00
zeripath 3497efac4a
Add Close() method to gogitRepository (#8901) (#8956)
Backport #8901 

In investigating #7947 it has become clear that the storage component of go-git repositories needs closing.

This PR adds this Close function and adds the Close functions as necessary.

In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files.

Fixes #7947
2019-11-13 13:54:04 +00:00
guillep2k fbcf235633 Backport: Fix password complexity check on registration (#8887) (#8888)
* Fix registration password complexity

* Fix integration to use a complex password ;)
2019-11-09 11:52:54 +00:00
guillep2k 1275c88589 Backport: Fix require external registration password (#8885) (#8890)
* Fix require external registration password

* Fix ctx on error condition by @jolheiser
2019-11-09 08:30:24 +00:00
Lauris BH 26457782c1 Fix new user form for non-local users (#8826) (#8828) 2019-11-05 08:19:32 +08:00
David Svantesson 8caf05989f Fix deadline on update issue or PR via API (#8698) 2019-10-28 01:36:59 +02:00
Monty Taylor 9bde52ffc1 Fix 500 when getting user as unauthenticated user (#8653) (#8663)
Backport #8653

When doing GET /api/v1/users/{user} as an unauthenticated user,
gitea throws a 500 because it's trying to dereference elements
from the context user. It wants to do this to see whether to
show the primary email and will do that if the logged in user
is admin or the user in question. However, if ctx.User is nil there is a panic
2019-10-25 13:09:15 +01:00
Lunny Xiao 14ebda6fd5 Hide some user information via API if user have no enough permission (#8655) (#8657)
* Hide some user information via API if user have no enough permission

* fix test
2019-10-24 08:59:53 +03:00
zeripath 1d10747514 Use AppSubUrl for more redirections (#8647) (#8651)
Partial backport without changes to locale files.

Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
2019-10-23 18:27:10 -04:00
John Olheiser 2fbd5ae2e5 Fix template error on account page (#8562) (#8622) 2019-10-22 10:08:59 +01:00
Lunny Xiao 22cea96c18 Fix bug on pull requests when transfer head repository (#8564) (#8569)
* fix bug on pull requests when transfer head repository

* add migration and fix lint

* fix tests and add a cache check on LoadBaseRepo
2019-10-19 08:29:35 +01:00
zeripath 4e85c8e0d8
Add missed close in ServeBlobLFS (#8527) (#8542) 2019-10-16 20:32:15 +01:00
guillep2k 595033f78e Fix password complexity regex for special characters (backport for v1.10.0) (#8524)
* Fix extra space

* Fix regular expression

* Fix error template name

* Simplify check code, fix default values, add test

* Fix router tests

* Fix fmt

* Fix setting and lint

* Move cleaning up code to test, improve comments

* Tidy up variable declaration
2019-10-16 11:09:27 +08:00
David Svantesson 366806db32 Fix errors in create org UI regarding team access permission. (#8506) 2019-10-14 19:20:42 +01:00
Maxim Tkachenko db657192d0 Password Complexity Checks (#6230)
Add password complexity checks. The default settings require a lowercase, uppercase, number and a special character within passwords.

Co-Authored-By: T-M-A <maxim.tkachenko@gmail.com>
Co-Authored-By: Lanre Adelowo <adelowomailbox@gmail.com>
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-10-14 16:24:26 +01:00
Lunny Xiao e3e44a59d0 Update migrated repositories' issues/comments/prs poster id if user has a github external user saved (#7751)
* update migrated issues/comments when login as github

* add get userid when migrating or login with github oauth2

* fix lint

* add migrations for repository service type

* fix build

* remove unnecessary dependencies on migrations

* add cron task to update migrations poster ids and fix posterid when migrating

* fix lint

* fix lint

* improve code

* fix lint

* improve code

* replace releases publish id to actual author id

* fix import

* fix bug

* fix lint

* fix rawdata definition

* fix some bugs

* fix error message
2019-10-14 09:10:42 +03:00
Lunny Xiao f2a3abc683
Move migrating repository from frontend to backend (#6200)
* move migrating to backend

* add loading image when migrating and fix tests

* fix format

* fix lint

* add redis task queue support and improve docs

* add redis vendor

* fix vet

* add database migrations and fix app.ini sample

* add comments for task section on app.ini.sample

* Update models/migrations/v84.go

Co-Authored-By: lunny <xiaolunwen@gmail.com>

* Update models/repo.go

Co-Authored-By: lunny <xiaolunwen@gmail.com>

* move migrating to backend

* add loading image when migrating and fix tests

* fix fmt

* add redis task queue support and improve docs

* fix fixtures

* fix fixtures

* fix duplicate function on index.js

* fix tests

* rename repository statuses

* check if repository is being create when SSH request

* fix lint

* fix template

* some improvements

* fix template

* unified migrate options

* fix lint

* fix loading page

* refactor

* When gitea restart, don't restart the running tasks because we may have servel gitea instances, that may break the migration

* fix js

* Update models/repo.go

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* fix tests

* rename ErrTaskIsNotExist to ErrTaskDoesNotExist

* delete release after add one on tests to make it run happy

* fix tests

* fix tests

* improve codes

* fix lint

* fix lint

* fix migrations
2019-10-13 21:23:14 +08:00
Lunny Xiao 46a12f196b
Move change issue title from models to issue service package (#8456)
* move change issue title from models to issue service package

* make the change less

* fix typo
2019-10-11 14:44:43 +08:00
Tekaoh b6616591d1 Check for either escaped or unescaped wiki filenames (#8408)
* Check for either escaped or unescaped wiki filenames

+ Gitea currently saves wiki pages with escaped filenames.
+ Wikis mirrored from other places like Github use unescaped filenames.
+ We need to be checking for filenames in either format to increase compatibility.

* Better logic for escaped and unescaped wiki filenames

Co-Authored-By: null <guillep2k@users.noreply.github.com>
2019-10-09 21:49:37 +03:00
guillep2k 4843723d00 Allow users with explicit read access to give approvals (#8382) 2019-10-08 15:18:17 -04:00