Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/go-gitea/gitea into comme…
Browse files Browse the repository at this point in the history
…nt_line
  • Loading branch information
metiftikci committed Nov 22, 2019
2 parents f44022f + cbd2beb commit 4799253
Show file tree
Hide file tree
Showing 64 changed files with 1,289 additions and 1,058 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/public/js/semantic.dropdown.custom.js
/web_src/js/vendor/**
/web_src/js/semanticDropdown.js
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ globals:
Vue: false

rules:
arrow-body-style: [0]
camelcase: [0]
comma-dangle: [2, only-multiline]
consistent-return: [0]
default-case: [0]
func-names: [0]
import/extensions: [0]
max-len: [0]
newline-per-chained-call: [0]
arrow-body-style: [0]
no-alert: [0]
no-continue: [0]
no-mixed-operators: [0]
Expand Down
3 changes: 2 additions & 1 deletion cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ func runWeb(ctx *cli.Context) error {
log.Critical("Failed to start server: %v", err)
}
log.Info("HTTP Listener: %s Closed", listenAddr)
graceful.WaitForServers()
graceful.Manager.WaitForServers()
graceful.Manager.WaitForTerminate()
log.Close()
return nil
}
6 changes: 2 additions & 4 deletions cmd/web_graceful.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !windows

// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
Expand Down Expand Up @@ -27,11 +25,11 @@ func runHTTPSWithTLSConfig(listenAddr string, tlsConfig *tls.Config, m http.Hand

// NoHTTPRedirector tells our cleanup routine that we will not be using a fallback http redirector
func NoHTTPRedirector() {
graceful.InformCleanup()
graceful.Manager.InformCleanup()
}

// NoMainListener tells our cleanup routine that we will not be using a possibly provided listener
// for our main HTTP/HTTPS service
func NoMainListener() {
graceful.InformCleanup()
graceful.Manager.InformCleanup()
}
37 changes: 0 additions & 37 deletions cmd/web_windows.go

This file was deleted.

7 changes: 6 additions & 1 deletion custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ THEMES = gitea,arc-green
DEFAULT_SHOW_FULL_NAME = false
; Whether to search within description at repository search on explore page.
SEARCH_REPO_DESCRIPTION = true
; Whether to enable a Service Worker to cache frontend assets
USE_SERVICE_WORKER = true

[ui.admin]
; Number of users that are displayed on one page
Expand Down Expand Up @@ -287,6 +289,9 @@ ALLOW_GRACEFUL_RESTARTS = true
; shutting down. Force shutdown if this process takes longer than this delay.
; set to a negative value to disable
GRACEFUL_HAMMER_TIME = 60s
; Allows the setting of a startup timeout and waithint for Windows as SVC service
; 0 disables this.
STARTUP_TIMEOUT = 0
; Static resources, includes resources on custom/, public/ and all uploaded avatars web browser cache time, default is 6h
STATIC_CACHE_TIME = 6h

Expand Down Expand Up @@ -897,4 +902,4 @@ QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
; Max attempts per http/https request on migrations.
MAX_ATTEMPTS = 3
; Backoff time per http/https request retry (seconds)
RETRY_BACKOFF = 3
RETRY_BACKOFF = 3
6 changes: 4 additions & 2 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
- `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes
regardless of the value of `DEFAULT_THEME`.
- `DEFAULT_SHOW_FULL_NAME`: false: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
- `SEARCH_REPO_DESCRIPTION`: true: Whether to search within description at repository search on explore page.
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets.

### UI - Admin (`ui.admin`)

Expand Down Expand Up @@ -189,6 +190,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `LETSENCRYPT_EMAIL`: **email@example.com**: Email used by Letsencrypt to notify about problems with issued certificates. (No default)
- `ALLOW_GRACEFUL_RESTARTS`: **true**: Perform a graceful restart on SIGHUP
- `GRACEFUL_HAMMER_TIME`: **60s**: After a restart the parent process will stop accepting new connections and will allow requests to finish before stopping. Shutdown will be forced if it takes longer than this time.
- `STARTUP_TIMEOUT`: **0**: Shutsdown the server if startup takes longer than the provided time. On Windows setting this sends a waithint to the SVC host to tell the SVC host startup may take some time. Please note startup is determined by the opening of the listeners - HTTP/HTTPS/SSH. Indexers may take longer to startup and can have their own timeouts.

## Database (`database`)

Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/advanced/config-cheat-sheet.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ menu:

- `EXPLORE_PAGING_NUM`: 探索页面每页显示的仓库数量。
- `ISSUE_PAGING_NUM`: 工单页面每页显示的工单数量。
- `FEED_MAX_COMMIT_NUM`: 活动流页面显示的最大提交树木
- `FEED_MAX_COMMIT_NUM`: 活动流页面显示的最大提交数量

### UI - Admin (`ui.admin`)

Expand Down
8 changes: 5 additions & 3 deletions docs/content/doc/advanced/hacking-on-gitea.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,24 @@ make revive vet misspell-check

### Updating CSS

To generate the CSS, you will need [Node.js](https://nodejs.org/) 8.0 or greater with npm. At present we use [less](http://lesscss.org/) and [postcss](https://postcss.org) to generate our CSS. Do **not** edit the files in `public/css` directly, as they are generated from `lessc` from the files in `public/less`.
To generate the CSS, you need [Node.js](https://nodejs.org/) 8.0 or greater with npm. We use [less](http://lesscss.org/) and [postcss](https://postcss.org) to generate our CSS. Do **not** edit the files in `public/css` directly, as they are generated from `lessc` from the files in `public/less`.

Edit files in `public/less`, run the linter, regenerate the CSS and commit all changed files:
Edit files in `public/less`, and then run the linter and build the CSS files via:

```bash
make css
```

### Updating JS

To run the JavaScript linter you will need [Node.js](https://nodejs.org/) 8.0 or greater with npm. Edit files in `public/js` and run the linter:
To generate the JS files, you need [Node.js](https://nodejs.org/) 8.0 or greater with npm. Edit files in `public/js`, run the linter and build the JS files via:

```bash
make js
```

Note: When working on frontend code, it is advisable to set `USE_SERVICE_WORKER` to `false` in `app.ini` which will prevent undesirable caching of frontend assets.

### Updating the API

When creating new API routes or modifying existing API routes, you **MUST**
Expand Down
1 change: 1 addition & 0 deletions docs/content/doc/features/comparison.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ _Symbols used in table:_
| Create new branches ||||||||
| Web code editor ||||||||
| Commit graph ||||||||
| Template Repositories | [](https://github.com/go-gitea/gitea/pull/8768) |||||||

#### Issue Tracker

Expand Down
3 changes: 3 additions & 0 deletions models/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func (pr *PullRequest) loadIssue(e Engine) (err error) {
}

pr.Issue, err = getIssueByID(e, pr.IssueID)
if err == nil {
pr.Issue.PullRequest = pr
}
return err
}

Expand Down
2 changes: 1 addition & 1 deletion models/repo_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func InitRepoIndexer() {
if setting.Indexer.StartupTimeout > 0 {
go func() {
timeout := setting.Indexer.StartupTimeout
if graceful.IsChild && setting.GracefulHammerTime > 0 {
if graceful.Manager.IsChild() && setting.GracefulHammerTime > 0 {
timeout += setting.GracefulHammerTime
}
select {
Expand Down
8 changes: 7 additions & 1 deletion modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,13 @@ func RetrieveTemplateRepo(ctx *Context, repo *models.Repository) {
return
}

if !repo.TemplateRepo.CheckUnitUser(ctx.User.ID, ctx.User.IsAdmin, models.UnitTypeCode) {
perm, err := models.GetUserRepoPermission(repo.TemplateRepo, ctx.User)
if err != nil {
ctx.ServerError("GetUserRepoPermission", err)
return
}

if !perm.CanRead(models.UnitTypeCode) {
repo.TemplateID = 0
}
}
Expand Down
40 changes: 0 additions & 40 deletions modules/graceful/cleanup.go

This file was deleted.

16 changes: 0 additions & 16 deletions modules/graceful/graceful_windows.go

This file was deleted.

Loading

0 comments on commit 4799253

Please sign in to comment.