Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
zjjhot committed May 16, 2023
2 parents bda33ee + bdd3007 commit 996f3da
Show file tree
Hide file tree
Showing 56 changed files with 668 additions and 246 deletions.
26 changes: 13 additions & 13 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ parserOptions:
ecmaVersion: latest

plugins:
- eslint-plugin-unicorn
- "@eslint-community/eslint-plugin-eslint-comments"
- eslint-plugin-custom-elements
- eslint-plugin-import
- eslint-plugin-jquery
- eslint-plugin-no-jquery
- eslint-plugin-sonarjs
- eslint-plugin-custom-elements
- eslint-plugin-regexp
- eslint-plugin-sonarjs
- eslint-plugin-unicorn
- eslint-plugin-wc
- eslint-plugin-eslint-comments

env:
es2022: true
Expand Down Expand Up @@ -45,6 +45,15 @@ overrides:
import/no-unused-modules: [0]

rules:
"@eslint-community/eslint-comments/disable-enable-pair": [2]
"@eslint-community/eslint-comments/no-aggregating-enable": [2]
"@eslint-community/eslint-comments/no-duplicate-disable": [2]
"@eslint-community/eslint-comments/no-restricted-disable": [0]
"@eslint-community/eslint-comments/no-unlimited-disable": [2]
"@eslint-community/eslint-comments/no-unused-disable": [2]
"@eslint-community/eslint-comments/no-unused-enable": [2]
"@eslint-community/eslint-comments/no-use": [0]
"@eslint-community/eslint-comments/require-description": [0]
accessor-pairs: [2]
array-bracket-newline: [0]
array-bracket-spacing: [2, never]
Expand Down Expand Up @@ -87,15 +96,6 @@ rules:
dot-notation: [0]
eol-last: [2]
eqeqeq: [2]
eslint-comments/disable-enable-pair: [2]
eslint-comments/no-aggregating-enable: [2]
eslint-comments/no-duplicate-disable: [2]
eslint-comments/no-restricted-disable: [0]
eslint-comments/no-unlimited-disable: [2]
eslint-comments/no-unused-disable: [2]
eslint-comments/no-unused-enable: [2]
eslint-comments/no-use: [0]
eslint-comments/require-description: [0]
for-direction: [2]
func-call-spacing: [2, never]
func-name-matching: [2]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:

jobs:
cron-licenses:
if: github.repository == "go-gitea/gitea"
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cron-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:
jobs:
action:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: dessant/lock-threads@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cron-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
crowdin-pull:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v3
- name: download from crowdin
Expand All @@ -31,6 +32,7 @@ jobs:
ssh_key: ${{ secrets.DEPLOY_KEY }}
crowdin-push:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v3
- name: push translations to crowdin
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pull-compliance-docsignore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: compliance

on:
pull_request:
paths:
- "docs/**"
- "*.md"

jobs:
compliance-docs:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"
6 changes: 5 additions & 1 deletion .github/workflows/pull-compliance.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: compliance

on: [pull_request]
on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/pull-db-tests-docsignore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: db-tests

on:
pull_request:
paths:
- "docs/**"
- "*.md"

jobs:
test-pgsql:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"

test-sqlite:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"

test-unit:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"

test-mysql5:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"

test-mysql8:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"

test-mssql:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"
6 changes: 5 additions & 1 deletion .github/workflows/pull-db-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: db-tests

on: [pull_request]
on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pull-docker-dryrun-docsignore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: docker-dryrun

on:
pull_request:
paths:
- "docs/**"
- "*.md"

jobs:
docker-dryrun:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"
6 changes: 5 additions & 1 deletion .github/workflows/pull-docker-dryrun.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: docker-dryrun

on: [pull_request]
on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pull-e2e-tests-docsignore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: e2e-tests

on:
pull_request:
paths:
- "docs/**"
- "*.md"

jobs:
test-e2e:
runs-on: ubuntu-latest
steps:
- run: echo "No build required"
6 changes: 5 additions & 1 deletion .github/workflows/pull-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: e2e-tests

on: [pull_request]
on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .stylelintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ignoreFiles:
- "**/*.go"

overrides:
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console/*"]
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console.css"]
rules:
scale-unlimited/declaration-strict-value: null
- files: ["**/chroma/*", "**/codemirror/*"]
Expand Down
3 changes: 2 additions & 1 deletion contrib/systemd/gitea.service
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ After=network.target
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
# LimitNOFILE=524288:524288
RestartSec=2s
Type=simple
Type=notify
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
Expand All @@ -62,6 +62,7 @@ WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
WatchdogSec=30s
# If you install Git to directory prefix other than default PATH (which happens
# for example if you install other versions of Git side-to-side with
# distribution version), uncomment below line and add that prefix to PATH
Expand Down
12 changes: 12 additions & 0 deletions docs/content/doc/installation/from-binary.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ git --version
Create a user to run Gitea (e.g. `git`)

```sh
# On Ubuntu/Debian:
adduser \
--system \
--shell /bin/bash \
Expand All @@ -88,6 +89,17 @@ adduser \
--disabled-password \
--home /home/git \
git

# On Fedora/RHEL/CentOS:
groupadd --system git
adduser \
--system \
--shell /bin/bash \
--comment 'Git Version Control' \
--gid git \
--home-dir /home/git \
--create-home \
git
```

### Create required directory structure
Expand Down
12 changes: 12 additions & 0 deletions docs/content/doc/installation/from-binary.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ git --version
创建用户(推荐使用名称 `git`

```sh
# On Ubuntu/Debian:
adduser \
--system \
--shell /bin/bash \
Expand All @@ -82,6 +83,17 @@ adduser \
--disabled-password \
--home /home/git \
git

# On Fedora/RHEL/CentOS:
groupadd --system git
adduser \
--system \
--shell /bin/bash \
--comment 'Git Version Control' \
--gid git \
--home-dir /home/git \
--create-home \
git
```

### 创建工作路径
Expand Down
4 changes: 2 additions & 2 deletions models/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ type Repository struct {
IsEmpty bool `xorm:"INDEX"`
IsArchived bool `xorm:"INDEX"`
IsMirror bool `xorm:"INDEX"`
*Mirror `xorm:"-"`
Status RepositoryStatus `xorm:"NOT NULL DEFAULT 0"`

Status RepositoryStatus `xorm:"NOT NULL DEFAULT 0"`

RenderingMetas map[string]string `xorm:"-"`
DocumentRenderingMetas map[string]string `xorm:"-"`
Expand Down
9 changes: 2 additions & 7 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ type Repository struct {
RepoLink string
CloneLink repo_model.CloneLink
CommitsCount int64
Mirror *repo_model.Mirror

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

if repo.IsMirror {
ctx.Repo.Mirror, err = repo_model.GetMirrorByRepoID(ctx, repo.ID)
pullMirror, err := repo_model.GetMirrorByRepoID(ctx, repo.ID)
if err == nil {
ctx.Repo.Mirror.Repo = repo
ctx.Data["IsPullMirror"] = true
ctx.Data["MirrorEnablePrune"] = ctx.Repo.Mirror.EnablePrune
ctx.Data["MirrorInterval"] = ctx.Repo.Mirror.Interval
ctx.Data["Mirror"] = ctx.Repo.Mirror
ctx.Data["PullMirror"] = pullMirror
} else if err != repo_model.ErrMirrorNotExist {
ctx.ServerError("GetMirrorByRepoID", err)
return
Expand Down
Loading

0 comments on commit 996f3da

Please sign in to comment.