From bbd9bebcc31dc2383482c3415bd298666318113f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 18 May 2020 07:31:49 +0200 Subject: [PATCH 001/192] Fix "Unknown task: git_fsck" error on admin dashboard (#11468) (#11471) * Fix "Unknown task: git_fsck" error on admin dashboard (#11468) * Update .drone.yml Co-authored-by: zeripath --- .drone.yml | 2 -- options/locale/locale_en-US.ini | 1 - templates/admin/dashboard.tmpl | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index ac8c929181..1e981c4c16 100644 --- a/.drone.yml +++ b/.drone.yml @@ -106,8 +106,6 @@ services: depends_on: - build when: - branch: - - master event: - push - pull_request diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index f6c9b43ee5..d10f4c2478 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1872,7 +1872,6 @@ dashboard.resync_all_sshkeys.desc = (Not needed for the built-in SSH server.) dashboard.resync_all_hooks = Resynchronize pre-receive, update and post-receive hooks of all repositories. dashboard.reinit_missing_repos = Reinitialize all missing Git repositories for which records exist dashboard.sync_external_users = Synchronize external user data -dashboard.git_fsck = Execute health checks on all repositories dashboard.server_uptime = Server Uptime dashboard.current_goroutine = Current Goroutines dashboard.current_memory_usage = Current Memory Usage diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index affed1634f..0079fc78d7 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -53,8 +53,8 @@ - {{.i18n.Tr "admin.dashboard.git_fsck"}} - + {{.i18n.Tr "admin.dashboard.repo_health_check"}} + {{.i18n.Tr "admin.dashboard.delete_generated_repository_avatars"}} From 087719cb8da5b0f231b7a4cba3cb5cf4bf38bd34 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 18 May 2020 08:21:00 +0200 Subject: [PATCH 002/192] Ensure public repositories in private organizations are visible and fix admin organizations list (#11465) (#11474) * Ensure that we can see public repositories in private organization Fix #10144 (Again) Signed-off-by: Andrew Thornton * Fix Admin users and organizations page Signed-off-by: Andrew Thornton * Update models/repo_list.go Co-authored-by: Lauris BH Co-authored-by: zeripath Co-authored-by: Lauris BH --- models/repo_list.go | 29 +++++++++++++++++++++++++---- routers/home.go | 3 ++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/models/repo_list.go b/models/repo_list.go index 316e6d084c..3e580a7229 100644 --- a/models/repo_list.go +++ b/models/repo_list.go @@ -249,14 +249,35 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond { } if opts.Collaborate != util.OptionalBoolFalse { + // A Collaboration is: collaborateCond := builder.And( + // 1. Repository we don't own + builder.Neq{"owner_id": opts.OwnerID}, + // 2. But we can see because of: builder.Or( - builder.Expr("repository.id IN (SELECT repo_id FROM `access` WHERE access.user_id = ?)", opts.OwnerID), - builder.In("id", builder.Select("`team_repo`.repo_id"). + // A. We have access + builder.In("`repository`.id", + builder.Select("`access`.repo_id"). + From("access"). + Where(builder.Eq{"`access`.user_id": opts.OwnerID})), + // B. We are in a team for + builder.In("`repository`.id", builder.Select("`team_repo`.repo_id"). From("team_repo"). Where(builder.Eq{"`team_user`.uid": opts.OwnerID}). - Join("INNER", "team_user", "`team_user`.team_id = `team_repo`.team_id"))), - builder.Neq{"owner_id": opts.OwnerID}) + Join("INNER", "team_user", "`team_user`.team_id = `team_repo`.team_id")), + // C. Public repositories in private organizations that we are member of + builder.And( + builder.Eq{"`repository`.is_private": false}, + builder.In("`repository`.owner_id", + builder.Select("`org_user`.org_id"). + From("org_user"). + Join("INNER", "`user`", "`user`.id = `org_user`.org_id"). + Where(builder.Eq{ + "`org_user`.uid": opts.OwnerID, + "`user`.type": UserTypeOrganization, + "`user`.visibility": structs.VisibleTypePrivate, + })))), + ) if !opts.Private { collaborateCond = collaborateCond.And(builder.Expr("owner_id NOT IN (SELECT org_id FROM org_user WHERE org_user.uid = ? AND org_user.is_public = ?)", opts.OwnerID, false)) } diff --git a/routers/home.go b/routers/home.go index 1b8c4cd17b..ae94207ade 100644 --- a/routers/home.go +++ b/routers/home.go @@ -194,7 +194,6 @@ func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplN if opts.Page <= 1 { opts.Page = 1 } - opts.Actor = ctx.User var ( users []*models.User @@ -252,6 +251,7 @@ func ExploreUsers(ctx *context.Context) { ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled RenderUserSearch(ctx, &models.SearchUserOptions{ + Actor: ctx.User, Type: models.UserTypeIndividual, ListOptions: models.ListOptions{PageSize: setting.UI.ExplorePagingNum}, IsActive: util.OptionalBoolTrue, @@ -272,6 +272,7 @@ func ExploreOrganizations(ctx *context.Context) { } RenderUserSearch(ctx, &models.SearchUserOptions{ + Actor: ctx.User, Type: models.UserTypeOrganization, ListOptions: models.ListOptions{PageSize: setting.UI.ExplorePagingNum}, Visible: visibleTypes, From 6e75bc013e97d3cc93e2ed02512e364e3333542c Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 18 May 2020 12:17:35 +0300 Subject: [PATCH 003/192] Fix comment box styling and cancelling (#11463) (#11464) (#11469) (#11467) * Fix styling of resolved code comment box (#11463) Co-authored-by: Lauris BH * Fix .comment-code-cloud not being removed when cancelling new code comment (#11464) * Fix footer padding for comment code reply form on issue event view (#11469) Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> --- templates/repo/diff/comment_form.tmpl | 2 +- web_src/less/_repository.less | 4 ++++ web_src/less/_review.less | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index a286725722..e201db4687 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -2,7 +2,7 @@ {{if $.hidden}} {{end}} -
+ {{$.root.CsrfTokenHtml}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 47b020d4e1..148d65e717 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -807,6 +807,10 @@ .author { font-weight: 700; } + + .comment-form-reply .footer { + padding-bottom: 1em; + } } .comment { diff --git a/web_src/less/_review.less b/web_src/less/_review.less index f146cc1da8..38e5c62793 100644 --- a/web_src/less/_review.less +++ b/web_src/less/_review.less @@ -17,6 +17,12 @@ } } +.add-comment-left.add-comment-right .ui.attached.header { + border: 1px solid #d4d4d5; + margin-bottom: .5em; + margin-top: .5em; +} + .focus-lines-new .ui.button.add-code-comment.add-code-comment-right, .focus-lines-old .ui.button.add-code-comment.add-code-comment-left { opacity: 1; From 2289e59bd7d62c341abbacf4818215c7b8c88549 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 18 May 2020 16:04:04 +0300 Subject: [PATCH 004/192] Changelog for v1.12.0-rc1 (#11462) --- CHANGELOG.md | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 280 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5431762bb..8147fd00bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,286 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has been added to each release, please refer to the [blog](https://blog.gitea.io). +## [1.12.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.12.0-rc1) - 2020-05-18 + +* BREAKING + * Remove migration support from versions earlier than 1.6.0 (#10026) + * Enable ENABLE_HARD_LINE_BREAK by default for rendering markdown (#11162) + * Fix sanitizer config - multiple rules (#11133) + * When using API CreateRelease set created_unix to the tag commit time (#11218) + * Remove check on username when using AccessToken authentication for the API (#11015) + * Return 404 from Contents API when items don't exist (#10323) + * Notification API should always return a JSON object with the current count of notifications (#10059) +* FEATURES + * Improve config logging when WrappedQueue times out (#11174) + * Add branch delete to API (#11112) + * Use markdown frontmatter to provide Table of contents, language and frontmatter rendering (#11047) + * Add a way to mark Conversation (code comment) resolved (#11037) + * Handle yaml frontmatter in markdown (#11016) + * Cache PullRequest Divergence (#10914) + * Make `gitea admin auth list` formatting configurable (#10844) + * Add Matrix webhook (#10831) + * Add Organization Wide Labels (#10814) + * Allow to set protected file patterns for files that can not be changed under no conditions (#10806) + * Option to set default branch at repository creation (#10803) + * Add request review from specific reviewers feature in pull request (#10756) + * Add NextCloud oauth (#10562) + * System-wide webhooks (#10546) + * Relax sanitization as per https://github.com/jch/html-pipeline (#10527) + * Use media links for img in post-process (#10515) + * Add API endpoints to manage OAuth2 Application (list/create/delete) (#10437) + * Render READMEs in docs/ .gitea or .github from root (#10361) + * Add feishu webhook support (#10229) + * Cache last commit to accelerate the repository directory page visit (#10069) + * Implement basic app.ini and path checks to doctor cmd (#10064) + * Make WorkerPools and Queues flushable (#10001) + * Implement "embedded" command to extract static resources (#9982) + * Add API endpoint for repo transfer (#9947) + * Make archive prefixing configurable with a global setting (#9943) + * Add Unique Queue infrastructure and move TestPullRequests to this (#9856) + * Issue/PR Context Popups (#9822) + * Add "Update Branch" button to Pull Requests (#9784) + * Add require signed commit for protected branch (#9708) + * Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532) + * Add API notification endpoints (#9488) + * Issue search support elasticsearch (#9428) + * Add API branch protection endpoint (#9311) + * Add a new command doctor to check if some wrong configurations on gitea instance (#9095) + * Add support for migrating from Gitlab (#9084) + * Add support for database schema in PostgreSQL (#8819) + * Add setting to set default and global disabled repository units. (#8788) + * Language statistics bar for repositories (#8037) + * Restricted users (#6274) +* BUGFIXES + * Check branch protection on IsUserAllowedToUpdate (#11448) + * Fix margin on attached segment headers when they are separated by other element (#11425) + * Fix webhook template when validation errors occur (#11421) + * Fix NPE in template due to missing signing key on commit page (#11392) + * Restore active background to Register button on Register page (#11390) + * Fix hook failure due to relative LFS_CONTENT_PATH (#11362) + * Correctly set the organization num repos (#11339) + * Prevent 500 with badly formed task list (#11328) + * Allow compare page to look up base, head, own-fork, forkbase-of-head (#11327) + * Handle panics that percolate up to the graceful module (#11291) + * Don't allow registration via the web form, when AllowOnlyExternalRegistration is True (#11248) + * Patch fomantic-ui to workaround build issue (#11244) + * Prevent panic during wrappedConn close at hammertime (#11219) + * On logout force redirect to start page (#11202) + * Fix creation of Organization repos by Users with max created personal repos (#11183) + * Add option to increase provided OAuth2 token maximum size (#11180) + * Log the indexer path on failure (#11172) + * Ensure that relative paths in edit preview work (#11143) + * Make API EditIssue and EditPullRequest issue notifications (#11123) + * Send 404 immediately for known public requests (#11117) + * Remove nil inserts in models (#11096) + * Add GetReviews() to RetryDownloader (#11093) + * Remove nonexistent serviceworker entries (#11091) + * Simplify and fix GetApprovalCounts (#11086) + * Fix wiki revision template and simplify some tmpl conditions (#11080) + * Make branch parameter optional for /api/v1/repos/{owner}/{repo}/contents/{filepath} (#11067) + * Align review-item svg octicons (#11065) + * Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team (#10997) + * Users should not be able to prohibit their own login (#10970) + * Fix scrollbar issues in dropdowns (#10897) + * Change the order of issues.closed_by to list opening user first (#10876) + * Allow site admin to check /api/v1/orgs endpoints (#10867) + * Avoid logging []byte in queue failures - convert to string first (#10865) + * Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen (#10863) + * Fix assignees double load bug (#10856) + * Handle push rejection in branch and upload (#10854) + * In authorized_keys use double-quote for windows compatibility (#10841) + * Fix milestone template (#10824) + * log.Fatal on failure to listen to SSH port (#10795) + * Fix forked repo has no icon and language stat. (#10791) + * Fix tag/release deletion (#10663) + * Fix webhook migration (#10641) + * Migration for deleting orphaned dependencies (#10617) + * Add migration to fix the old broken merge-bases (#10604) + * Update templates for Go 1.14 (#10596) + * Remove unnecessary parentheses in wiki/view template (#10583) + * Change default value of DefaultCommandExecutionTimeout to match docs (#10581) + * Handle panic in indexer initialisation better (#10534) + * Set correct content_type value for Gogs/Gitea webhooks (#9504) (#10456) + * Fixed wrong AppSubUrl in multiple templates (#10447) + * Fix profile page CSS (#10406) + * Inject SVG sprite via ajax (#10320) + * Fix migration information update bug when linked github account (#10310) + * Allow admin to check org membership by API for other users (#10201) + * Fix topics dropdown (#10167) + * Ensure DeleteUser is not allowed to Delete Orgs and visa versa (#10134) + * Fix IsErrPullClosed (#10093) + * Accept punctuation after simple+cross repository issue references (#10091) + * On merge of already closed PR redirect back to the pulls page (#10010) + * Fix crowdin update script (#9969) + * Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch (#9927) + * Add option to prevent LDAP from deactivating everything on empty search (#9879) + * Fix admin handling at merge of PR (#9749) + * err_admin_name_pattern_not_allowed String Clarification (#9731) + * Fix wrong original git service type on a migrated repository (#9693) + * Fix ref links in issue overviews for tags (#8742) +* ENHANCEMENTS + * Increase width for authors on commit view (#11441) + * Hide archived repos by default in repo-list (#11440) + * Better styling for code review comment textarea (#11428) + * Support view individual commit for wiki pages (#11415) + * Fix yellow background on active elements in code review (#11414) + * Better styling for code review comment form (#11413) + * Change install description on homepage (#11395) + * Ensure search action button is coalesced to adjacent input (#11385) + * Switch code editor to Monaco (#11366) + * Add paging and archive/private repository filtering to dashboard list (#11321) + * Changed image of openid-connect logo for better look on arc-green theme (#11312) + * Load Repo Topics on blame view too (#11307) + * Change the style in admin notice content view from `

` to `

` (#11301)
+  * Allow log.xxx.default to set logging settings for the default logger only (#11292)
+  * Automatically attempt auto recovery of broken disk queues (Update lunny/levelqueue to 0.3.0) (#11285)
+  * Make sendmail a Process and have default timeout (#11256)
+  * Check value of skip-repository flag in dump command (#11254)
+  * Fix submit review form (#11252)
+  * Allow unauthenticated users to compare (#11240)
+  * Add EventSource support (#11235)
+  * Refactor Milestone related (#11225)
+  * Add pull review API endpoints (#11224)
+  * Add a 'this' to issue close/reopened messages (#11204)
+  * When migrating from Gitlab map Approvals to approving Reviews (#11147)
+  * Improve representation of attachments in issues (#11141)
+  * Protect default branch against deletion (#11115)
+  * Add X-Total-Count on /repos/{owner]/{repo}/pulls API endpoint (#11113)
+  * Fix status label on branches list vertical alignment (#11109)
+  * Add single release page and latest redirect (#11102)
+  * Add missing commit states to PR checks template (#11085)
+  * Change icon on title for merged PR to git-merge (#11064)
+  * Add MergePull comment type instead of close for merge PR (#11058)
+  * Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055)
+  * Consolidate author name across timeline (#11053)
+  * Refactor UpdateOAuth2Application (#11034)
+  * Support unicode emojis and remove emojify.js (#11032)
+  * Add git hook "warning" to admin panel (#11030)
+  * Add flash notify for email preference setting success (#11027)
+  * Remove package code.gitea.io/gitea/modules/git import out of models (#11025)
+  * Match arc-green code tag color to code blocks (#11023)
+  * Move syntax highlighting to web worker (#11017)
+  * Prevent merge of outdated PRs on protected branches (#11012)
+  * Add Get/Update for api/v1/user/applications/oauth2 (#11008)
+  * Upgrade to most recent bluemonday (#11007)
+  * Tweak code tags in markdown (#11000)
+  * Reject duplicate AccessToken names (#10994)
+  * Fix Ctrl-Enter shortcut for issues (#10986)
+  * Provide `OwnerName` field for README template (#10981)
+  * Prettify Timeline (#10972)
+  * Add issue subscription check to API (#10967)
+  * Use AJAX for notifications table (#10961)
+  * Adjust label padding (#10957)
+  * Avoiding directory execution on hook (#10954) (#10955)
+  * Migrate ActivityHeatmap to Vue SFC (#10953)
+  * Change merge strategy: do not check write access if user in merge white list (#10951)
+  * Enable GO111MODULE=on globally in Makefile (#10939)
+  * API endpoint to get single commit via SHA and Ref (#10915)
+  * Add accordion to release list and hide non-latest (#10910)
+  * Split dashboard elements into separate template files (#10885)
+  * Add more message on sidebar menus (#10872)
+  * Set MySQL rowtype to dynamic for new tables (#10833)
+  * Completely fix task-list checkbox styling (#10798)
+  * Hide gear icon for user who can't use them on sidebar (#10750)
+  * Refactor Cron and merge dashboard tasks (#10745)
+  * Change review status icons on pr view style to github style (#10737)
+  * Make pagination optional for API list notification endpoints (#10714)
+  * Fix tab indentation in code view (#10671)
+  * Fix task-list checkbox styling (#10668)
+  * Multiple LFS improvements (#10667)
+  * Make PR message on pushes configurable (#10664)
+  * Move dropzone.js to npm/webpack (#10645)
+  * Ensure Update button is enabled even when CI has failed (#10640)
+  * Add restricted user filter to LDAP authentication (#10600)
+  * Add Yandex OAuth2 provider (#8335) (#10564)
+  * Make avatar lookup occur at image request (#10540)
+  * Prevent accidential selection of language stats bar (#10537)
+  * Add fluid-icon (#10491)
+  * Inform participants on UI too (#10473)
+  * Build with go 1.14 (and raise minimum go version to 1.12) (#10467)
+  * Add max-file-size to LFS (#10463)
+  * Enable paggination for ListRepoTags API (#10454)
+  * Update JS dependencies (#10450)
+  * Show the username as a fallback on feeds if full name is blank (#10438)
+  * Various dark theme fixes (#10416)
+  * Display pull request head branch even the branch deleted or repository deleted (#10413)
+  * Prevent Firefox from using apple-touch-icon (#10402)
+  * Fix input[type=file] on dark theme (#10382)
+  * Improve mobile review-box sizing (#10297)
+  * Notification: queue ui.go notification-service (#10281)
+  * Add detected file language to code search (#10256)
+  * Index code and stats only for non-empty repositories (#10251)
+  * Add Approval Counts to pulls list (#10238)
+  * Limit label list height on edit issue page (#10216)
+  * Improve 404 error message (#10214)
+  * Tweak locale to respect singular conflicting file message in PR list (#10177)
+  * Fix commit view (#10169)
+  * Reorganize frontend files and tooling (#10168)
+  * Allow emoji on popup label (#10166)
+  * ListIssues add filter for milestones API (#10148)
+  * Show if a PR has conflicting files on the PR lists (#10130)
+  * Fix inconsistent label color format in API (#10129)
+  * Show download count info in release list (#10124)
+  * Add Octicon SVG spritemap (#10107)
+  * Update aria-fixed semantic-dropdown to fomantic master (#10096)
+  * Fix apple-touch-icon, regenerate images (#10065)(#10006)
+  * Style blockquote for default issue mail template (#10024)
+  * More expansions in template repositories (#10021)
+  * Allow list collaborators for users with Read access to repo (#9995)
+  * Add explicit dimensions to navbar avatar (#9986)
+  * Remove loadCSS and preload woff2 icon fonts (#9976)
+  * Fix commit view JS features, reimplement folding (#9968)
+  * Fix review avatar image (#9962)
+  * Improve notification pager (#9821)
+  * Move jquery and jquery-migrate to npm/webpack (#9813)
+  * Change font to Roboto to support more charsets (#9803)
+  * Move mailer to use a queue (#9789)
+  * Issue search on my related repositories (#9758)
+  * Add "before" query to ListIssueComments and ListRepoIssueComments API (#9685)
+  * Move tracked time api convert to convert package (#9665)
+  * Improve PR info in default merge message (#9635)
+  * Granular webhook events (#9626)
+  * Add Reviewed-on in commit message (#9623)
+  * Add top author stats to activity page (#9615)
+  * Allow repo admin to merge PR regardless of review status (#9611)
+  * Migrate reactions when migrating repository from github (#9599)
+  * API orgEditTeam make Fields optional (#9556)
+  * Move create/fork repository from models to modules/repository (#9489)
+  * Migrate reviews when migrating repository from github (#9463)
+  * Times API add filters (#9373)
+  * Move push commits from models to modules/repository (#9370)
+  * Add API endpoint to check notifications [Extend #9488] (#9595)
+  * Add GET /orgs API endpoint (#9560)
+  * API add/generalize pagination (#9452)
+  * Make create org repo API call same as github (#9186)
+* BUILD
+  * Turn off go modules for xgo and gxz (#10963)
+  * Add gitea-vet (#10948)
+  * Rename scripts to build and add revive command as a new build tool command (#10942)
+  * Add 'make lint', restructure 'compliance' pipeline (#10861)
+  * Move JS build dependencies to 'dependencies' (#10763)
+  * Use whitelist to find go files, run find only once (#10594)
+  * Move vue and vue-calendar-heatmap to npm/webpack (#10188)
+  * Move jquery.are-you-sure to npm/webpack (#10063)
+  * Move highlight.js to npm/webpack (#10011)
+  * Generate Bindata if TAGS="bindata" and not up-to-date (#10004)
+  * Move CSS build to webpack (#9983)
+  * Move fomantic target, update 'make help' (#9945)
+  * Add css extraction and minification to webpack (#9944)
+  * Misc webpack tweaks (#9924)
+  * Make node_modules a order-only prerequisite (#9923)
+  * Update documentation for the go module era (#9751)
+  * Move swagger-ui to webpack/npm and update it to 3.24.3 (#9714)
+  * Use npm to manage fomantic and only build needed components (#9561)
+* MISC
+  * Add gnupg to Dockerfile (#11365)
+  * Update snapcraft.yaml for core18 and latest features (#11300)
+  * Update JS dependencies, min Node.js version 10.13 (#11246)
+  * Change default charset for MySQL on install to utf8mb4 (#10989)
+  * Return issue subscription status from API subscribe (#10966)
+  * Fix queue log param (#10733)
+  * Add warning when using relative path to app.ini (#10104)
+
 ## [1.11.5](https://github.com/go-gitea/gitea/releases/tag/v1.11.5) - 2020-05-09
 
 * BUGFIXES

From 1aa6176bd82a938a01e838f801ef7ea63a682edb Mon Sep 17 00:00:00 2001
From: Lauris BH 
Date: Mon, 18 May 2020 19:14:28 +0300
Subject: [PATCH 005/192] MySQL instance is needed for all triggers (#11484)

---
 .drone.yml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 1e981c4c16..a18839a499 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -105,10 +105,6 @@ services:
         from_secret: gitlab_read_token
     depends_on:
       - build
-    when:
-      event:
-        - push
-        - pull_request
 
   - name: mysql8
     pull: default

From 1547ce5669595db5b5894307d0bb33640ecdf137 Mon Sep 17 00:00:00 2001
From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Date: Tue, 19 May 2020 07:59:07 +0200
Subject: [PATCH 006/192] Fix top margin for bottom attached header (#11480)
 (#11485)

* Fix top margin for bottom attached header (#11480)

(cherry picked from commit 6b798feaf6bb59ba32273d13755a11d3dcefaddc)

* restart ci

Co-authored-by: Lauris BH 
---
 web_src/less/_base.less | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index de8655bd20..de722bdf22 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -1234,7 +1234,7 @@ i.icon.centerlock {
 }
 
 /* https://github.com/go-gitea/gitea/issues/10210 */
-.ui.attached.segment ~ .ui.attached.header {
+.ui.attached.segment ~ .ui.top.attached.header {
     margin-top: 1rem;
 }
 

From 1197512b2b5ec92ad8a2b506bb45b8d31595e04c Mon Sep 17 00:00:00 2001
From: 6543 <6543@obermui.de>
Date: Tue, 19 May 2020 15:03:10 +0200
Subject: [PATCH 007/192] Make localstorage read ssh or https correctly
 (#11483) (#11490)

* Make localstorage read ssh or https correctly

* Update index.js

If not login there is only a "https" button, This commit fix  the "https" button hasn't blue border.

* Keep user selected whether or not to log in

* Update index.js

Co-authored-by: L0veSunshine 
Co-authored-by: zeripath 
---
 web_src/js/index.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/web_src/js/index.js b/web_src/js/index.js
index f7b4ef24d8..b808812372 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1109,8 +1109,10 @@ async function initRepository() {
     $('.clone-url').text($(this).data('link'));
     $('#repo-clone-url').val($(this).data('link'));
     $(this).addClass('blue');
-    $('#repo-clone-ssh').removeClass('blue');
-    localStorage.setItem('repo-clone-protocol', 'https');
+    if ($('#repo-clone-ssh').length > 0) {
+      $('#repo-clone-ssh').removeClass('blue');
+      localStorage.setItem('repo-clone-protocol', 'https');
+    }
   });
   $('#repo-clone-url').on('click', function () {
     $(this).select();
@@ -2436,7 +2438,9 @@ $(document).ready(async () => {
   if ($('#repo-clone-url').length > 0) {
     switch (localStorage.getItem('repo-clone-protocol')) {
       case 'ssh':
-        if ($('#repo-clone-ssh').length === 0) {
+        if ($('#repo-clone-ssh').length > 0) {
+          $('#repo-clone-ssh').trigger('click');
+        } else {
           $('#repo-clone-https').trigger('click');
         }
         break;

From c1ba480a7a4a8bdbb9f3bcb2036037a1221475d1 Mon Sep 17 00:00:00 2001
From: silverwind 
Date: Wed, 20 May 2020 00:02:25 +0200
Subject: [PATCH 008/192] Tweak reaction buttons (#11496) (#11516)

- Vertical centering using flexbox
- Very slightly decreased size of the boxes

Co-authored-by: zeripath 
Co-authored-by: techknowlogick 

Co-authored-by: zeripath 
Co-authored-by: techknowlogick 
---
 web_src/less/_repository.less | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index 148d65e717..38f9e115c8 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -2197,9 +2197,12 @@
         padding: 0;
         display: flex;
 
-        .ui.label {
+        .ui.label,
+        .ui.label.visible {
             max-height: 40px;
-            padding: 9px 15px 7px;
+            padding: .4rem .8rem;
+            display: flex !important;
+            align-items: center;
             border: 0;
             border-right: 1px solid;
             border-radius: 0;
@@ -2220,20 +2223,17 @@
         }
 
         .reaction-count {
-            margin-left: 4px;
+            margin-left: .5rem;
         }
 
         .select-reaction {
-            float: left;
-            padding: .6em;
-            line-height: 21px;
+            display: flex;
+            align-items: center;
+            padding: .5rem;
 
             &:not(.active) a {
                 display: none;
             }
-            > svg {
-                vertical-align: middle;
-            }
         }
 
         &:hover .select-reaction a {

From b67eafbc21d82956b122acbd7b6aa6882cecef5a Mon Sep 17 00:00:00 2001
From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Date: Wed, 20 May 2020 04:50:48 +0200
Subject: [PATCH 009/192] Use more toned colors for selected line (#11493)
 (#11511)

Co-authored-by: zeripath 
(cherry picked from commit 7b66400f55779e5af3704403e605abb025a9002d)

Co-authored-by: techknowlogick 
---
 web_src/less/_base.less                  | 2 +-
 web_src/less/themes/theme-arc-green.less | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index de722bdf22..823ad151d3 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -1177,7 +1177,7 @@ i.icon.centerlock {
     }
 
     .lines-code .active {
-        background: #fff866;
+        background: #fff6af;
     }
 }
 
diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less
index 4977ed0fc8..0a468d047c 100644
--- a/web_src/less/themes/theme-arc-green.less
+++ b/web_src/less/themes/theme-arc-green.less
@@ -1138,7 +1138,7 @@ td.blob-excerpt {
 }
 
 .lines-code .code-view .active {
-    background: #554a00;
+    background: #534d1b;
 }
 
 a.ui.label:hover,

From 09cc6392f6320560e805bd50f99ccd85cda9319c Mon Sep 17 00:00:00 2001
From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Date: Wed, 20 May 2020 18:15:34 +0200
Subject: [PATCH 010/192] Fix selected line color in arc-green (#11492)
 (#11520)

Co-authored-by: techknowlogick 
(cherry picked from commit 6da87eda8bcfca49a008c07f7e3cff001df921bf)
---
 web_src/less/themes/theme-arc-green.less | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less
index 0a468d047c..eabbe30a34 100644
--- a/web_src/less/themes/theme-arc-green.less
+++ b/web_src/less/themes/theme-arc-green.less
@@ -1137,7 +1137,7 @@ td.blob-excerpt {
     background-color: rgba(0, 0, 0, .15);
 }
 
-.lines-code .code-view .active {
+.code-view .lines-code .active {
     background: #534d1b;
 }
 

From c83bc55b523251c0891a014155d0948f193e6f38 Mon Sep 17 00:00:00 2001
From: zeripath 
Date: Wed, 20 May 2020 20:42:03 +0100
Subject: [PATCH 011/192] TrimSpace when reading InternalToken from a file
 (#11502) (#11524)

InternalTokens are fixed as alphanum strings therefore TrimSpace from these.
Also use isatty to not add a terminal newline when redirecting generate.

Fix #11498

Signed-off-by: Andrew Thornton 

Co-authored-by: Lauris BH 

Co-authored-by: Lauris BH 
---
 cmd/generate.go            | 23 ++++++++++++++++++++---
 modules/setting/setting.go |  2 +-
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/cmd/generate.go b/cmd/generate.go
index 4e91b1d3f0..13a99c94f4 100644
--- a/cmd/generate.go
+++ b/cmd/generate.go
@@ -7,9 +7,11 @@ package cmd
 
 import (
 	"fmt"
+	"os"
 
 	"code.gitea.io/gitea/modules/generate"
 
+	"github.com/mattn/go-isatty"
 	"github.com/urfave/cli"
 )
 
@@ -59,7 +61,12 @@ func runGenerateInternalToken(c *cli.Context) error {
 		return err
 	}
 
-	fmt.Printf("%s\n", internalToken)
+	fmt.Printf("%s", internalToken)
+
+	if isatty.IsTerminal(os.Stdout.Fd()) {
+		fmt.Printf("\n")
+	}
+
 	return nil
 }
 
@@ -69,7 +76,12 @@ func runGenerateLfsJwtSecret(c *cli.Context) error {
 		return err
 	}
 
-	fmt.Printf("%s\n", JWTSecretBase64)
+	fmt.Printf("%s", JWTSecretBase64)
+
+	if isatty.IsTerminal(os.Stdout.Fd()) {
+		fmt.Printf("\n")
+	}
+
 	return nil
 }
 
@@ -79,6 +91,11 @@ func runGenerateSecretKey(c *cli.Context) error {
 		return err
 	}
 
-	fmt.Printf("%s\n", secretKey)
+	fmt.Printf("%s", secretKey)
+
+	if isatty.IsTerminal(os.Stdout.Fd()) {
+		fmt.Printf("\n")
+	}
+
 	return nil
 }
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index ede4687c81..9507d46930 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -1069,7 +1069,7 @@ func loadInternalToken(sec *ini.Section) string {
 			return token
 		}
 
-		return string(buf)
+		return strings.TrimSpace(string(buf))
 	default:
 		log.Fatal("Unsupported URI-Scheme %q (INTERNAL_TOKEN_URI = %q)", tempURI.Scheme, uri)
 	}

From 034492384b739863363ea1651702e09ab6e2a0ed Mon Sep 17 00:00:00 2001
From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Date: Thu, 21 May 2020 07:53:10 +0200
Subject: [PATCH 012/192] Fix margin for branch-update grid on PR view when
 update button is not present (#11521) (#11525)

* Fix margin for branch-update grid on PR view when update button is not present

* Move padding to row element

Co-authored-by: techknowlogick 
(cherry picked from commit ee4e8542c7dddafe8ed110f6ec0bb9f730a63b0a)

Co-authored-by: techknowlogick 
---
 web_src/less/_repository.less | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index 38f9e115c8..3f014103c8 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -648,13 +648,10 @@
                 }
                 .branch-update.grid {
                     .row {
-                        padding-bottom: 0;
+                        padding-bottom: 1rem;
                         .icon {
                             margin-top: 1.1rem;
                         }
-                        .ui.button {
-                            margin-bottom: 1rem;
-                        }
                     }
                 }
             }

From 8525a4858107ec39a063c3d793f17b516909be15 Mon Sep 17 00:00:00 2001
From: zeripath 
Date: Thu, 21 May 2020 14:23:20 +0100
Subject: [PATCH 013/192] Fix repo-list private and total count bugs (#11500)
 (#11532)

* Fix repo-list private and total count bugs

Signed-off-by: Andrew Thornton 

* Ensure limited and private org public repos are displayed on "private"

Signed-off-by: Andrew Thornton 

* switch from onlyPrivate to is_private

Signed-off-by: Andrew Thornton 

* Generate swagger

Signed-off-by: Andrew Thornton 

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

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
---
 models/repo_list.go                    | 16 +++-----
 routers/api/v1/repo/repo.go            |  9 +++--
 templates/swagger/v1_json.tmpl         |  4 +-
 templates/user/dashboard/repolist.tmpl |  2 +-
 web_src/js/index.js                    | 54 ++++----------------------
 5 files changed, 23 insertions(+), 62 deletions(-)

diff --git a/models/repo_list.go b/models/repo_list.go
index 3e580a7229..dea88d8816 100644
--- a/models/repo_list.go
+++ b/models/repo_list.go
@@ -140,10 +140,13 @@ type SearchRepoOptions struct {
 	PriorityOwnerID int64
 	OrderBy         SearchOrderBy
 	Private         bool // Include private repositories in results
-	OnlyPrivate     bool // Include only private repositories in results
 	StarredByID     int64
 	AllPublic       bool // Include also all public repositories of users and public organisations
 	AllLimited      bool // Include also all public repositories of limited organisations
+	// None -> include public and private
+	// True -> include just private
+	// False -> incude just public
+	IsPrivate util.OptionalBool
 	// None -> include collaborative AND non-collaborative
 	// True -> include just collaborative
 	// False -> incude just non-collaborative
@@ -221,15 +224,8 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
 				))))
 	}
 
-	if opts.OnlyPrivate {
-		cond = cond.And(
-			builder.Or(
-				builder.Eq{"is_private": true},
-				builder.In("owner_id", builder.Select("id").From("`user`").Where(
-					builder.And(
-						builder.Eq{"type": UserTypeOrganization},
-						builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
-					)))))
+	if opts.IsPrivate != util.OptionalBoolNone {
+		cond = cond.And(builder.Eq{"is_private": opts.IsPrivate.IsTrue()})
 	}
 
 	if opts.Template != util.OptionalBoolNone {
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index a724ebcc37..e5055daa2b 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -78,9 +78,9 @@ func Search(ctx *context.APIContext) {
 	//   in: query
 	//   description: include private repositories this user has access to (defaults to true)
 	//   type: boolean
-	// - name: onlyPrivate
+	// - name: is_private
 	//   in: query
-	//   description: only include private repositories this user has access to (defaults to false)
+	//   description: show only pubic, private or all repositories (defaults to all)
 	//   type: boolean
 	// - name: template
 	//   in: query
@@ -133,7 +133,6 @@ func Search(ctx *context.APIContext) {
 		TopicOnly:          ctx.QueryBool("topic"),
 		Collaborate:        util.OptionalBoolNone,
 		Private:            ctx.IsSigned && (ctx.Query("private") == "" || ctx.QueryBool("private")),
-		OnlyPrivate:        ctx.IsSigned && ctx.QueryBool("onlyPrivate"),
 		Template:           util.OptionalBoolNone,
 		StarredByID:        ctx.QueryInt64("starredBy"),
 		IncludeDescription: ctx.QueryBool("includeDesc"),
@@ -169,6 +168,10 @@ func Search(ctx *context.APIContext) {
 		opts.Archived = util.OptionalBoolOf(ctx.QueryBool("archived"))
 	}
 
+	if ctx.Query("is_private") != "" {
+		opts.IsPrivate = util.OptionalBoolOf(ctx.QueryBool("is_private"))
+	}
+
 	var sortMode = ctx.Query("sort")
 	if len(sortMode) > 0 {
 		var sortOrder = ctx.Query("order")
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index a6b24ed970..b7fa714a64 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -1771,8 +1771,8 @@
           },
           {
             "type": "boolean",
-            "description": "only include private repositories this user has access to (defaults to false)",
-            "name": "onlyPrivate",
+            "description": "show only pubic, private or all repositories (defaults to all)",
+            "name": "is_private",
             "in": "query"
           },
           {
diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl
index dc1507403c..93dda77d24 100644
--- a/templates/user/dashboard/repolist.tmpl
+++ b/templates/user/dashboard/repolist.tmpl
@@ -101,7 +101,7 @@