Skip to content

Commit

Permalink
Merge branch 'main' into fix-blob-mount-access
Browse files Browse the repository at this point in the history
  • Loading branch information
KN4CK3R authored Jul 9, 2023
2 parents 7ca1af0 + 38844e0 commit c597031
Show file tree
Hide file tree
Showing 639 changed files with 9,379 additions and 5,199 deletions.
13 changes: 7 additions & 6 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ plugins:
- eslint-plugin-wc

env:
es2022: true
es2024: true
node: true

globals:
__webpack_public_path__: true

overrides:
- files: ["web_src/**/*"]
globals:
__webpack_public_path__: true
process: false # https://github.com/webpack/webpack/issues/15833
- files: ["web_src/**/*", "docs/**/*"]
env:
browser: true
Expand Down Expand Up @@ -155,7 +156,7 @@ rules:
import/no-restricted-paths: [0]
import/no-self-import: [2]
import/no-unassigned-import: [0]
import/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$"]}]
import/no-unresolved: [2, {commonjs: true, ignore: [\?.+$, ^vitest/]}]
import/no-unused-modules: [2, {unusedExports: true}]
import/no-useless-path-segments: [2, {commonjs: true}]
import/no-webpack-loader-syntax: [2]
Expand Down Expand Up @@ -692,7 +693,7 @@ rules:
unicorn/prefer-dom-node-remove: [2]
unicorn/prefer-dom-node-text-content: [2]
unicorn/prefer-event-target: [2]
unicorn/prefer-export-from: [2, {ignoreUsedVariables: true}]
unicorn/prefer-export-from: [0]
unicorn/prefer-includes: [2]
unicorn/prefer-json-parse-buffer: [0]
unicorn/prefer-keyboard-event-key: [2]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature Request
description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here!
labels: ["kind/feature", "kind/proposal"]
labels: ["kind/proposal"]
body:
- type: markdown
attributes:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/files-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
value: ${{ jobs.detect.outputs.templates }}
docker:
value: ${{ jobs.detect.outputs.docker }}
swagger:
value: ${{ jobs.detect.outputs.swagger }}

