]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoDump github/gitlab/gitea repository data to a local directory and restore to gitea...
Lunny Xiao [Sun, 27 Dec 2020 03:34:19 +0000 (11:34 +0800)]
Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244)

* Dump github/gitlab repository data to a local directory

* Fix lint

* Adjust directory structure

* Allow migration special units

* Allow migration ignore release assets

* Fix lint

* Add restore repository

* stage the changes

* Merge

* Fix lint

* Update the interface

* Add some restore methods

* Finish restore

* Add comments

* Fix restore

* Add a token flag

* Fix bug

* Fix test

* Fix test

* Fix bug

* Fix bug

* Fix lint

* Fix restore

* refactor downloader

* fmt

* Fix bug isEnd detection on getIssues

* Refactor maxPerPage

* Remove unused codes

* Remove unused codes

* Fix bug

* Fix restore

* Fix dump

* Uploader should not depend downloader

* use release attachment name but not id

* Fix restore bug

* Fix lint

* Fix restore bug

* Add a method of DownloadFunc for base.Release to make uploader not depend on downloader

* fix Release yml marshal

* Fix trace information

* Fix bug when dump & restore

* Save relative path on yml file

* Fix bug

* Use relative path

* Update docs

* Use git service string but not int

* Recognize clone addr to service type

3 years agoMigration: drop to long repo topics (#14152)
6543 [Sun, 27 Dec 2020 01:23:57 +0000 (01:23 +0000)]
Migration: drop to long repo topics (#14152)

3 years agoChange topic name size from 25 to 50 (#14150)
Lunny Xiao [Sat, 26 Dec 2020 23:28:47 +0000 (07:28 +0800)]
Change topic name size from 25 to 50 (#14150)

* Change topic name size from 25 to 50

* recreateTable requires full bean definition

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix escaping issue in diff (#14153)
zeripath [Sat, 26 Dec 2020 21:58:21 +0000 (21:58 +0000)]
Fix escaping issue in diff (#14153)

Ensure that linecontent is escaped before passing to template.HTML

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 26 Dec 2020 18:23:50 +0000 (18:23 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix UI on edit auth source page (#14137)
Norwin [Sat, 26 Dec 2020 18:22:42 +0000 (18:22 +0000)]
Fix UI on edit auth source page (#14137)

* do not override OAuth URLs with default values when editing an auth source (fixes #12014)
* show custom url inputs by default for providers that don't provide an official hosted service

3 years agoDisable SSH key deletion of externally managed Keys (#13985)
zeripath [Sat, 26 Dec 2020 04:24:47 +0000 (04:24 +0000)]
Disable SSH key deletion of externally managed Keys (#13985)

* Disable SSH key addition and deletion when externally managed

When a user has a login source which has SSH key management
key addition and deletion using the UI should be disabled.

Fix #13983

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make only externally managed keys disabled

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agomigrate from com.* to alternatives (#14103)
6543 [Fri, 25 Dec 2020 09:59:32 +0000 (09:59 +0000)]
migrate from com.* to alternatives (#14103)

* remove github.com/unknwon/com from models

* dont use "com.ToStr()"

* replace "com.ToStr" with "fmt.Sprint" where its easy to do

* more refactor

* fix test

* just "proxy" Copy func for now

* as per @lunny

3 years agoDisable Fomantic's custom scrollbars (#14109)
silverwind [Thu, 24 Dec 2020 22:34:49 +0000 (23:34 +0100)]
Disable Fomantic's custom scrollbars (#14109)

We already have custom scrollbars in our own CSS which are superior to
Fomantic's so diable them to save a few bytes and prevent interference.

3 years agoFix heatmap total contributions (#14141)
Lunny Xiao [Thu, 24 Dec 2020 20:58:30 +0000 (04:58 +0800)]
Fix heatmap total contributions (#14141)

3 years agoFix creating OAuth2 auth source from CLI (#14116)
Daniil Pankratov [Thu, 24 Dec 2020 19:47:17 +0000 (22:47 +0300)]
Fix creating OAuth2 auth source from CLI (#14116)

Fix creation OAuth2 auth source from CLI.

Fix #8356

Co-authored-by: Daniil Pankratov <daniil.pankratov@t-systems.com>
3 years agoFix api doc response code (#14123)
Norwin [Thu, 24 Dec 2020 18:14:01 +0000 (18:14 +0000)]
Fix api doc response code (#14123)

Fixes #14120

3 years agoEnsure that search term and page are not lost on adoption page-turn (#14133)
zeripath [Thu, 24 Dec 2020 15:26:19 +0000 (15:26 +0000)]
Ensure that search term and page are not lost on adoption page-turn (#14133)

Fix #14111

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 24 Dec 2020 04:26:32 +0000 (04:26 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoImprove vfsgen to not unzip bindata files but send to browser directly (#7109)
Lunny Xiao [Thu, 24 Dec 2020 04:25:17 +0000 (12:25 +0800)]
Improve vfsgen to not unzip bindata files but send to browser directly (#7109)

* Don't unzip files from bindata but send to browser directly

* remove dependent for httpgzip

* Add tests for parseAcceptEncoding

* Update docs for ENABLE_GZIP

* Fix bug

* Fix bug

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix admin monitoring margin (#14134)
silverwind [Wed, 23 Dec 2020 20:38:29 +0000 (21:38 +0100)]
Fix admin monitoring margin (#14134)

3 years agoAPI: Make BasicAuth Prefix case insensitive (#14106)
6543 [Wed, 23 Dec 2020 19:52:46 +0000 (19:52 +0000)]
API: Make BasicAuth Prefix case insensitive (#14106)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 23 Dec 2020 19:11:05 +0000 (19:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix manifest encoding (#14114)
silverwind [Wed, 23 Dec 2020 19:09:54 +0000 (20:09 +0100)]
Fix manifest encoding (#14114)

The previous URL encoding would encode spaces to '+' for the app name
which is incorrect. Use base64 encoding instead which does not have such
issues.

3 years agoFix spelling avator -> avatar (#14115)
Jimmy Praet [Tue, 22 Dec 2020 21:28:03 +0000 (22:28 +0100)]
Fix spelling avator -> avatar (#14115)

3 years agoFix git.parseTagData (#14105)
6543 [Tue, 22 Dec 2020 20:44:25 +0000 (20:44 +0000)]
Fix git.parseTagData (#14105)

* Fix git.parseTagData()
close #14092

* Add Test

* add message to test

* limit readers

* git tag -m trims and terminates with a newline

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 22 Dec 2020 15:55:30 +0000 (15:55 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix incorrect generated link in documentation page (#14112)
Donlon [Tue, 22 Dec 2020 15:54:12 +0000 (23:54 +0800)]
Fix incorrect generated link in documentation page (#14112)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 22 Dec 2020 11:15:05 +0000 (11:15 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoInline manifest.json (#14038)
silverwind [Tue, 22 Dec 2020 11:13:50 +0000 (12:13 +0100)]
Inline manifest.json (#14038)

* Inline manifest.json

Improve performance by eliminating this separate request and just inline
this small JSON in HTML directly as a data uri.

Also update previously static app name scripts to use AppName.

I've confirmed this as working via "Add to Homescreen" feature which
offered to save the shortcut under the new app name.

* prerender manifest data on startup

* move to settings

* restore setting.AppStartTime and use it on admin page

* use double quotes because template.URL escapes everything

* fix lint

* move variable to global context variable

* delete template file

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 22 Dec 2020 03:48:23 +0000 (03:48 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd user filter to issueTrackedTimes, enable usage for issue managers (#14081)
Norwin [Tue, 22 Dec 2020 03:47:17 +0000 (03:47 +0000)]
Add user filter to issueTrackedTimes, enable usage for issue managers (#14081)

* add user filter to issueTrackedTimes

fixes #14024

* update swagger

* allow user filter for issue writers

* improve swagger doc

* return 404 on invalid user

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 22 Dec 2020 02:55:02 +0000 (02:55 +0000)]
[skip ci] Updated translations via Crowdin

3 years agorework heatmap permissions (#14080)
Norwin [Tue, 22 Dec 2020 02:53:37 +0000 (02:53 +0000)]
rework heatmap permissions (#14080)

* now uses the same permission model as for the activity feed:
  only include activities in repos, that the doer has access to.
  this might be somewhat slower.

* also improves handling of user.KeepActivityPrivate (still shows
  the heatmap to self & admins)

* extend tests

* adjust integration test to new behaviour

* add access to actions for admins

* extend heatmap unit tests

3 years agoStandardize Co-Authored-By / Reviewed-By strings (#14097)
Cirno the Strongest [Tue, 22 Dec 2020 02:19:33 +0000 (03:19 +0100)]
Standardize Co-Authored-By / Reviewed-By strings (#14097)

* Standardize Co-Authored-By / Reviewed-By strings

* Use lowercase variant

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoAdd StatDir and replace com.StatDir (#14099)
Lunny Xiao [Mon, 21 Dec 2020 23:40:57 +0000 (07:40 +0800)]
Add StatDir and replace com.StatDir (#14099)

* Add StatDir and replace com.StatDir

* a nit

* Remove wrong file

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Dec 2020 23:04:32 +0000 (23:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agomore test case for STORAGE_TYPE overrides (and fixes) (#14096)
胡玮文 [Mon, 21 Dec 2020 23:03:18 +0000 (07:03 +0800)]
more test case for STORAGE_TYPE overrides (and fixes) (#14096)

Signed-off-by: 胡玮文 <huww98@outlook.com>
3 years agoFix storage config implementation (#14091)
胡玮文 [Mon, 21 Dec 2020 17:59:18 +0000 (01:59 +0800)]
Fix storage config implementation (#14091)

The design is very flexible, but not implemented correctly.
This commit fixes several issues:
* Costom storage type stated in https://docs.gitea.io/en-us/config-cheat-sheet/#storage-storage
  not working
* [storage.attachments], [storage.minio] section not respected

Signed-off-by: 胡玮文 <huww98@outlook.com>
3 years agoAdd Test for Fix #14040 (#14045)
6543 [Mon, 21 Dec 2020 17:27:23 +0000 (17:27 +0000)]
Add Test for Fix #14040 (#14045)

Add Test for Fix #14040

3 years agoUse the text of pull-request as the squash commit's message (#13071)
Mura Li [Mon, 21 Dec 2020 16:46:14 +0000 (00:46 +0800)]
Use the text of pull-request as the squash commit's message (#13071)

Originally, it was filled by the commit messages of the involved
commits. In this change, we use the headline comment of the pull
request as the commit message when it is a squash merge.

Thanks to @zeripath for suggesting the idea.

Fixes #12365

Co-authored-by: Mura Li <typeless@users.noreply.github.com>
3 years agoAdd mentionable teams to tributeValues and change team mention rules to gh's style...
a1012112796 [Mon, 21 Dec 2020 15:39:28 +0000 (23:39 +0800)]
Add mentionable teams to tributeValues and change team mention rules to gh's style (#13198)

* Add mentionable teams to tributeValues

Signed-off-by: a1012112796 <1012112796@qq.com>
* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
* Change team mention rules to gh's style

* use org's avator as team avator in ui

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update modules/markup/html.go

* Update models/issue.go

Co-authored-by: Lauris BH <lauris@nix.lv>
* Update models/issue.go

* fix a small nit and update test code

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Dec 2020 14:41:16 +0000 (14:41 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdded option to disable migrations (#13114)
Paweł Bogusławski [Mon, 21 Dec 2020 14:39:41 +0000 (15:39 +0100)]
Added option to disable migrations (#13114)

* Added option to disable migrations

This patch introduces DISABLE_MIGRATIONS parameter in [repository]
section of app.ini (by default set to false). If set to true
it blocks access to repository migration feature.

This mod hides also local repo import option in user editor if
local repo importing or migrations is disabled.

* Alter Example config

DISABLE_MIGRATIONS set to false in example config to
match its default value.

* HTTP error 403 instead of 500 on denied access to migration

* Parameter DISABLE_MIGRATIONS exposed via API

Fixes: 04b04cf854bcb3ed7659442bcf79822bdebe29e9
Author-Change-Id: IB#1105130

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Dec 2020 13:13:27 +0000 (13:13 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoexpose translation of previously hardcoded string (#14087)
Norwin [Mon, 21 Dec 2020 13:12:13 +0000 (13:12 +0000)]
expose translation of previously hardcoded string (#14087)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Dec 2020 08:32:25 +0000 (08:32 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoPresent repository name as {{name}}#{{index}} instead of label on dashboard issuelist...
Cirno the Strongest [Mon, 21 Dec 2020 08:31:20 +0000 (09:31 +0100)]
Present repository name as {{name}}#{{index}} instead of label on dashboard issuelist (#14085)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoLocale: say another issue instead of this issue (#14082)
DuckDuckWhale [Mon, 21 Dec 2020 06:11:39 +0000 (22:11 -0800)]
Locale: say another issue instead of this issue (#14082)

Saying "this issue" is confusing because it could be understood as the
issue that the user is currently viewing, not which the "issue" link
points to.

3 years agoAdd repo name label again on dashboard issue / pulls page (#14073)
Jimmy Praet [Sun, 20 Dec 2020 22:52:29 +0000 (23:52 +0100)]
Add repo name label again on dashboard issue / pulls page (#14073)

The label got removed in PR #13594

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoSearch and Diff CSS enhancements (#14050)
silverwind [Sun, 20 Dec 2020 18:00:03 +0000 (19:00 +0100)]
Search and Diff CSS enhancements (#14050)

* Search and Diff CSS enhancements

- Use flexbox for language stats
- Improve labels and code boxes on repo and code search
- Use flexbox on diff header and improve suppressed diff text
- Add dedicated color for diff expander

* more diff tweaks, less vertical padding on header

* more minor tweaks

* always show fold icon, image diff improvments

* remove margin

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agodep: update crypto. info: https://golangtutorial.dev/news/fix-in-crypto-package/...
techknowlogick [Sun, 20 Dec 2020 15:36:07 +0000 (10:36 -0500)]
dep: update crypto. info: https://golangtutorial.dev/news/fix-in-crypto-package/ (#14067)

Co-authored-by: zeripath <art27@cantab.net>
3 years agoShow dropdown with all statuses for commit (#13977)
Cirno the Strongest [Sun, 20 Dec 2020 03:13:12 +0000 (04:13 +0100)]
Show dropdown with all statuses for commit (#13977)

* Show dropdown with all statuses for commit

* Use popups

* Remove unnecessary change

* Style popup

* Use divided list

* As per @silverwind

* Refactor GetLastCommitStatus

* Missing dropdown on repo home and commit page

* Fix tests

* Make status icon be a part of a link on PR list

* Fix missing translation call

* Indent fix

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 20 Dec 2020 01:32:15 +0000 (01:32 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoManually approve new registration (#13083)
Jiri Vlasak [Sun, 20 Dec 2020 01:31:06 +0000 (02:31 +0100)]
Manually approve new registration (#13083)

* Add register manual confirm settings option

The new settings option is used when manually approving new
registrations.

* Enable manual confirmation of new registered user

When manual registration confirmation is desired (by default `false`)
create new user in the database that is *not active*. The user must then
be activated manually.

This change speeds up the process of adding new confirmed users for
Gitea instances without external auth mechanism. (Currently the option
is to manually create new user by admin.)

* Update docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix feed push tag (#14064)
Lunny Xiao [Sat, 19 Dec 2020 23:46:28 +0000 (07:46 +0800)]
Fix feed push tag (#14064)

* Fix dashboard feed bug when push tag

* Fix variable name

* Fix delete tag

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 19 Dec 2020 22:31:48 +0000 (22:31 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRefactor get tag to remove unnecessary steps (#14058)
Lunny Xiao [Sat, 19 Dec 2020 22:30:39 +0000 (06:30 +0800)]
Refactor get tag to remove unnecessary steps (#14058)

* Fix tag cache bug

3 years agoFix merge button dropdown triangle alignment (#14041)
silverwind [Sat, 19 Dec 2020 03:57:25 +0000 (04:57 +0100)]
Fix merge button dropdown triangle alignment (#14041)

https://github.com/go-gitea/gitea/pull/14028 had improved dropdown
triangle display for buttons with text but had regressed it for buttons
without. Fix this by adding a class to prevent horizontal margin adjustment.

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoput ${CURDIR} in quotes to prevent make from splitting paths with spaces into separat...
Kyle D [Sat, 19 Dec 2020 02:54:01 +0000 (21:54 -0500)]
put ${CURDIR} in quotes to prevent make from splitting paths with spaces into separate strings (#14056)

3 years agogitea png to logo (#13974)
Kyle D [Sat, 19 Dec 2020 01:17:27 +0000 (20:17 -0500)]
gitea png to logo (#13974)

* gitea png to logo.svg

* gitea safari svg to logo

* minify svgs

* Update english docs

* Update missing section on customizing logo

3 years agoCommit list display tweaks (#14043)
silverwind [Fri, 18 Dec 2020 20:00:07 +0000 (21:00 +0100)]
Commit list display tweaks (#14043)

- Make plain <pre> inherit our monospace fonts, overriding fomantic's
  css reset which means expanded commit messages now follow the font
  settings.
- Adjust link styling and keyword highlighting in commit message
- Consolidate .commit-summary styles to single selector group

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAccept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989)
zeripath [Fri, 18 Dec 2020 17:44:18 +0000 (17:44 +0000)]
Accept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989)

* Accept multiple SSH keys in single LDAP SSHPublicKey attribute

Fix #13984

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoShow status check for merged PRs (#13975)
Cirno the Strongest [Fri, 18 Dec 2020 12:37:55 +0000 (13:37 +0100)]
Show status check for merged PRs (#13975)

* Show status check for merged PRs

* Handle PRs with no commits

* Styling

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd whiteline after label on Signing Verification Settings (#14042)
Cirno the Strongest [Fri, 18 Dec 2020 10:27:42 +0000 (11:27 +0100)]
Add whiteline after label on Signing Verification Settings (#14042)

3 years ago[Refactor] CombinedStatus and CommitStatus related functions & structs (#14026)
6543 [Fri, 18 Dec 2020 03:33:32 +0000 (03:33 +0000)]
[Refactor] CombinedStatus and CommitStatus related functions & structs (#14026)

* RM unused struct

* rename (*CommitStatus) loadRepo() -> loadAttributes()

* move ToCommitStatus into its own file

* use CommitStatusState instead of StatusState

* move CombinedStatus convertion into convert package

* let models.GetLatestCommitStatus use repoID direct and accept ListOptions

* update swagger docs

* fix tests

* Fix swagger docs

* rm page

* fix swagger docs!!!

* return json null

* always return json

* rename api.Status to api.CommitStatus

* fix swagger docs

* sec swagger fix

3 years agoFix panic in BasicAuthDecode (#14046)
silverwind [Fri, 18 Dec 2020 01:51:28 +0000 (02:51 +0100)]
Fix panic in BasicAuthDecode (#14046)

* Fix panic in BasicAuthDecode

If the string does not contain ":" that function would run into an
`index out of range [1] with length 1` error. prevent that.

* Update BasicAuthDecode()

Co-authored-by: 6543 <6543@obermui.de>
3 years agoMakefile cleanup & double golangci-lint timeout (#14044)
silverwind [Thu, 17 Dec 2020 22:55:52 +0000 (23:55 +0100)]
Makefile cleanup & double golangci-lint timeout (#14044)

* Makefile cleanup

The xmldom dependency is no longer required since #13680. Also,
whitespace cleanup.

* double the golangci-lint timeout

3 years agoClean up SVG (#13680)
techknowlogick [Thu, 17 Dec 2020 21:33:53 +0000 (16:33 -0500)]
Clean up SVG (#13680)

* Clean up SVG

* update per feedback

* fix css style

* Delete gitea.png

* no new line at end of file

* fix newline?

Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix bug in commit verification introduced in #13673 (#14040)
zeripath [Thu, 17 Dec 2020 20:42:33 +0000 (20:42 +0000)]
Fix bug in commit verification introduced in #13673 (#14040)

There is a slight bug in the commit_reader introduced in #13673 whereby
commit messages which have a final unterminated line miss their final line.

This PR fixes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDashboard search tweaks (#14008)
silverwind [Thu, 17 Dec 2020 19:58:21 +0000 (20:58 +0100)]
Dashboard search tweaks (#14008)

- Fix color of inactive pagination parts caused by overreaching CSS
selector.
- Slightly reduce horizontal padding on list items
- Add spacing around pagination and move it outside of <ul>

3 years agoDiff and code review refactors and improvements (#13922)
silverwind [Thu, 17 Dec 2020 15:52:58 +0000 (16:52 +0100)]
Diff and code review refactors and improvements (#13922)

* Diff CSS refactors and misc tweaks

- Simplify Diff CSS styling
- Add color variables for diff
- Fix vertical centering of inline comment button
- Slightly adjust text colors, e.g. in comment header

* Code review improvments

* selector tweak

* fix diff issues, add inactive bg color

Co-authored-by: 6543 <6543@obermui.de>
3 years agoDropdown triangle fixes (#14028)
silverwind [Thu, 17 Dec 2020 14:37:56 +0000 (15:37 +0100)]
Dropdown triangle fixes (#14028)

* Dropdown triangle fixes

Fomantic's CSS assumes the dropdown triangles are fonts but we've recently
swapped them for SVG so we need to wrestle a bit with Fomantic to get it
to display properly and not cause buttons to resize.

Fixes: https://github.com/go-gitea/gitea/issues/14014
* move css and add link

3 years agoUse native git variants by default with go-git variants as build tag (#13673)
zeripath [Thu, 17 Dec 2020 14:00:47 +0000 (14:00 +0000)]
Use native git variants by default with go-git variants as build tag (#13673)

* Move last commit cache back into modules/git

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove go-git from the interface for last commit cache

Signed-off-by: Andrew Thornton <art27@cantab.net>
* move cacheref to last_commit_cache

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove go-git from routers/private/hook

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move FindLFSFiles to pipeline

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make no-go-git variants

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

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

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

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

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

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

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

* As per @lunny

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* default to use no-go-git variants and add gogit build tag

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoCause NotifyMigrateRepository to emit a repo create webhook (#14004)
zeripath [Thu, 17 Dec 2020 12:26:22 +0000 (12:26 +0000)]
Cause NotifyMigrateRepository to emit a repo create webhook (#14004)

* Cause NotifyMigrateRepository to emit a repo create webhook

This PR simply makes NotifyMigrateRepository emit a Create Repo webhook.
The reason for no new payload is that the information sent to
NotifyMigrateRepository is only essentially the same as
NotifyCreateRepository

Fix #13996

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAlways wait for the cmd to finish (#14006)
zeripath [Thu, 17 Dec 2020 11:50:21 +0000 (11:50 +0000)]
Always wait for the cmd to finish (#14006)

After cancelling the context we still need to wait for the
command to finish otherwise zombie processes may occur

Fix #13987

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agofix label of --id in admin delete user (#14005)
zeripath [Thu, 17 Dec 2020 07:57:32 +0000 (07:57 +0000)]
fix label of --id in admin delete user (#14005)

* fix label of --id in admin delete user

This pr fixes the label descriptor of `gitea admin delete user`
but also adds a `--username` option.

Fix #13995

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add delete email support

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agodocs(docker): fix diff format. (#14035)
Bo-Yi Wu [Thu, 17 Dec 2020 05:00:43 +0000 (13:00 +0800)]
docs(docker): fix diff format. (#14035)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
3 years agoHotFix: Hide private partisipation in Orgs (#13994)
6543 [Wed, 16 Dec 2020 23:39:12 +0000 (23:39 +0000)]
HotFix: Hide private partisipation in Orgs (#13994)

* HotFix: Hide private partisipation in Orgs

* refactor & add node to fuc GetOrganizations

3 years agoAdd FAQ link to Issue template (#14020)
6543 [Wed, 16 Dec 2020 19:18:36 +0000 (19:18 +0000)]
Add FAQ link to Issue template (#14020)

3 years agoFix webhook list styling (#14001)
Cirno the Strongest [Wed, 16 Dec 2020 18:22:21 +0000 (19:22 +0100)]
Fix webhook list styling (#14001)

* Fix webhook list styling

* As per @silverwind

3 years agoSend webhook when tag is removed via Web UI (#14015)
Cirno the Strongest [Wed, 16 Dec 2020 16:00:46 +0000 (17:00 +0100)]
Send webhook when tag is removed via Web UI (#14015)

* Send webhook when tag is removed via Web UI

* Stray code

3 years agoSend push event when tag is created or deleted (#13999)
Cirno the Strongest [Wed, 16 Dec 2020 12:41:21 +0000 (13:41 +0100)]
Send push event when tag is created or deleted (#13999)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix correct diff view for PR review comments in PR view page (#14002)
Jimmy Praet [Wed, 16 Dec 2020 09:54:58 +0000 (10:54 +0100)]
Fix correct diff view for PR review comments in PR view page (#14002)

Fixes #13683.

The diff snippet that provides context for a code review comment on the pull request timeline page used to be calculated based on the headCommitID. But in 1.13, with PR #13448, this changed to the commitID from the blame for the commented line, which seems to cause these incorrect review comment diff snippets.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoStore repository data in data path if not previously set (#13991)
techknowlogick [Tue, 15 Dec 2020 21:52:59 +0000 (16:52 -0500)]
Store repository data in data path if not previously set (#13991)

* Store repository data in data path if not previously set

* update docs

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

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

Co-authored-by: silverwind <me@silverwind.io>
3 years agoadd @noerw to maintainers (#13997)
Norwin [Tue, 15 Dec 2020 19:19:26 +0000 (19:19 +0000)]
add @noerw to maintainers (#13997)

* add @noerw to maintainers

* format

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[API] Add ref to create/edit issue options & deprecated assignee (#13992)
6543 [Tue, 15 Dec 2020 18:38:10 +0000 (18:38 +0000)]
[API] Add ref to create/edit issue options & deprecated assignee (#13992)

* API: Add ref to create/edit issue options

* deprecate Assignee in favour of Assignees

3 years agoStandardise logging of failed authentication attempts in internal SSH (#13962)
zeripath [Tue, 15 Dec 2020 08:45:13 +0000 (08:45 +0000)]
Standardise logging of failed authentication attempts in internal SSH (#13962)

Continuing on from #13953 continue to improve and standardise
logging from internal SSH.

Also updates the fail2ban setup

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix markdown checkboxes on Blink (#13988)
silverwind [Tue, 15 Dec 2020 07:00:41 +0000 (08:00 +0100)]
Fix markdown checkboxes on Blink (#13988)

Blink still requires a vendor prefix for `mask-image` and `mask-size`,
so add that here to fix the rendering.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoHide command line instructions when merge form is visible (#13956)
Cirno the Strongest [Tue, 15 Dec 2020 06:09:24 +0000 (07:09 +0100)]
Hide command line instructions when merge form is visible (#13956)

* Hide commandline instructions when merge form is visible

* As per @silverwind

Co-authored-by: zeripath <art27@cantab.net>
3 years agoTrim the branch prefix from action.GetBranch (#13981)
zeripath [Mon, 14 Dec 2020 17:08:37 +0000 (17:08 +0000)]
Trim the branch prefix from action.GetBranch (#13981)

* Trim the branch prefix from action.GetBranch

 #13882 has revealed that the refname of an action is actually only a
refname pattern and necessarily a branch. For examplem pushing to
refs/heads/master will result in action with refname refs/heads/master
but pushing to master will result in a refname master.

The simplest solution to providing a fix here is to trim the prefix
therefore this PR proposes this.

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

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agoAdd emoji in label to project boards (#13978)
Rakshith Ravi [Mon, 14 Dec 2020 10:06:58 +0000 (15:36 +0530)]
Add emoji in label to project boards (#13978)

* Update view.tmpl

Added rendering of emoji to project label

* Add RenderEmojiPlain to the title and remove has-emoji

Co-authored-by: zeripath <art27@cantab.net>
3 years agoDo not display org avatar near icon for internal repos (#13957)
Cirno the Strongest [Sun, 13 Dec 2020 21:51:15 +0000 (22:51 +0100)]
Do not display org avatar near icon for internal repos (#13957)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoadd thumbnail preview section to issue attachments (#13826)
bobemoe [Sun, 13 Dec 2020 19:12:27 +0000 (19:12 +0000)]
add thumbnail preview section to issue attachments (#13826)

* add thumbnail preview section to attachments

* dont show thumbnail if the image is already shown inline

* update router to pass the `content` to the attachemnts template

* limit attachment preview height to 150px (same as width)

* remove unused css (referance removed in https://github.com/go-gitea/gitea/pull/11141/files#diff-9faae32445ed9673de2830c9fc35e93f44487f0a0068202988adaf00a5bac850L66 )

* dont show divider after edit if no attachemnts

Co-authored-by: James <inbox.dev@jhodges.co.uk>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[API] Add Ref to Issue (#13946)
zeripath [Sun, 13 Dec 2020 11:34:11 +0000 (11:34 +0000)]
[API] Add Ref to Issue (#13946)

* Add Ref to api.Issue

This PR adds Ref to api.Issue and adds the backend parts to the migrator.

Fix #13918

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 13 Dec 2020 02:49:02 +0000 (02:49 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRemoves dangling < on emails/list.tmpl (#13970)
WeebDataHoarder [Sun, 13 Dec 2020 02:48:03 +0000 (03:48 +0100)]
Removes dangling < on emails/list.tmpl (#13970)

This dangling character was leftover from commit c85bb6263503ebd335863f413214a775973a1fac from PR #13860

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 13 Dec 2020 01:06:57 +0000 (01:06 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMarkdown task list improvements (#13952)
silverwind [Sun, 13 Dec 2020 01:05:50 +0000 (02:05 +0100)]
Markdown task list improvements (#13952)

* Markdown task list improvements

- Remove `.ui` class and wrappers to prevent fomantic from messing with it.
- Change rendered HTML to match GitHub.
- Add custom styling for the checkboxes.

* fix unittest

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoWhenever the password is updated ensure that the hash algorithm is too (#13966)
zeripath [Sat, 12 Dec 2020 18:59:49 +0000 (18:59 +0000)]
Whenever the password is updated ensure that the hash algorithm is too (#13966)

`user.HashPassword` may potentially - and in fact now likely does - change
the `passwd_hash_algo` therefore whenever the `passwd` is updated, this
also needs to be updated.

Fix #13832

Thanks @fblaese for the hint

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 12 Dec 2020 15:34:20 +0000 (15:34 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoPossible fix the webhook API creation (#13960)
Lunny Xiao [Sat, 12 Dec 2020 15:33:19 +0000 (23:33 +0800)]
Possible fix the webhook API creation (#13960)

* Possible fix the webhook API creation

* Fix api create webhook bug

3 years agoFix missing username on dashboard context switch navbar (#13959)
Cirno the Strongest [Sat, 12 Dec 2020 13:10:20 +0000 (14:10 +0100)]
Fix missing username on dashboard context switch navbar (#13959)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 12 Dec 2020 11:21:18 +0000 (11:21 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoEnforce setting HEAD in wiki to master (#13950)
zeripath [Sat, 12 Dec 2020 11:20:14 +0000 (11:20 +0000)]
Enforce setting HEAD in wiki to master (#13950)

The default branch in wikis must be master - therefore forcibly set the HEAD
to master.

Fix #13846

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>