Skip to content

Commit 459c59c

Browse files
Merge branch 'master' into branch-protection-anyone
# Conflicts: # public/js/index.js # public/js/index.js.map
2 parents d48fcb4 + a4e398d commit 459c59c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1280
-1057
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/public/js/semantic.dropdown.custom.js
2-
/web_src/js/vendor/**
1+
/web_src/js/semanticDropdown.js

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ globals:
2525
Vue: false
2626

2727
rules:
28+
arrow-body-style: [0]
2829
camelcase: [0]
2930
comma-dangle: [2, only-multiline]
3031
consistent-return: [0]
3132
default-case: [0]
3233
func-names: [0]
34+
import/extensions: [0]
3335
max-len: [0]
3436
newline-per-chained-call: [0]
35-
arrow-body-style: [0]
3637
no-alert: [0]
3738
no-continue: [0]
3839
no-mixed-operators: [0]

cmd/web.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ func runWeb(ctx *cli.Context) error {
227227
log.Critical("Failed to start server: %v", err)
228228
}
229229
log.Info("HTTP Listener: %s Closed", listenAddr)
230-
graceful.WaitForServers()
230+
graceful.Manager.WaitForServers()
231+
graceful.Manager.WaitForTerminate()
231232
log.Close()
232233
return nil
233234
}

cmd/web_graceful.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build !windows
2-
31
// Copyright 2016 The Gitea Authors. All rights reserved.
42
// Use of this source code is governed by a MIT-style
53
// license that can be found in the LICENSE file.
@@ -27,11 +25,11 @@ func runHTTPSWithTLSConfig(listenAddr string, tlsConfig *tls.Config, m http.Hand
2725

2826
// NoHTTPRedirector tells our cleanup routine that we will not be using a fallback http redirector
2927
func NoHTTPRedirector() {
30-
graceful.InformCleanup()
28+
graceful.Manager.InformCleanup()
3129
}
3230

3331
// NoMainListener tells our cleanup routine that we will not be using a possibly provided listener
3432
// for our main HTTP/HTTPS service
3533
func NoMainListener() {
36-
graceful.InformCleanup()
34+
graceful.Manager.InformCleanup()
3735
}

cmd/web_windows.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

custom/conf/app.ini.sample

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ THEMES = gitea,arc-green
153153
DEFAULT_SHOW_FULL_NAME = false
154154
; Whether to search within description at repository search on explore page.
155155
SEARCH_REPO_DESCRIPTION = true
156+
; Whether to enable a Service Worker to cache frontend assets
157+
USE_SERVICE_WORKER = true
156158

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

@@ -897,4 +902,4 @@ QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
897902
; Max attempts per http/https request on migrations.
898903
MAX_ATTEMPTS = 3
899904
; Backoff time per http/https request retry (seconds)
900-
RETRY_BACKOFF = 3
905+
RETRY_BACKOFF = 3

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
118118
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
119119
- `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes
120120
regardless of the value of `DEFAULT_THEME`.
121-
- `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.
122-
- `SEARCH_REPO_DESCRIPTION`: true: Whether to search within description at repository search on explore page.
121+
- `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.
122+
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
123+
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets.
123124

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

@@ -189,6 +190,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
189190
- `LETSENCRYPT_EMAIL`: **[email protected]**: Email used by Letsencrypt to notify about problems with issued certificates. (No default)
190191
- `ALLOW_GRACEFUL_RESTARTS`: **true**: Perform a graceful restart on SIGHUP
191192
- `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.
193+
- `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.
192194

193195
## Database (`database`)
194196

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ menu:
3737

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

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

docs/content/doc/advanced/hacking-on-gitea.en-us.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,24 @@ make revive vet misspell-check
138138

139139
### Updating CSS
140140

141-
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`.
141+
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`.
142142

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

145145
```bash
146146
make css
147147
```
148148

149149
### Updating JS
150150

151-
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:
151+
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:
152152

153153
```bash
154154
make js
155155
```
156156

157+
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.
158+
157159
### Updating the API
158160

159161
When creating new API routes or modifying existing API routes, you **MUST**

models/pull.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ func (pr *PullRequest) loadIssue(e Engine) (err error) {
152152
}
153153

154154
pr.Issue, err = getIssueByID(e, pr.IssueID)
155+
if err == nil {
156+
pr.Issue.PullRequest = pr
157+
}
155158
return err
156159
}
157160

0 commit comments

Comments
 (0)