Skip to content

Commit 6d0fc62

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Make the vscode clone link respect transport protocol (go-gitea#20557) Fix typo of issue template name (go-gitea#21117) [skip ci] Updated translations via Crowdin Fix pagination limit parameter problem (go-gitea#21109) Rewrite go license generator in go (go-gitea#21078) Allow uppercase ASCII alphabet in PyPI package names (go-gitea#21095) Fix various typos (go-gitea#21103) Update docs issue-pull-request-templates.zh-cn.md (go-gitea#21030) Upgrade the document about how to collect logs for systemd and docker (go-gitea#21101)
2 parents 3235109 + 86ed47e commit 6d0fc62

File tree

27 files changed

+795
-296
lines changed

27 files changed

+795
-296
lines changed

.drone.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ steps:
9090
- name: checks-backend
9191
image: golang:1.19
9292
commands:
93-
- curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get -qqy install nodejs
9493
- make checks-backend
95-
environment:
96-
DEBIAN_FRONTEND: noninteractive
9794
depends_on: [deps-backend]
9895
volumes:
9996
- name: deps

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ tidy-check: tidy
422422
.PHONY: go-licenses
423423
go-licenses: assets/go-licenses.json
424424

425-
assets/go-licenses.json: go.mod go.sum build/generate-go-licenses.js
426-
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --save_path="$(GO_LICENSE_TMP_DIR)" 2>/dev/null
427-
node build/generate-go-licenses.js "$(GO_LICENSE_TMP_DIR)" "$(GO_LICENSE_FILE)"
428-
@rm -rf "$(GO_LICENSE_TMP_DIR)"
425+
assets/go-licenses.json: go.mod go.sum
426+
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
427+
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
428+
@rm -rf $(GO_LICENSE_TMP_DIR)
429429

430430
generate-ini-sqlite:
431431
sed -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \

assets/go-licenses.json

Lines changed: 364 additions & 214 deletions
Large diffs are not rendered by default.

build/generate-go-licenses.go

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Copyright 2022 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build ignore
6+
7+
package main
8+
9+
import (
10+
"encoding/json"
11+
"io/fs"
12+
"os"
13+
"path/filepath"
14+
"regexp"
15+
"sort"
16+
"strings"
17+
)
18+
19+
// regexp is based on go-license, excluding README and NOTICE
20+
// https://github.com/google/go-licenses/blob/master/licenses/find.go
21+
var licenseRe = regexp.MustCompile(`^(?i)((UN)?LICEN(S|C)E|COPYING).*$`)
22+
23+
type LicenseEntry struct {
24+
Name string `json:"name"`
25+
Path string `json:"path"`
26+
LicenseText string `json:"licenseText"`
27+
}
28+
29+
func main() {
30+
base, out := os.Args[1], os.Args[2]
31+
32+
paths := []string{}
33+
err := filepath.WalkDir(base, func(path string, entry fs.DirEntry, err error) error {
34+
if err != nil {
35+
return err
36+
}
37+
if entry.IsDir() || !licenseRe.MatchString(entry.Name()) {
38+
return nil
39+
}
40+
paths = append(paths, path)
41+
return nil
42+
})
43+
if err != nil {
44+
panic(err)
45+
}
46+
47+
sort.Strings(paths)
48+
49+
entries := []LicenseEntry{}
50+
for _, path := range paths {
51+
licenseText, err := os.ReadFile(path)
52+
if err != nil {
53+
panic(err)
54+
}
55+
56+
path := strings.Replace(path, base+string(os.PathSeparator), "", 1)
57+
58+
entries = append(entries, LicenseEntry{
59+
Name: filepath.Dir(path),
60+
Path: path,
61+
LicenseText: string(licenseText),
62+
})
63+
}
64+
65+
jsonBytes, err := json.MarshalIndent(entries, "", " ")
66+
if err != nil {
67+
panic(err)
68+
}
69+
70+
err = os.WriteFile(out, jsonBytes, 0o644)
71+
if err != nil {
72+
panic(err)
73+
}
74+
}

build/generate-go-licenses.js

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

docs/content/doc/advanced/logging-documentation.en-us.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ menu:
1515

1616
# Logging Configuration
1717

18-
The logging framework has been revamped in Gitea 1.9.0.
19-
2018
**Table of Contents**
2119

2220
{{< toc >}}
2321

22+
## Collecting Logs for Help
23+
24+
To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}).
25+
2426
## Log Groups
2527

2628
The fundamental thing to be aware of in Gitea is that there are several

docs/content/doc/help/faq.en-us.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,9 @@ Gitea requires the system or browser to have one of the supported Emoji fonts in
392392

393393
Stdout on systemd goes to the journal by default. Try using `journalctl`, `journalctl -u gitea`, or `journalctl <path-to-gitea-binary>`.
394394

395-
Similarly stdout on docker can be viewed using `docker logs <container>`
395+
Similarly, stdout on docker can be viewed using `docker logs <container>`.
396+
397+
To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}).
396398

397399
## Initial logging
398400

@@ -413,7 +415,7 @@ unchanged in the database schema. This may lead to warning such as:
413415
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0
414416
```
415417

416-
These can safely be ignored but you may able to stop these warnings by getting Gitea to recreate these tables using:
418+
These can safely be ignored, but you are able to stop these warnings by getting Gitea to recreate these tables using:
417419

418420
```
419421
gitea doctor recreate-table user

docs/content/doc/help/seek-help.en-us.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ menu:
2222

2323
1. Your `app.ini` (with any sensitive data scrubbed as necessary).
2424
2. The Gitea logs, and any other appropriate log files for the situation.
25-
- The logs are likely to be outputted to console. If you need to collect logs from files,
25+
- When using systemd, use `journalctl --lines 1000 --unit gitea` to collect logs.
26+
- When using docker, use `docker logs --tail 1000 <gitea-container>` to collect logs.
27+
- By default, the logs are outputted to console. If you need to collect logs from files,
2628
you could copy the following config into your `app.ini` (remove all other `[log]` sections),
2729
then you can find the `*.log` files in Gitea's log directory (default: `%(GITEA_WORK_DIR)/log`).
2830

2931
```ini
30-
; To show all SQL logs, you can also set LOG_SQL=true in the [database] section
32+
; To show all SQL logs, you can also set LOG_SQL=true in the [database] section
3133
[log]
3234
LEVEL=debug
3335
MODE=console,file

docs/content/doc/installation/windows-service.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Open "Windows Services", search for the service named "gitea", right-click it an
4949
"Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port
5050
that was configured).
5151

52-
## Adding startup dependancies
52+
## Adding startup dependencies
5353

54-
To add a startup dependancy to the Gitea Windows service (eg Mysql, Mariadb), as an Administrator, then run the following command:
54+
To add a startup dependency to the Gitea Windows service (eg Mysql, Mariadb), as an Administrator, then run the following command:
5555

5656
```
5757
sc.exe config gitea depend= mariadb

docs/content/doc/usage/issue-pull-request-templates.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Possible file names for issue templates:
4242
- `.gitea/ISSUE_TEMPLATE.yml`
4343
- `.gitea/issue_template.md`
4444
- `.gitea/issue_template.yaml`
45-
- `.gitea/issue_template.md`
45+
- `.gitea/issue_template.yml`
4646
- `.github/ISSUE_TEMPLATE.md`
4747
- `.github/ISSUE_TEMPLATE.yaml`
4848
- `.github/ISSUE_TEMPLATE.yml`

0 commit comments

Comments
 (0)