Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
zjjhot committed Sep 9, 2022
2 parents 3235109 + 86ed47e commit 6d0fc62
Show file tree
Hide file tree
Showing 27 changed files with 795 additions and 296 deletions.
3 changes: 0 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ steps:
- name: checks-backend
image: golang:1.19
commands:
- curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get -qqy install nodejs
- make checks-backend
environment:
DEBIAN_FRONTEND: noninteractive
depends_on: [deps-backend]
volumes:
- name: deps
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ tidy-check: tidy
.PHONY: go-licenses
go-licenses: assets/go-licenses.json

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

generate-ini-sqlite:
sed -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
Expand Down
578 changes: 364 additions & 214 deletions assets/go-licenses.json

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions build/generate-go-licenses.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright 2022 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.

//go:build ignore

package main

import (
"encoding/json"
"io/fs"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
)

// regexp is based on go-license, excluding README and NOTICE
// https://github.com/google/go-licenses/blob/master/licenses/find.go
var licenseRe = regexp.MustCompile(`^(?i)((UN)?LICEN(S|C)E|COPYING).*$`)

type LicenseEntry struct {
Name string `json:"name"`
Path string `json:"path"`
LicenseText string `json:"licenseText"`
}

func main() {
base, out := os.Args[1], os.Args[2]

paths := []string{}
err := filepath.WalkDir(base, func(path string, entry fs.DirEntry, err error) error {
if err != nil {
return err
}
if entry.IsDir() || !licenseRe.MatchString(entry.Name()) {
return nil
}
paths = append(paths, path)
return nil
})
if err != nil {
panic(err)
}

sort.Strings(paths)

entries := []LicenseEntry{}
for _, path := range paths {
licenseText, err := os.ReadFile(path)
if err != nil {
panic(err)
}

path := strings.Replace(path, base+string(os.PathSeparator), "", 1)

entries = append(entries, LicenseEntry{
Name: filepath.Dir(path),
Path: path,
LicenseText: string(licenseText),
})
}

jsonBytes, err := json.MarshalIndent(entries, "", " ")
if err != nil {
panic(err)
}

err = os.WriteFile(out, jsonBytes, 0o644)
if err != nil {
panic(err)
}
}
30 changes: 0 additions & 30 deletions build/generate-go-licenses.js

This file was deleted.

6 changes: 4 additions & 2 deletions docs/content/doc/advanced/logging-documentation.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ menu:

# Logging Configuration

The logging framework has been revamped in Gitea 1.9.0.

**Table of Contents**

{{< toc >}}

## Collecting Logs for Help

To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}).

## Log Groups

The fundamental thing to be aware of in Gitea is that there are several
Expand Down
6 changes: 4 additions & 2 deletions docs/content/doc/help/faq.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ Gitea requires the system or browser to have one of the supported Emoji fonts in

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

Similarly stdout on docker can be viewed using `docker logs <container>`
Similarly, stdout on docker can be viewed using `docker logs <container>`.

To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}).

## Initial logging

Expand All @@ -413,7 +415,7 @@ unchanged in the database schema. This may lead to warning such as:
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
```

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

```
gitea doctor recreate-table user
Expand Down
6 changes: 4 additions & 2 deletions docs/content/doc/help/seek-help.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ menu:

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

```ini
; To show all SQL logs, you can also set LOG_SQL=true in the [database] section
; To show all SQL logs, you can also set LOG_SQL=true in the [database] section
[log]
LEVEL=debug
MODE=console,file
Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/installation/windows-service.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Open "Windows Services", search for the service named "gitea", right-click it an
"Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port
that was configured).

## Adding startup dependancies
## Adding startup dependencies

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

```
sc.exe config gitea depend= mariadb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Possible file names for issue templates:
- `.gitea/ISSUE_TEMPLATE.yml`
- `.gitea/issue_template.md`
- `.gitea/issue_template.yaml`
- `.gitea/issue_template.md`
- `.gitea/issue_template.yml`
- `.github/ISSUE_TEMPLATE.md`
- `.github/ISSUE_TEMPLATE.yaml`
- `.github/ISSUE_TEMPLATE.yml`
Expand Down
Loading

0 comments on commit 6d0fc62

Please sign in to comment.