]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoRestore token authentication for git http when 2FA active (#15915)
zeripath [Wed, 19 May 2021 02:30:33 +0000 (03:30 +0100)]
Restore token authentication for git http when 2FA active (#15915)

There was a small regression in #15303 whereby token auth
with 2FA active would be disallowed.

This PR fixes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 May 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix typo in hacking-on-gitea.en-us.md (#15918)
Ikko Ashimine [Tue, 18 May 2021 17:35:59 +0000 (02:35 +0900)]
Fix typo in hacking-on-gitea.en-us.md (#15918)

* continously -> continuously
* continous -> continuous

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 18 May 2021 00:25:04 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUse Wants= over Requires= in systemd file (#15897)
silverwind [Mon, 17 May 2021 13:09:15 +0000 (15:09 +0200)]
Use Wants= over Requires= in systemd file (#15897)

`Requires=` has the behaviour of stopping `gitea.service` when the
database is stopped but not bringing it up again after the database is
started again. Use `Wants=` to define a weak requirement instead,
meaning `gitea.service` will be kept running when the database is
stopped, which is not an issue because gitea will just reconnect later
on.

Fixes: https://github.com/go-gitea/gitea/issues/15866
Co-authored-by: zeripath <art27@cantab.net>
3 years agogit migration: don't prompt interactively for clone credentials (#15902)
Norwin [Mon, 17 May 2021 10:59:31 +0000 (10:59 +0000)]
git migration: don't prompt interactively for clone credentials (#15902)

* don't prompt interactively for clone credentials

* apply GIT_TERMINAL_PROMPT=0 to all git cmds

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 17 May 2021 00:25:05 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoremove unimplemented searchbar from project view (#15901)
Norwin [Mon, 17 May 2021 00:10:30 +0000 (00:10 +0000)]
remove unimplemented searchbar from project view (#15901)

3 years agoIssue sidebar and misc css fixes (#15524)
silverwind [Sun, 16 May 2021 20:18:18 +0000 (22:18 +0200)]
Issue sidebar and misc css fixes (#15524)

- Replace remaining font icons with SVG in issue sidebar
- Rework issue due date display
- Realign avatar in timeline
- Fix font size in repo search and code explore
- Consolidate active button styles
- Fix loading form on arc-green
- Align time tracker buttons vertically

Fixes: https://github.com/go-gitea/gitea/issues/15896
3 years agoUse a special name for update default branch on repository setting (#15893)
Lunny Xiao [Sun, 16 May 2021 18:24:47 +0000 (02:24 +0800)]
Use a special name for update default branch on repository setting (#15893)

3 years agoRework Token API comments (#15162)
Ian Wienand [Sun, 16 May 2021 13:51:53 +0000 (23:51 +1000)]
Rework Token API comments (#15162)

Move the token API discussion into a common section discussing the
generation and listing of the tokens.  Add a note on the display of
the sha1 during creation and listing.

Co-authored-by: Norwin <noerw@users.noreply.github.com>
3 years agoimprove empty notice (#15890)
Lunny Xiao [Sun, 16 May 2021 11:58:26 +0000 (19:58 +0800)]
improve empty notice (#15890)

3 years agoSystemd needs After as well as Require (#15881)
zeripath [Sun, 16 May 2021 08:41:37 +0000 (09:41 +0100)]
Systemd needs After as well as Require (#15881)

If the gitea service is stopped because of the db going down
it needs an `After=db.service` to ensure it is restarted in
addition to the `Requires=db.service` to ensure that the db
is started before gitea is started.

Fix #15866

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 16 May 2021 00:25:04 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoMove sans-serif fallback font higher than emoji fonts (#15855)
zeripath [Sun, 16 May 2021 00:12:55 +0000 (01:12 +0100)]
Move sans-serif fallback font higher than emoji fonts (#15855)

The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of #15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoGitHub: migrate draft releases too (#15884)
6543 [Sat, 15 May 2021 22:37:17 +0000 (00:37 +0200)]
GitHub: migrate draft releases too (#15884)

* GitHub: migrate draft releases too

* refactor

3 years agoHold the event source when there are no listeners (#15725)
zeripath [Sat, 15 May 2021 21:46:13 +0000 (22:46 +0100)]
Hold the event source when there are no listeners (#15725)

* Hold the event source when there are no listeners

The event source does not need to run when there are no listeners. Therefore
pause it when there are none.

* add some more logging

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoCreate a session on ReverseProxy and ensure that ReverseProxy users cannot change...
zeripath [Sat, 15 May 2021 18:33:13 +0000 (19:33 +0100)]
Create a session on ReverseProxy and ensure that ReverseProxy users cannot change username (#15304)

* Create a session on ReverseProxy and ensure that ReverseProxy users cannot change username

ReverseProxy users should generate a session on reverse proxy username change.

Also prevent ReverseProxy users from changing their username.

Fix #2407

* add testcase

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPrevent double-login for Git HTTP and LFS and simplify login (#15303)
zeripath [Sat, 15 May 2021 15:32:09 +0000 (16:32 +0100)]
Prevent double-login for Git HTTP and LFS and simplify login (#15303)

* Prevent double-login for Git HTTP and LFS and simplify login

There are a number of inconsistencies with our current methods for
logging in for git and lfs. The first is that there is a double login
process. This is particularly evident in 1.13 where there are no less
than 4 hash checks for basic authentication due to the previous
IsPasswordSet behaviour.

This duplicated code had individual inconsistencies that were not
helpful and caused confusion.

This PR does the following:

* Remove the specific login code from the git and lfs handlers except
for the lfs special bearer token
* Simplify the meaning of DisableBasicAuthentication to allow Token and
Oauth2 sign-in.
* The removal of the specific code from git and lfs means that these
both now have the same login semantics and can - if not
DisableBasicAuthentication - login from external services. Further it
allows Oauth2 token authentication as per our standard mechanisms.
* The change in the recovery handler prevents the service from
re-attempting to login - primarily because this could easily cause a
further panic and it is wasteful.

* add test

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoMultiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue...
zeripath [Sat, 15 May 2021 14:22:26 +0000 (15:22 +0100)]
Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693)

* move shutdownfns, terminatefns and hammerfns out of separate goroutines

Coalesce the shutdownfns etc into a list of functions that get run at shutdown
rather then have them run at goroutines blocked on selects.

This may help reduce the background select/poll load in certain
configurations.

* The LevelDB queues can actually wait on empty instead of polling

Slight refactor to cause leveldb queues to wait on empty instead of polling.

* Shutdown the shadow level queue once it is empty

* Remove bytefifo additional goroutine for readToChan as it can just be run in run

* Remove additional removeWorkers goroutine for workers

* Simplify the AtShutdown and AtTerminate functions and add Channel Flusher

* Add shutdown flusher to CUQ

* move persistable channel shutdown stuff to Shutdown Fn

* Ensure that UPCQ has the correct config

* handle shutdown during the flushing

* reduce risk of race between zeroBoost and addWorkers

* prevent double shutdown

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix error message when saving generated LOCAL_ROOT_URL config (#15880)
Naohisa Murakami [Sat, 15 May 2021 10:23:21 +0000 (19:23 +0900)]
Fix error message when saving generated LOCAL_ROOT_URL config (#15880)

3 years agoFix blame row height alignment (#15863)
Norwin [Sat, 15 May 2021 01:15:53 +0000 (01:15 +0000)]
Fix blame row height alignment (#15863)

* fix blame row alignment on firefox

* fix blame row alignment in chrome

* fix blame row alignment in safari

as per @silverwind

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 15 May 2021 00:25:06 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoClose the gitrepo when deleting the repository (#15876)
zeripath [Fri, 14 May 2021 20:19:38 +0000 (21:19 +0100)]
Close the gitrepo when deleting the repository (#15876)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpgrade xorm to v1.1.0 (#15869)
Lunny Xiao [Fri, 14 May 2021 19:17:06 +0000 (03:17 +0800)]
Upgrade xorm to v1.1.0 (#15869)

3 years agoFix bound address/port for caddy's certmagic library (see #15848) (#15859)
Blake Miner [Fri, 14 May 2021 14:39:10 +0000 (10:39 -0400)]
Fix bound address/port for caddy's certmagic library (see #15848) (#15859)

3 years agoFix LFS commit finder not working (#15856)
KN4CK3R [Fri, 14 May 2021 13:12:11 +0000 (15:12 +0200)]
Fix LFS commit finder not working (#15856)

* Create a copy of the sha bytes.

Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd timeout to writing to responses (#15831)
zeripath [Fri, 14 May 2021 12:26:03 +0000 (13:26 +0100)]
Add timeout to writing to responses (#15831)

In #15826 it has become apparent that there are a few occasions when a response can
hang during writing, and because there is no timeout go will happily just block
interminably. This PR adds a fixed 5 second timeout to all writes to a connection.

Fix #15826

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoStop calling WriteHeader in Write (#15862)
zeripath [Fri, 14 May 2021 08:05:50 +0000 (09:05 +0100)]
Stop calling WriteHeader in Write (#15862)

Fixes http: superfluous response.WriteHeader call from code.gitea.io/gitea/modules/context.(*Response).WriteHeader (response.go:67)

* Looking again we don't need this writeHeader as all of our downstream
implementations will always do it for us

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoAdd jest rootDir and test-frontend dependency (#15860)
silverwind [Fri, 14 May 2021 06:28:51 +0000 (08:28 +0200)]
Add jest rootDir and test-frontend dependency (#15860)

- Define jest rootDir to limit where it looks for test files
- Add missing dependency on test-frontend target so it can be ran from a
  clean checkout

3 years agoreverse proxy for IIS (#15555)
Jimmy [Fri, 14 May 2021 04:36:53 +0000 (12:36 +0800)]
reverse proxy for IIS (#15555)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd information on how to rotate logging from outside container (#15852)
zeripath [Fri, 14 May 2021 04:36:23 +0000 (05:36 +0100)]
Add information on how to rotate logging from outside container (#15852)

Fix #15842

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoOnly write config in environment-to-ini if there are changes (#15861)
zeripath [Thu, 13 May 2021 23:01:05 +0000 (00:01 +0100)]
Only write config in environment-to-ini if there are changes (#15861)

* Only write config in environment-to-ini if there are changes

Only write the new config in environment-to-ini if there are changes or the
destination is not the same as the customconf.

Fix #15719
Fix #15857

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoRestore PAM user autocreation functionality (#15825)
zeripath [Thu, 13 May 2021 22:11:47 +0000 (23:11 +0100)]
Restore PAM user autocreation functionality (#15825)

* Restore PAM user autocreation functionality

PAM autoregistration of users currently fails due to email invalidity.
This PR adds a new setting to PAM to allow an email domain to be set
or just sets the email to the noreply address and if that fails falls
back to uuid@localhost

Fix #15702

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpdate JS dependencies, use Node 16 (#15804)
silverwind [Thu, 13 May 2021 15:12:36 +0000 (17:12 +0200)]
Update JS dependencies, use Node 16 (#15804)

- Update all JS dependencies to latest version
- Use Node 16 on CI
- Add new lint rules
- Add some gitignore entries for debug files

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoOnly offer hostcertificates if they exist (#15849)
zeripath [Thu, 13 May 2021 12:11:28 +0000 (13:11 +0100)]
Only offer hostcertificates if they exist (#15849)

A common bug report is the otherwise harmless sshd logging:

```
Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
```

This PR simply checks if these files exist before creation of sshd_config and if
they do not exist, doesn't add a reference to them.

Fix #14110 amongst others.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoAllow custom highlight mapping beyond file extensions (#15808)
mlpo [Thu, 13 May 2021 09:31:23 +0000 (11:31 +0200)]
Allow custom highlight mapping beyond file extensions (#15808)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agofix truncate utf8 string (#15828)
yan [Thu, 13 May 2021 07:50:57 +0000 (15:50 +0800)]
fix truncate utf8 string (#15828)

* fix truncate utf8 string.

* revoke truncated user info.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 13 May 2021 00:25:06 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bound address/port for caddy's certmagic library (#15758)
Blake Miner [Wed, 12 May 2021 19:58:55 +0000 (15:58 -0400)]
Fix bound address/port for caddy's certmagic library (#15758)

* Fix bound address/port for caddy's certmagic library

* Fix bug

Co-authored-by: zeripath <art27@cantab.net>
3 years agochange s3 bucket name (#15847)
techknowlogick [Wed, 12 May 2021 19:08:33 +0000 (15:08 -0400)]
change s3 bucket name (#15847)

3 years agoUnregister non-matching serviceworkers (#15834)
silverwind [Wed, 12 May 2021 18:36:53 +0000 (20:36 +0200)]
Unregister non-matching serviceworkers (#15834)

* Unregister non-matching serviceworkers

With the addition of the /assets url, users who visited a previous
version of the site now may have two active service workers, one with
the old scope `/` and one with scope `/assets`. This check for
serviceworkers that do not match the current script path and unregisters
them.

Also included is a small refactor to publicpath.js which was simplified
because AssetUrlPrefix is always present now. Also it makes use of the
new joinPaths helper too.

Fixes: https://github.com/go-gitea/gitea/pull/15823
3 years agoUpgrade unrolled/render to v1.1.1 (#15845)
Lunny Xiao [Wed, 12 May 2021 17:47:05 +0000 (01:47 +0800)]
Upgrade unrolled/render to v1.1.1 (#15845)

3 years agoUpdate README.md | Add translation section (#15830)
Oymate [Wed, 12 May 2021 15:02:55 +0000 (21:02 +0600)]
Update README.md | Add translation section (#15830)

* Update README.md

* chinese translation

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update README.md

* Update README.md

* Update README.md

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoReaction improvements (#15836)
silverwind [Wed, 12 May 2021 06:16:22 +0000 (08:16 +0200)]
Reaction improvements (#15836)

- Add some spacing to inline reactions
- Adjust colors and add variables

3 years agoTagger can be empty, as can Commit and Author - tolerate this (#15835)
zeripath [Wed, 12 May 2021 05:11:42 +0000 (06:11 +0100)]
Tagger can be empty, as can Commit and Author - tolerate this (#15835)

Unfortunately some old repositories can have tags with empty Tagger, Commit
or Author. Go-Git variants will always have empty values for these whereas
the native git variant leaves them at nil. The simplest solution is just to
always have these set to empty Signatures.

v156 migration also makes the incorrect assumption that these cannot be empty.
Therefore add some handling to this and add logging and adjust broken
logging elsewhere in this migration.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix individual tests (addition to #15802) (#15818)
KN4CK3R [Wed, 12 May 2021 04:13:42 +0000 (06:13 +0200)]
Fix individual tests (addition to #15802) (#15818)

* Decouple TestAction_GetRepoLink and TestSizedAvatarLink.

* Load database for TestCheckGPGUserEmail.

* Load database for TestMakeIDsFromAPIAssigneesToAdd.

* Load database for TestGetUserIDsByNames and TestGetMaileableUsersByIDs.

* Load database for TestUser_ToUser.

* Load database for TestRepository_EditWikiPage.

* Include AppSubURL in test.

* Prevent panic with empty slice.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 12 May 2021 00:12:06 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoQueue manager FlushAll can loop rapidly - add delay (#15733)
zeripath [Tue, 11 May 2021 23:22:08 +0000 (00:22 +0100)]
Queue manager FlushAll can loop rapidly - add delay (#15733)

* Queue manager FlushAll can loop rapidly - add delay

Add delay within FlushAll to prevent rapid loop when workers are busy

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agolabel size, PR ref, new PR button alignment (#15363)
Mike L [Tue, 11 May 2021 22:11:12 +0000 (00:11 +0200)]
label size, PR ref, new PR button alignment (#15363)

Co-authored-by: zeripath <art27@cantab.net>
3 years agodon't record error when loading ref comment but ref comment id is zero (#15820)
Lunny Xiao [Tue, 11 May 2021 20:43:35 +0000 (04:43 +0800)]
don't record error when loading ref comment but ref comment id is zero (#15820)

3 years agoSet autocomplete off on branches selector (#15809)
zeripath [Tue, 11 May 2021 16:32:06 +0000 (17:32 +0100)]
Set autocomplete off on branches selector (#15809)

Fix #15782

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agopoint appleboy/drone-git-push to use updated primary branch
techknowlogick [Tue, 11 May 2021 00:27:56 +0000 (20:27 -0400)]
point appleboy/drone-git-push to use updated primary branch

3 years agoAdd Active and ProhibitLogin to API (#15689)
KN4CK3R [Tue, 11 May 2021 00:22:29 +0000 (02:22 +0200)]
Add Active and ProhibitLogin to API (#15689)

* Added active and prohibit_login.

* Do not omit fields for normal users.

3 years agoAdd mimetype mapping settings (#15133)
Adam Szatyin [Mon, 10 May 2021 20:38:08 +0000 (22:38 +0200)]
Add mimetype mapping settings (#15133)

* Fix APK's Content-Type header

* Fix case sensitive comparison

* Add custom mime type mapping for downloadable files

* Add documentation for MIME type mapping

* Rename download.mimetype.mapping configuration to repository.mimetype_mapping

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd err to log (#15813)
John Olheiser [Mon, 10 May 2021 19:48:23 +0000 (14:48 -0500)]
Add err to log (#15813)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agodon't record error when request a non-exist user (#15819)
Lunny Xiao [Mon, 10 May 2021 17:43:55 +0000 (01:43 +0800)]
don't record error when request a non-exist user (#15819)

* don't record error when request a non-exist user

* Update routers/repo/http.go

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoadd note about ``cron.SCHEDULE`` format in document (#15812)
a1012112796 [Mon, 10 May 2021 16:54:45 +0000 (00:54 +0800)]
add note about ``cron.SCHEDULE`` format in document (#15812)

* add note about ``cron.SCHEDULE`` format in document

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update custom/conf/app.example.ini

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix goth user infer bug (#15821)
Lunny Xiao [Mon, 10 May 2021 15:31:32 +0000 (23:31 +0800)]
Fix goth user infer bug (#15821)

3 years agoMove restore repo to internal router and invoke from command to avoid open the same...
Lunny Xiao [Mon, 10 May 2021 07:57:45 +0000 (15:57 +0800)]
Move restore repo to internal router and invoke from command to avoid open the same db file or queues files (#15790)

* Move restore repo to internal router and invoke from command to avoid open the same db file or queues files

* Follow @zeripath's review

* set no timeout for resotre repo private request

* make restore repo cancelable

3 years agoUse single shared random string generation function (#15741)
silverwind [Mon, 10 May 2021 06:45:17 +0000 (08:45 +0200)]
Use single shared random string generation function (#15741)

* Use single shared random string generation function

- Replace 3 functions that do the same with 1 shared one
- Use crypto/rand over math/rand for a stronger RNG
- Output only alphanumerical for URL compatibilty

Fixes: #15536
* use const string method

* Update modules/avatar/avatar.go

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agoOn open repository open common cat file batch and batch-check (#15667)
zeripath [Mon, 10 May 2021 01:27:03 +0000 (02:27 +0100)]
On open repository open common cat file batch and batch-check (#15667)

Use common git cat-file --batch and git cat-file --batch-check to
significantly reduce calls to git.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoReturn go-get info on subdirs (#15642)
zeripath [Sun, 9 May 2021 21:50:06 +0000 (22:50 +0100)]
Return go-get info on subdirs (#15642)

This PR is an alternative to #15628 and makes the go get handler a
handler.

Fix #15625

Close #15628

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoComment out app.example.ini (#15807)
zeripath [Sun, 9 May 2021 21:10:05 +0000 (22:10 +0100)]
Comment out app.example.ini (#15807)

This PR is an alternative to #15559.

Instead of deleting the app.example.ini - just comment out most of the
thing. This makes it clear what needs to be set and what is completely
optional - and keeps the documentation.

The app.example.ini is moved around to move the most important settings
higher in the document.

Close #15559

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix incorrect asset URL (#15805)
silverwind [Sun, 9 May 2021 20:03:09 +0000 (22:03 +0200)]
Fix incorrect asset URL (#15805)

Fixes another regression from https://github.com/go-gitea/gitea/pull/15219.

3 years agoRespect default merge message syntax when parsing item references (#15772)
Steven [Sun, 9 May 2021 18:25:23 +0000 (20:25 +0200)]
Respect default merge message syntax when parsing item references (#15772)

* Respect merge message structure for parsing item references

Signed-off-by: JustusBunsi <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd trace logging to SSO methods (#15803)
zeripath [Sun, 9 May 2021 16:04:53 +0000 (17:04 +0100)]
Add trace logging to SSO methods (#15803)

It is currenly impossible to detect which "SSO" method is responsible for login. This
PR adds some basic trace logging to these methods.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoTests should use test files (#15801)
6543 [Sun, 9 May 2021 15:20:33 +0000 (17:20 +0200)]
Tests should use test files (#15801)

3 years agoAllow only internal registration (#15795)
6543 [Sun, 9 May 2021 14:13:35 +0000 (16:13 +0200)]
Allow only internal registration (#15795)

* Add ALLOW_ONLY_INTERNAL_REGISTRATION into settings

* OpenID respect setting too

3 years agoFixed individual markdown tests. (#15802)
KN4CK3R [Sun, 9 May 2021 13:29:49 +0000 (15:29 +0200)]
Fixed individual markdown tests. (#15802)

3 years agoChangelog v1.14.2 (#15794) (#15799)
6543 [Sun, 9 May 2021 11:49:26 +0000 (13:49 +0200)]
Changelog v1.14.2 (#15794) (#15799)

* Changelog v1.14.2 (#15794)

* changelog tool generate

* format & add

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUse binary version of revive linter (#15739)
silverwind [Sun, 9 May 2021 11:08:02 +0000 (13:08 +0200)]
Use binary version of revive linter (#15739)

Use the common `go get` method to install and run the revive linter,
removing the useless build/lint.go and related vendor libraries.

3 years agoEnsure that ctx.Written is checked after issues(...) calls (#15797)
zeripath [Sun, 9 May 2021 02:33:49 +0000 (03:33 +0100)]
Ensure that ctx.Written is checked after issues(...) calls (#15797)

Fix issue noted in #15783

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDisplay conflict-free merge messages for pull requests (#15773)
Steven [Sat, 8 May 2021 19:19:42 +0000 (21:19 +0200)]
Display conflict-free merge messages for pull requests (#15773)

Repositories using external issue tracker tend to use numeric issues in
commits. To prevent conflicts during issue reference parsing or inside
commit hooks, this change respects these configuration and uses the !
character to refer to pull requests in merge commit messages.

For repositories using squash merges, this was already handled.

Signed-off-by: JustusBunsi <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoExponential Backoff for ByteFIFO (#15724)
zeripath [Sat, 8 May 2021 16:29:47 +0000 (17:29 +0100)]
Exponential Backoff for ByteFIFO (#15724)

This PR is another in the vein of queue improvements. It suggests an
exponential backoff for bytefifo queues to reduce the load from queue
polling. This will mostly be useful for redis queues.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoCode comments improvements (#15722)
silverwind [Sat, 8 May 2021 15:28:25 +0000 (17:28 +0200)]
Code comments improvements (#15722)

- Right-align the Reply and Resolve buttons
- Center Resolved text and add some padding
- Add padding to inline comments
- Indent the comment content to align with author name
- Re-parent form to allow better button layout space.

Co-authored-by: zeripath <art27@cantab.net>
3 years agoRename StaticUrlPrefix to AssetUrlPrefix (#15779)
silverwind [Sat, 8 May 2021 14:27:25 +0000 (16:27 +0200)]
Rename StaticUrlPrefix to AssetUrlPrefix (#15779)

Use a new name for this template/frontend variable to make it distinct
from the server variable StaticURLPrefix.

3 years ago[API] make change repo settings work on empty repos (#15778)
6543 [Sat, 8 May 2021 12:11:36 +0000 (14:11 +0200)]
[API] make change repo settings work on empty repos (#15778)

* API: Fix #15602

* Add TEST

3 years agoMake let target "clean-all" remove node_modules folder too (#15780)
6543 [Sat, 8 May 2021 09:57:48 +0000 (11:57 +0200)]
Make let target "clean-all" remove node_modules folder too (#15780)

* Make let target "clean-all" remove node_modules folder too

3 years agoAdd selecting tags on the compare page (#15723)
Jonathan Tran [Fri, 7 May 2021 21:10:05 +0000 (17:10 -0400)]
Add selecting tags on the compare page (#15723)

* Add selecting tags on the compare page

* Remove unused condition and change indentation

* Fix tag tab in dropdown to be black

* Add compare tag integration test

Co-authored-by: Jonathan Tran <jon@allspice.io>
3 years agoUse esbuild to minify CSS (#15756)
silverwind [Fri, 7 May 2021 19:12:37 +0000 (21:12 +0200)]
Use esbuild to minify CSS (#15756)

It's about a 30% speedup in webpack build time with neglible differences
in the output size. We do lose the ability for CSS source maps, but I
rarely have a use for them anyways.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoUse pulls in commit graph unless pulls are disabled (#15774)
zeripath [Fri, 7 May 2021 18:10:30 +0000 (19:10 +0100)]
Use pulls in commit graph unless pulls are disabled (#15774)

Fix #15370

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix URL of gitea emoji (#15770)
silverwind [Fri, 7 May 2021 15:34:33 +0000 (17:34 +0200)]
Fix URL of gitea emoji (#15770)

Fixes regression from #15219

3 years agoOAuth2 login: Set account link to "login" as default behavior (#15768)
6543 [Fri, 7 May 2021 14:15:16 +0000 (16:15 +0200)]
OAuth2 login: Set account link to "login" as default behavior (#15768)

3 years agoSet GIT_DIR correctly if it is not set (#15751)
zeripath [Fri, 7 May 2021 13:19:09 +0000 (14:19 +0100)]
Set GIT_DIR correctly if it is not set (#15751)

* Set GIT_DIR correctly if it is not set

* Expand out templates

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agonot show `ref-in-new-issue` pop when issue was disabled (#15761)
a1012112796 [Fri, 7 May 2021 11:59:01 +0000 (19:59 +0800)]
not show `ref-in-new-issue` pop when issue was disabled (#15761)

fix #15718

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoDrop back to use IsAnInteractiveSession for SVC (#15749)
zeripath [Fri, 7 May 2021 09:27:31 +0000 (10:27 +0100)]
Drop back to use IsAnInteractiveSession for SVC (#15749)

* Drop back to use IsAnInteractiveSession for SVC

There is an apparent permission change problem when using
IsWindowsService to determine if the SVC manager should be
used.

This PR simply drops back to using IsAnInteractiveSession as
this does not change behaviour.

Fix #15454

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Yes staticcheck I know this is deprecated

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just leave me alone lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoUse a generic markup class to display externally rendered files and diffs (#15735)
6543 [Fri, 7 May 2021 08:43:41 +0000 (10:43 +0200)]
Use a generic markup class to display externally rendered files and diffs (#15735)

* creates and implements generic markup less class

* How to give custom CSS to externally rendered html

* Clarifies sources of CSS styling of markup

* further clarification of sources of markup styling

* rename _markdown to _markup

* remove defunct import

* fix orphaned reference

* Update docs/content/doc/advanced/external-renderers.en-us.md

* more renames markdown -> markup

* do not suggest less customization

* add back tokens

* fix class whitespace, remove useless if-clause

* remove unused csv-data rules

* use named exports and rename functions

* sort imports

Co-authored-by: HarvsG <11440490+HarvsG@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
3 years agoImprove logo customization docs (#15754)
silverwind [Fri, 7 May 2021 06:32:29 +0000 (08:32 +0200)]
Improve logo customization docs (#15754)

* Improve logo customization docs

* Update docs/content/doc/advanced/customizing-gitea.en-us.md

* Update docs/content/doc/advanced/customizing-gitea.en-us.md

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix bug where repositories appear unadopted (#15757)
zeripath [Fri, 7 May 2021 01:21:34 +0000 (02:21 +0100)]
Fix bug where repositories appear unadopted (#15757)

Fix bug where repositories with capital letters in their names appear unadopted.

Fix #15755

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix setting version table in dump (#15753)
zeripath [Thu, 6 May 2021 23:17:43 +0000 (00:17 +0100)]
Fix setting version table in dump (#15753)

* Fix setting version table in dump

As noted on Discord there is a problem with gitea dump where the version table
is not being dumped correctly.

This is due to a missing pointer in the TableInfo.

This PR fixes this.

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

3 years agoFeature/oauth userinfo (#15721)
N. L. H [Thu, 6 May 2021 05:30:15 +0000 (07:30 +0200)]
Feature/oauth userinfo (#15721)

* Implemented userinfo #8534

* Make lint happy

* Add userinfo endpoint to openid-configuration

* Give an error when uid equals 0

* Implemented BearerTokenErrorCode handling

* instead of ctx.error use ctx.json so that clients
parse error and error_description correctly

* Removed unneeded if statement

* Use switch instead of subsequent if statements
Have a default for unknown errorcodes.

Co-authored-by: Nils Hillmann <hillmann@nlh-software.de>
Co-authored-by: nlhsoftware <nlhsoftware@noreply.localhost>
3 years agoreverse #15734 partial and comment (#15740)
6543 [Thu, 6 May 2021 04:05:54 +0000 (06:05 +0200)]
reverse #15734 partial and comment (#15740)

* reverse & comment

* Update templates/repo/graph/commits.tmpl

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agofix some ui bug about draft release (#15137)
a1012112796 [Thu, 6 May 2021 03:12:50 +0000 (11:12 +0800)]
fix some ui bug about draft release (#15137)

* fix some ui bug about draft release

- should not show draft release in tag list because
  it will't create real tag
- still show draft release without tag and commit message
  for draft release instead of 404 error
- remove tag load for attachement links because it's useless

Signed-off-by: a1012112796 <1012112796@qq.com>
* add test code

* fix test

That's because has added a new release in relaese test database.

* fix dropdown link for draft release

3 years agoDefer closing the gitrepo until the end of the wrapped context functions (#15653)
zeripath [Wed, 5 May 2021 23:30:25 +0000 (00:30 +0100)]
Defer closing the gitrepo until the end of the wrapped context functions (#15653)

There was a mistake in #15372 where deferral of gitrepo close occurs before it should.

This PR fixes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix close button change on delete in simplemde area (#15737)
zeripath [Wed, 5 May 2021 22:46:04 +0000 (23:46 +0100)]
Fix close button change on delete in simplemde area (#15737)

* Fix close button change on delete in simplemde area

Fix issue with close button changing when deleting in the simplemde textarea.

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

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd caret styling CSS (#15651)
silverwind [Wed, 5 May 2021 18:14:04 +0000 (20:14 +0200)]
Add caret styling CSS (#15651)

* Add caret styling CSS

Fixes: https://github.com/go-gitea/gitea/issues/15644
* add rule in arc-green as well

* grammar

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

Co-authored-by: Wim <wim@42.be>
* remove extra rule

* add comment

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Wim <wim@42.be>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoIssue list alignment tweaks (#15483)
silverwind [Wed, 5 May 2021 16:57:59 +0000 (18:57 +0200)]
Issue list alignment tweaks (#15483)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoCommit Graph: Pull-Requests should not link to issues (#15734)
KN4CK3R [Wed, 5 May 2021 15:57:39 +0000 (17:57 +0200)]
Commit Graph: Pull-Requests should not link to issues (#15734)

Use `/pulls` and simplify code.

3 years agoFix broken avatars since #15301 (#15731)
zeripath [Wed, 5 May 2021 13:06:39 +0000 (14:06 +0100)]
Fix broken avatars since #15301 (#15731)

There was a missing * from the avatars routes in #15301.

Fix #15727

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