jobs:
detect:
Expand All @@ -27,6 +29,7 @@ jobs:
actions: ${{ steps.changes.outputs.actions }}
templates: ${{ steps.changes.outputs.templates }}
docker: ${{ steps.changes.outputs.docker }}
swagger: ${{ steps.changes.outputs.swagger }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
Expand All @@ -36,13 +39,15 @@ jobs:
backend:
- "**/*.go"
- "templates/**/*.tmpl"
- "assets/emoji.json"
- "go.mod"
- "go.sum"
- "Makefile"
frontend:
- "**/*.js"
- "web_src/**"
- "assets/emoji.json"
- "package.json"
- "package-lock.json"
- "Makefile"
Expand All @@ -63,3 +68,6 @@ jobs:
- "Dockerfile.rootless"
- "docker/**"
- "Makefile"
swagger:
- "templates/swagger/v1_json.tmpl"
12 changes: 12 additions & 0 deletions .github/workflows/pull-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ jobs:
- run: make deps-py
- run: make lint-templates

lint-swagger:
if: needs.files-changed.outputs.swagger == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-swagger

lint-go-windows:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
Expand Down
2 changes: 1 addition & 1 deletion .stylelintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules:
declaration-no-important: null
declaration-property-max-values: null
declaration-property-unit-allowed-list: null
declaration-property-unit-disallowed-list: null
declaration-property-unit-disallowed-list: {line-height: [em]}
declaration-property-value-allowed-list: null
declaration-property-value-disallowed-list: null
declaration-property-value-no-unknown: true
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@ 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.19.4](https://github.com/go-gitea/gitea/releases/tag/v1.19.4) - 2023-07-04

* SECURITY
* Fix open redirect check for more cases (#25143) (#25155)
* API
* Return `404` in the API if the requested webhooks were not found (#24823) (#24830)
* Fix `organization` field being `null` in `GET /api/v1/teams/{id}` (#24694) (#24696)
* ENHANCEMENTS
* Set `--font-weight-bold` to 600 (#24840)
* Make mailer SMTP check have timed context (#24751) (#24759)
* Do not select line numbers when selecting text from the action run logs (#24594) (#24596)
* BUGFIXES
* Fix bug when change user name (#25637) (#25645)
* Fix task list checkbox toggle to work with YAML front matter (#25184) (#25236)
* Hide limited users if viewed by anonymous ghost (#25214) (#25224)
* Add `WithPullRequest` for `actionsNotifier` (#25144) (#25196)
* Fix parallelly generating index failure with Mysql (#24567) (#25081)
* GitLab migration: Sanitize response for reaction list (#25054) (#25059)
* Fix users cannot visit issue attachment bug (#25019) (#25027)
* Fix missing reference prefix of commits when sync mirror repository (#24994)
* Only validate changed columns when update user (#24867) (#24903)
* Make DeleteIssue use correct context (#24885)
* Fix topics deleted via API not being deleted in org page (#24825) (#24829)
* Fix Actions being enabled accidentally (#24802) (#24810)
* Fix missed table name on iterate lfs meta objects (#24768) (#24774)
* Fix safari cookie session bug (#24772)
* Respect original content when creating secrets (#24745) (#24746)
* Fix Pull Mirror out-of-sync bugs (#24732) (#24733)
* Fix run list broken when trigger user deleted (#24706) (#24709)
* Fix issues list page multiple selection update milestones (#24660) (#24663)
* Fix: release page for empty or non-existing target (#24659)
* Fix close org projects (#24588) (#24591)
* Refresh the refernce of the closed PR when reopening (#24231) (#24587)
* Fix the permission of team's `Actions` unit issue (#24536) (#24545)
* Bump go.etcd.io/bbolt and blevesearch deps (#23062) (#24519)
* Fix new wiki page mirror (#24518)
* Match unqualified references when syncing pulls as well (#23070)
* DOCS
* Change branch name from master to main in some documents' links (#25126) (#25139)
* Remove unnecessary content on docs (#24976) (#25001)
* Unify doc links to use paths relative to doc folder (#24979) (#25000)
* Fix docs documenting invalid `@every` for `OLDER_THAN` cron settings (#24695) (#24698)
* MISC
* Merge different languages for language stats (#24900) (#24921)
* Hiding Secrets options when Actions feature is disabled (#24792)
* Improve decryption failure message (#24573) (#24575)
* Makefile: Use portable !, not GNUish -not, with find(1). (#24565) (#24572)

## [1.19.3](https://github.com/go-gitea/gitea/releases/tag/1.19.3) - 2023-05-03

* SECURITY
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ Xinyi Gong <[email protected]> (@HesterG)
wxiaoguang <[email protected]> (@wxiaoguang)
Gary Moon <[email protected]> (@garymoon)
Philip Peterson <[email protected]> (@philip-peterson)
Denys Konovalov <[email protected]> (@denyskon)
Punit Inani <[email protected]> (@puni9869)
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ help:
@echo " - test-frontend test frontend files"
@echo " - test-backend test backend files"
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
@echo " - update-js update js dependencies"
@echo " - update-py update py dependencies"
@echo " - webpack build webpack files"
@echo " - svg build svg files"
@echo " - fomantic build fomantic files"
Expand Down Expand Up @@ -358,10 +360,10 @@ lint: lint-frontend lint-backend
lint-fix: lint-frontend-fix lint-backend-fix

.PHONY: lint-frontend
lint-frontend: lint-js lint-css lint-md lint-swagger
lint-frontend: lint-js lint-css

.PHONY: lint-frontend-fix
lint-frontend-fix: lint-js-fix lint-css-fix lint-md lint-swagger
lint-frontend-fix: lint-js-fix lint-css-fix

.PHONY: lint-backend
lint-backend: lint-go lint-go-vet lint-editorconfig
Expand Down Expand Up @@ -924,13 +926,20 @@ node_modules: package-lock.json
poetry install
@touch .venv

.PHONY: npm-update
npm-update: node-check | node_modules
npx updates -cu
.PHONY: update-js
update-js: node-check | node_modules
npx updates -u -f package.json
rm -rf node_modules package-lock.json
npm install --package-lock
@touch node_modules

.PHONY: update-py
update-py: node-check | node_modules
npx updates -u -f pyproject.toml
rm -rf .venv poetry.lock
poetry install
@touch .venv

.PHONY: fomantic
fomantic:
rm -rf $(FOMANTIC_WORK_DIR)/build
Expand Down
2 changes: 1 addition & 1 deletion assets/emoji.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/code-batch-process.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

var optionLogVerbose bool

func logVerbose(msg string, args ...interface{}) {
func logVerbose(msg string, args ...any) {
if optionLogVerbose {
log.Printf(msg, args...)
}
Expand Down
2 changes: 1 addition & 1 deletion build/generate-emoji.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

const (
gemojiURL = "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
maxUnicodeVersion = 14
maxUnicodeVersion = 15
)

var flagOut = flag.String("o", "modules/emoji/emoji_data.go", "out")
Expand Down
6 changes: 3 additions & 3 deletions cmd/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
},
}

func publicKey(priv interface{}) interface{} {
func publicKey(priv any) any {
switch k := priv.(type) {
case *rsa.PrivateKey:
return &k.PublicKey
Expand All @@ -74,7 +74,7 @@ func publicKey(priv interface{}) interface{} {
}
}

func pemBlockForKey(priv interface{}) *pem.Block {
func pemBlockForKey(priv any) *pem.Block {
switch k := priv.(type) {
case *rsa.PrivateKey:
return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)}
Expand All @@ -94,7 +94,7 @@ func runCert(c *cli.Context) error {
return err
}

var priv interface{}
var priv any
var err error
switch c.String("ecdsa-curve") {
case "":
Expand Down
18 changes: 17 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,21 @@ func setupConsoleLogger(level log.Level, colorize bool, out io.Writer) {
WriterOption: log.WriterConsoleOption{Stderr: out == os.Stderr},
}
writer := log.NewEventWriterConsole("console-default", writeMode)
log.GetManager().GetLogger(log.DEFAULT).RemoveAllWriters().AddWriters(writer)
log.GetManager().GetLogger(log.DEFAULT).ReplaceAllWriters(writer)
}

// PrepareConsoleLoggerLevel by default, use INFO level for console logger, but some sub-commands (for git/ssh protocol) shouldn't output any log to stdout.
// Any log appears in git stdout pipe will break the git protocol, eg: client can't push and hangs forever.
func PrepareConsoleLoggerLevel(defaultLevel log.Level) func(*cli.Context) error {
return func(c *cli.Context) error {
level := defaultLevel
if c.Bool("quiet") || c.GlobalBoolT("quiet") {
level = log.FATAL
}
if c.Bool("debug") || c.GlobalBool("debug") || c.Bool("verbose") || c.GlobalBool("verbose") {
level = log.TRACE
}
log.SetConsoleLogger(log.DEFAULT, "console-default", level)
return nil
}
}
2 changes: 1 addition & 1 deletion cmd/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func setupDoctorDefaultLogger(ctx *cli.Context, colorize bool) {
log.FallbackErrorf("unable to create file log writer: %v", err)
return
}
log.GetManager().GetLogger(log.DEFAULT).RemoveAllWriters().AddWriters(writer)
log.GetManager().GetLogger(log.DEFAULT).ReplaceAllWriters(writer)
}
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
},
}

func fatal(format string, args ...interface{}) {
func fatal(format string, args ...any) {
fmt.Fprintf(os.Stderr, format+"\n", args...)
log.Fatal(format, args...)
}
Expand Down Expand Up @@ -236,7 +236,7 @@ func runDump(ctx *cli.Context) error {
return err
}

var iface interface{}
var iface any
if fileName == "-" {
iface, err = archiver.ByExtension(fmt.Sprintf(".%s", outType))
} else {
Expand Down
4 changes: 2 additions & 2 deletions cmd/embedded.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"github.com/urfave/cli"
)

// Cmdembedded represents the available extract sub-command.
// CmdEmbedded represents the available extract sub-command.
var (
Cmdembedded = cli.Command{
CmdEmbedded = cli.Command{
Name: "embedded",
Usage: "Extract embedded resources",
Description: "A command for extracting embedded resources, like templates and images",
Expand Down
2 changes: 2 additions & 0 deletions cmd/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
Expand All @@ -32,6 +33,7 @@ var (
Name: "hook",
Usage: "Delegate commands to corresponding Git hooks",
Description: "This should only be called by Git",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Subcommands: []cli.Command{
subcmdHookPreReceive,
subcmdHookUpdate,
Expand Down
2 changes: 2 additions & 0 deletions cmd/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"strings"

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"

"github.com/urfave/cli"
Expand All @@ -17,6 +18,7 @@ import (
var CmdKeys = cli.Command{
Name: "keys",
Usage: "This command queries the Gitea database to get the authorized command for a given ssh key fingerprint",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Action: runKeys,
Flags: []cli.Flag{
cli.StringFlag{
Expand Down
6 changes: 3 additions & 3 deletions cmd/manager_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func runAddConnLogger(c *cli.Context) error {
defer cancel()

setup(ctx, c.Bool("debug"))
vals := map[string]interface{}{}
vals := map[string]any{}
mode := "conn"
vals["net"] = "tcp"
if c.IsSet("protocol") {
Expand Down Expand Up @@ -208,7 +208,7 @@ func runAddFileLogger(c *cli.Context) error {
defer cancel()

setup(ctx, c.Bool("debug"))
vals := map[string]interface{}{}
vals := map[string]any{}
mode := "file"
if c.IsSet("filename") {
vals["filename"] = c.String("filename")
Expand Down Expand Up @@ -236,7 +236,7 @@ func runAddFileLogger(c *cli.Context) error {
return commonAddLogger(c, mode, vals)
}

func commonAddLogger(c *cli.Context, mode string, vals map[string]interface{}) error {
func commonAddLogger(c *cli.Context, mode string, vals map[string]any) error {
if len(c.String("level")) > 0 {
vals["level"] = log.LevelFromString(c.String("level")).String()
}
Expand Down
Loading

0 comments on commit c597031

Please sign in to comment.