Skip to content

Commit 996f3da

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix WEBP image copying (go-gitea#24743) Reorganize CSS files (go-gitea#24739) Don't run build and test if only docs changed (go-gitea#24530) [skip ci] Updated translations via Crowdin Rework Oauth login buttons, swap github logo to monocolor (go-gitea#24740) Implement systemd-notify protocol (go-gitea#21151) Bump vm2 from 3.9.17 to 3.9.18 (go-gitea#24742) Refactor Pull Mirror and fix out-of-sync bugs (go-gitea#24732) Unification of registration fields order (go-gitea#24737) Switch to `@eslint-community/eslint-comments` (go-gitea#24736) Docs for creating a user to run Gitea on Fedora/RHEL/CentOS (go-gitea#24725)
2 parents bda33ee + bdd3007 commit 996f3da

Some content is hidden

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

56 files changed

+668
-246
lines changed

.eslintrc.yaml

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ parserOptions:
99
ecmaVersion: latest
1010

1111
plugins:
12-
- eslint-plugin-unicorn
12+
- "@eslint-community/eslint-plugin-eslint-comments"
13+
- eslint-plugin-custom-elements
1314
- eslint-plugin-import
1415
- eslint-plugin-jquery
1516
- eslint-plugin-no-jquery
16-
- eslint-plugin-sonarjs
17-
- eslint-plugin-custom-elements
1817
- eslint-plugin-regexp
18+
- eslint-plugin-sonarjs
19+
- eslint-plugin-unicorn
1920
- eslint-plugin-wc
20-
- eslint-plugin-eslint-comments
2121

2222
env:
2323
es2022: true
@@ -45,6 +45,15 @@ overrides:
4545
import/no-unused-modules: [0]
4646

4747
rules:
48+
"@eslint-community/eslint-comments/disable-enable-pair": [2]
49+
"@eslint-community/eslint-comments/no-aggregating-enable": [2]
50+
"@eslint-community/eslint-comments/no-duplicate-disable": [2]
51+
"@eslint-community/eslint-comments/no-restricted-disable": [0]
52+
"@eslint-community/eslint-comments/no-unlimited-disable": [2]
53+
"@eslint-community/eslint-comments/no-unused-disable": [2]
54+
"@eslint-community/eslint-comments/no-unused-enable": [2]
55+
"@eslint-community/eslint-comments/no-use": [0]
56+
"@eslint-community/eslint-comments/require-description": [0]
4857
accessor-pairs: [2]
4958
array-bracket-newline: [0]
5059
array-bracket-spacing: [2, never]
@@ -87,15 +96,6 @@ rules:
8796
dot-notation: [0]
8897
eol-last: [2]
8998
eqeqeq: [2]
90-
eslint-comments/disable-enable-pair: [2]
91-
eslint-comments/no-aggregating-enable: [2]
92-
eslint-comments/no-duplicate-disable: [2]
93-
eslint-comments/no-restricted-disable: [0]
94-
eslint-comments/no-unlimited-disable: [2]
95-
eslint-comments/no-unused-disable: [2]
96-
eslint-comments/no-unused-enable: [2]
97-
eslint-comments/no-use: [0]
98-
eslint-comments/require-description: [0]
9999
for-direction: [2]
100100
func-call-spacing: [2, never]
101101
func-name-matching: [2]

.github/workflows/cron-licenses.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66

77
jobs:
88
cron-licenses:
9-
if: github.repository == "go-gitea/gitea"
109
runs-on: ubuntu-latest
10+
if: github.repository == 'go-gitea/gitea'
1111
steps:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-go@v3

.github/workflows/cron-lock.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515
jobs:
1616
action:
1717
runs-on: ubuntu-latest
18+
if: github.repository == 'go-gitea/gitea'
1819
steps:
1920
- uses: dessant/lock-threads@v4
2021
with:

.github/workflows/cron-translations.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
crowdin-pull:
99
runs-on: ubuntu-latest
10+
if: github.repository == 'go-gitea/gitea'
1011
steps:
1112
- uses: actions/checkout@v3
1213
- name: download from crowdin
@@ -31,6 +32,7 @@ jobs:
3132
ssh_key: ${{ secrets.DEPLOY_KEY }}
3233
crowdin-push:
3334
runs-on: ubuntu-latest
35+
if: github.repository == 'go-gitea/gitea'
3436
steps:
3537
- uses: actions/checkout@v3
3638
- name: push translations to crowdin
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: compliance
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- "*.md"
8+
9+
jobs:
10+
compliance-docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "No build required"

.github/workflows/pull-compliance.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: compliance
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "*.md"
48

59
concurrency:
610
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: db-tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- "*.md"
8+
9+
jobs:
10+
test-pgsql:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "No build required"
14+
15+
test-sqlite:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- run: echo "No build required"
19+
20+
test-unit:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- run: echo "No build required"
24+
25+
test-mysql5:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- run: echo "No build required"
29+
30+
test-mysql8:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- run: echo "No build required"
34+
35+
test-mssql:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- run: echo "No build required"

.github/workflows/pull-db-tests.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: db-tests
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "*.md"
48

59
concurrency:
610
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: docker-dryrun
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- "*.md"
8+
9+
jobs:
10+
docker-dryrun:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "No build required"

.github/workflows/pull-docker-dryrun.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: docker-dryrun
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "*.md"
48

59
concurrency:
610
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: e2e-tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- "*.md"
8+
9+
jobs:
10+
test-e2e:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "No build required"

.github/workflows/pull-e2e-tests.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: e2e-tests
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "*.md"
48

59
concurrency:
610
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.stylelintrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ignoreFiles:
55
- "**/*.go"
66

77
overrides:
8-
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console/*"]
8+
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console.css"]
99
rules:
1010
scale-unlimited/declaration-strict-value: null
1111
- files: ["**/chroma/*", "**/codemirror/*"]

contrib/systemd/gitea.service

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ After=network.target
5252
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
5353
# LimitNOFILE=524288:524288
5454
RestartSec=2s
55-
Type=simple
55+
Type=notify
5656
User=git
5757
Group=git
5858
WorkingDirectory=/var/lib/gitea/
@@ -62,6 +62,7 @@ WorkingDirectory=/var/lib/gitea/
6262
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
6363
Restart=always
6464
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
65+
WatchdogSec=30s
6566
# If you install Git to directory prefix other than default PATH (which happens
6667
# for example if you install other versions of Git side-to-side with
6768
# distribution version), uncomment below line and add that prefix to PATH

docs/content/doc/installation/from-binary.en-us.md

+12
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ git --version
8080
Create a user to run Gitea (e.g. `git`)
8181

8282
```sh
83+
# On Ubuntu/Debian:
8384
adduser \
8485
--system \
8586
--shell /bin/bash \
@@ -88,6 +89,17 @@ adduser \
8889
--disabled-password \
8990
--home /home/git \
9091
git
92+
93+
# On Fedora/RHEL/CentOS:
94+
groupadd --system git
95+
adduser \
96+
--system \
97+
--shell /bin/bash \
98+
--comment 'Git Version Control' \
99+
--gid git \
100+
--home-dir /home/git \
101+
--create-home \
102+
git
91103
```
92104

93105
### Create required directory structure

docs/content/doc/installation/from-binary.zh-cn.md

+12
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ git --version
7474
创建用户(推荐使用名称 `git`
7575

7676
```sh
77+
# On Ubuntu/Debian:
7778
adduser \
7879
--system \
7980
--shell /bin/bash \
@@ -82,6 +83,17 @@ adduser \
8283
--disabled-password \
8384
--home /home/git \
8485
git
86+
87+
# On Fedora/RHEL/CentOS:
88+
groupadd --system git
89+
adduser \
90+
--system \
91+
--shell /bin/bash \
92+
--comment 'Git Version Control' \
93+
--gid git \
94+
--home-dir /home/git \
95+
--create-home \
96+
git
8597
```
8698

8799
### 创建工作路径

models/repo/repo.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ type Repository struct {
149149
IsEmpty bool `xorm:"INDEX"`
150150
IsArchived bool `xorm:"INDEX"`
151151
IsMirror bool `xorm:"INDEX"`
152-
*Mirror `xorm:"-"`
153-
Status RepositoryStatus `xorm:"NOT NULL DEFAULT 0"`
152+
153+
Status RepositoryStatus `xorm:"NOT NULL DEFAULT 0"`
154154

155155
RenderingMetas map[string]string `xorm:"-"`
156156
DocumentRenderingMetas map[string]string `xorm:"-"`

modules/context/repo.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ type Repository struct {
6161
RepoLink string
6262
CloneLink repo_model.CloneLink
6363
CommitsCount int64
64-
Mirror *repo_model.Mirror
6564

6665
PullRequest *PullRequest
6766
}
@@ -380,13 +379,9 @@ func repoAssignment(ctx *Context, repo *repo_model.Repository) {
380379
ctx.Data["Permission"] = &ctx.Repo.Permission
381380

382381
if repo.IsMirror {
383-
ctx.Repo.Mirror, err = repo_model.GetMirrorByRepoID(ctx, repo.ID)
382+
pullMirror, err := repo_model.GetMirrorByRepoID(ctx, repo.ID)
384383
if err == nil {
385-
ctx.Repo.Mirror.Repo = repo
386-
ctx.Data["IsPullMirror"] = true
387-
ctx.Data["MirrorEnablePrune"] = ctx.Repo.Mirror.EnablePrune
388-
ctx.Data["MirrorInterval"] = ctx.Repo.Mirror.Interval
389-
ctx.Data["Mirror"] = ctx.Repo.Mirror
384+
ctx.Data["PullMirror"] = pullMirror
390385
} else if err != repo_model.ErrMirrorNotExist {
391386
ctx.ServerError("GetMirrorByRepoID", err)
392387
return

0 commit comments

Comments
 (0)