Commit graph

9636 commits

Author SHA1 Message Date
6543 b534a5164f
[API] Expose allowed Reactions (#11735)
* [API] Expose allowed Reactions

* dont be in soutch a rush

* add TEST

* use ElementsMatch

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-06-04 12:16:53 +03:00
mrsdizzie 2842f6cf42
Include query in sign in redirect (#11579)
* Include query in sign in redirect

Include query string in ctx.Data["SignInLink"] so people are redirected to the right page after singing in. Fixes case of:

Visit:

 https://try.gitea.io/mrsdizzie/testcase/issues?q=&type=all&sort=&state=open&labels=7071&milestone=0&assignee=0

Sign in, then redirected to:

 https://try.gitea.io/mrsdizzie/testcase/issues

Create a new "SignInLink" instead of updating the existing "Link" because too many places in the code assume "Link" won't have a query

* Apply suggestions from code review

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-03 23:41:02 -04:00
silverwind 3affe9516a
Update fomantic-ui to 2.8.5 (#11736)
Update to [2.8.5](https://github.com/fomantic/Fomantic-UI/releases/tag/2.8.5)
and remove the workaround for the CSS build race condition.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-03 22:24:04 -04:00
techknowlogick a3b185d54c
Alpine 3.12 (#11720)
* increase alpine to 3.12

* Update .drone.yml
2020-06-03 16:32:51 -04:00
mrsdizzie 2b2373f6c2
Don't put integration test data outside of test folder (#11746)
Some integration test data is being put outside of the integration test folders which means it isn't deleted properly with make clean. Update config so it works as expected.

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-03 15:07:02 -04:00
GiteaBot c6cee44134 [skip ci] Updated translations via Crowdin 2020-06-03 18:19:35 +00:00
6543 ce7510a80f
[API] on 500 error only show message if gitea in dev mode (#11641)
* add API specific InternalServerError()

* return 500 error msg only if not Production mode

* rm unnessesary change
2020-06-03 14:17:54 -04:00
GiteaBot 19aab76853 [skip ci] Updated translations via Crowdin 2020-06-03 15:38:09 +00:00
zeripath a730dc1419
Fix verification of subkeys of default gpg key (#11713)
* Fix verification of subkeys of default gpg key

Fix #10309

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

* Remove debug log

* Update models/gpg_key.go

* As per @6543

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-03 11:36:41 -04:00
silverwind 160c23c4ab
export monaco editor on window.codeEditors (#11739)
Fixes: https://github.com/go-gitea/gitea/issues/10409

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-06-03 14:19:32 +03:00
GiteaBot 4280d44a45 [skip ci] Updated translations via Crowdin 2020-06-03 08:31:48 +00:00
Cirno the Strongest 3ea5d864b9
Fix message wrapping on PR commit list (#11616)
* Fix message wrapping on PR commit list

* Update templates/repo/commits_list_small.tmpl

Co-authored-by: silverwind <me@silverwind.io>
2020-06-03 09:30:34 +01:00
Will 保哥 464b583c6c
Update from-package.zh-tw.md (#11626)
Add translation for `install-from-package` page

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-03 02:11:26 -04:00
GiteaBot 2cf99f89c6 [skip ci] Updated translations via Crowdin 2020-06-03 06:10:22 +00:00
赵智超 de0b2d4e32
bug: fix wrong poster message for code comment on Pull view (#11721)
As title, maybe fix one of issue in #11705

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-03 02:09:03 -04:00
Cirno the Strongest 8e035f81c0
Fix styling for commiter on diff view (#11715)
* Fix styling for commiter on diff view

* Update options/locale/locale_en-US.ini

* Update templates/repo/commit_page.tmpl

Co-authored-by: silverwind <me@silverwind.io>

* Update templates/repo/commit_page.tmpl

Co-authored-by: silverwind <me@silverwind.io>

* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-02 22:40:08 -04:00
S7evinK dcefcc10e6
Add missing templates (#11729)
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-02 22:04:52 -04:00
Bagas Sanjaya d9b5c21625
[Contrib] Change License Link to Full CC0 Legalcode (PP and TOS) (#10057)
* Change license link to full (raw link) legal code on options/license

* Replace link to full legal code at CC site

* Update contrib/legal/tos.html.sample

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-02 21:22:17 -04:00
John Olheiser a6fd2f23f7
Allow site admin to disable mirrors (#11740)
* Allow site admin to disable mirrors

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

* No need to run through Safe

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

* Clarify only disabling NEW mirrors

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

* Apply suggestions from @guillep2k

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-06-02 21:21:38 -04:00
Cirno the Strongest d0a18a1270
Show full GPG commit status on PR commit history (#11702)
* Show full GPG commit status on PR commit history

* move shabox badge to separate template

* unnecessary $

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-06-02 20:22:26 -04:00
zeripath a1ad188326
Fix chardet test and add ordering option (#11621)
* Fix chardet test and add ordering option

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

* minor fixes

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

* remove log

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

* remove log2

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

* only iterate through top results

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

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

* slight restructure of for loop

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-02 19:20:19 -03:00
zeripath fe2cacf5ea
Properly truncate system notices (#11714)
* Properly truncate system notices

As noted in #11658 the system notifications list will always suffix
system notices with ... even when the notice is longer than 120
characters.

Instead we should use .text.truncate to auto truncate and make the
notices clickable to view their details.

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

* As per @CirnoT make table cell clickable

* ensure that pre wraps

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-02 16:24:18 -04:00
mrsdizzie 3af51f1ab7
Update emoji dataset with skin tone variants (#11678)
* Update emoji dataset with skin tone variants

Since the format of emoji that support skin tone modifiers is predictable we can add different variants into our dataset when generating it so that we can match and properly style most skin tone variants of emoji. No real code change here other than what generates the dataset and the data itself.

* use escape unicode sequence in map

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-02 02:22:40 -04:00
zeripath 14ca111f33
log slow tests (#11487)
* log slow tests

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

* placate lint

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

* More lint placation

Co-authored-by: 6543 <6543@obermui.de>

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-01 21:39:44 -04:00
6543 dc812f8ba5
Issue/Pull expose IsLocked Property on API (#11708)
Expose IsLocked Property
2020-06-01 22:01:55 +01:00
GiteaBot 7cb1e1f609 [skip ci] Updated translations via Crowdin 2020-05-31 21:00:58 +00:00
6543 b636cd6fd4
Handle expected errors in FileCreate & FileUpdate API (#11643)
as title

needed for #11641
2020-05-31 21:59:34 +01:00
guillep2k 34b6983f56
Add changelog for 1.11.6 (#11695) (#11700)
* Add changelog for 1.11.6

* Update CHANGELOG.md

Co-authored-by: techknowlogick <matti@mdranta.net>

* Update CHANGELOG.md

Co-authored-by: techknowlogick <matti@mdranta.net>

* Apply suggestions from @lafriks

* #11459 is bugfix

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-31 01:28:11 -04:00
Cuong Manh Le d98df0ede3
models: include LFS when calculating repo size (#11060)
Fixes #9369

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-31 00:51:19 -04:00
silverwind cdec70f3f8
Narrow down Edge version in browser support docs (#11640)
* Narrow down Edge version in browser support docs

I noticed that Edge 14 has a pretty buggy fetch implementation and
because it has already reached end of support I think it's better we
don't specifically state support for it, even if it may work to some
extend.

* mention both edge versions

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-30 23:06:34 -04:00
TLZ 2d1ade3415
Update Caddy reverse-proxy instructions (#11655)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-30 22:16:32 -04:00
Cirno the Strongest 9d652002c6
Fix language stat calculation (#11692)
* Fix language stat calculation

* Group languages and ignore 0 size files

* remove unneeded code
2020-05-31 01:58:55 +03:00
Lauris BH ea4c139cd2
Change language statistics to save size instead of percentage (#11681)
* Change language statistics to save size instead of percentage in database

Co-Authored-By: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>

* Do not exclude if only language

* Fix edge cases with special langauges

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
2020-05-30 10:46:15 +03:00
Cirno the Strongest 4395c607ed
Make tabular menu styling consistent for arc-green (#11570)
* Make tabular menu styling consistent for arc-green

* rework completely

* transparent borders

* use darker color for active item; override only colors for borders

* Update web_src/less/themes/theme-arc-green.less

Co-authored-by: silverwind <me@silverwind.io>

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
2020-05-30 00:15:25 +01:00
zeripath 495354c4bd
Add logging to long migrations (#11647)
* Add logging to long migrations

Also fix v136 to not use models

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-05-29 23:18:24 +01:00
zeripath 6e4480835f
Fix issue with DiffIndex on initial commit (#11677)
Unfortunately #11614 introduced a bug whereby the initial commit of a
repository could not be seen due to there being no parent commit to
create a clear diff from.

Here we create a diffstat from the difference between the parentless SHA and the SHA of the empty tree - a constant known to git. (With thanks to @L0veSunshine for informing me of this SHA)

Thanks to @a1012112796 for initial attempt to fix.

Fix #11650

Closes #11674

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-Authored-By: L0veSunshine <xuan199651@gmail.com>
2020-05-29 22:14:00 +01:00
Terence Le Huu Phuong 141d52cc0f
Add API Endpoint for Branch Creation (#11607)
* [FEATURE] [API] Add Endpoint for Branch Creation

Issue: https://github.com/go-gitea/gitea/issues/11376

This commit introduces an API endpoint for branch creation.

The added route is POST /repos/{owner}/{repo}/branches.
A JSON with the name of the new branch and the name of the old branch is
required as parameters.

Signed-off-by: Terence Le Huu Phuong <terence@qwasar.io>

* Put all the logic into CreateBranch and removed CreateRepoBranch

* - Added the error ErrBranchDoesNotExist in error.go
- Made the CreateNewBranch function return an errBranchDoesNotExist error
when the OldBranch does not exist
- Made the CreateBranch API function checks that the repository is not
empty and that branch exists.

* - Added a resetFixtures helper function in integration_test.go to
fine-tune test env resetting
- Added api test for CreateBranch
- Used resetFixture instead of the more general prepareTestEnv in the
repo_branch_test CreateBranch tests

* Moved the resetFixtures call inside the loop for APICreateBranch function

* Put the prepareTestEnv back in repo_branch_test

* fix import order/sort api branch test

Co-authored-by: zeripath <art27@cantab.net>
2020-05-29 19:16:20 +01:00
Cirno the Strongest f36104e410
Normalize avatar radius (#11589)
We already made avatars square for .ui avatar.img class but this is not enough, and in some place Fomantic default styling still applied.

This PR updates our override of radius to match all Fomantic classes.
2020-05-29 18:00:39 +01:00
mrsdizzie 4c1ff57f1a
Update emoji regex (#11584)
When matching emoji, use a regex built from the data we have instead of something generic using unicode ranges. A generic regex can't tell the difference between two separate emoji next to each other or one emoji that is built out of two separate emoji next to each other.

This means that emoji that are next to each other without space in between will be now accurately spanned individually with proper title etc...
2020-05-29 17:08:36 +01:00
Cirno the Strongest 02fa329a7c
Fix missing authorization check on pull for public repos of private/limited org (#11656)
Fixes #11651
2020-05-29 15:47:17 +01:00
GiteaBot 0d9f9f7de1 [skip ci] Updated translations via Crowdin 2020-05-29 13:25:34 +00:00
6543 726e1e5279
Doctor check & fix db consistency (#11111)
needed to fix issue as described in #10280

* rename check-db to check-db-version
* add check-db-consistency:
* find issues without existing repository
* find pulls without existing issues
* find tracked times without existing issues/pulls
* find labels without repository or org reference

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-29 14:24:15 +01:00
赵智超 ab73b56575
translate: Change translate for admin.config.enable_captcha (#11657)
* translate: Change translate for admin.config.enable_captcha

add 'register' to make it more accurate

Signed-off-by: a1012112796 <1012112796@qq.com>

* Update options/locale/locale_en-US.ini

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-29 11:36:51 +03:00
Lauris BH bd2335671f
Exclude generated files from language statistics (#11653)
* Update go-enry to v2.5.2
2020-05-29 09:20:01 +03:00
zeripath e8955173a9
Default MSSQL port 0 to allow automatic detection by default (#11642)
Fix #11633

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-28 23:59:59 -04:00
zeripath 8730b091e3
Add debug option to hooks (#11624)
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-28 23:04:44 -04:00
6543 560744fb33
Handle expected errors in AddGPGkey API (#11644)
* handle GPG Parse & Email Errors

* correct TEST

* update Swagger

* more Docu
2020-05-28 17:25:54 -04:00
6543 9f55769804
Return json on 500 error from API (#11574)
* add API specific InternalServerError()

Co-authored-by: zeripath <art27@cantab.net>

* return 500 error msg only if not Production mode

* Revert "return 500 error msg only if not Production mode"

This reverts commit 8467b2cee6.

* InternalServerError

Co-authored-by: zeripath <art27@cantab.net>
2020-05-28 13:58:11 -03:00
zeripath 3aedc795c4
Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635)
Fix #11634

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-05-28 16:29:15 +03:00
GiteaBot cd5b0e262e [skip ci] Updated translations via Crowdin 2020-05-27 20:33:27 +00:00