]> source.dussan.org Git - gitea.git/log
gitea.git
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 14 May 2020 18:00:33 +0000 (18:00 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix svg octicon-key placement (#11410)
Cirno the Strongest [Thu, 14 May 2020 17:59:18 +0000 (19:59 +0200)]
Fix svg octicon-key placement (#11410)

4 years agoSwitch code editor to Monaco (#11366)
silverwind [Thu, 14 May 2020 16:06:01 +0000 (18:06 +0200)]
Switch code editor to Monaco (#11366)

* Switch code editor to Monaco

This switches out CodeMirror for Monaco which is based on the same code
base as VS code and should work pretty similar to it.

It does add a few async chunks, totalling around 10MB to our build. It
currently supports around 65 languages and in the default configuration,
each language would emit one ugly [number].js chunk, so I opted to
combine them all into a single file for now.

CodeMirror is still being used under the hood by SimpleMDE so it can not
be removed yet.

* inline editorconfig, fix diff, use for markdown, remove more dead code

* refactors, remove jquery usage

* use tab_width

* fix intellisense

* rename function for clarity

* misc tweaks, enable webpack progress display

* only use --progress on dev build

* remove useless borders in arc-green

* fix typo

* remove obsolete comment

* small refactor

* fix file creation and various refactors

* unset useTabStops too when no editorconfig

* small refactor

* disable webpack's [big] warnings

* remove useless await

* fix dark theme check

* rename chunk to 'monaco'

* add to .gitignore and delete webpack dest before build

* increase editor height

* support more editorconfig properties

* remove empty element filter

* rename

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 13 May 2020 23:00:00 +0000 (23:00 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdd awesome-gitea reference on install from package docs (#11405)
John Olheiser [Wed, 13 May 2020 22:58:49 +0000 (17:58 -0500)]
Add awesome-gitea reference on install from package docs (#11405)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
4 years agoChange install description (#11395)
John Olheiser [Wed, 13 May 2020 09:08:44 +0000 (04:08 -0500)]
Change install description (#11395)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 13 May 2020 07:52:13 +0000 (07:52 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoRevert "Avoid 0 new commits messages to be send (#11082)" (#11397)
zeripath [Wed, 13 May 2020 07:50:56 +0000 (08:50 +0100)]
Revert "Avoid 0 new commits messages to be send (#11082)" (#11397)

This reverts commit 6034f8bcaaa5348fee775d2307ff03162130a088.

4 years agoAdd missing card component to semantic.json (#11394)
Cirno the Strongest [Wed, 13 May 2020 01:43:06 +0000 (03:43 +0200)]
Add missing card component to semantic.json (#11394)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoRefactor Milestone related (#11225)
6543 [Tue, 12 May 2020 21:54:35 +0000 (23:54 +0200)]
Refactor Milestone related (#11225)

4 years agoUnfortunately go template if does not shortcut (#11392)
zeripath [Tue, 12 May 2020 21:01:27 +0000 (22:01 +0100)]
Unfortunately go template if does not shortcut (#11392)

Go template's `{{if ...}}` does not shortcut its tests therefore it is
possible to cause a NPE unless you separate ifs into two.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoEnsure search action button coalesced to adjacent input (#11385)
zeripath [Tue, 12 May 2020 19:08:43 +0000 (20:08 +0100)]
Ensure search action button coalesced to adjacent input (#11385)

Fomantic-ui's action button syntax requires that the button is
the next sibling of the input it is attached to and that they
are both children of a div.action.

Fix #11375

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoui: Replenish the missing ‘PageIsSignUp’ in sign up view (#11390)
赵智超 [Tue, 12 May 2020 18:01:15 +0000 (02:01 +0800)]
ui: Replenish the missing ‘PageIsSignUp’ in sign up view (#11390)

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoUpdate docs to reflect new location of homebrew repo (#11384)
techknowlogick [Tue, 12 May 2020 12:51:41 +0000 (08:51 -0400)]
Update docs to reflect new location of homebrew repo (#11384)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoAllow compare page to look up base, head, own-fork, forkbase-of-head (#11327)
zeripath [Tue, 12 May 2020 05:52:46 +0000 (06:52 +0100)]
Allow compare page to look up base, head, own-fork, forkbase-of-head (#11327)

* Allow compare page to look up base, head, own-fork, forkbase-of-head

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update routers/repo/compare.go

* as per @guillep2k

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Rationalise the names a little

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Rationalise the names a little (2)

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix 500 with fork of fork

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent 500 on compare different trees

Signed-off-by: Andrew Thornton <art27@cantab.net>
* dotdotdot is perfectly valid in both usernames and repo names

Signed-off-by: Andrew Thornton <art27@cantab.net>
* ensure we can set the head and base repos too

Signed-off-by: Andrew Thornton <art27@cantab.net>
* ensure we can set the head and base repos too (2)

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* only set headRepo == baseRepo if isSameRepo

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoFix usage of removed jqXHR.success (#11379)
Cirno the Strongest [Tue, 12 May 2020 03:34:48 +0000 (05:34 +0200)]
Fix usage of removed jqXHR.success (#11379)

Introduced by b57a735 via removal of jQuery-Migrate.

This PR changes usage of .success on jqXHR to .done.

Fixes #11228 and few other places, such as removal of code comments.

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 11 May 2020 22:05:16 +0000 (22:05 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoCorrectly set the organization num repos (#11339)
zeripath [Mon, 11 May 2020 22:04:08 +0000 (23:04 +0100)]
Correctly set the organization num repos (#11339)

* Correctly set the organization num repos

Correctly set the organization num repos to the number of
accessible repos for the user

Fix #11194

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update models/user.go

* Explicit columns

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add test and fix 0 counted orgs

Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove orgname from api

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 11 May 2020 09:45:39 +0000 (09:45 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoConsolidate API for getting single commit (#11368)
Cirno the Strongest [Mon, 11 May 2020 09:44:36 +0000 (11:44 +0200)]
Consolidate API for getting single commit (#11368)

* Allow Git ref for /repos/{owner}/{repo}/git/commits/{sha}

* Consolidate API for getting single commit

* Fix tests and do it differently

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 11 May 2020 08:39:13 +0000 (08:39 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoSupport Range header end in lfs (#11314)
burbon [Mon, 11 May 2020 08:37:59 +0000 (09:37 +0100)]
Support Range header end in lfs (#11314)

* Initial support of end Range header option in lfs

* Allow end range option to be unspecified

* Declare toByte for consistency

* Factor out content encoding tests from doLfs

This is so Range tests could still use doLfs but without repeating
not related tests

* Add Range header test

* implemented extraHeader
* parametrized expectedStatus

* Add more test cases of Range header

* Fix S1030: should use resp.Body.String()

* Add more tests for edge cases

* Fix tests

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoPrevent 500 with badly formed task list (#11328)
zeripath [Sun, 10 May 2020 23:14:49 +0000 (00:14 +0100)]
Prevent 500 with badly formed task list (#11328)

Fix #11317

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoAdd gnupg to Dockerfile (#11365)
Cirno the Strongest [Sun, 10 May 2020 20:41:34 +0000 (22:41 +0200)]
Add gnupg to Dockerfile (#11365)

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[Vendor] mssqldb: 2019-11-28 -> 2020-04-28 (#11364)
6543 [Sun, 10 May 2020 17:42:52 +0000 (19:42 +0200)]
[Vendor] mssqldb: 2019-11-28 -> 2020-04-28 (#11364)

 update go-mssqldb 2019-11-28 (1d7a30a10f73) -> 2020-04-28 (06a60b6afbbc)

4 years agoChanged image of openid-connect logo for better look on arc-green theme (#11312)
Leo [Sun, 10 May 2020 14:55:22 +0000 (16:55 +0200)]
Changed image of openid-connect logo for better look on arc-green theme (#11312)

* Set background of openIDConnect logo to white in arc-green theme

* Fixed linting off arc-green theme

Signed-off-by: Leo Maroni <git@em0lar.de>
* Revert changes of first commit (white background) and replaced the image

* Updated openid_connect (part 2)

* Update public/img/auth/openid_connect.svg

Now in one line

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoMove LFS directory creation out of NewContext (#11362)
zeripath [Sun, 10 May 2020 13:30:46 +0000 (14:30 +0100)]
Move LFS directory creation out of NewContext (#11362)

Fix #9481
(probably others too)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoUpdate github.com/pquerna/otp from untagged to v1.2.0 (#11358)
6543 [Sun, 10 May 2020 12:50:16 +0000 (14:50 +0200)]
Update github.com/pquerna/otp from untagged to v1.2.0 (#11358)

4 years agoUpdate github.com/issue9/identicon from untagged to v1.0.1 (#11359)
6543 [Sun, 10 May 2020 10:23:17 +0000 (12:23 +0200)]
Update github.com/issue9/identicon from untagged to v1.0.1 (#11359)

Co-authored-by: zeripath <art27@cantab.net>
4 years agogithub.com/yohcop/openid-go update to first tagged version (#11357)
6543 [Sun, 10 May 2020 08:53:04 +0000 (10:53 +0200)]
github.com/yohcop/openid-go update to first tagged version (#11357)

4 years ago[Vendor] blevesearch v0.8.1 -> v1.0.7 (#11360)
6543 [Sun, 10 May 2020 05:40:54 +0000 (07:40 +0200)]
[Vendor] blevesearch v0.8.1 -> v1.0.7 (#11360)

* Update blevesearch v0.8.1 -> v1.0.7

* make vendor

Co-authored-by: zeripath <art27@cantab.net>
4 years agoFew tweaks in the hacking guide (#11345)
silverwind [Sat, 9 May 2020 22:11:30 +0000 (00:11 +0200)]
Few tweaks in the hacking guide (#11345)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFrontport Changelog for v1.11.5 (#11356)
6543 [Sat, 9 May 2020 20:24:46 +0000 (22:24 +0200)]
Frontport Changelog for v1.11.5 (#11356)

* Changelog v1.11.5 (#11329)

* Changelog v1.11.5

* Apply suggestions from code review

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Update Changelog for 1.11.5 (#11347)

* Update Changelog for 1.11.5

* bumb version in docs

* Update CHANGELOG.md

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoFix tracked time issues (#11349)
6543 [Sat, 9 May 2020 14:18:44 +0000 (16:18 +0200)]
Fix tracked time issues (#11349)

* Fix nil exeption: #11313

* fix 500

* activate test 😆

* move logic

4 years agoLimit snap build architectures (#11346)
Alan Pope [Sat, 9 May 2020 04:39:19 +0000 (05:39 +0100)]
Limit snap build architectures (#11346)

Builds will fail on s390x, i386 and ppc64el because we depend on nodejs, which is only published for armhf, arm64 and amd64. This change merely tells the snap build farm to not waste time trying to build on architectures will will guarantee failure. Apologies for overlooking this in our previous PR.

Example build failures can be seen at [i386](https://launchpad.net/~build.snapcraft.io/+snap/53d5570c233b8b3663242f8d94dc21ad/+build/945935), [ppc64el](https://launchpad.net/~build.snapcraft.io/+snap/53d5570c233b8b3663242f8d94dc21ad/+build/945939), [s390x](https://launchpad.net/~build.snapcraft.io/+snap/53d5570c233b8b3663242f8d94dc21ad/+build/945940)

4 years agoupdate snapcraft.yaml for core18 and latest features (#11300)
Sergio Schvezov [Fri, 8 May 2020 20:21:28 +0000 (17:21 -0300)]
update snapcraft.yaml for core18 and latest features (#11300)

Removing some of the complexity, together with the install and
configure hook.

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
4 years agoAdd default CommitID for create pull review api (#11334)
赵智超 [Fri, 8 May 2020 18:50:23 +0000 (02:50 +0800)]
Add default CommitID for create pull review api (#11334)

If user create pull review through api but not set CommitID,
I think it's necessary to use last headCommitID as default seting,
or this review will be considered as stale review which is wrong

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoPrevent timer leaks in Workerpool and others (#11333)
zeripath [Fri, 8 May 2020 15:46:05 +0000 (16:46 +0100)]
Prevent timer leaks in Workerpool and others (#11333)

There is a potential memory leak in `Workerpool` due to the intricacies of
`time.Timer` stopping.

Whenever a `time.Timer` is `Stop`ped its channel must be cleared using a
`select` if the result of the `Stop()` is `false`.

Unfortunately in `Workerpool` these were checked the wrong way round.

However, there were a few other places that were not being checked.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoAdd NotifySyncPushCommits to indexer notifier (#11309)
zeripath [Fri, 8 May 2020 14:58:40 +0000 (15:58 +0100)]
Add NotifySyncPushCommits to indexer notifier (#11309)

Thanks to @simon-on-gh for tracking down the issue.

Fix #11200

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoSplit some words from template to improve translation. (#11221)
L0veSunshine [Fri, 8 May 2020 12:39:17 +0000 (20:39 +0800)]
Split some words from template to improve translation. (#11221)

* split some words from template

* split some words from template

* add " " to mustache expression

* split some words from template

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoAdd EventSource support (#11235)
zeripath [Thu, 7 May 2020 21:49:00 +0000 (22:49 +0100)]
Add EventSource support (#11235)

If the browser supports EventSource switch to use this instead of
polling notifications.

Signed-off-by: Andrew Thornton art27@cantab.net
4 years agoWhen deleting a tracked time through the API return 404 not 500 (#11319)
6543 [Thu, 7 May 2020 17:54:33 +0000 (19:54 +0200)]
When deleting a tracked time through the API return 404 not 500 (#11319)

4 years agoManage port in submodule refurl (#11305)
zeripath [Thu, 7 May 2020 14:25:52 +0000 (15:25 +0100)]
Manage port in submodule refurl (#11305)

* Manage port in submodule refurl

Fix #11304

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* URLJoin is causes a cyclic dependency and possibly isn't what what we want anyway

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Protect against leading .. in scp syntax

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoPrevent multiple listings of organization when creating a repository (#11303)
6543 [Thu, 7 May 2020 13:24:59 +0000 (15:24 +0200)]
Prevent multiple listings of organization when creating a repository (#11303)

prevent double entries in results of GetOrgsCanCreateRepoByUserID

I first try to only add GroupBy directly but xorm return broken user objects ...

... solution was to just query related UserIDs(OrgIDs) first and return OrgUsers based on this IDs

close #11258

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 7 May 2020 06:48:52 +0000 (06:48 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdding advanced label set. (#11298)
opyale [Thu, 7 May 2020 06:47:34 +0000 (08:47 +0200)]
Adding advanced label set. (#11298)

Add an advanced label set to contrib

4 years agoProtect default branch against deletion (#11115)
6543 [Wed, 6 May 2020 11:08:45 +0000 (13:08 +0200)]
Protect default branch against deletion (#11115)

Although default branch is not offered for deletion in the templates, we need to prevent it both at the router level and in the pre-receive hook.

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoLoad Repo Topics on blame view (#11307)
6543 [Tue, 5 May 2020 21:51:49 +0000 (23:51 +0200)]
Load Repo Topics on blame view (#11307)

Fix #11280

4 years agoapi.Context.NotFound(...) should tolerate nil (#11288)
zeripath [Tue, 5 May 2020 18:52:13 +0000 (19:52 +0100)]
api.Context.NotFound(...) should tolerate nil (#11288)

There is an unfortunate signature change with the api.Context
NotFound function; whereas the normal modules/context/Context
NotFound function requires an error or nil, the api.Context
variant will panic with an NPE if a nil is provided.

This PR will allow api.Context.NotFound to tolerate a being
passed a nil.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoChange the style in admin notice content view from <p> to <pre> (#11301)
赵智超 [Tue, 5 May 2020 15:16:55 +0000 (23:16 +0800)]
Change the style in admin notice content view from <p> to <pre> (#11301)

That's because many notic have more than one lines. So I think
pre is more better to used in here than p

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoUpdate JS dependencies (#11297)
silverwind [Tue, 5 May 2020 03:48:52 +0000 (05:48 +0200)]
Update JS dependencies (#11297)

Contains an apparently important bug fix for highlight.js [1],
otherwise nothing of interest.

[1] https://github.com/highlightjs/highlight.js/releases/tag/10.0.2

Co-authored-by: zeripath <art27@cantab.net>
4 years agoAllow unauthenticated users to compare (#11240)
Kyle Evans [Mon, 4 May 2020 22:44:30 +0000 (17:44 -0500)]
Allow unauthenticated users to compare (#11240)

* routers: make /compare route available to unauthenticated users

Remove some bits of the compare interface if the user isn't signed in.
Notably, they don't need to see the "New Pull Request" button box nor the
hidden form that would fail to submit due to the POST request continuing to
require proper privileges.

Follow-up commits will improve the UI a bit around this, removing some
"Pull Request" verbiage in favor of "Compare."

* ui: home: show "compare" button for unauthenticated users

This change requires pulling in the BaseRepo unconditionally and
recording if the pull request is in-fact not allowed
(.PullRequestCtx.Allowed). If the user isn't allowed to create a pull
request, either because this isn't a fork or same-fork branch PRs aren't
allowed, then we'll name the button "Compare" instead of "Pull Request."

* ui: branch list: use the new Compare language when available

When viewing the branch listing as an unauthenticated user, you'll get
"Pull Request" buttons. use the new "Compare" verbiage instead, which
matches GitHub behavior when you can't issue a pull request from the
branches.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoFix Create new branch (#11294)
zeripath [Mon, 4 May 2020 20:55:52 +0000 (21:55 +0100)]
Fix Create new branch (#11294)

Fix #11212

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoFix; declare DOMAIN variable for docker setup (#10780)
Adrian POIGET [Mon, 4 May 2020 09:50:29 +0000 (11:50 +0200)]
Fix; declare DOMAIN variable for docker setup (#10780)

In the /install form, the value for SSH Server Domain is taken form the DOMAIN variable
and overwrites SSH_DOMAIN environment variable set the first time if nothing done

Co-authored-by: Adrian POIGET <adrian.poiget@viveris.fr>
4 years agoUpdate lunny/levelqueue to 0.3.0 (#11285)
guillep2k [Mon, 4 May 2020 06:51:09 +0000 (03:51 -0300)]
Update lunny/levelqueue to 0.3.0 (#11285)

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
4 years agoFix orgs not being displayed on create repo form (#11279)
Cirno the Strongest [Sun, 3 May 2020 21:08:24 +0000 (23:08 +0200)]
Fix orgs not being displayed on create repo form (#11279)

4 years agoRestore checkbox rendering and prevent poor sanitization of spans (#11277)
zeripath [Sun, 3 May 2020 20:17:24 +0000 (21:17 +0100)]
Restore checkbox rendering and prevent poor sanitization of spans  (#11277)

* Add test

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Restore checkbox rendering and prevent poor sanitization of spans

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agorepo: milestone: make /milestone/:id endpoint accessible (#11264)
Kyle Evans [Sun, 3 May 2020 09:07:04 +0000 (04:07 -0500)]
repo: milestone: make /milestone/:id endpoint accessible (#11264)

Previously, this required authentication, but there's not actually
any privileged information on this page.  Move the endpoint out of
the group that requires sign-in.  It still requires the ability to
read issues and pull requests, so private repositories (for instance)
will not be exposed.

Fixes #10312
Fixes #11233

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 3 May 2020 03:59:30 +0000 (03:59 +0000)]
[skip ci] Updated translations via Crowdin

4 years agocmd: dump: check value of skip-repository flag (#11254)
Kyle Evans [Sun, 3 May 2020 03:57:45 +0000 (22:57 -0500)]
cmd: dump: check value of skip-repository flag (#11254)

This is a boolean flag; simply checking if it's set isn't enough, we must check the value as well.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoSendmail should create a process on the gitea system and have a default timeout ...
zeripath [Sat, 2 May 2020 23:04:31 +0000 (00:04 +0100)]
Sendmail should create a process on the gitea system and have a default timeout (#11256)

* Make sure that sendmail processes register with the process manager
* Provide a timeout for these (initially of 5 minutes)
* Add configurable value and tie in to documentation
* Tie in to the admin config page.

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 2 May 2020 14:05:12 +0000 (14:05 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix bug about comment attachment (#11272)
Lunny Xiao [Sat, 2 May 2020 14:03:47 +0000 (22:03 +0800)]
Fix bug about comment attachment (#11272)

4 years agoShow pull request selection even when unrelated branches (#11239)
zeripath [Sat, 2 May 2020 08:06:01 +0000 (09:06 +0100)]
Show pull request selection even when unrelated branches (#11239)

Fix #10525

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 2 May 2020 00:22:11 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAPI: Add pull review endpoints (#11224)
6543 [Sat, 2 May 2020 00:20:51 +0000 (02:20 +0200)]
API: Add pull review endpoints (#11224)

* API: Added pull review read only endpoints

* Update Structs, move Conversion, Refactor

* refactor

* lint & co

* fix lint + refactor

* add new Review state, rm unessesary, refacotr loadAttributes, convert patch to diff

* add DeletePullReview

* add paggination

* draft1: Create & submit review

* fix lint

* fix lint

* impruve test

* DONT use GhostUser for loadReviewer

* expose comments_count of a PullReview

* infent GetCodeCommentsCount()

* fixes

* fix+impruve

* some nits

* Handle Ghosts :ghost:

* add TEST for GET apis

* complete TESTS

* add HTMLURL to PullReview responce

* code format as per @lafriks

* update swagger definition

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

Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
* add comments

Co-authored-by: Thomas Berger <loki@lokis-chaos.de>
Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
4 years agoRemove last traces of has-emoji class (#11263)
mrsdizzie [Fri, 1 May 2020 17:58:45 +0000 (13:58 -0400)]
Remove last traces of has-emoji class (#11263)

Now that emojify.js has been removed, get rid of all instances of has-emoji class that was only used for that. Support for rendering shortcodes should remain in all of these places so it should still work the same.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agocmd: dump: add an -L/--skip-log option (#11253)
Kyle Evans [Fri, 1 May 2020 01:30:31 +0000 (20:30 -0500)]
cmd: dump: add an -L/--skip-log option (#11253)

Not all dumps need to include the logs, in a similar vain to not all dumps
needing to include repositories; these may be subject to different backup
mechanisms/constraints. Add a simple option to let them be excluded from the
dump to simplify workflows that need to exclude them or not collect in the
first place.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoReturn issue subscription status from API subscribe (#10966)
6543 [Thu, 30 Apr 2020 22:55:24 +0000 (00:55 +0200)]
Return issue subscription status from API subscribe (#10966)

* [API] issue subscription indicate by http status

* CI.restart()

4 years agoFix spelling mistake with Rewiew (#11262)
zeripath [Thu, 30 Apr 2020 20:24:08 +0000 (21:24 +0100)]
Fix spelling mistake with Rewiew (#11262)

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoRefactor UpdateOAuth2Application (#11034)
6543 [Thu, 30 Apr 2020 17:50:47 +0000 (19:50 +0200)]
Refactor UpdateOAuth2Application (#11034)

Following on from #11008 refactor UpdateOAuth2Application

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 30 Apr 2020 15:14:00 +0000 (15:14 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix creation of Organization repos by Users with max created personal repos (#11183)
Andrew Bezold [Thu, 30 Apr 2020 15:11:56 +0000 (11:11 -0400)]
Fix creation of Organization repos by Users with max created personal repos (#11183)

* Fix creation of Org repos

Fix go-gitea#9269

* Change variable name to appease linter

* Update PR with suggestions

Add a note for user.CanCreateRepo() about failure assumptions
Change repo.create help message

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoAdd a 'this' to issue close/reopened messages (#11204)
silverwind [Thu, 30 Apr 2020 13:49:12 +0000 (15:49 +0200)]
Add a 'this' to issue close/reopened messages (#11204)

* add a 'this' to issue close/reopened messages

* add 'this issue/pull request' and create new localization entries

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoWhen using API CreateRelease set created_unix to the tag commit time (#11218)
Jason Duan [Thu, 30 Apr 2020 13:10:42 +0000 (21:10 +0800)]
When using API CreateRelease set created_unix to the tag commit time (#11218)

4 years agoPropose an explanation how to restart gracefully gitea after an update (#10866)
Km [Thu, 30 Apr 2020 12:14:27 +0000 (14:14 +0200)]
Propose an explanation how to restart gracefully gitea after an update (#10866)

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoUpdate JS dependencies, min Node.js version 10.13 (#11246)
silverwind [Thu, 30 Apr 2020 10:37:01 +0000 (12:37 +0200)]
Update JS dependencies, min Node.js version 10.13 (#11246)

`less-loader` now dictates a minimum Node.js version of 10.13.0,
released 2018-10-30 so I've updated this requirement to match.

https://github.com/webpack-contrib/less-loader/releases/tag/v6.0.0

4 years agoUse keys.openpgp.org instead of pgp.mit.edu (#11249)
zeripath [Thu, 30 Apr 2020 09:08:43 +0000 (10:08 +0100)]
Use keys.openpgp.org instead of pgp.mit.edu (#11249)

The SKS Keyserver network has been under attack with poisoned
certificates since at least 2019. Downloading a poisoned certificate has
the awful side-effect of completely breaking your keyring and most
software has now moved off the network and uses the keys.openpgp.org
which has a different protocol instead - in fact one whereby emails are
verified.

For more details regarding the attack see: https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d6955275f

See: https://keys.openpgp.org/about and https://keys.openpgp.org/about/faq

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoAllow emoji short code in labels (#11250)
mrsdizzie [Thu, 30 Apr 2020 08:10:15 +0000 (04:10 -0400)]
Allow emoji short code in labels (#11250)

* Allow emoji short code in labels

As title, turn :alias: type short code into emojis when rendering labels to match previous behavior

* Update models/issue_label.go

Co-Authored-By: John Olheiser <john.olheiser@gmail.com>
* render text in templates not code

* remove has-emoji class

🧙‍♀️

* fix new issue form

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoPatch fomantic-ui to workaround build issue (#11244)
silverwind [Thu, 30 Apr 2020 06:26:37 +0000 (08:26 +0200)]
Patch fomantic-ui to workaround build issue (#11244)

* Patch fomantic-ui to workaround build issue

Better workaround than https://github.com/go-gitea/gitea/issues/10653
for https://github.com/fomantic/Fomantic-UI/issues/1356. It does not
seem like we're getting a new Fomantic-UI release anytime soon, so
this patches it after node_modules installation.

Fixes: https://github.com/go-gitea/gitea/issues/11243
Fixes: https://github.com/go-gitea/gitea/issues/10679
* copy instead of patch

* update package-lock.json

* Update Makefile

Co-Authored-By: Sorien <Sorien@users.noreply.github.com>
* Update web_src/fomantic/css.js

Co-Authored-By: zeripath <art27@cantab.net>
Co-authored-by: Sorien <Sorien@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years ago[API] ListIssues add filter for milestones (#10148)
6543 [Thu, 30 Apr 2020 04:15:39 +0000 (06:15 +0200)]
[API] ListIssues add filter for milestones (#10148)

* Refactor Issue Filter Func

* ListIssues add filter for milestones

* as per @lafriks

* documentation ...

4 years agoFix submit review form (#11252)
zeripath [Thu, 30 Apr 2020 01:59:47 +0000 (02:59 +0100)]
Fix submit review form (#11252)

* Fix submit review form

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* try something different

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update web_src/less/_base.less

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago Don't allow registration via the web form, when AllowOnlyExternalRegistration is...
n0emis [Wed, 29 Apr 2020 21:46:43 +0000 (23:46 +0200)]
 Don't allow registration via the web form, when AllowOnlyExternalRegistration is True (#11248)

* Don't allow registration via the web form, when AllowOnlyExternalRegistration is True

* Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true

4 years agoFix sanitizer config - multiple rules (#11133)
Alexander Scheel [Wed, 29 Apr 2020 11:34:59 +0000 (07:34 -0400)]
Fix sanitizer config - multiple rules (#11133)

In #9888, it was reported that my earlier pull request #9075 didn't quite function as expected. I was quite hopeful the `ValuesWithShadow()` worked as expected (and, I thought my testing showed it did) but I guess not. @zeripath proposed an alternative syntax which I like:

```ini
[markup.sanitizer.1]
ELEMENT=a
ALLOW_ATTR=target
REGEXP=something
[markup.sanitizer.2]
ELEMENT=a
ALLOW_ATTR=target
REGEXP=something
```

This was quite easy to adopt into the existing code. I've done so in a semi-backwards-compatible manner:

 - The value from `.Value()` is used for each element.
 - We parse `[markup.sanitizer]` and all `[markup.sanitizer.*]` sections and add them as rules.

This means that existing configs will load one rule (not all rules). It also means people can use string identifiers (`[markup.sanitiser.KaTeX]`) if they prefer, instead of numbered ones.

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoBugFix: updateLabel can updated not allowed fields #11242 (#11242)
6543 [Tue, 28 Apr 2020 23:28:56 +0000 (01:28 +0200)]
BugFix: updateLabel can updated not allowed fields #11242 (#11242)

4 years agoSupport unicode emojis and remove emojify.js (#11032)
mrsdizzie [Tue, 28 Apr 2020 18:05:39 +0000 (14:05 -0400)]
Support unicode emojis and remove emojify.js (#11032)

* Support unicode emojis and remove emojify.js

This PR replaces all use of emojify.js and adds unicode emoji support to various areas of gitea.

This works in a few ways:

First it adds emoji parsing support into gitea itself. This allows us to

 * Render emojis from valid alias (:smile:)
 * Detect unicode emojis and let us put them in their own class with proper aria-labels and styling
 * Easily allow for custom "emoji"
 * Support all emoji rendering and features without javascript
 * Uses plain unicode and lets the system render in appropriate emoji font
 * Doesn't leave us relying on external sources for updates/fixes/features

That same list of emoji is also used to create a json file which replaces the part of emojify.js that populates the emoji search tribute. This file is about 35KB with GZIP turned on and I've set it to load after the page renders to not hinder page load time (and this removes loading emojify.js also)

For custom "emoji" it uses a pretty simple scheme of just looking for /emojis/img/name.png where name is something a user has put in the "allowed reactions" setting we already have. The gitea reaction that was previously hard coded into a forked copy of emojify.js is included and works as a custom reaction under this method.

The emoji data sourced here is from https://github.com/github/gemoji which is the gem library Github uses for their emoji rendering (and a data source for other sites). So we should be able to easily render any emoji and :alias: that Github can, removing any errors from migrated content. They also update it as well, so we can sync when there are new unicode emoji lists released.

I've included a slimmed down and slightly modified forked copy of https://github.com/knq/emoji to make up our own emoji module. The code is pretty straight forward and again allows us to have a lot of flexibility in what happens.

I had seen a few comments about performance in some of the other threads if we render this ourselves, but there doesn't seem to be any issue here. In a test it can parse, convert, and render 1,000 emojis inside of a large markdown table in about 100ms on my laptop (which is many more emojis than will ever be in any normal issue). This also prevents any flickering and other weirdness from using javascript to render some things while using go for others.

Not included here are image fall back URLS. I don't really think they are necessary for anything new being written in 2020. However, managing the emoji ourselves would allow us to add these as a feature later on if it seems necessary.

Fixes: https://github.com/go-gitea/gitea/issues/9182
Fixes: https://github.com/go-gitea/gitea/issues/8974
Fixes: https://github.com/go-gitea/gitea/issues/8953
Fixes: https://github.com/go-gitea/gitea/issues/6628
Fixes: https://github.com/go-gitea/gitea/issues/5130
* add new shared function emojiHTML

* don't increase emoji size in issue title

* Update templates/repo/issue/view_content/add_reaction.tmpl

Co-Authored-By: 6543 <6543@obermui.de>
* Support for emoji rendering in various templates

* Render code and review comments as they should be

* Better way to handle mail subjects

* insert unicode from tribute selection

* Add template helper for plain text when needed

* Use existing replace function I forgot about

* Don't include emoji greater than Unicode Version 12

Only include emoji and aliases in JSON

* Update build/generate-emoji.go

* Tweak regex slightly to really match everything including random invisible characters. Run tests for every emoji we have

* final updates

* code review

* code review

* hard code gitea custom emoji to match previous behavior

* Update .eslintrc

Co-Authored-By: silverwind <me@silverwind.io>
* disable preempt

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoDisable new signal-based asynchronous goroutine preemption from GO 1.14 in git env...
mrsdizzie [Tue, 28 Apr 2020 15:45:32 +0000 (11:45 -0400)]
Disable new signal-based asynchronous goroutine preemption from GO 1.14 in git env (#11237)

As seen in trouble shooting #11032 the new feature of Go 1.14 is causing several second delays in startup in certain situations. Debugging shows it spending several seconds handling SIGURG commands during init:

```
6922:04:51.984234 trace init() ./modules/queue/unique_queue_wrapped.go
remote: ) = 69 <0.000012>
remote: [pid 15984] 22:04:51 write(1, "\ttime taken: 236.761\302\265s\n\n", 25    time taken: 236.761µs
remote:
remote: ) = 25 <0.000011>
remote: [pid 15984] 22:04:51 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=15984, si_uid=0} ---
remote: [pid 15984] 22:04:52 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=15984, si_uid=0} ---
remote: [pid 15984] 22:04:52 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=15984, si_uid=0} ---
```

This causes up to 20 seconds added to a push in some cases as it happens for each call of the gitea hook command. This is likely the cause of #10661 as well and would start to effect users once we release 1.12 which would be the first release compiled with Go 1.14. I suspect this is just a slight issue with the upstream implementatation as there have been a few very similar bugs fixed and reported:

 https://github.com/golang/go/issues/37741
 https://github.com/golang/go/issues/37942

We should revisit this in the future and see if a newer version of Go has solved it, but for now disable this option in the environment that gitea hook runs in to avoid it.

4 years agoMake the PushCreate test declarative (#11229)
zeripath [Tue, 28 Apr 2020 08:32:23 +0000 (09:32 +0100)]
Make the PushCreate test declarative (#11229)

Reduce the code duplication in the PushCreate test and switch
to a declarative format.

* Instead of explicitly creating the repository re-use functions from the other declarative tests and add comments
* Ensure that the test repository is deleted at the end of test
* Slightly reorder the sub-tests

Also reduce the code duplication in MergeFork and add some comments there too and make doGitCloneFail be self-contained.

Signed-off-by: Andrew Thornton art27@cantab.net
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 27 Apr 2020 23:43:08 +0000 (23:43 +0000)]
[skip ci] Updated translations via Crowdin

4 years ago[Docs] Config Cheat Sheet - Task Edit (#9972)
Bagas Sanjaya [Mon, 27 Apr 2020 23:41:59 +0000 (06:41 +0700)]
[Docs] Config Cheat Sheet - Task Edit (#9972)

* backwards compatibility typo

* Unlist description and separate from list by an empty line

* redis needs password edit

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

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
4 years agoMake error pages translatable (#11163)
6543 [Mon, 27 Apr 2020 23:03:15 +0000 (01:03 +0200)]
Make error pages translatable (#11163)

* make error pages translatable

* dont translate ":"

* link need Safe

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 27 Apr 2020 11:21:30 +0000 (11:21 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoSlight performance changes to integrations/git_test.go (#11227)
zeripath [Mon, 27 Apr 2020 11:20:09 +0000 (12:20 +0100)]
Slight performance changes to integrations/git_test.go (#11227)

* switch to use pseudorandom generator and stop cloning in pushcreate

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add some logging of BranchProtectPRMerge

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Stop running prepareTestEnv so often for TestAPIGetBranch

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoPrevent panic during wrappedConn close at hammertime (#11219)
zeripath [Mon, 27 Apr 2020 00:01:06 +0000 (01:01 +0100)]
Prevent panic during wrappedConn close at hammertime (#11219)

* Prevent panic during wrappedConn close at hammertime

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

* Fix extraneous debug in goldmark.go

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoMake TaskCheckBox render correctly (#11214)
zeripath [Sun, 26 Apr 2020 05:09:08 +0000 (06:09 +0100)]
Make TaskCheckBox render correctly (#11214)

* Fix checkbox rendering

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Normalize checkbox rendering

Signed-off-by: Andrew Thornton <art27@cantab.net>
* set the checkboxes to readonly instead of disabled

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoOn logout redirect to start page and clear redirect cookie (#11202)
colorfulberry [Sat, 25 Apr 2020 22:11:32 +0000 (06:11 +0800)]
On logout redirect to start page and clear redirect cookie (#11202)

when one user logout should clear redirect to value, otherwise switch the account will occur error.

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoUpdate JS dependencies, highlight.js 10.0.0 (#11195)
silverwind [Fri, 24 Apr 2020 19:13:01 +0000 (21:13 +0200)]
Update JS dependencies, highlight.js 10.0.0 (#11195)

Breaking changes in higlight.js do not affect us.

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix GetContents(): Dont't ignore Executables (#11192)
6543 [Fri, 24 Apr 2020 16:20:22 +0000 (18:20 +0200)]
Fix GetContents(): Dont't ignore Executables (#11192)

* Refactor: dont expose help functions

* repofiles GetContents: dont ignore executables

* CI.restart()

4 years agoUse markdown frontmatter to provide Table of contents, language and frontmatter rende...
zeripath [Fri, 24 Apr 2020 13:22:36 +0000 (14:22 +0100)]
Use markdown frontmatter to provide Table of contents, language and frontmatter rendering (#11047)

* Add control for the rendering of the frontmatter
* Add control to include a TOC
* Add control to set language - allows control of ToC header and CJK glyph choice.

Signed-off-by: Andrew Thornton art27@cantab.net
4 years ago[ui] Change icon type for review action in action page (#11191)
赵智超 [Fri, 24 Apr 2020 04:58:14 +0000 (12:58 +0800)]
[ui] Change icon type for review action in action page (#11191)

* as title, do same changs on action view with #10737
* chage default icon from "invalid type" to "question" , because  "invalid type" is not a meaningfull icon type

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