Compare commits
113 Commits
main
...
release/v1
Author | SHA1 | Date |
---|---|---|
Giteabot | 69bdcf41f3 | |
Giteabot | e610b0389a | |
Lunny Xiao | 13ffa287b1 | |
wxiaoguang | e5b684e567 | |
Giteabot | 64ed262e18 | |
wxiaoguang | f51c8e0008 | |
Giteabot | d8a59d5f12 | |
Giteabot | 1ddfe03131 | |
Giteabot | 24cf06592e | |
Giteabot | 0b6f7fb607 | |
KN4CK3R | c27a3af728 | |
Giteabot | 12aca3ef20 | |
Giteabot | 2390a46d0f | |
Giteabot | 51b6a78791 | |
wxiaoguang | e6f62eea70 | |
Giteabot | 8981f6d0fc | |
Giteabot | b2b5c80cb2 | |
Giteabot | 77db40e084 | |
Giteabot | 7222bac4e3 | |
wxiaoguang | 0eb4ab4246 | |
Giteabot | 102dcfa3a0 | |
Giteabot | 614d6df2d8 | |
Giteabot | 345a25d016 | |
Giteabot | e8a7cd4a1d | |
6543 | 6c43b9f6f6 | |
HesterG | 40744f8976 | |
Giteabot | 9d69a4758e | |
Giteabot | 53747a58a0 | |
Giteabot | 00ba826360 | |
Giteabot | 9bbb4d8d6d | |
lonix1 | 5703a0d3e3 | |
Giteabot | 85bad22ff8 | |
Giteabot | 71d2a6a41a | |
wxiaoguang | d1f1f1142e | |
Giteabot | 2cd9d6b3f9 | |
Denys Konovalov | 050c38ca19 | |
Giteabot | 51789ba12d | |
Giteabot | b0de3d08b8 | |
Giteabot | 2e64449de7 | |
John Olheiser | ec539b7a77 | |
techknowlogick | 6fbdacb524 | |
Denys Konovalov | 948f6ca029 | |
wxiaoguang | 061b68e995 | |
John Olheiser | 734fd93f59 | |
Giteabot | 203fe2841d | |
Giteabot | 056829749e | |
Giteabot | f18b8e7d8a | |
Giteabot | ea00ed320d | |
sebastian-sauer | 30a783879f | |
wxiaoguang | cb3173a1e9 | |
Giteabot | ffe089432f | |
Giteabot | 8302b95d6b | |
Giteabot | 6f1c95ec5b | |
Giteabot | cda69a0363 | |
Giteabot | 4908cc9adf | |
Giteabot | 28ed763f55 | |
silverwind | 8e89eb8f43 | |
Giteabot | dfefe86045 | |
Giteabot | 10fcb55507 | |
Giteabot | e9105ac281 | |
Giteabot | e6e1cfd8e4 | |
Giteabot | 072997692c | |
Giteabot | e9fab3ea3e | |
wxiaoguang | e0bd6ebabd | |
Giteabot | cc73f6e821 | |
Giteabot | ff18c3ba65 | |
Giteabot | b673edbeaf | |
derelm | 05431593ef | |
Giteabot | aa4c9c3215 | |
Giteabot | 4e79c76ed0 | |
Giteabot | 3bd311c3f4 | |
techknowlogick | 7e06e6a042 | |
Giteabot | e5629d9701 | |
Giteabot | 4ea38bba73 | |
Giteabot | 25cb1fb994 | |
Giteabot | e5422db5c7 | |
Giteabot | 3a29f6aaff | |
Giteabot | 99d71b2b65 | |
Giteabot | 783f7ccb2c | |
Giteabot | 3f75fbf8fe | |
Giteabot | 4124f8ef70 | |
Giteabot | b45ea0280b | |
Giteabot | 031ddfcb7b | |
yp05327 | d686aa0d31 | |
Giteabot | 037366f93f | |
Giteabot | 5191ab6445 | |
Giteabot | bfd3eb9dbc | |
Giteabot | 8fa9d9dcc9 | |
Giteabot | 21cd5c2f3d | |
Giteabot | 22948048b2 | |
Giteabot | fa28d0e706 | |
Giteabot | 3ea544d89c | |
Giteabot | 9cef7a4600 | |
Giteabot | c207b94e0c | |
Giteabot | 506c70884a | |
Giteabot | f64f5495af | |
Giteabot | 3e9fc36729 | |
Giteabot | 8e798ebbdf | |
Giteabot | 0ad5ae0dbf | |
Giteabot | 0cf467e9e0 | |
Giteabot | 5ff0f7d0ca | |
silverwind | 224ee0d4e5 | |
silverwind | ee26d1c578 | |
Giteabot | 18093d4c9a | |
Giteabot | de1d14590d | |
Giteabot | 0058453fd9 | |
Giteabot | 7679f4d51a | |
Giteabot | 82a8c26bbf | |
Giteabot | cb113991a3 | |
Giteabot | 0bf07a7f61 | |
Giteabot | adb5b9c061 | |
HesterG | f0c967560a | |
Giteabot | 1cc63ade82 |
439
.drone.yml
439
.drone.yml
|
@ -1,138 +1,3 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: release-latest
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
workspace:
|
||||
base: /source
|
||||
path: /
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
- "release/*"
|
||||
event:
|
||||
- push
|
||||
paths:
|
||||
exclude:
|
||||
- "docs/**"
|
||||
|
||||
volumes:
|
||||
- name: deps
|
||||
temp: {}
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
pull: always
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: deps-frontend
|
||||
image: node:20
|
||||
pull: always
|
||||
commands:
|
||||
- make deps-frontend
|
||||
|
||||
- name: deps-backend
|
||||
image: gitea/test_env:linux-1.20-amd64
|
||||
pull: always
|
||||
commands:
|
||||
- make deps-backend
|
||||
volumes:
|
||||
- name: deps
|
||||
path: /go
|
||||
|
||||
- name: static
|
||||
image: techknowlogick/xgo:go-1.20.x
|
||||
pull: always
|
||||
commands:
|
||||
# Upgrade to node 20 once https://github.com/techknowlogick/xgo/issues/163 is resolved
|
||||
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
|
||||
- export PATH=$PATH:$GOPATH/bin
|
||||
- make release
|
||||
environment:
|
||||
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
volumes:
|
||||
- name: deps
|
||||
path: /go
|
||||
|
||||
- name: gpg-sign
|
||||
image: plugins/gpgsign:1
|
||||
pull: always
|
||||
settings:
|
||||
detach_sign: true
|
||||
excludes:
|
||||
- "dist/release/*.sha256"
|
||||
files:
|
||||
- "dist/release/*"
|
||||
environment:
|
||||
GPGSIGN_KEY:
|
||||
from_secret: gpgsign_key
|
||||
GPGSIGN_PASSPHRASE:
|
||||
from_secret: gpgsign_passphrase
|
||||
|
||||
- name: release-branch
|
||||
image: woodpeckerci/plugin-s3:latest
|
||||
pull: always
|
||||
settings:
|
||||
acl:
|
||||
from_secret: aws_s3_acl
|
||||
region:
|
||||
from_secret: aws_s3_region
|
||||
bucket:
|
||||
from_secret: aws_s3_bucket
|
||||
endpoint:
|
||||
from_secret: aws_s3_endpoint
|
||||
path_style:
|
||||
from_secret: aws_s3_path_style
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
target: "/gitea/${DRONE_BRANCH##release/v}"
|
||||
environment:
|
||||
AWS_ACCESS_KEY_ID:
|
||||
from_secret: aws_access_key_id
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
from_secret: aws_secret_access_key
|
||||
when:
|
||||
branch:
|
||||
- "release/*"
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: release-main
|
||||
image: woodpeckerci/plugin-s3:latest
|
||||
settings:
|
||||
acl:
|
||||
from_secret: aws_s3_acl
|
||||
region:
|
||||
from_secret: aws_s3_region
|
||||
bucket:
|
||||
from_secret: aws_s3_bucket
|
||||
endpoint:
|
||||
from_secret: aws_s3_endpoint
|
||||
path_style:
|
||||
from_secret: aws_s3_path_style
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
target: /gitea/main
|
||||
environment:
|
||||
AWS_ACCESS_KEY_ID:
|
||||
from_secret: aws_access_key_id
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
from_secret: aws_secret_access_key
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: release-version
|
||||
|
@ -379,133 +244,6 @@ steps:
|
|||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: docker-linux-amd64-release
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/main
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
pull: always
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: publish
|
||||
image: plugins/docker:latest
|
||||
pull: always
|
||||
settings:
|
||||
auto_tag: false
|
||||
tags: nightly-linux-amd64
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
- name: publish-rootless
|
||||
image: plugins/docker:latest
|
||||
settings:
|
||||
dockerfile: Dockerfile.rootless
|
||||
auto_tag: false
|
||||
tags: nightly-linux-amd64-rootless
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: docker-linux-amd64-release-branch
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- "refs/heads/release/v*"
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
pull: always
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: publish
|
||||
image: plugins/docker:latest
|
||||
pull: always
|
||||
settings:
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-nightly-linux-amd64
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
- name: publish-rootless
|
||||
image: plugins/docker:latest
|
||||
settings:
|
||||
dockerfile: Dockerfile.rootless
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-nightly-linux-amd64-rootless
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
@ -641,136 +379,6 @@ steps:
|
|||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: docker-linux-arm64-release
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/main
|
||||
paths:
|
||||
exclude:
|
||||
- "docs/**"
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
pull: always
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: publish
|
||||
image: plugins/docker:latest
|
||||
pull: always
|
||||
settings:
|
||||
auto_tag: false
|
||||
tags: nightly-linux-arm64
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
- name: publish-rootless
|
||||
image: plugins/docker:latest
|
||||
settings:
|
||||
dockerfile: Dockerfile.rootless
|
||||
auto_tag: false
|
||||
tags: nightly-linux-arm64-rootless
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: docker-linux-arm64-release-branch
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- "refs/heads/release/v*"
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
pull: always
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: publish
|
||||
image: plugins/docker:latest
|
||||
pull: always
|
||||
settings:
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-nightly-linux-arm64
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
- name: publish-rootless
|
||||
image: plugins/docker:latest
|
||||
settings:
|
||||
dockerfile: Dockerfile.rootless
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-nightly-linux-arm64-rootless
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=https://goproxy.io
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
DOCKER_BUILDKIT: 1
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
@ -816,50 +424,3 @@ depends_on:
|
|||
- docker-linux-amd64-release-candidate-version
|
||||
- docker-linux-arm64-release-version
|
||||
- docker-linux-arm64-release-candidate-version
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: docker-manifest
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: manifest-rootless
|
||||
image: plugins/manifest
|
||||
pull: always
|
||||
settings:
|
||||
auto_tag: false
|
||||
ignore_missing: true
|
||||
spec: docker/manifest.rootless.tmpl
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
|
||||
- name: manifest
|
||||
image: plugins/manifest
|
||||
settings:
|
||||
auto_tag: false
|
||||
ignore_missing: true
|
||||
spec: docker/manifest.tmpl
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/main
|
||||
- "refs/heads/release/v*"
|
||||
paths:
|
||||
exclude:
|
||||
- "docs/**"
|
||||
|
||||
depends_on:
|
||||
- docker-linux-amd64-release
|
||||
- docker-linux-arm64-release
|
||||
- docker-linux-amd64-release-branch
|
||||
- docker-linux-arm64-release-branch
|
||||
|
|
|
@ -29,11 +29,11 @@ globals:
|
|||
__webpack_public_path__: true
|
||||
|
||||
overrides:
|
||||
- files: ["web_src/**/*.js", "docs/**/*.js"]
|
||||
- files: ["web_src/**/*", "docs/**/*"]
|
||||
env:
|
||||
browser: true
|
||||
node: false
|
||||
- files: ["web_src/**/*worker.js"]
|
||||
- files: ["web_src/**/*worker.*"]
|
||||
env:
|
||||
worker: true
|
||||
rules:
|
||||
|
@ -42,7 +42,7 @@ overrides:
|
|||
rules:
|
||||
import/no-unresolved: [0]
|
||||
import/no-extraneous-dependencies: [0]
|
||||
- files: ["*.config.js"]
|
||||
- files: ["*.config.*"]
|
||||
rules:
|
||||
import/no-unused-modules: [0]
|
||||
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
/templates/swagger/v1_json.tmpl linguist-generated
|
||||
/vendor/** -text -eol linguist-vendored
|
||||
/web_src/fomantic/build/** linguist-generated
|
||||
/web_src/fomantic/_site/globals/site.variables linguist-language=Less
|
||||
/web_src/js/vendor/** -text -eol linguist-vendored
|
||||
Dockerfile.* linguist-language=Dockerfile
|
||||
|
|
|
@ -3,6 +3,7 @@ name: cron-licenses
|
|||
on:
|
||||
schedule:
|
||||
- cron: "7 0 * * 1" # every Monday at 00:07 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
cron-licenses:
|
||||
|
|
|
@ -3,6 +3,7 @@ name: cron-translations
|
|||
on:
|
||||
schedule:
|
||||
- cron: "7 0 * * *" # every day at 00:07 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
crowdin-pull:
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
uses: ./.github/workflows/files-changed.yml
|
||||
|
||||
lint-backend:
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -27,7 +27,7 @@ jobs:
|
|||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
|
||||
lint-go-windows:
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -44,7 +44,7 @@ jobs:
|
|||
GOARCH: amd64
|
||||
|
||||
lint-go-gogit:
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -59,7 +59,7 @@ jobs:
|
|||
TAGS: bindata gogit sqlite sqlite_unlock_notify
|
||||
|
||||
checks-backend:
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -72,7 +72,7 @@ jobs:
|
|||
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
|
||||
|
||||
frontend:
|
||||
if: needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -83,9 +83,10 @@ jobs:
|
|||
- run: make deps-frontend
|
||||
- run: make lint-frontend
|
||||
- run: make checks-frontend
|
||||
- run: make frontend
|
||||
|
||||
backend:
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -94,12 +95,9 @@ jobs:
|
|||
with:
|
||||
go-version: ">=1.20"
|
||||
check-latest: true
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
# no frontend build here as backend should be able to build
|
||||
# even without any frontend files
|
||||
- run: make deps-backend deps-tools
|
||||
- run: make deps-frontend
|
||||
- run: make frontend
|
||||
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
|
||||
- name: build-backend-arm64
|
||||
run: make backend # test cross compile
|
||||
|
@ -120,7 +118,7 @@ jobs:
|
|||
GOARCH: 386
|
||||
|
||||
docs:
|
||||
if: needs.files-changed.outputs.docs == 'true'
|
||||
if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -133,7 +131,7 @@ jobs:
|
|||
- run: make docs # test if build could succeed
|
||||
|
||||
actions:
|
||||
if: needs.files-changed.outputs.actions == 'true'
|
||||
if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
uses: ./.github/workflows/files-changed.yml
|
||||
|
||||
test-pgsql:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
@ -58,7 +58,7 @@ jobs:
|
|||
USE_REPO_TEST_DIR: 1
|
||||
|
||||
test-sqlite:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -79,7 +79,7 @@ jobs:
|
|||
USE_REPO_TEST_DIR: 1
|
||||
|
||||
test-unit:
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
@ -144,7 +144,7 @@ jobs:
|
|||
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
|
||||
|
||||
test-mysql5:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
@ -188,7 +188,7 @@ jobs:
|
|||
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
|
||||
|
||||
test-mysql8:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
@ -217,7 +217,7 @@ jobs:
|
|||
USE_REPO_TEST_DIR: 1
|
||||
|
||||
test-mssql:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
uses: ./.github/workflows/files-changed.yml
|
||||
|
||||
docker-dryrun:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
uses: ./.github/workflows/files-changed.yml
|
||||
|
||||
test-e2e:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
name: release-nightly-assets
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, release/v* ]
|
||||
|
||||
jobs:
|
||||
nightly-binary:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
||||
- run: git fetch --unshallow --quiet --tags --force
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ">=1.20"
|
||||
check-latest: true
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
- run: make deps-frontend deps-backend
|
||||
# xgo build
|
||||
- run: make release
|
||||
env:
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
- name: import gpg key
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
- name: sign binaries
|
||||
run: |
|
||||
for f in dist/release/*; do
|
||||
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
|
||||
done
|
||||
# clean branch name to get the folder name in S3
|
||||
- name: Get cleaned branch name
|
||||
id: clean_name
|
||||
run: |
|
||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
||||
echo "Cleaned name is ${REF_NAME}"
|
||||
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||
- name: upload binaries to s3
|
||||
uses: jakejarvis/s3-sync-action@master
|
||||
env:
|
||||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||
SOURCE_DIR: dist/release
|
||||
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
|
||||
nightly-docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
|
||||
- run: git fetch --unshallow --quiet --tags --force
|
||||
- uses: docker/setup-qemu-action@v2
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- name: Get cleaned branch name
|
||||
id: clean_name
|
||||
run: |
|
||||
# if main then say nightly otherwise cleanup name
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||
echo "branch=nightly" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
||||
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: build rootful docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
||||
- name: build rootless docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
file: Dockerfile.rootless
|
||||
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless
|
|
@ -16,10 +16,6 @@ _test
|
|||
.vscode
|
||||
__debug_bin
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
|
@ -57,8 +53,6 @@ cpu.out
|
|||
/bin
|
||||
/dist
|
||||
/custom/*
|
||||
!/custom/conf
|
||||
/custom/conf/*
|
||||
!/custom/conf/app.example.ini
|
||||
/data
|
||||
/indexers
|
||||
|
|
|
@ -80,6 +80,7 @@ rules:
|
|||
media-feature-name-no-vendor-prefix: true
|
||||
media-feature-name-unit-allowed-list: null
|
||||
media-feature-name-value-allowed-list: null
|
||||
media-feature-name-value-no-unknown: true
|
||||
media-feature-range-notation: null
|
||||
named-grid-areas-no-invalid: true
|
||||
no-descending-specificity: null
|
||||
|
|
549
CHANGELOG.md
549
CHANGELOG.md
|
@ -4,6 +4,555 @@ 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.20.0-rc2](https://github.com/go-gitea/gitea/releases/tag/1.20.0-rc2) - 2023-06-27
|
||||
|
||||
* BREAKING
|
||||
* Refactor path & config system (#25330) (#25416)
|
||||
* Fix all possible setting error related storages and added some tests (#23911) (#25244)
|
||||
* Use a separate admin page to show global stats, remove `actions` stat (#25062)
|
||||
* Remove the service worker (#25010)
|
||||
* Remove meta tags `theme-color` and `default-theme` (#24960)
|
||||
* Use `[git.config]` for reflog cleaning up (#24958)
|
||||
* Allow all URL schemes in Markdown links by default (#24805)
|
||||
* Redesign Scoped Access Tokens (#24767)
|
||||
* Fix team members API endpoint pagination (#24754)
|
||||
* Rewrite logger system (#24726)
|
||||
* Increase default LFS auth timeout from 20m to 24h (#24628)
|
||||
* Rewrite queue (#24505)
|
||||
* Remove `font-awesome` and fomantic `icon` module (#24471)
|
||||
* Remove unused setting `time.FORMAT` (#24430)
|
||||
* Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270)
|
||||
* Correct the access log format (#24085)
|
||||
* Reserve ".png" suffix for user/org names (#23992)
|
||||
* Prefer native parser for SSH public key parsing (#23798)
|
||||
* Editor preview support for external renderers (#23333)
|
||||
* Add Gitea Profile Readmes (#23260)
|
||||
* Refactor `ctx` in templates (#23105)
|
||||
* SECURITY
|
||||
* Set type="password" on all auth_token fields (#22175)
|
||||
* FEATURES
|
||||
* Add button on diff header to copy file name, misc diff header tweaks (#24986)
|
||||
* API endpoint for changing/creating/deleting multiple files (#24887)
|
||||
* Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default (#24860)
|
||||
* Add up and down arrows to selected lookup repositories (#24727)
|
||||
* Add Go package registry (#24687)
|
||||
* Add status indicator on main home screen for each repo (#24638)
|
||||
* Support for status check pattern (#24633)
|
||||
* Implement Cargo HTTP index (#24452)
|
||||
* Add Debian package registry (#24426)
|
||||
* Add the ability to pin Issues (#24406)
|
||||
* Add follow organization and fix the logic of following page (#24345)
|
||||
* Allow `webp` images as avatars (#24248)
|
||||
* Support upload `outputs` and use `needs` context on Actions (#24230)
|
||||
* Allow adding new files to an empty repo (#24164)
|
||||
* Make wiki title supports dashes and improve wiki name related features (#24143)
|
||||
* Add monospace toggle button to textarea (#24034)
|
||||
* Use auto-updating, natively hoverable, localized time elements (#23988)
|
||||
* Add ntlm authentication support for mail (#23811)
|
||||
* Add CLI command to register runner tokens (#23762)
|
||||
* Add Alpine package registry (#23714)
|
||||
* Expand/Collapse all changed files (#23639)
|
||||
* Add unset default project column (#23531)
|
||||
* Add activity feeds API (#23494)
|
||||
* Add RPM registry (#23380)
|
||||
* Add meilisearch support (#23136)
|
||||
* Add API for License templates (#23009)
|
||||
* Add admin API email endpoints (#22792)
|
||||
* Add user rename endpoint to admin api (#22789)
|
||||
* Add API for gitignore templates (#22783)
|
||||
* Implement actions artifacts (#22738)
|
||||
* Add RSS Feeds for branches and files (#22719)
|
||||
* Display when a repo was archived (#22664)
|
||||
* Add Swift package registry (#22404)
|
||||
* Add CRAN package registry (#22331)
|
||||
* Add user webhooks (#21563)
|
||||
* Implement systemd-notify protocol (#21151)
|
||||
* Implement Issue Config (#20956)
|
||||
* API
|
||||
* Fix `Permission` in API returned repository struct (#25388) (#25441)
|
||||
* Add API for Label templates (#24602)
|
||||
* Filters for GetAllCommits (#24568)
|
||||
* Add ability to specify '--not' from GetAllCommits (#24409)
|
||||
* Support uploading file to empty repo by API (#24357)
|
||||
* Add absent repounits to create/edit repo API (#23500)
|
||||
* Add login name and source id for admin user searching API (#23376)
|
||||
* Create a branch directly from commit on the create branch API (#22956)
|
||||
* Add API to manage issue dependencies (#17935)
|
||||
* ENHANCEMENTS
|
||||
* Improve speed of loadprojects for issue list (#25468) (#25493)
|
||||
* Move some regexp out of functions (#25430) (#25445)
|
||||
* Diff page enhancements (#25398) (#25437)
|
||||
* Various UI fixes (#25264) (#25431)
|
||||
* Fix label list divider (#25312) (#25372)
|
||||
* Fix UI on mobile view (#25315) (#25340)
|
||||
* When viewing a file, hide the add button (#25320) (#25339)
|
||||
* Show if File is Executable (#25287) (#25300)
|
||||
* Fix edit OAuth application width (#25262) (#25263)
|
||||
* Use flex to align SVG and text (#25163) (#25260)
|
||||
* Revert overflow: overlay (revert #21850) (#25231) (#25239)
|
||||
* Use inline SVG for built-in OAuth providers (#25171) (#25234)
|
||||
* Change access token UI to select dropdowns (#25109) (#25230)
|
||||
* Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211)
|
||||
* Minor arc-green color tweaks (#25175) (#25205)
|
||||
* Button and color enhancements (#24989) (#25176)
|
||||
* Fix mobile navbar and misc cleanups (#25134) (#25169)
|
||||
* Modify OAuth login ui and fix display name, iconurl related logic (#25030) (#25161)
|
||||
* Improve notification icon and navbar (#25111) (#25124)
|
||||
* Add details summary for vertical menus in settings to allow toggling (#25098)
|
||||
* Don't display `select all issues` checkbox when no issues are available (#25086)
|
||||
* Use RepositoryList instead of []*Repository (#25074)
|
||||
* Add ability to set multiple redirect URIs in OAuth application UI (#25072)
|
||||
* Use git command instead of the ini package to remove the `origin` remote (#25066)
|
||||
* Remove cancel button from branch protection form (#25063)
|
||||
* Show file tree by default (#25052)
|
||||
* Add Progressbar to Milestone Page (#25050)
|
||||
* Minor UI improvements: logo alignment, auth map editor, auth name display (#25043)
|
||||
* Allow for PKCE flow without client secret + add docs (#25033)
|
||||
* Refactor INI package (first step) (#25024)
|
||||
* Various style fixes (#25008)
|
||||
* Fix delete user account modal (#25004)
|
||||
* Refactor diffFileInfo / DiffTreeStore (#24998)
|
||||
* Add user level action runners (#24995)
|
||||
* Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988)
|
||||
* Add step start time to `ViewStepLog` (#24980)
|
||||
* Add dark mode to API Docs (#24971)
|
||||
* Display file mode for new file and file mode changes (#24966)
|
||||
* Make the 500 page load themes (#24953)
|
||||
* Show `bot` label next to username when rendering autor link if the user is a bot (#24943)
|
||||
* Repo list improvements, fix bold helper classes (#24935)
|
||||
* Improve queue and logger context (#24924)
|
||||
* Improve RunMode / dev mode (#24886)
|
||||
* Improve some Forms (#24878)
|
||||
* Add show timestamp/seconds and fullscreen options to action page (#24876)
|
||||
* Fix double border and adjust width for user profile page (#24870)
|
||||
* Improve Actions CSS (#24864)
|
||||
* Fix `@font-face` overrides (#24855)
|
||||
* Remove `In your repositories` link in milestones dashboard (#24853)
|
||||
* Fix missing yes/no in delete time log modal (#24851)
|
||||
* Show new pull request button also on subdirectories and files (#24842)
|
||||
* Make environment-to-ini support loading key value from file (#24832)
|
||||
* Support wildcard in email domain allow/block list (#24831)
|
||||
* Use `CommentList` instead of `[]*Comment` (#24828)
|
||||
* Add RTL rendering support to Markdown (#24816)
|
||||
* Rework notifications list (#24812)
|
||||
* Mute repo names in dashboard repo list (#24811)
|
||||
* Fix max width and margin of comment box on conversation page (#24809)
|
||||
* Some refactors for issues stats (#24793)
|
||||
* Rework label colors (#24790)
|
||||
* Fix OAuth login loading state (#24788)
|
||||
* Remove duplicated issues options and some more refactors (#24787)
|
||||
* Decouple the different contexts from each other (#24786)
|
||||
* Remove background on user dashboard filter bar (#24779)
|
||||
* Improve and fix bugs surrounding reactions (#24760)
|
||||
* Make the color of zero-contribution-squares in the activity heatmap more subtle (#24758)
|
||||
* Fix WEBP image copying (#24743)
|
||||
* Rework OAuth login buttons, swap github logo to monocolor (#24740)
|
||||
* Consolidate the two review boxes into one (#24738)
|
||||
* Unification of registration fields order (#24737)
|
||||
* Refactor Pull Mirror and fix out-of-sync bugs (#24732)
|
||||
* Improvements for action detail page (#24718)
|
||||
* Fix flash of unstyled content in action view page (#24712)
|
||||
* Don't filter action runs based on state (#24711)
|
||||
* Optimize actions list by removing an unnecessary `git` call (#24710)
|
||||
* Support no label/assignee filter and batch clearing labels/assignees (#24707)
|
||||
* Add icon support for safari (#24697)
|
||||
* Use standard HTTP library to serve files (#24693)
|
||||
* Improve button-ghost, remove tertiary button (#24692)
|
||||
* Only hide tooltip tippy instances (#24688)
|
||||
* Support migrating storage for actions log via command line (#24679)
|
||||
* Remove highlight in repo list (#24675)
|
||||
* Add markdown preview to Submit Review Textarea (#24672)
|
||||
* Update pin and add pin-slash (#24669)
|
||||
* Improve empty notifications display (#24668)
|
||||
* Support SSH for go get (#24664)
|
||||
* Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653)
|
||||
* Only show one tippy at a time (#24648)
|
||||
* Notification list enhancements, fix striped tables on dark theme (#24639)
|
||||
* Improve queue & process & stacktrace (#24636)
|
||||
* Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634)
|
||||
* Remove fluid on compare diff page (#24627)
|
||||
* Add a tooltip to the job rerun button (#24617)
|
||||
* Attach a tooltip to the action status icon (#24614)
|
||||
* Make the actions control button look like an actual button (#24611)
|
||||
* Remove unnecessary code (#24610)
|
||||
* Make repo migration cancelable and fix various bugs (#24605)
|
||||
* Improve updating Actions tasks (#24600)
|
||||
* Attach a tooltip to the action control button (#24595)
|
||||
* Make repository response support HTTP range request (#24592)
|
||||
* Improve Gitea's web context, decouple "issue template" code into service package (#24590)
|
||||
* Modify luminance calculation and extract related functions into single files (#24586)
|
||||
* Simplify template helper functions (#24570)
|
||||
* Split "modules/context.go" to separate files (#24569)
|
||||
* Add org visibility label to non-organization's dashboard (#24558)
|
||||
* Update LDAP filters to include both username and email address (#24547)
|
||||
* Review fixes and enhancements (#24526)
|
||||
* Display warning when user try to rename default branch (#24512)
|
||||
* Fix color for transfer related buttons when having no permission to act (#24510)
|
||||
* Rework button coloring, add focus and active colors (#24507)
|
||||
* New webhook trigger for receiving Pull Request review requests (#24481)
|
||||
* Add goto issue id function (#24479)
|
||||
* Fix incorrect webhook time and use relative-time to display it (#24477)
|
||||
* RSS icon fixes (#24476)
|
||||
* Replace `N/A` with `-` everywhere (#24474)
|
||||
* Pass 'not' to commit count (#24473)
|
||||
* Enhance stylelint rule config, remove dead CSS (#24472)
|
||||
* Improve "new-menu" (#24465)
|
||||
* Remove fomantic breadcrumb module (#24463)
|
||||
* Improve template system and panic recovery (#24461)
|
||||
* Make Issue/PR/projects more compact, misc CSS tweaks (#24459)
|
||||
* Replace remaining fontawesome dropdown icons with SVG (#24455)
|
||||
* Remove all direct references to font-awesome (#24448)
|
||||
* Move links out of translation (#24446)
|
||||
* Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442)
|
||||
* Hide 'Mirror Settings' when unneeded, improve hints (#24433)
|
||||
* Add "Updated" column for admin repositories list (#24429)
|
||||
* Improve issue list filter (#24425)
|
||||
* Rework header bar on issue, pull requests and milestone (#24420)
|
||||
* Improve template helper (#24417)
|
||||
* Make repo size style matches others (commits/branches/tags) (#24408)
|
||||
* Support markdown editor for issue template (#24400)
|
||||
* Improve commit date in commit graph (#24399)
|
||||
* Start cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackable menu (#24393)
|
||||
* Merge setting.InitXXX into one function with options (#24389)
|
||||
* Move `Rename branch` from repo settings page to the page of branches list (#24380)
|
||||
* Improve protected branch setting page (#24379)
|
||||
* Display 'Unknown' when runner.version is empty (#24378)
|
||||
* Display owner of a runner as a tooltip instead of static text (#24377)
|
||||
* Fix incorrect last online time in runner_edit.tmpl (#24376)
|
||||
* Fix unclear `IsRepositoryExist` logic (#24374)
|
||||
* Add custom helm repo name generated from url (#24363)
|
||||
* Replace placeholders in licenses (#24354)
|
||||
* Add rerun workflow button and refactor to use SVG octicons (#24350)
|
||||
* Refactor "route" related code, fix Safari cookie bug (#24330)
|
||||
* Alert error message if open dependencies are included in the issues that try to batch close (#24329)
|
||||
* Add missed column title in runner management page (#24328)
|
||||
* Automatically select the org when click create repo from org dashboard (#24325)
|
||||
* Modify width of ui container, fine tune css for settings pages and org header (#24315)
|
||||
* Fix config list overflow and layout (#24312)
|
||||
* Improve some modal action buttons (#24289)
|
||||
* Move code from module to service (#24287)
|
||||
* Sort users and orgs on explore by recency by default (#24279)
|
||||
* Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275)
|
||||
* Show workflow config error on file view also (#24267)
|
||||
* Improve template helper functions: string/slice (#24266)
|
||||
* Use more specific test methods (#24265)
|
||||
* Add `DumpVar` helper function to help debugging templates (#24262)
|
||||
* Limit avatar upload to valid image files (#24258)
|
||||
* Improve emoji and mention matching (#24255)
|
||||
* Change to vertical navbar layout for secondary navbar for repo/user/admin settings (#24246)
|
||||
* Refactor config provider (#24245)
|
||||
* Improve test logger (#24235)
|
||||
* Default show closed actions list if all actions was closed (#24234)
|
||||
* Add missing badges in user profile for /projects and /packages (#24232)
|
||||
* Add repository counter badge to repository tab (#24205)
|
||||
* Move secrets and runners settings to actions settings (#24200)
|
||||
* Require at least one unit to be enabled (#24189)
|
||||
* Use same action status svg icons on actions list as on action page (#24178)
|
||||
* Use secondary pointing menu for tabs on user/organization home page (#24162)
|
||||
* Improve Wiki TOC (#24137)
|
||||
* Refactor locale number (#24134)
|
||||
* Localize activity heatmap (except tooltip) (#24131)
|
||||
* Fix duplicate modals when clicking on "remove all" repository button (#24129)
|
||||
* Add runner check in repo action page (#24124)
|
||||
* Support triggering workflows by wiki related events (#24119)
|
||||
* Refactor cookie (#24107)
|
||||
* Remove untranslatable `on_date` key (#24106)
|
||||
* Refactor delete_modal_actions template and use it for project column related actions (#24097)
|
||||
* Improve git log for debugging (#24095)
|
||||
* Add option to search for users is active join a team (#24093)
|
||||
* Add PDF rendering via PDFObject (#24086)
|
||||
* Refactor web route (#24080)
|
||||
* Make more functions use ctx instead of db.DefaultContext (#24068)
|
||||
* Make HTML template functions support context (#24056)
|
||||
* Refactor rename user and rename organization (#24052)
|
||||
* Localize milestone related time strings (#24051)
|
||||
* Expand selected file when clicking file tree (#24041)
|
||||
* Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040)
|
||||
* Add placeholder and aria attributes to release and wiki edit page (#24031)
|
||||
* Add new user types `reserved`, `bot`, and `remote` (#24026)
|
||||
* Allow adding SSH keys even if SSH server is disabled (#24025)
|
||||
* Use a general approach to access custom/static/builtin assets (#24022)
|
||||
* Update github.com/google/go-github to v52 (#24004)
|
||||
* Replace tribute with text-expander-element for textarea (#23985)
|
||||
* Group template helper functions, remove `Printf`, improve template error messages (#23982)
|
||||
* Drop "unrolled/render" package (#23965)
|
||||
* Add job.duration in web ui (#23963)
|
||||
* Tweak pull request branch delete ui (#23951)
|
||||
* Merge template functions "dict/Dict/mergeinto" (#23932)
|
||||
* Use a general Eval function for expressions in templates. (#23927)
|
||||
* Clean template/helper.go (#23922)
|
||||
* Actions: Use default branch as ref when a branch/tag delete occurs (#23910)
|
||||
* Add tooltips for MD editor buttons and add `muted` class for buttons (#23896)
|
||||
* Improve markdown editor: width, height, preferred (#23895)
|
||||
* Make Release Download URLs predictable (#23891)
|
||||
* Remove fomantic ".link" selector and styles (#23888)
|
||||
* Added close/open button to details page of milestone (#23877)
|
||||
* Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876)
|
||||
* Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861)
|
||||
* Make first section on home page full width (#23854)
|
||||
* Use different SVG for pending and running actions (#23836)
|
||||
* Display image size for multiarch container images (#23821)
|
||||
* Improve action log display with control chars (#23820)
|
||||
* Fix dropdown direction behavior (#23806)
|
||||
* Fix incorrect/Improve error handle in edit user page (#23805)
|
||||
* Use clippie module to copy to clipboard (#23801)
|
||||
* Make minio package support legacy MD5 checksum (#23768)
|
||||
* Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766)
|
||||
* Refactor docs (#23752)
|
||||
* Fix markup background, improve wiki rendering (#23750)
|
||||
* Make label templates have consistent behavior and priority (#23749)
|
||||
* Improve LoadUnitConfig to handle invalid or duplicate units (#23736)
|
||||
* Append `(comment)` when a link points at a comment rather than the whole issue (#23734)
|
||||
* Clean some legacy files and move some build files (#23699)
|
||||
* Refactor repo commit list (#23690)
|
||||
* Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687)
|
||||
* Add aria attributes to interactive time tooltips. (#23661)
|
||||
* Fix long project name display in issue list and in related dropdown (#23653)
|
||||
* Use data-tooltip-content for tippy tooltip (#23649)
|
||||
* Fix new issue/pull request btn margin when it is next to sort (#23647)
|
||||
* Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (#23626)
|
||||
* Allow new file and edit file preview if it has editable extension (#23624)
|
||||
* Replace a few fontawesome icons with svg (#23602)
|
||||
* `Publish Review` buttons should indicate why they are disabled (#23598)
|
||||
* Convert issue list checkboxes to native (#23596)
|
||||
* Set opaque background on markup and images (#23578)
|
||||
* Use a general approach to show tooltip, fix temporary tooltip bug (#23574)
|
||||
* Improve `<SvgIcon>` to make it output `svg` node and optimize performance (#23570)
|
||||
* Enable color for consistency checks diffs (#23563)
|
||||
* Fix dropdown icon misalignment when using fomantic icon (#23558)
|
||||
* Decouple the issue-template code from comment_tab.tmpl (#23556)
|
||||
* Remove `id="comment-form"` dead code, fix tag (#23555)
|
||||
* Diff improvements (#23553)
|
||||
* Sort Python package descriptors by version to mimic PyPI format (#23550)
|
||||
* Use a general approch to improve a11y for all checkboxes and dropdowns. (#23542)
|
||||
* Fix long name ui issues and label ui issue (#23541)
|
||||
* Return `repository` in npm package metadata endpoint (#23539)
|
||||
* Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538)
|
||||
* Remove stars in dashboard repo list (#23530)
|
||||
* Update mini-css-extract-plugin, remove postcss (#23520)
|
||||
* Change `Close` to either `Close issue` or `Close pull request` (#23506)
|
||||
* Fix theme-auto loading (#23504)
|
||||
* Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491)
|
||||
* Display the version of runner in the runner list (#23490)
|
||||
* Replace Less with CSS (#23481)
|
||||
* Fix `.locale.Tr` function not found in delete modal (#23468)
|
||||
* Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463)
|
||||
* Add project type descriptions in issue badge and improve project icons (#23437)
|
||||
* Use context for `RepositoryList.LoadAttributes` (#23435)
|
||||
* Refactor branch/tag selector to Vue SFC (#23421)
|
||||
* Keep (add if not existing) xmlns attribute for generated SVG images (#23410)
|
||||
* Refactor dashboard repo list to Vue SFC (#23405)
|
||||
* Add workflow error notification in ui (#23404)
|
||||
* Refactor branch/tag selector dropdown (first step) (#23394)
|
||||
* Reduce duplicate and useless code in options (#23369)
|
||||
* Convert `<div class="button">` to `<button class="button">` (#23337)
|
||||
* Add path prefix to ObjectStorage.Iterator (#23332)
|
||||
* Improve cache context (#23330)
|
||||
* Move pidfile creation from setting to web cmd package (#23285)
|
||||
* Fix tags view (#23243)
|
||||
* Add commit info in action page (#23210)
|
||||
* Support paste treepath when creating a new file or updating the file name (#23209)
|
||||
* Allow skipping forks and mirrors from being indexed (#23187)
|
||||
* Use context parameter in services/repository (#23186)
|
||||
* Hide target selector if tag exists when creating new release (#23171)
|
||||
* Improve FindProjects (#23085)
|
||||
* Clean Path in Options (#23006)
|
||||
* Add margin top to the top of branches (#23002)
|
||||
* Remove unnecessary and incorrect `find('.menu').toggle()` (#22987)
|
||||
* Improve GetBoards and getDefaultBoard (#22981)
|
||||
* Improve squash merge commit author and co-author with private emails (#22977)
|
||||
* Add --quiet option to gitea dump (#22969)
|
||||
* Add pagination for dashboard and user activity feeds (#22937)
|
||||
* Handle files starting with colons in WalkGitLog (#22935)
|
||||
* Add "Reviewed by you" filter for pull requests (#22927)
|
||||
* Parse external request id from request headers, and print it in access log (#22906)
|
||||
* Replace `repo.namedBlob` by `git.TreeEntry`. (#22898)
|
||||
* Pull Requests: add button to compare force pushed commits (#22857)
|
||||
* Fix pull request update showing too many commits with multiple branches (#22856)
|
||||
* Require approval to run actions for fork pull request (#22803)
|
||||
* Projects: rename Board to Column in interface and improve consistency (#22767)
|
||||
* Add user visibility in dashboard navbar (#22747)
|
||||
* Add .livemd as a markdown extension (#22730)
|
||||
* Clean up WebAuthn javascript code and remove JQuery code (#22697)
|
||||
* Merge message template support for rebase without merge commit (#22669)
|
||||
* Show editorconfig warnings when viewing a malformed editorconfig (#21257)
|
||||
* Npm packages: set repository link based on the url in package.json (#20379)
|
||||
* BUGFIXES
|
||||
* Add Adopt repository event and handler (#25497) (#25518)
|
||||
* Improve wiki sidebar and TOC (#25460) (#25477)
|
||||
* Make "dismiss" content shown correctly (#25461) (#25465)
|
||||
* Change default email domain for LDAP users (#25425) (#25434)
|
||||
* Fix missing commit message body when the message has leading newlines (#25418) (#25422)
|
||||
* Fix LDAP sync when Username Attribute is empty (#25278) (#25379)
|
||||
* Fetch all git data for embedding correct version in docker image (#25361) (#25373)
|
||||
* Fix incorrect actions ref_name (#25358) (#25367)
|
||||
* Write absolute AppDataPath to app.ini when installing (#25331) (#25347)
|
||||
* Fix incorrect config argument position for builtin SSH server (#25341)
|
||||
* Remove EasyMDE focus outline on text (#25328) (#25332)
|
||||
* Fix displayed RPM repo url (#25310) (#25313)
|
||||
* Fix index generation parallelly failure (#25235) (#25269)
|
||||
* Fix panic when migrating a repo from GitHub with issues (#25246) (#25247)
|
||||
* Fix task list checkbox toggle to work with YAML front matter (#25184) (#25227)
|
||||
* Fix compatible for webhook ref type (#25195) (#25223)
|
||||
* Hide limited users if viewed by anonymous ghost (#25214) (#25220)
|
||||
* Do not overwrite the log mode when installing (#25203) (#25209)
|
||||
* Fix fullscreen for action (#25200) (#25207)
|
||||
* Add `WithPullRequest` for `actionsNotifier` (#25144) (#25197)
|
||||
* Fix `MilestoneIDs` when querying issues (#25125) (#25141)
|
||||
* Fix incorrect git ignore rule and add missing license files (#25135) (#25138)
|
||||
* Remove incorrect element ID on "post-install" page (#25104) (#25129)
|
||||
* Fix 500 error caused by notifications without an issue such as repo transfers (#25101)
|
||||
* Help to recover from corrupted levelqueue (#24912)
|
||||
* Fix 500 error when select `No assignee` filter in issue list page (#24854)
|
||||
* Add validations.required check to dropdown field (#24849)
|
||||
* Reenable creating default webhooks. (#24626)
|
||||
* Fix incorrect user visibility (#24557)
|
||||
* Fix commits pushed with deploy keys not shown in dashboard (#24521)
|
||||
* Check length of `LogIndexes` in case it is outdated (#24516)
|
||||
* Fix incorrect CurrentUser check for docker rootless (#24441)
|
||||
* Fix some mistakes when using `ignSignIn` (#24415)
|
||||
* Fix incorrect CORS response in Http Git handler (#24303)
|
||||
* Fix issue attachment handling (#24202)
|
||||
* Make mention autocomplete case insensitive in new markdown editor (#24190)
|
||||
* Use 1.18's aria role for dropdown menus (#24144)
|
||||
* Fix internal sever error when visiting a PR that bound to the deleted team (#24127)
|
||||
* Add migration to fix external unit access mode of owner/admin team (#24117)
|
||||
* Show friendly 500 error page to users and developers (#24110)
|
||||
* Fix meilisearch not working when searching across multiple repositories (#24109)
|
||||
* Fix math and mermaid rendering bugs (#24049)
|
||||
* Remove "inverted" class on creating new label and cancel buttons (#24030)
|
||||
* Allow repo admins too to delete the repo (#23940)
|
||||
* Disable editing tags (#23883)
|
||||
* Fix review conversation reply (#23846)
|
||||
* Fix incorrect CORS failure detection logic (#23844)
|
||||
* Remove incorrect HTML self close tag (#23748)
|
||||
* Fix incorrect `toggle` buttons (#23676)
|
||||
* Introduce path Clean/Join helper functions (#23495)
|
||||
* Fix missed migration in #22235 (#23482)
|
||||
* Do not store user projects as organization projects (#23353)
|
||||
* Fix incorrect display for comment context menu (#23343)
|
||||
* Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (#23245)
|
||||
* Fix submit button won't refresh in New Repository Fork page (#22994)
|
||||
* Remove stars when repo goes private (#19904)
|
||||
* TESTING
|
||||
* Add missing test case and fix typo in tests (#24915)
|
||||
* Kd/fix redis unit test (#24650)
|
||||
* Add owner team permission check test (#24096)
|
||||
* Test renderReadmeFile (#23185)
|
||||
* Add default owner team to privated_org and limited_org in unit test (#23109)
|
||||
* Speed up HasUserStopwatch & GetActiveStopwatch (#23051)
|
||||
* Remove all package data after tests (#22984)
|
||||
* TRANSLATION
|
||||
* Add Chinese documentations for Actions (#24902)
|
||||
* Change `valid_until` translation to `valid_until_date` and include placeholder for the date (#24563)
|
||||
* Change `add_on` translation to `added_on` and include placeholder for the date (#24562)
|
||||
* Change `join_on` translation to `joined_on` and include placeholder for the date (#24550)
|
||||
* Use double quotes consistently in en-US (#24141)
|
||||
* Clarify Gitea/Crowdin locale behaviors, add tests for LocaleStore, fix some strings with semicolons (#23819)
|
||||
* Update localization.zh-cn.md (#23448)
|
||||
* Fix grammar in error message (#23273)
|
||||
* BUILD
|
||||
* Upgrade snap to node 20 (#24990)
|
||||
* Use Go 1.20 for next release (#24859)
|
||||
* Ignore build for docs only (#24761)
|
||||
* Update cron-translations.yml (#24708)
|
||||
* Update to Alpine 3.18 (#24700)
|
||||
* Check latest version on CI (#24556)
|
||||
* Upgrade to Node 20 on CI, enable actions cancellation (#24524)
|
||||
* Mark `/templates/swagger/v1_json.tmpl` as generated file (#24306)
|
||||
* Enable forbidigo linter (#24278)
|
||||
* Introduce lint-md and compliance-docs pipeline (#24021)
|
||||
* Add eslint-plugin-custom-elements (#23991)
|
||||
* Update eslints for Vue 3 (#23935)
|
||||
* Improve backport-locales.go (#23807)
|
||||
* Don't run unnecessary steps when only docs changed (#23103)
|
||||
* DOCS
|
||||
* Use the new download domain replace the old (#25405) (#25409)
|
||||
* Add Exoscale to installation on cloud provider docs (#25342) (#25346)
|
||||
* Improve some documents: release version, logging, NFS lock (#25202) (#25204)
|
||||
* Change branch name from master to main in some documents' links (#25126) (#25140)
|
||||
* Introduce how to configure cache when starting a Runner with Docker (#25077)
|
||||
* Docs: remove an extraneous whitespace (#24949)
|
||||
* Update Asciidoc markup example with safe defaults (#24920)
|
||||
* Fix <empty> in administration/config-cheat-sheet.en-us.md (#24905)
|
||||
* Rename docs packages title from xxx Packages Repository -> xxx Package Registry (#24895)
|
||||
* Replace `drone exec` to `act_runner exec` in test README.md (#24791)
|
||||
* Update packages overview page (#24730)
|
||||
* Docs for creating a user to run Gitea on Fedora/RHEL/CentOS (#24725)
|
||||
* Move actions as usage's subdirectory and update comparsion zh-cn version (#24719)
|
||||
* Document `redis-cluster` explicitly in config (#24717)
|
||||
* Improve reverse-proxy document and fix nginx config bug (#24616)
|
||||
* Fix broken `README` link (#24546)
|
||||
* Update `CONTRIBUTING.md` (#24492)
|
||||
* Docs for Gitea Actions (#24405)
|
||||
* Zh-cn support on doc pages (#24166)
|
||||
* Fix https setup doc zh-cn (#24015)
|
||||
* Adjust some documentations titles (#23941)
|
||||
* More specific and unique feed name for NuGet install command template. (#23889)
|
||||
* Clarify that Gitea requires JavaScript (#23677)
|
||||
* Rename develop -> development, contribute -> contributing, administer -> administration (#23662)
|
||||
* Update PR documentation (#23620)
|
||||
* Add package registry architecture overview (#23445)
|
||||
* Add gradle samples in maven doc of packages (#23374)
|
||||
* Improve the frontend guideline (#23298)
|
||||
* Add document for `webcomponents` (#23261)
|
||||
* Add Gitea Community Code of Conduct (#23188)
|
||||
* Avoid Hugo from adding quote to actions url (#23097)
|
||||
* Improve reverse proxies documentation (#23068)
|
||||
* Docs: HTTPS configuration for zh-cn (#23039)
|
||||
* MISC
|
||||
* Use "utf8mb4" for MySQL by default (#25432)
|
||||
* Show outdated comments in files changed tab (#24936) (#25428)
|
||||
* Avoid polluting config file when "save" (#25395) (#25406)
|
||||
* Fix blank dir message when uploading files from web editor (#25391) (#25400)
|
||||
* Fix issue filters on mobile view (#25368) (#25371)
|
||||
* Avoid polluting the config (#25345) (#25354)
|
||||
* Fix action runner last online state on edit page (#25337)
|
||||
* Remove fomantic inverted variations (#25286) (#25289)
|
||||
* Show OAuth2 errors to end users (#25261) (#25271)
|
||||
* Fix profile render when the README.md size is larger than 1024 bytes (#25270)
|
||||
* Fix strange UI behavior of cancelling dismiss review modal (#25172)
|
||||
* Update js dependencies (#25137) (#25151)
|
||||
* Fix swagger documentation for multiple files API endpoint (#25110)
|
||||
* Fix link to customizing-gitea (#25056)
|
||||
* Add Link to Stars and Forks Page to Repo List (#24931)
|
||||
* Improve confusable character string (#24911)
|
||||
* Fix install page context, make the install page tests really test (#24858)
|
||||
* Add gitea manager reload-templates command (#24843)
|
||||
* Create pull request for base after editing file, if not enabled on fork (#24841)
|
||||
* Fix video width overflow in markdown, and other changes to match img (#24834)
|
||||
* Support Copy Link for video attachments (#24833)
|
||||
* Improve accessibility when (re-)viewing files (#24817)
|
||||
* Add IsErrRepoFilesAlreadyExist check when fork repo (#24678)
|
||||
* Fix typo in act-runner file (#24652)
|
||||
* Do not send "registration success email" for external auth sources (#24632)
|
||||
* Filter get single commit (#24613)
|
||||
* Make diff view full width again (#24598)
|
||||
* Add permission check for moving issue action in project view page (#24589)
|
||||
* Revert "Prevent a user with a different email from accepting the team invite" (#24531)
|
||||
* Temporarily disable PATs until next release (#24527)
|
||||
* Clean up polluted styles and remove dead CSS code (#24497)
|
||||
* Faster git.GetDivergingCommits (#24482)
|
||||
* Fix test delivery button in repo webhook settings page (#24478)
|
||||
* Use globally shared HTMLRender (#24436)
|
||||
* Fix layouts of admin table / adapt repo / email test (#24370)
|
||||
* Gitea Actions add `base_ref`, `head_ref`, `api_url`, `ref_type` fields (#24356)
|
||||
* Fix 404 error when leaving the last private org team (#24322)
|
||||
* Improve External Wiki in Repo Header (#24304)
|
||||
* Updated upgrade script that is informing user that Gitea service has to be running in order to upgrade it (#24260)
|
||||
* Add run status in action view page (#24223)
|
||||
* Show visibility status of email in own profile (#23900)
|
||||
* Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890)
|
||||
* Add self to maintainers (#23644)
|
||||
* Upgrade to npm lockfile v3 and explicitely set it (#23561)
|
||||
* Improve indices for `action` table (#23532)
|
||||
* Update JS dependencies, Require Node.js 16 (#23528)
|
||||
* Add init file for Ubuntu (#23362)
|
||||
* Update go.mod dependencies (#23126)
|
||||
* Use minio/sha256-simd for accelerated SHA256 (#23052)
|
||||
* More detailed branch delete message (#22696)
|
||||
* Add tooltips to `Hide comment type` settings where necessary (#21306)
|
||||
|
||||
## [1.19.3](https://github.com/go-gitea/gitea/releases/tag/1.19.3) - 2023-05-03
|
||||
|
||||
* SECURITY
|
||||
|
|
|
@ -174,7 +174,7 @@ Here's how to run the test suite:
|
|||
## Translation
|
||||
|
||||
All translation work happens on [Crowdin](https://crowdin.com/project/gitea).
|
||||
The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini).
|
||||
The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini).
|
||||
It is synced regularly with Crowdin. \
|
||||
Other locales on main branch **should not** be updated manually as they will be overwritten with each sync. \
|
||||
Once a language has reached a **satisfactory percentage** of translated keys (~25%), it will be synced back into this repo and included in the next released version.
|
||||
|
@ -557,7 +557,7 @@ be reviewed by two maintainers and must pass the automatic tests.
|
|||
- And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
|
||||
- If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
|
||||
- Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
|
||||
- Verify all release assets were correctly published through CI on dl.gitea.io and GitHub releases. Once ACKed:
|
||||
- bump the version of https://dl.gitea.io/gitea/version.json
|
||||
- Verify all release assets were correctly published through CI on dl.gitea.com and GitHub releases. Once ACKed:
|
||||
- bump the version of https://dl.gitea.com/gitea/version.json
|
||||
- merge the blog post PR
|
||||
- announce the release in discord `#announcements`
|
||||
|
|
27
Makefile
27
Makefile
|
@ -79,12 +79,21 @@ endif
|
|||
STORED_VERSION_FILE := VERSION
|
||||
HUGO_VERSION ?= 0.111.3
|
||||
|
||||
GITHUB_REF_TYPE ?= branch
|
||||
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
# backwards compatible to build with Drone
|
||||
ifneq ($(DRONE_TAG),)
|
||||
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||
GITHUB_REF_TYPE := tag
|
||||
GITHUB_REF_NAME := $(DRONE_TAG)
|
||||
endif
|
||||
|
||||
ifneq ($(GITHUB_REF_TYPE),branch)
|
||||
VERSION ?= $(subst v,,$(GITHUB_REF_NAME))
|
||||
GITEA_VERSION ?= $(VERSION)
|
||||
else
|
||||
ifneq ($(DRONE_BRANCH),)
|
||||
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||
ifneq ($(GITHUB_REF_NAME),)
|
||||
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))
|
||||
else
|
||||
VERSION ?= main
|
||||
endif
|
||||
|
@ -831,28 +840,28 @@ release-windows: | $(DIST_DIRS)
|
|||
ifeq (,$(findstring gogit,$(TAGS)))
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
|
||||
endif
|
||||
ifeq ($(CI),true)
|
||||
ifneq ($(DRONE_TAG),)
|
||||
cp /build/* $(DIST)/binaries
|
||||
endif
|
||||
|
||||
.PHONY: release-linux
|
||||
release-linux: | $(DIST_DIRS)
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
|
||||
ifeq ($(CI),true)
|
||||
ifneq ($(DRONE_TAG),)
|
||||
cp /build/* $(DIST)/binaries
|
||||
endif
|
||||
|
||||
.PHONY: release-darwin
|
||||
release-darwin: | $(DIST_DIRS)
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
|
||||
ifeq ($(CI),true)
|
||||
ifneq ($(DRONE_TAG),)
|
||||
cp /build/* $(DIST)/binaries
|
||||
endif
|
||||
|
||||
.PHONY: release-freebsd
|
||||
release-freebsd: | $(DIST_DIRS)
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
|
||||
ifeq ($(CI),true)
|
||||
ifneq ($(DRONE_TAG),)
|
||||
cp /build/* $(DIST)/binaries
|
||||
endif
|
||||
|
||||
|
@ -1010,9 +1019,5 @@ docker:
|
|||
docker build --disable-content-trust=false -t $(DOCKER_REF) .
|
||||
# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" .
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build:
|
||||
docker run -ti --rm -v "$(CURDIR):/srv/app/src/code.gitea.io/gitea" -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" CGO_EXTRA_CFLAGS="$(CGO_EXTRA_CFLAGS)" webhippie/golang:edge make clean build
|
||||
|
||||
# This endif closes the if at the top of the file
|
||||
endif
|
||||
|
|
|
@ -173,8 +173,8 @@ for the full license text.
|
|||
|
||||
Looking for an overview of the interface? Check it out!
|
||||
|
||||
|![Dashboard](https://dl.gitea.io/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.io/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.io/screenshots/global_issues.png)|
|
||||
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
|
||||
|:---:|:---:|:---:|
|
||||
|![Branches](https://dl.gitea.io/screenshots/branches.png)|![Web Editor](https://dl.gitea.io/screenshots/web_editor.png)|![Activity](https://dl.gitea.io/screenshots/activity.png)|
|
||||
|![New Migration](https://dl.gitea.io/screenshots/migration.png)|![Migrating](https://dl.gitea.io/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
|
||||
![Pull Request Dark](https://dl.gitea.io/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.io/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.io/screenshots/diff_dark.png)|
|
||||
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
|
||||
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
|
||||
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
|
||||
|
|
|
@ -91,8 +91,8 @@ Fork -> Patch -> Push -> Pull Request
|
|||
|
||||
## 截图
|
||||
|
||||
|![Dashboard](https://dl.gitea.io/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.io/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.io/screenshots/global_issues.png)|
|
||||
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
|
||||
|:---:|:---:|:---:|
|
||||
|![Branches](https://dl.gitea.io/screenshots/branches.png)|![Web Editor](https://dl.gitea.io/screenshots/web_editor.png)|![Activity](https://dl.gitea.io/screenshots/activity.png)|
|
||||
|![New Migration](https://dl.gitea.io/screenshots/migration.png)|![Migrating](https://dl.gitea.io/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
|
||||
![Pull Request Dark](https://dl.gitea.io/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.io/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.io/screenshots/diff_dark.png)|
|
||||
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
|
||||
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
|
||||
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
|
||||
|
|
|
@ -42,7 +42,7 @@ func runGenerateActionsRunnerToken(c *cli.Context) error {
|
|||
ctx, cancel := installSignals()
|
||||
defer cancel()
|
||||
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
|
||||
scope := c.String("scope")
|
||||
|
||||
|
|
20
cmd/cmd.go
20
cmd/cmd.go
|
@ -58,7 +58,7 @@ func confirm() (bool, error) {
|
|||
}
|
||||
|
||||
func initDB(ctx context.Context) error {
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
setting.LoadDBSetting()
|
||||
setting.InitSQLLoggersForCli(log.INFO)
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ func runRecreateTable(ctx *cli.Context) error {
|
|||
golog.SetOutput(log.LoggerToWriter(log.GetLogger(log.DEFAULT).Info))
|
||||
|
||||
debug := ctx.Bool("debug")
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
setting.LoadDBSetting()
|
||||
|
||||
if debug {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ func runDump(ctx *cli.Context) error {
|
|||
}
|
||||
fileName += "." + outType
|
||||
}
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
|
||||
// make sure we are logging to the console no matter what the configuration tells us do to
|
||||
// FIXME: don't use CfgProvider directly
|
||||
|
@ -353,9 +353,9 @@ func runDump(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
excludes = append(excludes, setting.RepoRootPath)
|
||||
excludes = append(excludes, setting.LFS.Path)
|
||||
excludes = append(excludes, setting.Attachment.Path)
|
||||
excludes = append(excludes, setting.Packages.Path)
|
||||
excludes = append(excludes, setting.LFS.Storage.Path)
|
||||
excludes = append(excludes, setting.Attachment.Storage.Path)
|
||||
excludes = append(excludes, setting.Packages.Storage.Path)
|
||||
excludes = append(excludes, setting.Log.RootPath)
|
||||
excludes = append(excludes, absFileName)
|
||||
if err := addRecursiveExclude(w, "data", setting.AppDataPath, excludes, verbose); err != nil {
|
||||
|
|
|
@ -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",
|
||||
|
@ -99,11 +99,6 @@ type assetFile struct {
|
|||
func initEmbeddedExtractor(c *cli.Context) error {
|
||||
setupConsoleLogger(log.ERROR, log.CanColorStderr, os.Stderr)
|
||||
|
||||
// Read configuration file
|
||||
setting.Init(&setting.Options{
|
||||
AllowEmpty: true,
|
||||
})
|
||||
|
||||
patterns, err := compileCollectPatterns(c.Args())
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -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"
|
||||
|
@ -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,
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/private"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
|
@ -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{
|
||||
|
|
|
@ -16,7 +16,7 @@ func runSendMail(c *cli.Context) error {
|
|||
ctx, cancel := installSignals()
|
||||
defer cancel()
|
||||
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
|
||||
if err := argsSet(c, "title"); err != nil {
|
||||
return err
|
||||
|
|
|
@ -179,7 +179,7 @@ func runMigrateStorage(ctx *cli.Context) error {
|
|||
switch strings.ToLower(ctx.String("storage")) {
|
||||
case "":
|
||||
fallthrough
|
||||
case string(storage.LocalStorageType):
|
||||
case string(setting.LocalStorageType):
|
||||
p := ctx.String("path")
|
||||
if p == "" {
|
||||
log.Fatal("Path must be given when storage is loal")
|
||||
|
@ -187,22 +187,24 @@ func runMigrateStorage(ctx *cli.Context) error {
|
|||
}
|
||||
dstStorage, err = storage.NewLocalStorage(
|
||||
stdCtx,
|
||||
storage.LocalStorageConfig{
|
||||
&setting.Storage{
|
||||
Path: p,
|
||||
})
|
||||
case string(storage.MinioStorageType):
|
||||
case string(setting.MinioStorageType):
|
||||
dstStorage, err = storage.NewMinioStorage(
|
||||
stdCtx,
|
||||
storage.MinioStorageConfig{
|
||||
Endpoint: ctx.String("minio-endpoint"),
|
||||
AccessKeyID: ctx.String("minio-access-key-id"),
|
||||
SecretAccessKey: ctx.String("minio-secret-access-key"),
|
||||
Bucket: ctx.String("minio-bucket"),
|
||||
Location: ctx.String("minio-location"),
|
||||
BasePath: ctx.String("minio-base-path"),
|
||||
UseSSL: ctx.Bool("minio-use-ssl"),
|
||||
InsecureSkipVerify: ctx.Bool("minio-insecure-skip-verify"),
|
||||
ChecksumAlgorithm: ctx.String("minio-checksum-algorithm"),
|
||||
&setting.Storage{
|
||||
MinioConfig: setting.MinioStorageConfig{
|
||||
Endpoint: ctx.String("minio-endpoint"),
|
||||
AccessKeyID: ctx.String("minio-access-key-id"),
|
||||
SecretAccessKey: ctx.String("minio-secret-access-key"),
|
||||
Bucket: ctx.String("minio-bucket"),
|
||||
Location: ctx.String("minio-location"),
|
||||
BasePath: ctx.String("minio-base-path"),
|
||||
UseSSL: ctx.Bool("minio-use-ssl"),
|
||||
InsecureSkipVerify: ctx.Bool("minio-insecure-skip-verify"),
|
||||
ChecksumAlgorithm: ctx.String("minio-checksum-algorithm"),
|
||||
},
|
||||
})
|
||||
default:
|
||||
return fmt.Errorf("unsupported storage type: %s", ctx.String("storage"))
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"code.gitea.io/gitea/models/unittest"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
packages_module "code.gitea.io/gitea/modules/packages"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/storage"
|
||||
packages_service "code.gitea.io/gitea/services/packages"
|
||||
|
||||
|
@ -57,7 +58,7 @@ func TestMigratePackages(t *testing.T) {
|
|||
|
||||
dstStorage, err := storage.NewLocalStorage(
|
||||
ctx,
|
||||
storage.LocalStorageConfig{
|
||||
&setting.Storage{
|
||||
Path: p,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
|
|
@ -51,7 +51,7 @@ func runRestoreRepository(c *cli.Context) error {
|
|||
ctx, cancel := installSignals()
|
||||
defer cancel()
|
||||
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
var units []string
|
||||
if s := c.String("units"); s != "" {
|
||||
units = strings.Split(s, ",")
|
||||
|
|
|
@ -44,6 +44,7 @@ var CmdServ = cli.Command{
|
|||
Name: "serv",
|
||||
Usage: "This command should only be called by SSH shell",
|
||||
Description: "Serv provides access auth for repositories",
|
||||
Before: PrepareConsoleLoggerLevel(log.FATAL),
|
||||
Action: runServ,
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
|
@ -61,7 +62,7 @@ func setup(ctx context.Context, debug bool) {
|
|||
} else {
|
||||
setupConsoleLogger(log.FATAL, false, os.Stderr)
|
||||
}
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
if debug {
|
||||
setting.RunMode = "dev"
|
||||
}
|
||||
|
|
186
cmd/web.go
186
cmd/web.go
|
@ -35,6 +35,7 @@ var CmdWeb = cli.Command{
|
|||
Usage: "Start Gitea web server",
|
||||
Description: `Gitea web server is the only thing you need to run,
|
||||
and it takes care of all the other things for you`,
|
||||
Before: PrepareConsoleLoggerLevel(log.INFO),
|
||||
Action: runWeb,
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
|
@ -101,12 +102,111 @@ func createPIDFile(pidPath string) {
|
|||
}
|
||||
}
|
||||
|
||||
func runWeb(ctx *cli.Context) error {
|
||||
if ctx.Bool("verbose") {
|
||||
setupConsoleLogger(log.TRACE, log.CanColorStdout, os.Stdout)
|
||||
} else if ctx.Bool("quiet") {
|
||||
setupConsoleLogger(log.FATAL, log.CanColorStdout, os.Stdout)
|
||||
func serveInstall(ctx *cli.Context) error {
|
||||
log.Info("Gitea version: %s%s", setting.AppVer, setting.AppBuiltWith)
|
||||
log.Info("App path: %s", setting.AppPath)
|
||||
log.Info("Work path: %s", setting.AppWorkPath)
|
||||
log.Info("Custom path: %s", setting.CustomPath)
|
||||
log.Info("Config file: %s", setting.CustomConf)
|
||||
log.Info("Prepare to run install page")
|
||||
|
||||
routers.InitWebInstallPage(graceful.GetManager().HammerContext())
|
||||
|
||||
// Flag for port number in case first time run conflict
|
||||
if ctx.IsSet("port") {
|
||||
if err := setPort(ctx.String("port")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if ctx.IsSet("install-port") {
|
||||
if err := setPort(ctx.String("install-port")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
c := install.Routes()
|
||||
err := listen(c, false)
|
||||
if err != nil {
|
||||
log.Critical("Unable to open listener for installer. Is Gitea already running?")
|
||||
graceful.GetManager().DoGracefulShutdown()
|
||||
}
|
||||
select {
|
||||
case <-graceful.GetManager().IsShutdown():
|
||||
<-graceful.GetManager().Done()
|
||||
log.Info("PID: %d Gitea Web Finished", os.Getpid())
|
||||
log.GetManager().Close()
|
||||
return err
|
||||
default:
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func serveInstalled(ctx *cli.Context) error {
|
||||
setting.InitCfgProvider(setting.CustomConf)
|
||||
setting.LoadCommonSettings()
|
||||
setting.MustInstalled()
|
||||
|
||||
log.Info("Gitea version: %s%s", setting.AppVer, setting.AppBuiltWith)
|
||||
log.Info("App path: %s", setting.AppPath)
|
||||
log.Info("Work path: %s", setting.AppWorkPath)
|
||||
log.Info("Custom path: %s", setting.CustomPath)
|
||||
log.Info("Config file: %s", setting.CustomConf)
|
||||
log.Info("Run mode: %s", setting.RunMode)
|
||||
log.Info("Prepare to run web server")
|
||||
|
||||
if setting.AppWorkPathMismatch {
|
||||
log.Error("WORK_PATH from config %q doesn't match other paths from environment variables or command arguments. "+
|
||||
"Only WORK_PATH in config should be set and used. Please remove the other outdated work paths from environment variables and command arguments", setting.CustomConf)
|
||||
}
|
||||
|
||||
rootCfg := setting.CfgProvider
|
||||
if rootCfg.Section("").Key("WORK_PATH").String() == "" {
|
||||
saveCfg, err := rootCfg.PrepareSaving()
|
||||
if err != nil {
|
||||
log.Error("Unable to prepare saving WORK_PATH=%s to config %q: %v\nYou must set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
|
||||
} else {
|
||||
rootCfg.Section("").Key("WORK_PATH").SetValue(setting.AppWorkPath)
|
||||
saveCfg.Section("").Key("WORK_PATH").SetValue(setting.AppWorkPath)
|
||||
if err = saveCfg.Save(); err != nil {
|
||||
log.Error("Unable to update WORK_PATH=%s to config %q: %v\nYou must set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
routers.InitWebInstalled(graceful.GetManager().HammerContext())
|
||||
|
||||
// We check that AppDataPath exists here (it should have been created during installation)
|
||||
// We can't check it in `InitWebInstalled`, because some integration tests
|
||||
// use cmd -> InitWebInstalled, but the AppDataPath doesn't exist during those tests.
|
||||
if _, err := os.Stat(setting.AppDataPath); err != nil {
|
||||
log.Fatal("Can not find APP_DATA_PATH %q", setting.AppDataPath)
|
||||
}
|
||||
|
||||
// Override the provided port number within the configuration
|
||||
if ctx.IsSet("port") {
|
||||
if err := setPort(ctx.String("port")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Set up Chi routes
|
||||
c := routers.NormalRoutes(graceful.GetManager().HammerContext())
|
||||
err := listen(c, true)
|
||||
<-graceful.GetManager().Done()
|
||||
log.Info("PID: %d Gitea Web Finished", os.Getpid())
|
||||
log.GetManager().Close()
|
||||
return err
|
||||
}
|
||||
|
||||
func servePprof() {
|
||||
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
|
||||
_, _, finished := process.GetManager().AddTypedContext(context.Background(), "Web: PProf Server", process.SystemProcessType, true)
|
||||
// The pprof server is for debug purpose only, it shouldn't be exposed on public network. At the moment it's not worth to introduce a configurable option for it.
|
||||
log.Info("Starting pprof server on localhost:6060")
|
||||
log.Info("Stopped pprof server: %v", http.ListenAndServe("localhost:6060", nil))
|
||||
finished()
|
||||
}
|
||||
|
||||
func runWeb(ctx *cli.Context) error {
|
||||
defer func() {
|
||||
if panicked := recover(); panicked != nil {
|
||||
log.Fatal("PANIC: %v\n%s", panicked, log.Stack(2))
|
||||
|
@ -128,75 +228,19 @@ func runWeb(ctx *cli.Context) error {
|
|||
createPIDFile(ctx.String("pid"))
|
||||
}
|
||||
|
||||
// Perform pre-initialization
|
||||
needsInstall := install.PreloadSettings(graceful.GetManager().HammerContext())
|
||||
if needsInstall {
|
||||
// Flag for port number in case first time run conflict
|
||||
if ctx.IsSet("port") {
|
||||
if err := setPort(ctx.String("port")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if ctx.IsSet("install-port") {
|
||||
if err := setPort(ctx.String("install-port")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
c := install.Routes()
|
||||
err := listen(c, false)
|
||||
if err != nil {
|
||||
log.Critical("Unable to open listener for installer. Is Gitea already running?")
|
||||
graceful.GetManager().DoGracefulShutdown()
|
||||
}
|
||||
select {
|
||||
case <-graceful.GetManager().IsShutdown():
|
||||
<-graceful.GetManager().Done()
|
||||
log.Info("PID: %d Gitea Web Finished", os.Getpid())
|
||||
log.GetManager().Close()
|
||||
if !setting.InstallLock {
|
||||
if err := serveInstall(ctx); err != nil {
|
||||
return err
|
||||
default:
|
||||
}
|
||||
} else {
|
||||
NoInstallListener()
|
||||
}
|
||||
|
||||
if setting.EnablePprof {
|
||||
go func() {
|
||||
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
|
||||
_, _, finished := process.GetManager().AddTypedContext(context.Background(), "Web: PProf Server", process.SystemProcessType, true)
|
||||
// The pprof server is for debug purpose only, it shouldn't be exposed on public network. At the moment it's not worth to introduce a configurable option for it.
|
||||
log.Info("Starting pprof server on localhost:6060")
|
||||
log.Info("Stopped pprof server: %v", http.ListenAndServe("localhost:6060", nil))
|
||||
finished()
|
||||
}()
|
||||
go servePprof()
|
||||
}
|
||||
|
||||
log.Info("Global init")
|
||||
// Perform global initialization
|
||||
setting.Init(&setting.Options{})
|
||||
routers.GlobalInitInstalled(graceful.GetManager().HammerContext())
|
||||
|
||||
// We check that AppDataPath exists here (it should have been created during installation)
|
||||
// We can't check it in `GlobalInitInstalled`, because some integration tests
|
||||
// use cmd -> GlobalInitInstalled, but the AppDataPath doesn't exist during those tests.
|
||||
if _, err := os.Stat(setting.AppDataPath); err != nil {
|
||||
log.Fatal("Can not find APP_DATA_PATH '%s'", setting.AppDataPath)
|
||||
}
|
||||
|
||||
// Override the provided port number within the configuration
|
||||
if ctx.IsSet("port") {
|
||||
if err := setPort(ctx.String("port")); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Set up Chi routes
|
||||
c := routers.NormalRoutes(graceful.GetManager().HammerContext())
|
||||
err := listen(c, true)
|
||||
<-graceful.GetManager().Done()
|
||||
log.Info("PID: %d Gitea Web Finished", os.Getpid())
|
||||
log.GetManager().Close()
|
||||
return err
|
||||
return serveInstalled(ctx)
|
||||
}
|
||||
|
||||
func setPort(port string) error {
|
||||
|
@ -217,9 +261,15 @@ func setPort(port string) error {
|
|||
defaultLocalURL += ":" + setting.HTTPPort + "/"
|
||||
|
||||
// Save LOCAL_ROOT_URL if port changed
|
||||
setting.CfgProvider.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
|
||||
if err := setting.CfgProvider.Save(); err != nil {
|
||||
return fmt.Errorf("Failed to save config file: %v", err)
|
||||
rootCfg := setting.CfgProvider
|
||||
saveCfg, err := rootCfg.PrepareSaving()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to save config file: %v", err)
|
||||
}
|
||||
rootCfg.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
|
||||
saveCfg.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
|
||||
if err = saveCfg.Save(); err != nil {
|
||||
return fmt.Errorf("failed to save config file: %v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -81,8 +81,6 @@ func main() {
|
|||
},
|
||||
}
|
||||
app.Action = runEnvironmentToIni
|
||||
setting.SetCustomPathAndConf("", "", "")
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to run app with %s: %v", os.Args, err)
|
||||
|
@ -90,12 +88,13 @@ func main() {
|
|||
}
|
||||
|
||||
func runEnvironmentToIni(c *cli.Context) error {
|
||||
providedCustom := c.String("custom-path")
|
||||
providedConf := c.String("config")
|
||||
providedWorkPath := c.String("work-path")
|
||||
setting.SetCustomPathAndConf(providedCustom, providedConf, providedWorkPath)
|
||||
setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{
|
||||
WorkPath: c.String("work-path"),
|
||||
CustomPath: c.String("custom-path"),
|
||||
CustomConf: c.String("config"),
|
||||
})
|
||||
|
||||
cfg, err := setting.NewConfigProviderFromFile(&setting.Options{CustomConf: setting.CustomConf, AllowEmpty: true})
|
||||
cfg, err := setting.NewConfigProviderFromFile(setting.CustomConf)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to load custom conf '%s': %v", setting.CustomConf, err)
|
||||
}
|
||||
|
|
|
@ -2159,7 +2159,7 @@ LEVEL = Info
|
|||
;RUN_AT_START = false
|
||||
;ENABLE_SUCCESS_NOTICE = false
|
||||
;SCHEDULE = @every 168h
|
||||
;HTTP_ENDPOINT = https://dl.gitea.io/gitea/version.json
|
||||
;HTTP_ENDPOINT = https://dl.gitea.com/gitea/version.json
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -2392,6 +2392,10 @@ LEVEL = Info
|
|||
;; Enable/Disable package registry capabilities
|
||||
;ENABLED = true
|
||||
;;
|
||||
;STORAGE_TYPE = local
|
||||
;; override the minio base path if storage type is minio
|
||||
;MINIO_BASE_PATH = packages/
|
||||
;;
|
||||
;; Path for chunked uploads. Defaults to APP_DATA_PATH + `tmp/package-upload`
|
||||
;CHUNKED_UPLOAD_PATH = tmp/package-upload
|
||||
;;
|
||||
|
@ -2452,6 +2456,19 @@ LEVEL = Info
|
|||
;; storage type
|
||||
;STORAGE_TYPE = local
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; repo-archive storage will override storage
|
||||
;;
|
||||
;[repo-archive]
|
||||
;STORAGE_TYPE = local
|
||||
;;
|
||||
;; Where your lfs files reside, default is data/lfs.
|
||||
;PATH = data/repo-archive
|
||||
;;
|
||||
;; override the minio base path if storage type is minio
|
||||
;MINIO_BASE_PATH = repo-archive/
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; settings for repository archives, will override storage setting
|
||||
|
@ -2471,6 +2488,9 @@ LEVEL = Info
|
|||
;;
|
||||
;; Where your lfs files reside, default is data/lfs.
|
||||
;PATH = data/lfs
|
||||
;;
|
||||
;; override the minio base path if storage type is minio
|
||||
;MINIO_BASE_PATH = lfs/
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -2520,8 +2540,9 @@ LEVEL = Info
|
|||
; [actions]
|
||||
;; Enable/Disable actions capabilities
|
||||
;ENABLED = false
|
||||
;; Default address to get action plugins, e.g. the default value means downloading from "https://gitea.com/actions/checkout" for "uses: actions/checkout@v3"
|
||||
;DEFAULT_ACTIONS_URL = https://gitea.com
|
||||
;;
|
||||
;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
|
||||
;DEFAULT_ACTIONS_URL = github
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -108,6 +108,14 @@ Admin operations:
|
|||
- `--all`, `-A`: Force a password change for all users
|
||||
- `--exclude username`, `-e username`: Exclude the given user. Can be set multiple times.
|
||||
- `--unset`: Revoke forced password change for the given users
|
||||
- `generate-access-token`:
|
||||
- Options:
|
||||
- `--username value`, `-u value`: Username. Required.
|
||||
- `--token-name value`, `-t value`: Token name. Required.
|
||||
- `--scopes value`: Comma-separated list of scopes. Scopes follow the format `[read|write]:<block>` or `all` where `<block>` is one of the available visual groups you can see when opening the API page showing the available routes (for example `repo`).
|
||||
- Examples:
|
||||
- `gitea admin user generate-access-token --username myname --token-name mytoken`
|
||||
- `gitea admin user generate-access-token --help`
|
||||
- `regenerate`
|
||||
- Options:
|
||||
- `hooks`: Regenerate Git Hooks for all repositories
|
||||
|
|
|
@ -1013,7 +1013,7 @@ Default templates for project boards:
|
|||
- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED).
|
||||
- `ENABLE_SUCCESS_NOTICE`: **true**: Set to false to switch off success notices.
|
||||
- `SCHEDULE`: **@every 168h**: Cron syntax for scheduling a work, e.g. `@every 168h`.
|
||||
- `HTTP_ENDPOINT`: **https://dl.gitea.io/gitea/version.json**: the endpoint that Gitea will check for newer versions
|
||||
- `HTTP_ENDPOINT`: **https://dl.gitea.com/gitea/version.json**: the endpoint that Gitea will check for newer versions
|
||||
|
||||
#### Cron - Delete all old system notices from database (`cron.delete_old_system_notices`)
|
||||
|
||||
|
@ -1254,8 +1254,9 @@ is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`.
|
|||
|
||||
## Storage (`storage`)
|
||||
|
||||
Default storage configuration for attachments, lfs, avatars and etc.
|
||||
Default storage configuration for attachments, lfs, avatars, repo-avatars, repo-archive, packages, actions_log, actions_artifact.
|
||||
|
||||
- `STORAGE_TYPE`: **local**: Storage type, `local` for local disk or `minio` for s3 compatible object storage service.
|
||||
- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing.
|
||||
- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when `STORAGE_TYPE` is `minio`
|
||||
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when `STORAGE_TYPE` is `minio`
|
||||
|
@ -1265,9 +1266,56 @@ Default storage configuration for attachments, lfs, avatars and etc.
|
|||
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
|
||||
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
|
||||
|
||||
And you can also define a customize storage like below:
|
||||
The recommanded storage configuration for minio like below:
|
||||
|
||||
```ini
|
||||
[storage]
|
||||
STORAGE_TYPE = minio
|
||||
; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||
MINIO_ENDPOINT = localhost:9000
|
||||
; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`
|
||||
MINIO_ACCESS_KEY_ID =
|
||||
; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
|
||||
MINIO_SECRET_ACCESS_KEY =
|
||||
; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio`
|
||||
MINIO_BUCKET = gitea
|
||||
; Minio location to create bucket only available when STORAGE_TYPE is `minio`
|
||||
MINIO_LOCATION = us-east-1
|
||||
; Minio enabled ssl only available when STORAGE_TYPE is `minio`
|
||||
MINIO_USE_SSL = false
|
||||
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
|
||||
MINIO_INSECURE_SKIP_VERIFY = false
|
||||
SERVE_DIRECT = true
|
||||
```
|
||||
|
||||
Defaultly every storage has their default base path like below
|
||||
|
||||
| storage | default base path |
|
||||
| ----------------- | ------------------ |
|
||||
| attachments | attachments/ |
|
||||
| lfs | lfs/ |
|
||||
| avatars | avatars/ |
|
||||
| repo-avatars | repo-avatars/ |
|
||||
| repo-archive | repo-archive/ |
|
||||
| packages | packages/ |
|
||||
| actions_log | actions_log/ |
|
||||
| actions_artifacts | actions_artifacts/ |
|
||||
|
||||
And bucket, basepath or `SERVE_DIRECT` could be special or overrided, if you want to use a different you can:
|
||||
|
||||
```ini
|
||||
[storage.actions_log]
|
||||
MINIO_BUCKET = gitea_actions_log
|
||||
SERVE_DIRECT = true
|
||||
MINIO_BASE_PATH = my_actions_log/ ; default is actions_log/ if blank
|
||||
```
|
||||
|
||||
If you want to customerize a different storage for `lfs` if above default storage defined
|
||||
|
||||
```ini
|
||||
[lfs]
|
||||
STORAGE_TYPE = my_minio
|
||||
|
||||
[storage.my_minio]
|
||||
STORAGE_TYPE = minio
|
||||
; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||
|
@ -1286,8 +1334,6 @@ MINIO_USE_SSL = false
|
|||
MINIO_INSECURE_SKIP_VERIFY = false
|
||||
```
|
||||
|
||||
And used by `[attachment]`, `[lfs]` and etc. as `STORAGE_TYPE`.
|
||||
|
||||
## Repository Archive Storage (`storage.repo-archive`)
|
||||
|
||||
Configuration for repository archive storage. It will inherit from default `[storage]` or
|
||||
|
@ -1306,6 +1352,11 @@ is `data/repo-archive` and the default of `MINIO_BASE_PATH` is `repo-archive/`.
|
|||
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
|
||||
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
|
||||
|
||||
## Repository Archives (`repo-archive`)
|
||||
|
||||
- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
||||
- `MINIO_BASE_PATH`: **repo-archive/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
|
||||
|
||||
## Proxy (`proxy`)
|
||||
|
||||
- `PROXY_ENABLED`: **false**: Enable the proxy if true, all requests to external via HTTP will be affected, if false, no proxy will be used even environment http_proxy/https_proxy
|
||||
|
@ -1323,37 +1374,22 @@ PROXY_HOSTS = *.github.com
|
|||
## Actions (`actions`)
|
||||
|
||||
- `ENABLED`: **false**: Enable/Disable actions capabilities
|
||||
- `DEFAULT_ACTIONS_URL`: **https://gitea.com**: Default address to get action plugins, e.g. the default value means downloading from "<https://gitea.com/actions/checkout>" for "uses: actions/checkout@v3"
|
||||
- `DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
|
||||
- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
||||
- `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
|
||||
|
||||
`DEFAULT_ACTIONS_URL` indicates where should we find the relative path action plugin. i.e. when use an action in a workflow file like
|
||||
`DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path.
|
||||
For example, `uses: actions/checkout@v3` means `https://github.com/actions/checkout@v3` since the value of `DEFAULT_ACTIONS_URL` is `github`.
|
||||
And it can be changed to `self` to make it `root_url_of_your_gitea/actions/checkout@v3`.
|
||||
|
||||
```yaml
|
||||
name: versions
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/*
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
```
|
||||
Please note that using `self` is not recommended for most cases, as it could make names globally ambiguous.
|
||||
Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it.
|
||||
Therefore, please use `self` only if you understand what you are doing.
|
||||
|
||||
Now we need to know how to get actions/checkout, this configuration is the default git server to get it. That means we will get the repository via git clone ${DEFAULT_ACTIONS_URL}/actions/checkout and fetch tag v3.
|
||||
|
||||
To help people who don't want to mirror these actions in their git instances, the default value is https://gitea.com
|
||||
To help people run actions totally in their network, they can change the value and copy all necessary action repositories into their git server.
|
||||
|
||||
Of course we should support the form in future PRs like
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gitea.com/actions/checkout@v3
|
||||
```
|
||||
|
||||
although Github don't support this form.
|
||||
In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
|
||||
However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`.
|
||||
However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub).
|
||||
Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`.
|
||||
|
||||
## Other (`other`)
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ menu:
|
|||
# 配置说明
|
||||
|
||||
这是针对Gitea配置文件的说明,你可以了解Gitea的强大配置。需要说明的是,你的所有改变请修改 `custom/conf/app.ini` 文件而不是源文件。
|
||||
所有默认值可以通过 [app.example.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini) 查看到。
|
||||
所有默认值可以通过 [app.example.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) 查看到。
|
||||
如果你发现 `%(X)s` 这样的内容,请查看 [ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。
|
||||
标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。
|
||||
|
||||
|
@ -414,7 +414,7 @@ LFS 的存储配置。 如果 `STORAGE_TYPE` 为空,则此配置将从 `[stora
|
|||
|
||||
## Storage (`storage`)
|
||||
|
||||
Attachments, lfs, avatars and etc 的默认存储配置。
|
||||
Attachments, lfs, avatars, repo-avatars, repo-archive, packages, actions_log, actions_artifact 的默认存储配置。
|
||||
|
||||
- `STORAGE_TYPE`: **local**: 附件存储类型,`local` 将存储到本地文件夹, `minio` 将存储到 s3 兼容的对象存储服务中。
|
||||
- `SERVE_DIRECT`: **false**: 允许直接重定向到存储系统。当前,仅 Minio/S3 是支持的。
|
||||
|
@ -425,9 +425,59 @@ Attachments, lfs, avatars and etc 的默认存储配置。
|
|||
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||
- `MINIO_USE_SSL`: **false**: Minio enabled ssl,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||
|
||||
你也可以自定义一个存储的名字如下:
|
||||
以下为推荐的 recommanded storage configuration for minio like below:
|
||||
|
||||
```ini
|
||||
[storage]
|
||||
STORAGE_TYPE = minio
|
||||
; uncomment when STORAGE_TYPE = local
|
||||
; PATH = storage root path
|
||||
; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||
MINIO_ENDPOINT = localhost:9000
|
||||
; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`
|
||||
MINIO_ACCESS_KEY_ID =
|
||||
; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
|
||||
MINIO_SECRET_ACCESS_KEY =
|
||||
; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio`
|
||||
MINIO_BUCKET = gitea
|
||||
; Minio location to create bucket only available when STORAGE_TYPE is `minio`
|
||||
MINIO_LOCATION = us-east-1
|
||||
; Minio enabled ssl only available when STORAGE_TYPE is `minio`
|
||||
MINIO_USE_SSL = false
|
||||
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
|
||||
MINIO_INSECURE_SKIP_VERIFY = false
|
||||
SERVE_DIRECT = true
|
||||
```
|
||||
|
||||
默认的,每一个存储都会有各自默认的 BasePath 在同一个minio中,默认值如下:
|
||||
|
||||
| storage | default base path |
|
||||
| ----------------- | ------------------ |
|
||||
| attachments | attachments/ |
|
||||
| lfs | lfs/ |
|
||||
| avatars | avatars/ |
|
||||
| repo-avatars | repo-avatars/ |
|
||||
| repo-archive | repo-archive/ |
|
||||
| packages | packages/ |
|
||||
| actions_log | actions_log/ |
|
||||
| actions_artifacts | actions_artifacts/ |
|
||||
|
||||
同时 bucket, basepath or `SERVE_DIRECT` 是可以被覆写的,像如下所示:
|
||||
|
||||
```ini
|
||||
[storage.actions_log]
|
||||
MINIO_BUCKET = gitea_actions_log
|
||||
SERVE_DIRECT = true
|
||||
MINIO_BASE_PATH = my_actions_log/ ; default is actions_log/ if blank
|
||||
```
|
||||
|
||||
当然你也可以完全自定义,像如下
|
||||
|
||||
```ini
|
||||
[lfs]
|
||||
STORAGE_TYPE = my_minio
|
||||
MINIO_BASE_PATH = my_lfs_basepath
|
||||
|
||||
[storage.my_minio]
|
||||
STORAGE_TYPE = minio
|
||||
; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||
|
@ -444,10 +494,9 @@ MINIO_LOCATION = us-east-1
|
|||
MINIO_USE_SSL = false
|
||||
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
|
||||
MINIO_INSECURE_SKIP_VERIFY = false
|
||||
SERVE_DIRECT = true
|
||||
```
|
||||
|
||||
然后你在 `[attachment]`, `[lfs]` 等中可以把这个名字用作 `STORAGE_TYPE` 的值。
|
||||
|
||||
## Repository Archive Storage (`storage.repo-archive`)
|
||||
|
||||
Repository archive 的存储配置。 如果 `STORAGE_TYPE` 为空,则此配置将从 `[storage]` 继承。如果不为 `local` 或者 `minio` 而为 `xxx`, 则从 `[storage.xxx]` 继承。当继承时, `PATH` 默认为 `data/repo-archive`,`MINIO_BASE_PATH` 默认为 `repo-archive/`。
|
||||
|
|
|
@ -24,7 +24,7 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
|
|||
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步:
|
||||
|
||||
- [快速备忘单](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
||||
- [完整配置清单](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||
- [完整配置清单](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
|
||||
|
||||
如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM`
|
||||
环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。
|
||||
|
@ -67,7 +67,7 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
|
|||
|
||||
同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与
|
||||
`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配
|
||||
([source in GitHub](https://github.com/go-gitea/gitea/blob/master/templates/repo/header.tmpl))
|
||||
([source in GitHub](https://github.com/go-gitea/gitea/blob/main/templates/repo/header.tmpl))
|
||||
|
||||
### 页面的其他新增内容
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ menu:
|
|||
Gitea's localization happens through our [Crowdin project](https://crowdin.com/project/gitea).
|
||||
|
||||
For changes to an **English** translation, a pull request can be made that changes the appropriate key in
|
||||
the [english locale](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini).
|
||||
the [english locale](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini).
|
||||
|
||||
For changes to a **non-English** translation, refer to the Crowdin project above.
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ menu:
|
|||
|
||||
Gitea的本地化是通过我们的[Crowdin项目](https://crowdin.com/project/gitea)进行的。
|
||||
|
||||
对于对**英语翻译**的更改,可以发出pull-request,来更改[英语语言环境](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)中合适的关键字。
|
||||
对于对**英语翻译**的更改,可以发出pull-request,来更改[英语语言环境](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini)中合适的关键字。
|
||||
|
||||
有关对**非英语**翻译的更改,请参阅上面的 Crowdin 项目。
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ menu:
|
|||
|
||||
我們在 [Crowdin 專案](https://crowdin.com/project/gitea)上進行在地化工作。
|
||||
|
||||
**英語系**的翻譯,可在修改[英文語言檔](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)後提出合併請求。
|
||||
**英語系**的翻譯,可在修改[英文語言檔](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini)後提出合併請求。
|
||||
|
||||
**非英語系**的翻譯,請前往上述的 Crowdin 專案。
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ Gitea 定義了一些基本物件於套件 [modules/migration](https://github.co
|
|||
- 您必須實作一個 `DownloaderFactory`,它用來偵測 URL 是否符合並建立上述的 `Downloader`。
|
||||
- 您需要在 `init()` 透過 `RegisterDownloaderFactory` 來註冊 `DownloaderFactory`。
|
||||
|
||||
您可以在 [downloader.go](https://github.com/go-gitea/gitea/blob/master/modules/migration/downloader.go) 中找到這些介面。
|
||||
您可以在 [downloader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/downloader.go) 中找到這些介面。
|
||||
|
||||
## Uploader 介面
|
||||
|
||||
目前只有 `GiteaLocalUploader` 被實作出來,所以我們只能通過 `Uploader` 儲存已下載的資料到本地的 Gitea 實例。
|
||||
目前尚未支援其它 Uploader。
|
||||
|
||||
您可以在 [uploader.go](https://github.com/go-gitea/gitea/blob/master/modules/migration/uploader.go) 中找到這些介面。
|
||||
您可以在 [uploader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/uploader.go) 中找到這些介面。
|
||||
|
|
|
@ -25,21 +25,19 @@ For more help resources, check all [Support Options]({{< relref "doc/help/suppor
|
|||
|
||||
{{< toc >}}
|
||||
|
||||
## Difference between 1.x and 1.x.x downloads
|
||||
## Difference between 1.x and 1.x.x downloads, how can I get latest stable release with bug fixes?
|
||||
|
||||
Version 1.7.x will be used for this example.
|
||||
Version 1.20.x will be used for this example.
|
||||
|
||||
**NOTE:** this example applies to Docker images as well!
|
||||
On our [downloads page](https://dl.gitea.com/gitea/) you will see a 1.20 directory, as well as directories for 1.20.0, 1.20.1.
|
||||
|
||||
On our [downloads page](https://dl.gitea.io/gitea/) you will see a 1.7 directory, as well as directories for 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, and 1.7.6.
|
||||
The 1.20 directory is the nightly build, which is built on each merged commit to the [`release/v1.20`](https://github.com/go-gitea/gitea/tree/release/v1.20) branch.
|
||||
|
||||
The 1.7 and 1.7.0 directories are **not** the same. The 1.7 directory is built on each merged commit to the [`release/v1.7`](https://github.com/go-gitea/gitea/tree/release/v1.7) branch.
|
||||
The 1.20.0 directory is a release build that was created when the [`v1.20.0`](https://github.com/go-gitea/gitea/releases/tag/v1.20.0) tag was created.
|
||||
|
||||
The 1.7.0 directory, however, is a build that was created when the [`v1.7.0`](https://github.com/go-gitea/gitea/releases/tag/v1.7.0) tag was created.
|
||||
The nightly builds (1.x) downloads will change as commits are merged to their respective branch, they contain the latest changes/fixes before a tag release is built.
|
||||
|
||||
This means that 1.x downloads will change as commits are merged to their respective branch (think of it as a separate "main" branch for each release).
|
||||
|
||||
On the other hand, 1.x.x downloads should never change.
|
||||
If a bug fix is targeted on 1.20.1 but 1.20.1 is not released yet, you can get the "1.20-nightly" build to get the bug fix.
|
||||
|
||||
## How to migrate from Gogs/GitHub/etc. to Gitea
|
||||
|
||||
|
@ -404,14 +402,6 @@ You will also need to change the app.ini database charset to `CHARSET=utf8mb4`.
|
|||
|
||||
Gitea requires the system or browser to have one of the supported Emoji fonts installed, which are Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji and Twemoji Mozilla. Generally, the operating system should already provide one of these fonts, but especially on Linux, it may be necessary to install them manually.
|
||||
|
||||
## Stdout logging on SystemD and Docker
|
||||
|
||||
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>`.
|
||||
|
||||
To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/support.en-us.md" >}}).
|
||||
|
||||
## Initial logging
|
||||
|
||||
Before Gitea has read the configuration file and set-up its logging it will log a number of things to stdout in order to help debug things if logging does not work.
|
||||
|
@ -454,12 +444,6 @@ gitea doctor recreate-table
|
|||
|
||||
It is highly recommended to back-up your database before running these commands.
|
||||
|
||||
## Why are tabs/indents wrong when viewing files
|
||||
|
||||
If you are using Cloudflare, turn off the auto-minify option in the dashboard.
|
||||
|
||||
`Speed` -> `Optimization` -> Uncheck `HTML` within the `Auto-Minify` settings.
|
||||
|
||||
## How to adopt repositories from disk
|
||||
|
||||
- Add your (bare) repositories to the correct spot for your configuration (`repository.ROOT`), ensuring they are in the correct layout `<REPO_ROOT>/[user]/[repo].git`.
|
||||
|
@ -470,3 +454,17 @@ If you are using Cloudflare, turn off the auto-minify option in the dashboard.
|
|||
- Users can also be given similar permissions via config [`ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`]({{< relref "doc/administration/config-cheat-sheet.en-us.md#repository" >}}).
|
||||
- If the above steps are done correctly, you should be able to select repositories to adopt.
|
||||
- If no repositories are found, enable [debug logging]({{< relref "doc/administration/config-cheat-sheet.en-us.md#repository" >}}) to check for any specific errors.
|
||||
|
||||
## Gitea can't start on NFS
|
||||
|
||||
In most cases, it's caused by broken NFS lock system. You can try to stop Gitea process and
|
||||
run `flock -n /data-nfs/gitea/queues/LOCK echo 'lock acquired'` to see whether the lock can be acquired immediately.
|
||||
If the lock can't be acquired, NFS might report some errors like `lockd: cannot monitor node-3, statd: server rpc.statd not responding, timed out` in its server logs.
|
||||
|
||||
Then the NFS lock could be reset by:
|
||||
|
||||
```bash
|
||||
# /etc/init.d/nfs stop
|
||||
# rm -rf /var/lib/nfs/sm/*
|
||||
# /etc/init.d/nfs start
|
||||
```
|
||||
|
|
|
@ -31,7 +31,7 @@ menu:
|
|||
|
||||
**注意:**此示例也适用于Docker镜像!
|
||||
|
||||
在我们的[下载页面](https://dl.gitea.io/gitea/)上,您会看到一个1.7目录,以及1.7.0、1.7.1、1.7.2、1.7.3、1.7.4、1.7.5和1.7.6的目录。
|
||||
在我们的[下载页面](https://dl.gitea.com/gitea/)上,您会看到一个1.7目录,以及1.7.0、1.7.1、1.7.2、1.7.3、1.7.4、1.7.5和1.7.6的目录。
|
||||
|
||||
1.7目录和1.7.0目录是**不同**的。1.7目录是在每个合并到[`release/v1.7`](https://github.com/go-gitea/gitea/tree/release/v1.7)分支的提交上构建的。
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ menu:
|
|||
|
||||
# Support Options
|
||||
|
||||
- [Paid Commercial Support](https://about.gitea.com/)
|
||||
- [Discord](https://discord.gg/Gitea)
|
||||
- [Discourse Forum](https://discourse.gitea.io/)
|
||||
|
||||
|
@ -35,30 +36,13 @@ menu:
|
|||
[log]
|
||||
LEVEL=debug
|
||||
MODE=console,file
|
||||
ROUTER=console,file
|
||||
XORM=console,file
|
||||
ENABLE_XORM_LOG=true
|
||||
FILE_NAME=gitea.log
|
||||
[log.file.router]
|
||||
FILE_NAME=router.log
|
||||
[log.file.xorm]
|
||||
FILE_NAME=xorm.log
|
||||
```
|
||||
|
||||
3. Any error messages you are seeing.
|
||||
4. When possible, try to replicate the issue on [try.gitea.io](https://try.gitea.io) and include steps so that others can reproduce the issue.
|
||||
- This will greatly improve the chance that the root of the issue can be quickly discovered and resolved.
|
||||
5. If you meet slow/hanging/deadlock problems, please report the stack trace when the problem occurs:
|
||||
1. Enable pprof in `app.ini` and restart Gitea
|
||||
|
||||
```ini
|
||||
[server]
|
||||
ENABLE_PPROF = true
|
||||
```
|
||||
|
||||
2. Trigger the bug, when Gitea gets stuck, use curl or browser to visit: `http://127.0.0.1:6060/debug/pprof/goroutine?debug=1` (IP must be `127.0.0.1` and port must be `6060`).
|
||||
3. If you are using Docker, please use `docker exec -it <container-name> curl "http://127.0.0.1:6060/debug/pprof/goroutine?debug=1"`.
|
||||
4. Report the output (the stack trace doesn't contain sensitive data)
|
||||
5. If you encounter slow/hanging/deadlock problems, please report the stack trace when the problem occurs.
|
||||
Go to the "Site Admin" -> "Monitoring" -> "Stacktrace" -> "Download diagnosis report".
|
||||
|
||||
## Bugs
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@ menu:
|
|||
|
||||
# Installation avec le binaire pré-compilé
|
||||
|
||||
Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.io/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle:
|
||||
Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.com/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle:
|
||||
|
||||
```
|
||||
wget -O gitea https://dl.gitea.io/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
|
||||
wget -O gitea https://dl.gitea.com/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
|
||||
chmod +x gitea
|
||||
```
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@ menu:
|
|||
|
||||
# 從執行檔安裝
|
||||
|
||||
所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了:
|
||||
所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.com/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了:
|
||||
|
||||
```
|
||||
wget -O gitea https://dl.gitea.io/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
|
||||
wget -O gitea https://dl.gitea.com/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
|
||||
chmod +x gitea
|
||||
```
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ git checkout pr-xyz
|
|||
|
||||
## Compilation
|
||||
|
||||
Comme nous regroupons déjà toutes les bibliothèques requises pour compiler Gitea, vous pouvez continuer avec le processus de compilation lui-même. Nous fournissons diverses [tâches Make](https://github.com/go-gitea/gitea/blob/master/Makefile) pour rendre le processus de construction aussi simple que possible. [Voyez ici comment obtenir Make](/fr-fr/hacking-on-gitea/). Selon vos besoins, vous pourrez éventuellement ajouter diverses options de compilation, vous pouvez choisir entre ces options :
|
||||
Comme nous regroupons déjà toutes les bibliothèques requises pour compiler Gitea, vous pouvez continuer avec le processus de compilation lui-même. Nous fournissons diverses [tâches Make](https://github.com/go-gitea/gitea/blob/main/Makefile) pour rendre le processus de construction aussi simple que possible. [Voyez ici comment obtenir Make](/fr-fr/hacking-on-gitea/). Selon vos besoins, vous pourrez éventuellement ajouter diverses options de compilation, vous pouvez choisir entre ces options :
|
||||
|
||||
* `bindata`: Intègre toutes les ressources nécessaires à l'exécution d'une instance de Gitea, ce qui rend un déploiement facile car il n'est pas nécessaire de se préoccuper des fichiers supplémentaires.
|
||||
* `sqlite sqlite_unlock_notify`: Active la prise en charge d'une base de données [SQLite3](https://sqlite.org/), ceci n'est recommandé que pour les petites installations de Gitea.
|
||||
|
|
|
@ -46,7 +46,7 @@ git checkout v{{< version >}}
|
|||
|
||||
## 編譯
|
||||
|
||||
完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/master/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明:
|
||||
完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/main/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明:
|
||||
|
||||
* `bindata`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。
|
||||
* `sqlite sqlite_unlock_notify`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。
|
||||
|
|
|
@ -56,3 +56,13 @@ To deploy Gitea to Linode, have a look at the [Linode Marketplace](https://www.l
|
|||
[alwaysdata](https://www.alwaysdata.com/) has Gitea as an app in their marketplace.
|
||||
|
||||
To deploy Gitea to alwaysdata, have a look at the [alwaysdata Marketplace](https://www.alwaysdata.com/en/marketplace/gitea/).
|
||||
|
||||
## Exoscale
|
||||
|
||||
[Exoscale](https://www.exoscale.com/) provides Gitea managed by [Glasskube](https://glasskube.eu/) in their marketplace.
|
||||
|
||||
Exoscale is a European cloud service provider.
|
||||
|
||||
The package is maintained and update via the open source [Glasskube Kubernetes Operator](https://github.com/glasskube/operator).
|
||||
|
||||
To deploy Gitea to Exoscale, have a look at the [Exoscale Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/).
|
||||
|
|
|
@ -22,7 +22,7 @@ Gitea provides a Helm Chart to allow for installation on kubernetes.
|
|||
A non-customized install can be done with:
|
||||
|
||||
```
|
||||
helm repo add gitea-charts https://dl.gitea.io/charts/
|
||||
helm repo add gitea-charts https://dl.gitea.com/charts/
|
||||
helm install gitea gitea-charts/gitea
|
||||
```
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ Gitea 已经提供了便于在 Kubernetes 云原生环境中安装所需的 Helm
|
|||
默认安装指令为:
|
||||
|
||||
```bash
|
||||
helm repo add gitea https://dl.gitea.io/charts
|
||||
helm repo add gitea https://dl.gitea.com/charts
|
||||
helm repo update
|
||||
helm install gitea gitea/gitea
|
||||
```
|
||||
|
|
|
@ -22,7 +22,7 @@ Gitea 提供 Helm Chart 用來安裝於 kubernetes。
|
|||
非自訂安裝可使用下列指令:
|
||||
|
||||
```
|
||||
helm repo add gitea-charts https://dl.gitea.io/charts/
|
||||
helm repo add gitea-charts https://dl.gitea.com/charts/
|
||||
helm install gitea gitea-charts/gitea
|
||||
```
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ menu:
|
|||
sudo vim /etc/systemd/system/gitea.service
|
||||
```
|
||||
|
||||
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
||||
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
||||
|
||||
修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||
|
||||
|
@ -58,7 +58,7 @@ sudo vim /etc/supervisor/supervisord.conf
|
|||
```
|
||||
|
||||
增加如下示例配置
|
||||
[supervisord config](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea)。
|
||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。
|
||||
|
||||
将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ menu:
|
|||
|
||||
#### 使用 systemd
|
||||
|
||||
複製範例 [gitea.service](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service) 到 `/etc/systemd/system/gitea.service` 後用您喜愛的文字編輯器開啟檔案。
|
||||
複製範例 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 到 `/etc/systemd/system/gitea.service` 後用您喜愛的文字編輯器開啟檔案。
|
||||
|
||||
取消註解任何需要在此系統上啟動的服務像是 MySQL。
|
||||
|
||||
|
@ -55,7 +55,7 @@ sudo apt install supervisor
|
|||
mkdir /home/git/gitea/log/supervisor
|
||||
```
|
||||
|
||||
附加範例 [supervisord config](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea) 的設定值到 `/etc/supervisor/supervisord.conf`。
|
||||
附加範例 [supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea) 的設定值到 `/etc/supervisor/supervisord.conf`。
|
||||
|
||||
用您喜愛的文字編輯器修改使用者(git)和家目錄(/home/git)設定以符合部署環境。若預設埠已被占用請修改埠號或移除「-p」旗標。
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ There are some basic steps to follow. On a Linux system run as the Gogs user:
|
|||
|
||||
* Create a Gogs backup with `gogs backup`. This creates `gogs-backup-[timestamp].zip` file
|
||||
containing all important Gogs data. You would need it if you wanted to move to the `gogs` back later.
|
||||
* Download the file matching the destination platform from the [downloads page](https://dl.gitea.io/gitea/).
|
||||
* Download the file matching the destination platform from the [downloads page](https://dl.gitea.com/gitea/).
|
||||
It should be `1.0.x` version. Migrating from `gogs` to any other version is impossible.
|
||||
* Put the binary at the desired install location.
|
||||
* Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`.
|
||||
|
@ -79,11 +79,11 @@ There are some basic steps to follow. On a Linux system run as the Gogs user:
|
|||
After successful migration from `gogs` to `gitea 1.0.x`, it is possible to upgrade `gitea` to a modern version
|
||||
in a two steps process.
|
||||
|
||||
Upgrade to [`gitea 1.6.4`](https://dl.gitea.io/gitea/1.6.4/) first. Download the file matching
|
||||
the destination platform from the [downloads page](https://dl.gitea.io/gitea/1.6.4/) and replace the binary.
|
||||
Upgrade to [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/) first. Download the file matching
|
||||
the destination platform from the [downloads page](https://dl.gitea.com/gitea/1.6.4/) and replace the binary.
|
||||
Run Gitea at least once and check that everything works as expected.
|
||||
|
||||
Then repeat the procedure, but this time using the [latest release](https://dl.gitea.io/gitea/{{< version >}}/).
|
||||
Then repeat the procedure, but this time using the [latest release](https://dl.gitea.com/gitea/{{< version >}}/).
|
||||
|
||||
## Upgrading from a more recent version of Gogs
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ menu:
|
|||
Veuillez suivre les étapes ci-dessous. Sur Unix, toute les commandes s'exécutent en tant que l'utilisateur utilisé pour votre installation de Gogs :
|
||||
|
||||
* Crééer une sauvegarde de Gogs avec la commande `gogs dump`. Le fichier nouvellement créé `gogs-dump-[timestamp].zip` contient toutes les données de votre instance de Gogs.
|
||||
* Téléchargez le fichier correspondant à votre plateforme à partir de la [page de téléchargements](https://dl.gitea.io/gitea).
|
||||
* Téléchargez le fichier correspondant à votre plateforme à partir de la [page de téléchargements](https://dl.gitea.com/gitea).
|
||||
* Mettez la binaire dans le répertoire d'installation souhaité.
|
||||
* Copiez le fichier `gogs/custom/conf/app.ini` vers `gitea/custom/conf/app.ini`.
|
||||
* Si vous avez personnalisé les répertoires `templates, public` dans `gogs/custom/`, copiez-les vers `gitea/custom/`.
|
||||
|
|
|
@ -27,7 +27,7 @@ menu:
|
|||
|
||||
- 使用 `gogs backup` 建立 Gogs 的備份。這會建立檔案 `gogs-backup-[timestamp].zip` 包含所有重要的 Gogs 資料。
|
||||
如果稍後您要恢復到 `gogs` 時會用到它。
|
||||
- 從[下載頁](https://dl.gitea.io/gitea/)下載對應您平臺的檔案。請下載 `1.0.x` 版,從 `gogs` 遷移到其它版本是不可行的。
|
||||
- 從[下載頁](https://dl.gitea.com/gitea/)下載對應您平臺的檔案。請下載 `1.0.x` 版,從 `gogs` 遷移到其它版本是不可行的。
|
||||
- 將二進位檔放到適當的安裝位置。
|
||||
- 複製 `gogs/custom/conf/app.ini` 到 `gitea/custom/conf/app.ini`。
|
||||
- 從 `gogs/custom/` 複製自訂 `templates, public` 到 `gitea/custom/`。
|
||||
|
@ -77,10 +77,10 @@ menu:
|
|||
|
||||
成功從 `gogs` 升級到 `gitea 1.0.x` 後再用 2 個步驟即可升級到最新版的 `gitea`。
|
||||
|
||||
請先升級到 [`gitea 1.6.4`](https://dl.gitea.io/gitea/1.6.4/),先從[下載頁](https://dl.gitea.io/gitea/1.6.4/)下載
|
||||
請先升級到 [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/),先從[下載頁](https://dl.gitea.com/gitea/1.6.4/)下載
|
||||
您平臺的二進位檔取代既有的。至少執行一次 Gitea 並確認一切符合預期。
|
||||
|
||||
接著重複上述步驟,但這次請使用[最新發行版本](https://dl.gitea.io/gitea/{{< version >}}/)。
|
||||
接著重複上述步驟,但這次請使用[最新發行版本](https://dl.gitea.com/gitea/{{< version >}}/)。
|
||||
|
||||
## 從更新版本的 Gogs 升級
|
||||
|
||||
|
|
|
@ -76,6 +76,12 @@ The default configuration is safe to use without any modification, so you can ju
|
|||
./act_runner --config config.yaml [command]
|
||||
```
|
||||
|
||||
You could also generate config file with docker:
|
||||
|
||||
```bash
|
||||
docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
|
||||
```
|
||||
|
||||
When you are using the docker image, you can specify the configuration file by using the `CONFIG_FILE` environment variable. Make sure that the file is mounted into the container as a volume:
|
||||
|
||||
```bash
|
||||
|
@ -172,6 +178,27 @@ It is because the act runner will run jobs in docker containers, so it needs to
|
|||
As mentioned, you can remove it if you want to run jobs in the host directly.
|
||||
To be clear, the "host" actually means the container which is running the act runner now, instead of the host machine.
|
||||
|
||||
### Set up the runner using docker compose
|
||||
|
||||
You could also set up the runner using the following `docker-compose.yml`:
|
||||
|
||||
```yml
|
||||
version: "3.8"
|
||||
services:
|
||||
runner:
|
||||
image: gitea/act_runner:nightly
|
||||
environment:
|
||||
CONFIG_FILE: /config.yaml
|
||||
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
|
||||
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
|
||||
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
|
||||
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
|
||||
volumes:
|
||||
- ./config.yaml:/config.yaml
|
||||
- ./data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
```
|
||||
|
||||
### Configuring cache when starting a Runner using docker image
|
||||
|
||||
If you do not intend to use `actions/cache` in workflow, you can ignore this section.
|
||||
|
|
|
@ -76,6 +76,12 @@ docker pull gitea/act_runner:nightly # for the latest nightly build
|
|||
./act_runner --config config.yaml [command]
|
||||
```
|
||||
|
||||
您亦可以如下使用 docker 创建配置文件:
|
||||
|
||||
```bash
|
||||
docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
|
||||
```
|
||||
|
||||
当使用Docker镜像时,可以使用`CONFIG_FILE`环境变量指定配置文件。确保将文件作为卷挂载到容器中:
|
||||
|
||||
```bash
|
||||
|
@ -169,6 +175,27 @@ docker run \
|
|||
如前所述,如果要在主机上直接运行Job,可以将其移除。
|
||||
需要明确的是,这里的 "主机" 实际上指的是当前运行 Act Runner的容器,而不是主机机器本身。
|
||||
|
||||
### 使用 Docker compose 运行 Runner
|
||||
|
||||
您亦可使用如下的 `docker-compose.yml`:
|
||||
|
||||
```yml
|
||||
version: "3.8"
|
||||
services:
|
||||
runner:
|
||||
image: gitea/act_runner:nightly
|
||||
environment:
|
||||
CONFIG_FILE: /config.yaml
|
||||
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
|
||||
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
|
||||
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
|
||||
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
|
||||
volumes:
|
||||
- ./config.yaml:/config.yaml
|
||||
- ./data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
```
|
||||
|
||||
### 当您使用 Docker 镜像启动 Runner,如何配置 Cache
|
||||
|
||||
如果你不打算在工作流中使用 `actions/cache`,你可以忽略本段。
|
||||
|
|
|
@ -164,3 +164,23 @@ Although we would like to provide more options, our limited manpower means that
|
|||
However, both Gitea and act runner are completely open source, so anyone can create a new/better implementation.
|
||||
We support your choice, no matter how you decide.
|
||||
In case you fork act runner to create your own version: Please contribute the changes back if you can and if you think your changes will help others as well.
|
||||
|
||||
## What workflow trigger events does Gitea support?
|
||||
|
||||
All events listed in this table are supported events and are compatible with GitHub.
|
||||
For events supported only by GitHub, see GitHub's [documentation](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
|
||||
|
||||
| trigger event | activity types |
|
||||
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------|
|
||||
| create | not applicable |
|
||||
| delete | not applicable |
|
||||
| fork | not applicable |
|
||||
| gollum | not applicable |
|
||||
| push | not applicable |
|
||||
| issues | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `milestoned`, `demilestoned`, `labeled`, `unlabeled` |
|
||||
| issue_comment | `created`, `edited`, `deleted` |
|
||||
| pull_request | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `synchronize`, `labeled`, `unlabeled` |
|
||||
| pull_request_review | `submitted`, `edited` |
|
||||
| pull_request_review_comment | `created`, `edited` |
|
||||
| release | `published`, `edited` |
|
||||
| registry_package | `published` |
|
||||
|
|
|
@ -164,3 +164,23 @@ defaults:
|
|||
然而,无论您如何决定,Gitea 和act runner都是完全开源的,所以任何人都可以创建一个新的/更好的实现。
|
||||
我们支持您的选择,无论您如何决定。
|
||||
如果您选择分支act runner来创建自己的版本,请在您认为您的更改对其他人也有帮助的情况下贡献这些更改。
|
||||
|
||||
## Gitea 支持哪些工作流触发事件?
|
||||
|
||||
表格中列出的所有事件都是支持的,并且与 GitHub 兼容。
|
||||
对于仅 GitHub 支持的事件,请参阅 GitHub 的[文档](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)。
|
||||
|
||||
| 触发事件 | 活动类型 |
|
||||
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------|
|
||||
| create | 不适用 |
|
||||
| delete | 不适用 |
|
||||
| fork | 不适用 |
|
||||
| gollum | 不适用 |
|
||||
| push | 不适用 |
|
||||
| issues | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `milestoned`, `demilestoned`, `labeled`, `unlabeled` |
|
||||
| issue_comment | `created`, `edited`, `deleted` |
|
||||
| pull_request | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `synchronize`, `labeled`, `unlabeled` |
|
||||
| pull_request_review | `submitted`, `edited` |
|
||||
| pull_request_review_comment | `created`, `edited` |
|
||||
| release | `published`, `edited` |
|
||||
| registry_package | `published` |
|
||||
|
|
|
@ -70,7 +70,7 @@ Le but de ce projet est de fournir de la manière la plus simple, la plus rapide
|
|||
- MSSQL
|
||||
- [TiDB](https://github.com/pingcap/tidb) (MySQL protocol)
|
||||
- Fichier de configuration
|
||||
- Voir [ici](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||
- Voir [ici](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
|
||||
- Panel d'administration
|
||||
- Statistiques
|
||||
- Actions
|
||||
|
|
|
@ -71,7 +71,7 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G
|
|||
- MSSQL
|
||||
- TiDB(MySQL 協議)
|
||||
- 設定檔
|
||||
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||
- [app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
|
||||
- 管理員面板
|
||||
- 系統摘要
|
||||
- 維護操作
|
||||
|
|
2
go.mod
2
go.mod
|
@ -122,7 +122,7 @@ require (
|
|||
mvdan.cc/xurls/v2 v2.4.0
|
||||
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
|
||||
xorm.io/builder v0.3.12
|
||||
xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e
|
||||
xorm.io/xorm v1.3.3-0.20230623150031-18f8e7a86c75
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1923,5 +1923,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:
|
|||
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
|
||||
xorm.io/builder v0.3.12 h1:ASZYX7fQmy+o8UJdhlLHSW57JDOkM8DNhcAF5d0LiJM=
|
||||
xorm.io/builder v0.3.12/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
|
||||
xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e h1:d5PY6mwuQK5/7T6VKfFswaKMzLmGTHkJ/ZS7+cUIAjk=
|
||||
xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=
|
||||
xorm.io/xorm v1.3.3-0.20230623150031-18f8e7a86c75 h1:ReBAlO50dCIXCWF8Gbi0ZRa62AGAwCJNCPaUNUa7JSg=
|
||||
xorm.io/xorm v1.3.3-0.20230623150031-18f8e7a86c75/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=
|
||||
|
|
194
main.go
194
main.go
|
@ -33,162 +33,164 @@ var (
|
|||
Tags = ""
|
||||
// MakeVersion holds the current Make version if built with make
|
||||
MakeVersion = ""
|
||||
|
||||
originalAppHelpTemplate = ""
|
||||
originalCommandHelpTemplate = ""
|
||||
originalSubcommandHelpTemplate = ""
|
||||
)
|
||||
|
||||
func init() {
|
||||
setting.AppVer = Version
|
||||
setting.AppBuiltWith = formatBuiltWith()
|
||||
setting.AppStartTime = time.Now().UTC()
|
||||
}
|
||||
|
||||
// Grab the original help templates
|
||||
originalAppHelpTemplate = cli.AppHelpTemplate
|
||||
originalCommandHelpTemplate = cli.CommandHelpTemplate
|
||||
originalSubcommandHelpTemplate = cli.SubcommandHelpTemplate
|
||||
// cmdHelp is our own help subcommand with more information
|
||||
// test cases:
|
||||
// ./gitea help
|
||||
// ./gitea -h
|
||||
// ./gitea web help
|
||||
// ./gitea web -h (due to cli lib limitation, this won't call our cmdHelp, so no extra info)
|
||||
// ./gitea admin
|
||||
// ./gitea admin help
|
||||
// ./gitea admin auth help
|
||||
// ./gitea -c /tmp/app.ini -h
|
||||
// ./gitea -c /tmp/app.ini help
|
||||
// ./gitea help -c /tmp/app.ini
|
||||
// GITEA_WORK_DIR=/tmp ./gitea help
|
||||
// GITEA_WORK_DIR=/tmp ./gitea help --work-path /tmp/other
|
||||
// GITEA_WORK_DIR=/tmp ./gitea help --config /tmp/app-other.ini
|
||||
var cmdHelp = cli.Command{
|
||||
Name: "help",
|
||||
Aliases: []string{"h"},
|
||||
Usage: "Shows a list of commands or help for one command",
|
||||
ArgsUsage: "[command]",
|
||||
Action: func(c *cli.Context) (err error) {
|
||||
args := c.Args()
|
||||
if args.Present() {
|
||||
err = cli.ShowCommandHelp(c, args.First())
|
||||
} else {
|
||||
err = cli.ShowAppHelp(c)
|
||||
}
|
||||
_, _ = fmt.Fprintf(c.App.Writer, `
|
||||
DEFAULT CONFIGURATION:
|
||||
AppPath: %s
|
||||
WorkPath: %s
|
||||
CustomPath: %s
|
||||
ConfigFile: %s
|
||||
|
||||
`, setting.AppPath, setting.AppWorkPath, setting.CustomPath, setting.CustomConf)
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "Gitea"
|
||||
app.Usage = "A painless self-hosted Git service"
|
||||
app.Description = `By default, gitea will start serving using the webserver with no
|
||||
arguments - which can alternatively be run by running the subcommand web.`
|
||||
app.Description = `By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
|
||||
app.Version = Version + formatBuiltWith()
|
||||
app.Commands = []cli.Command{
|
||||
app.EnableBashCompletion = true
|
||||
|
||||
// these sub-commands need to use config file
|
||||
subCmdWithIni := []cli.Command{
|
||||
cmd.CmdWeb,
|
||||
cmd.CmdServ,
|
||||
cmd.CmdHook,
|
||||
cmd.CmdDump,
|
||||
cmd.CmdCert,
|
||||
cmd.CmdAdmin,
|
||||
cmd.CmdGenerate,
|
||||
cmd.CmdMigrate,
|
||||
cmd.CmdKeys,
|
||||
cmd.CmdConvert,
|
||||
cmd.CmdDoctor,
|
||||
cmd.CmdManager,
|
||||
cmd.Cmdembedded,
|
||||
cmd.CmdEmbedded,
|
||||
cmd.CmdMigrateStorage,
|
||||
cmd.CmdDocs,
|
||||
cmd.CmdDumpRepository,
|
||||
cmd.CmdRestoreRepository,
|
||||
cmd.CmdActions,
|
||||
cmdHelp, // TODO: the "help" sub-command was used to show the more information for "work path" and "custom config", in the future, it should avoid doing so
|
||||
}
|
||||
// these sub-commands do not need the config file, and they do not depend on any path or environment variable.
|
||||
subCmdStandalone := []cli.Command{
|
||||
cmd.CmdCert,
|
||||
cmd.CmdGenerate,
|
||||
cmd.CmdDocs,
|
||||
}
|
||||
// Now adjust these commands to add our global configuration options
|
||||
|
||||
// First calculate the default paths and set the AppHelpTemplates in this context
|
||||
setting.SetCustomPathAndConf("", "", "")
|
||||
setAppHelpTemplates()
|
||||
|
||||
// default configuration flags
|
||||
defaultFlags := []cli.Flag{
|
||||
// shared configuration flags, they are for global and for each sub-command at the same time
|
||||
// eg: such command is valid: "./gitea --config /tmp/app.ini web --config /tmp/app.ini", while it's discouraged indeed
|
||||
// keep in mind that the short flags like "-C", "-c" and "-w" are globally polluted, they can't be used for sub-commands anymore.
|
||||
globalFlags := []cli.Flag{
|
||||
cli.HelpFlag,
|
||||
cli.StringFlag{
|
||||
Name: "custom-path, C",
|
||||
Value: setting.CustomPath,
|
||||
Usage: "Custom path file path",
|
||||
Usage: "Set custom path (defaults to '{WorkPath}/custom')",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "config, c",
|
||||
Value: setting.CustomConf,
|
||||
Usage: "Custom configuration file path",
|
||||
Usage: "Set custom config file (defaults to '{WorkPath}/custom/conf/app.ini')",
|
||||
},
|
||||
cli.VersionFlag,
|
||||
cli.StringFlag{
|
||||
Name: "work-path, w",
|
||||
Value: setting.AppWorkPath,
|
||||
Usage: "Set the gitea working path",
|
||||
Usage: "Set Gitea's working path (defaults to the Gitea's binary directory)",
|
||||
},
|
||||
}
|
||||
|
||||
// Set the default to be equivalent to cmdWeb and add the default flags
|
||||
app.Flags = append(app.Flags, cmd.CmdWeb.Flags...)
|
||||
app.Flags = append(app.Flags, defaultFlags...)
|
||||
app.Action = cmd.CmdWeb.Action
|
||||
|
||||
// Add functions to set these paths and these flags to the commands
|
||||
app.Before = establishCustomPath
|
||||
for i := range app.Commands {
|
||||
setFlagsAndBeforeOnSubcommands(&app.Commands[i], defaultFlags, establishCustomPath)
|
||||
app.Flags = append(app.Flags, globalFlags...)
|
||||
app.Flags = append(app.Flags, cmd.CmdWeb.Flags...) // TODO: the web flags polluted the global flags, they are not really global flags
|
||||
app.Action = prepareWorkPathAndCustomConf(cmd.CmdWeb.Action)
|
||||
app.HideHelp = true // use our own help action to show helps (with more information like default config)
|
||||
app.Before = cmd.PrepareConsoleLoggerLevel(log.INFO)
|
||||
for i := range subCmdWithIni {
|
||||
prepareSubcommands(&subCmdWithIni[i], globalFlags)
|
||||
}
|
||||
|
||||
app.EnableBashCompletion = true
|
||||
app.Commands = append(app.Commands, subCmdWithIni...)
|
||||
app.Commands = append(app.Commands, subCmdStandalone...)
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to run app with %s: %v", os.Args, err)
|
||||
_, _ = fmt.Fprintf(app.Writer, "\nFailed to run with %s: %v\n", os.Args, err)
|
||||
}
|
||||
|
||||
log.GetManager().Close()
|
||||
}
|
||||
|
||||
func setFlagsAndBeforeOnSubcommands(command *cli.Command, defaultFlags []cli.Flag, before cli.BeforeFunc) {
|
||||
func prepareSubcommands(command *cli.Command, defaultFlags []cli.Flag) {
|
||||
command.Flags = append(command.Flags, defaultFlags...)
|
||||
command.Before = establishCustomPath
|
||||
command.Action = prepareWorkPathAndCustomConf(command.Action)
|
||||
command.HideHelp = true
|
||||
if command.Name != "help" {
|
||||
command.Subcommands = append(command.Subcommands, cmdHelp)
|
||||
}
|
||||
for i := range command.Subcommands {
|
||||
setFlagsAndBeforeOnSubcommands(&command.Subcommands[i], defaultFlags, before)
|
||||
prepareSubcommands(&command.Subcommands[i], defaultFlags)
|
||||
}
|
||||
}
|
||||
|
||||
func establishCustomPath(ctx *cli.Context) error {
|
||||
var providedCustom string
|
||||
var providedConf string
|
||||
var providedWorkPath string
|
||||
|
||||
currentCtx := ctx
|
||||
for {
|
||||
if len(providedCustom) != 0 && len(providedConf) != 0 && len(providedWorkPath) != 0 {
|
||||
break
|
||||
// prepareWorkPathAndCustomConf wraps the Action to prepare the work path and custom config
|
||||
// It can't use "Before", because each level's sub-command's Before will be called one by one, so the "init" would be done multiple times
|
||||
func prepareWorkPathAndCustomConf(action any) func(ctx *cli.Context) error {
|
||||
return func(ctx *cli.Context) error {
|
||||
var args setting.ArgWorkPathAndCustomConf
|
||||
curCtx := ctx
|
||||
for curCtx != nil {
|
||||
if curCtx.IsSet("work-path") && args.WorkPath == "" {
|
||||
args.WorkPath = curCtx.String("work-path")
|
||||
}
|
||||
if curCtx.IsSet("custom-path") && args.CustomPath == "" {
|
||||
args.CustomPath = curCtx.String("custom-path")
|
||||
}
|
||||
if curCtx.IsSet("config") && args.CustomConf == "" {
|
||||
args.CustomConf = curCtx.String("config")
|
||||
}
|
||||
curCtx = curCtx.Parent()
|
||||
}
|
||||
if currentCtx == nil {
|
||||
break
|
||||
setting.InitWorkPathAndCommonConfig(os.Getenv, args)
|
||||
if ctx.Bool("help") || action == nil {
|
||||
// the default behavior of "urfave/cli": "nil action" means "show help"
|
||||
return cmdHelp.Action.(func(ctx *cli.Context) error)(ctx)
|
||||
}
|
||||
if currentCtx.IsSet("custom-path") && len(providedCustom) == 0 {
|
||||
providedCustom = currentCtx.String("custom-path")
|
||||
}
|
||||
if currentCtx.IsSet("config") && len(providedConf) == 0 {
|
||||
providedConf = currentCtx.String("config")
|
||||
}
|
||||
if currentCtx.IsSet("work-path") && len(providedWorkPath) == 0 {
|
||||
providedWorkPath = currentCtx.String("work-path")
|
||||
}
|
||||
currentCtx = currentCtx.Parent()
|
||||
|
||||
return action.(func(*cli.Context) error)(ctx)
|
||||
}
|
||||
setting.SetCustomPathAndConf(providedCustom, providedConf, providedWorkPath)
|
||||
|
||||
setAppHelpTemplates()
|
||||
|
||||
if ctx.IsSet("version") {
|
||||
cli.ShowVersion(ctx)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func setAppHelpTemplates() {
|
||||
cli.AppHelpTemplate = adjustHelpTemplate(originalAppHelpTemplate)
|
||||
cli.CommandHelpTemplate = adjustHelpTemplate(originalCommandHelpTemplate)
|
||||
cli.SubcommandHelpTemplate = adjustHelpTemplate(originalSubcommandHelpTemplate)
|
||||
}
|
||||
|
||||
func adjustHelpTemplate(originalTemplate string) string {
|
||||
overridden := ""
|
||||
if _, ok := os.LookupEnv("GITEA_CUSTOM"); ok {
|
||||
overridden = "(GITEA_CUSTOM)"
|
||||
}
|
||||
|
||||
return fmt.Sprintf(`%s
|
||||
DEFAULT CONFIGURATION:
|
||||
CustomPath: %s %s
|
||||
CustomConf: %s
|
||||
AppPath: %s
|
||||
AppWorkPath: %s
|
||||
|
||||
`, originalTemplate, setting.CustomPath, overridden, setting.CustomConf, setting.AppPath, setting.AppWorkPath)
|
||||
}
|
||||
|
||||
func formatBuiltWith() string {
|
||||
|
|
|
@ -346,6 +346,9 @@ func UpdateTask(ctx context.Context, task *ActionTask, cols ...string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// UpdateTaskByState updates the task by the state.
|
||||
// It will always update the task if the state is not final, even there is no change.
|
||||
// So it will update ActionTask.Updated to avoid the task being judged as a zombie task.
|
||||
func UpdateTaskByState(ctx context.Context, state *runnerv1.TaskState) (*ActionTask, error) {
|
||||
stepStates := map[int64]*runnerv1.StepState{}
|
||||
for _, v := range state.Steps {
|
||||
|
@ -386,6 +389,12 @@ func UpdateTaskByState(ctx context.Context, state *runnerv1.TaskState) (*ActionT
|
|||
}, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
// Force update ActionTask.Updated to avoid the task being judged as a zombie task
|
||||
task.Updated = timeutil.TimeStampNow()
|
||||
if err := UpdateTask(ctx, task, "updated"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if err := task.LoadAttributes(ctx); err != nil {
|
||||
|
|
|
@ -123,7 +123,10 @@ func newXORMEngine() (*xorm.Engine, error) {
|
|||
|
||||
// SyncAllTables sync the schemas of all tables, is required by unit test code
|
||||
func SyncAllTables() error {
|
||||
return x.StoreEngine("InnoDB").Sync2(tables...)
|
||||
_, err := x.StoreEngine("InnoDB").SyncWithOptions(xorm.SyncOptions{
|
||||
WarnIfDatabaseColumnMissed: true,
|
||||
}, tables...)
|
||||
return err
|
||||
}
|
||||
|
||||
// InitEngine initializes the xorm.Engine and sets it as db.DefaultContext
|
||||
|
|
|
@ -89,6 +89,33 @@ func mysqlGetNextResourceIndex(ctx context.Context, tableName string, groupID in
|
|||
return idx, nil
|
||||
}
|
||||
|
||||
func mssqlGetNextResourceIndex(ctx context.Context, tableName string, groupID int64) (int64, error) {
|
||||
if _, err := GetEngine(ctx).Exec(fmt.Sprintf(`
|
||||
MERGE INTO %s WITH (HOLDLOCK) AS target
|
||||
USING (SELECT %d AS group_id) AS source
|
||||
(group_id)
|
||||
ON target.group_id = source.group_id
|
||||
WHEN MATCHED
|
||||
THEN UPDATE
|
||||
SET max_index = max_index + 1
|
||||
WHEN NOT MATCHED
|
||||
THEN INSERT (group_id, max_index)
|
||||
VALUES (%d, 1);
|
||||
`, tableName, groupID, groupID)); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var idx int64
|
||||
_, err := GetEngine(ctx).SQL(fmt.Sprintf("SELECT max_index FROM %s WHERE group_id = ?", tableName), groupID).Get(&idx)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if idx == 0 {
|
||||
return 0, errors.New("cannot get the correct index")
|
||||
}
|
||||
return idx, nil
|
||||
}
|
||||
|
||||
// GetNextResourceIndex generates a resource index, it must run in the same transaction where the resource is created
|
||||
func GetNextResourceIndex(ctx context.Context, tableName string, groupID int64) (int64, error) {
|
||||
switch {
|
||||
|
@ -96,6 +123,8 @@ func GetNextResourceIndex(ctx context.Context, tableName string, groupID int64)
|
|||
return postgresGetNextResourceIndex(ctx, tableName, groupID)
|
||||
case setting.Database.Type.IsMySQL():
|
||||
return mysqlGetNextResourceIndex(ctx, tableName, groupID)
|
||||
case setting.Database.Type.IsMSSQL():
|
||||
return mssqlGetNextResourceIndex(ctx, tableName, groupID)
|
||||
}
|
||||
|
||||
e := GetEngine(ctx)
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -21,6 +22,7 @@ var defaultFileBlockSize int64 = 32 * 1024
|
|||
type File interface {
|
||||
io.ReadWriteCloser
|
||||
io.Seeker
|
||||
fs.File
|
||||
}
|
||||
|
||||
type file struct {
|
||||
|
@ -193,10 +195,26 @@ func (f *file) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (f *file) Stat() (os.FileInfo, error) {
|
||||
if f.metaID == 0 {
|
||||
return nil, os.ErrInvalid
|
||||
}
|
||||
|
||||
fileMeta, err := findFileMetaByID(f.ctx, f.metaID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return fileMeta, nil
|
||||
}
|
||||
|
||||
func timeToFileTimestamp(t time.Time) int64 {
|
||||
return t.UnixMicro()
|
||||
}
|
||||
|
||||
func fileTimestampToTime(timestamp int64) time.Time {
|
||||
return time.UnixMicro(timestamp)
|
||||
}
|
||||
|
||||
func (f *file) loadMetaByPath() (*dbfsMeta, error) {
|
||||
var fileMeta dbfsMeta
|
||||
if ok, err := db.GetEngine(f.ctx).Where("full_path = ?", f.fullPath).Get(&fileMeta); err != nil {
|
||||
|
|
|
@ -5,7 +5,10 @@ package dbfs
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
)
|
||||
|
@ -100,3 +103,29 @@ func Remove(ctx context.Context, name string) error {
|
|||
defer f.Close()
|
||||
return f.delete()
|
||||
}
|
||||
|
||||
var _ fs.FileInfo = (*dbfsMeta)(nil)
|
||||
|
||||
func (m *dbfsMeta) Name() string {
|
||||
return path.Base(m.FullPath)
|
||||
}
|
||||
|
||||
func (m *dbfsMeta) Size() int64 {
|
||||
return m.FileSize
|
||||
}
|
||||
|
||||
func (m *dbfsMeta) Mode() fs.FileMode {
|
||||
return os.ModePerm
|
||||
}
|
||||
|
||||
func (m *dbfsMeta) ModTime() time.Time {
|
||||
return fileTimestampToTime(m.ModifyTimestamp)
|
||||
}
|
||||
|
||||
func (m *dbfsMeta) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *dbfsMeta) Sys() any {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func TestDbfsBasic(t *testing.T) {
|
|||
|
||||
_, err = OpenFile(db.DefaultContext, "test2.txt", os.O_RDONLY)
|
||||
assert.Error(t, err)
|
||||
|
||||
// test stat
|
||||
f, err = OpenFile(db.DefaultContext, "test/test.txt", os.O_RDWR|os.O_CREATE)
|
||||
assert.NoError(t, err)
|
||||
stat, err := f.Stat()
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, "test.txt", stat.Name())
|
||||
assert.EqualValues(t, 0, stat.Size())
|
||||
_, err = f.Write([]byte("0123456789"))
|
||||
assert.NoError(t, err)
|
||||
stat, err = f.Stat()
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, 10, stat.Size())
|
||||
}
|
||||
|
||||
func TestDbfsReadWrite(t *testing.T) {
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
-
|
||||
id: 1
|
||||
repo_id: 5
|
||||
interval: 3600
|
||||
enable_prune: false
|
||||
updated_unix: 0
|
||||
next_update_unix: 0
|
||||
lfs_enabled: false
|
||||
lfs_endpoint: ""
|
||||
|
||||
-
|
||||
id: 2
|
||||
repo_id: 25
|
||||
interval: 3600
|
||||
enable_prune: false
|
||||
updated_unix: 0
|
||||
next_update_unix: 0
|
||||
lfs_enabled: false
|
||||
lfs_endpoint: ""
|
||||
|
||||
-
|
||||
id: 3
|
||||
repo_id: 26
|
||||
interval: 3600
|
||||
enable_prune: false
|
||||
updated_unix: 0
|
||||
next_update_unix: 0
|
||||
lfs_enabled: false
|
||||
lfs_endpoint: ""
|
||||
|
||||
-
|
||||
id: 4
|
||||
repo_id: 27
|
||||
interval: 3600
|
||||
enable_prune: false
|
||||
updated_unix: 0
|
||||
next_update_unix: 0
|
||||
lfs_enabled: false
|
||||
lfs_endpoint: ""
|
||||
|
||||
-
|
||||
id: 5
|
||||
repo_id: 28
|
||||
interval: 3600
|
||||
enable_prune: false
|
||||
updated_unix: 0
|
||||
next_update_unix: 0
|
||||
lfs_enabled: false
|
||||
lfs_endpoint: ""
|
|
@ -141,7 +141,7 @@
|
|||
num_projects: 0
|
||||
num_closed_projects: 0
|
||||
is_private: true
|
||||
is_empty: true
|
||||
is_empty: false
|
||||
is_archived: false
|
||||
is_mirror: true
|
||||
status: 0
|
||||
|
|
|
@ -83,13 +83,47 @@ func mysqlGetCommitStatusIndex(ctx context.Context, repoID int64, sha string) (i
|
|||
return idx, nil
|
||||
}
|
||||
|
||||
func mssqlGetCommitStatusIndex(ctx context.Context, repoID int64, sha string) (int64, error) {
|
||||
if _, err := db.GetEngine(ctx).Exec(`
|
||||
MERGE INTO commit_status_index WITH (HOLDLOCK) AS target
|
||||
USING (SELECT ? AS repo_id, ? AS sha) AS source
|
||||
(repo_id, sha)
|
||||
ON target.repo_id = source.repo_id AND target.sha = source.sha
|
||||
WHEN MATCHED
|
||||
THEN UPDATE
|
||||
SET max_index = max_index + 1
|
||||
WHEN NOT MATCHED
|
||||
THEN INSERT (repo_id, sha, max_index)
|
||||
VALUES (?, ?, 1);
|
||||
`, repoID, sha, repoID, sha); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var idx int64
|
||||
_, err := db.GetEngine(ctx).SQL("SELECT max_index FROM `commit_status_index` WHERE repo_id = ? AND sha = ?",
|
||||
repoID, sha).Get(&idx)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if idx == 0 {
|
||||
return 0, errors.New("cannot get the correct index")
|
||||
}
|
||||
return idx, nil
|
||||
}
|
||||
|
||||
// GetNextCommitStatusIndex retried 3 times to generate a resource index
|
||||
func GetNextCommitStatusIndex(ctx context.Context, repoID int64, sha string) (int64, error) {
|
||||
if !git.IsValidSHAPattern(sha) {
|
||||
return 0, git.ErrInvalidSHA{SHA: sha}
|
||||
}
|
||||
|
||||
switch {
|
||||
case setting.Database.Type.IsPostgreSQL():
|
||||
return postgresGetCommitStatusIndex(ctx, repoID, sha)
|
||||
case setting.Database.Type.IsMySQL():
|
||||
return mysqlGetCommitStatusIndex(ctx, repoID, sha)
|
||||
case setting.Database.Type.IsMSSQL():
|
||||
return mssqlGetCommitStatusIndex(ctx, repoID, sha)
|
||||
}
|
||||
|
||||
e := db.GetEngine(ctx)
|
||||
|
|
|
@ -167,7 +167,7 @@ func AsCommentType(typeName string) CommentType {
|
|||
|
||||
func (t CommentType) HasContentSupport() bool {
|
||||
switch t {
|
||||
case CommentTypeComment, CommentTypeCode, CommentTypeReview:
|
||||
case CommentTypeComment, CommentTypeCode, CommentTypeReview, CommentTypeDismissReview:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
@ -18,11 +18,11 @@ import (
|
|||
type CodeComments map[string]map[int64][]*Comment
|
||||
|
||||
// FetchCodeComments will return a 2d-map: ["Path"]["Line"] = Comments at line
|
||||
func FetchCodeComments(ctx context.Context, issue *Issue, currentUser *user_model.User) (CodeComments, error) {
|
||||
return fetchCodeCommentsByReview(ctx, issue, currentUser, nil)
|
||||
func FetchCodeComments(ctx context.Context, issue *Issue, currentUser *user_model.User, showOutdatedComments bool) (CodeComments, error) {
|
||||
return fetchCodeCommentsByReview(ctx, issue, currentUser, nil, showOutdatedComments)
|
||||
}
|
||||
|
||||
func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *user_model.User, review *Review) (CodeComments, error) {
|
||||
func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *user_model.User, review *Review, showOutdatedComments bool) (CodeComments, error) {
|
||||
pathToLineToComment := make(CodeComments)
|
||||
if review == nil {
|
||||
review = &Review{ID: 0}
|
||||
|
@ -33,7 +33,7 @@ func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *u
|
|||
ReviewID: review.ID,
|
||||
}
|
||||
|
||||
comments, err := findCodeComments(ctx, opts, issue, currentUser, review)
|
||||
comments, err := findCodeComments(ctx, opts, issue, currentUser, review, showOutdatedComments)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -47,15 +47,17 @@ func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *u
|
|||
return pathToLineToComment, nil
|
||||
}
|
||||
|
||||
func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issue, currentUser *user_model.User, review *Review) ([]*Comment, error) {
|
||||
func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issue, currentUser *user_model.User, review *Review, showOutdatedComments bool) ([]*Comment, error) {
|
||||
var comments CommentList
|
||||
if review == nil {
|
||||
review = &Review{ID: 0}
|
||||
}
|
||||
conds := opts.ToConds()
|
||||
if review.ID == 0 {
|
||||
|
||||
if !showOutdatedComments && review.ID == 0 {
|
||||
conds = conds.And(builder.Eq{"invalidated": false})
|
||||
}
|
||||
|
||||
e := db.GetEngine(ctx)
|
||||
if err := e.Where(conds).
|
||||
Asc("comment.created_unix").
|
||||
|
@ -118,12 +120,12 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
|
|||
}
|
||||
|
||||
// FetchCodeCommentsByLine fetches the code comments for a given treePath and line number
|
||||
func FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, treePath string, line int64) ([]*Comment, error) {
|
||||
func FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, treePath string, line int64, showOutdatedComments bool) ([]*Comment, error) {
|
||||
opts := FindCommentsOptions{
|
||||
Type: CommentTypeCode,
|
||||
IssueID: issue.ID,
|
||||
TreePath: treePath,
|
||||
Line: line,
|
||||
}
|
||||
return findCodeComments(ctx, opts, issue, currentUser, nil)
|
||||
return findCodeComments(ctx, opts, issue, currentUser, nil, showOutdatedComments)
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ func TestFetchCodeComments(t *testing.T) {
|
|||
|
||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
|
||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
|
||||
res, err := issues_model.FetchCodeComments(db.DefaultContext, issue, user)
|
||||
res, err := issues_model.FetchCodeComments(db.DefaultContext, issue, user, false)
|
||||
assert.NoError(t, err)
|
||||
assert.Contains(t, res, "README.md")
|
||||
assert.Contains(t, res["README.md"], int64(4))
|
||||
|
@ -58,7 +58,7 @@ func TestFetchCodeComments(t *testing.T) {
|
|||
assert.Equal(t, int64(4), res["README.md"][4][0].ID)
|
||||
|
||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||
res, err = issues_model.FetchCodeComments(db.DefaultContext, issue, user2)
|
||||
res, err = issues_model.FetchCodeComments(db.DefaultContext, issue, user2, false)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, res, 1)
|
||||
}
|
||||
|
|
|
@ -229,39 +229,41 @@ func (issues IssueList) loadMilestones(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (issues IssueList) getProjectIDs() []int64 {
|
||||
ids := make(container.Set[int64], len(issues))
|
||||
for _, issue := range issues {
|
||||
ids.Add(issue.ProjectID())
|
||||
}
|
||||
return ids.Values()
|
||||
}
|
||||
func (issues IssueList) LoadProjects(ctx context.Context) error {
|
||||
issueIDs := issues.getIssueIDs()
|
||||
projectMaps := make(map[int64]*project_model.Project, len(issues))
|
||||
left := len(issueIDs)
|
||||
|
||||
func (issues IssueList) loadProjects(ctx context.Context) error {
|
||||
projectIDs := issues.getProjectIDs()
|
||||
if len(projectIDs) == 0 {
|
||||
return nil
|
||||
type projectWithIssueID struct {
|
||||
*project_model.Project `xorm:"extends"`
|
||||
IssueID int64
|
||||
}
|
||||
|
||||
projectMaps := make(map[int64]*project_model.Project, len(projectIDs))
|
||||
left := len(projectIDs)
|
||||
for left > 0 {
|
||||
limit := db.DefaultMaxInSize
|
||||
if left < limit {
|
||||
limit = left
|
||||
}
|
||||
|
||||
projects := make([]*projectWithIssueID, 0, limit)
|
||||
err := db.GetEngine(ctx).
|
||||
In("id", projectIDs[:limit]).
|
||||
Find(&projectMaps)
|
||||
Table("project").
|
||||
Select("project.*, project_issue.issue_id").
|
||||
Join("INNER", "project_issue", "project.id = project_issue.project_id").
|
||||
In("project_issue.issue_id", issueIDs[:limit]).
|
||||
Find(&projects)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, project := range projects {
|
||||
projectMaps[project.IssueID] = project.Project
|
||||
}
|
||||
left -= limit
|
||||
projectIDs = projectIDs[limit:]
|
||||
issueIDs = issueIDs[limit:]
|
||||
}
|
||||
|
||||
for _, issue := range issues {
|
||||
issue.Project = projectMaps[issue.ProjectID()]
|
||||
issue.Project = projectMaps[issue.ID]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -541,7 +543,7 @@ func (issues IssueList) loadAttributes(ctx context.Context) error {
|
|||
return fmt.Errorf("issue.loadAttributes: loadMilestones: %w", err)
|
||||
}
|
||||
|
||||
if err := issues.loadProjects(ctx); err != nil {
|
||||
if err := issues.LoadProjects(ctx); err != nil {
|
||||
return fmt.Errorf("issue.loadAttributes: loadProjects: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,12 @@ func TestIssueList_LoadAttributes(t *testing.T) {
|
|||
}
|
||||
if issue.ID == int64(1) {
|
||||
assert.Equal(t, int64(400), issue.TotalTrackedTime)
|
||||
assert.NotNil(t, issue.Project)
|
||||
} else if issue.ID == int64(2) {
|
||||
assert.Equal(t, int64(3682), issue.TotalTrackedTime)
|
||||
assert.Nil(t, issue.Project)
|
||||
} else {
|
||||
assert.Nil(t, issue.Project)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,6 @@ func (issue *Issue) LoadProject(ctx context.Context) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
// ProjectID return project id if issue was assigned to one
|
||||
func (issue *Issue) ProjectID() int64 {
|
||||
return issue.projectID(db.DefaultContext)
|
||||
}
|
||||
|
||||
func (issue *Issue) projectID(ctx context.Context) int64 {
|
||||
var ip project_model.ProjectIssue
|
||||
has, err := db.GetEngine(ctx).Where("issue_id=?", issue.ID).Get(&ip)
|
||||
|
|
|
@ -141,7 +141,7 @@ func (r *Review) LoadCodeComments(ctx context.Context) (err error) {
|
|||
if err = r.loadIssue(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
r.CodeComments, err = fetchCodeCommentsByReview(ctx, r.Issue, nil, r)
|
||||
r.CodeComments, err = fetchCodeCommentsByReview(ctx, r.Issue, nil, r, false)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -147,9 +147,9 @@ func MainTest(m *testing.M) {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
setting.CustomPath = filepath.Join(setting.AppWorkPath, "custom")
|
||||
setting.AppDataPath = tmpDataPath
|
||||
|
||||
setting.SetCustomPathAndConf("", "", "")
|
||||
unittest.InitSettings()
|
||||
if err = git.InitFull(context.Background()); err != nil {
|
||||
fmt.Printf("Unable to InitFull: %v\n", err)
|
||||
|
|
|
@ -53,7 +53,7 @@ func DeleteOrphanedAttachments(x *xorm.Engine) error {
|
|||
|
||||
for _, attachment := range attachments {
|
||||
uuid := attachment.UUID
|
||||
if err := util.RemoveAll(filepath.Join(setting.Attachment.Path, uuid[0:1], uuid[1:2], uuid)); err != nil {
|
||||
if err := util.RemoveAll(filepath.Join(setting.Attachment.Storage.Path, uuid[0:1], uuid[1:2], uuid)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ func RemoveAttachmentMissedRepo(x *xorm.Engine) error {
|
|||
|
||||
for i := 0; i < len(attachments); i++ {
|
||||
uuid := attachments[i].UUID
|
||||
if err = util.RemoveAll(filepath.Join(setting.Attachment.Path, uuid[0:1], uuid[1:2], uuid)); err != nil {
|
||||
if err = util.RemoveAll(filepath.Join(setting.Attachment.Storage.Path, uuid[0:1], uuid[1:2], uuid)); err != nil {
|
||||
fmt.Printf("Error: %v", err) //nolint:forbidigo
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ func RenameExistingUserAvatarName(x *xorm.Engine) error {
|
|||
for _, user := range users {
|
||||
oldAvatar := user.Avatar
|
||||
|
||||
if stat, err := os.Stat(filepath.Join(setting.Avatar.Path, oldAvatar)); err != nil || !stat.Mode().IsRegular() {
|
||||
if stat, err := os.Stat(filepath.Join(setting.Avatar.Storage.Path, oldAvatar)); err != nil || !stat.Mode().IsRegular() {
|
||||
if err == nil {
|
||||
err = fmt.Errorf("Error: \"%s\" is not a regular file", oldAvatar)
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ func RenameExistingUserAvatarName(x *xorm.Engine) error {
|
|||
return fmt.Errorf("[user: %s] user table update: %w", user.LowerName, err)
|
||||
}
|
||||
|
||||
deleteList.Add(filepath.Join(setting.Avatar.Path, oldAvatar))
|
||||
deleteList.Add(filepath.Join(setting.Avatar.Storage.Path, oldAvatar))
|
||||
migrated++
|
||||
select {
|
||||
case <-ticker.C:
|
||||
|
@ -135,7 +135,7 @@ func RenameExistingUserAvatarName(x *xorm.Engine) error {
|
|||
// copyOldAvatarToNewLocation copies oldAvatar to newAvatarLocation
|
||||
// and returns newAvatar location
|
||||
func copyOldAvatarToNewLocation(userID int64, oldAvatar string) (string, error) {
|
||||
fr, err := os.Open(filepath.Join(setting.Avatar.Path, oldAvatar))
|
||||
fr, err := os.Open(filepath.Join(setting.Avatar.Storage.Path, oldAvatar))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("os.Open: %w", err)
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ func copyOldAvatarToNewLocation(userID int64, oldAvatar string) (string, error)
|
|||
return newAvatar, nil
|
||||
}
|
||||
|
||||
if err := os.WriteFile(filepath.Join(setting.Avatar.Path, newAvatar), data, 0o666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(setting.Avatar.Storage.Path, newAvatar), data, 0o666); err != nil {
|
||||
return "", fmt.Errorf("os.WriteFile: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -262,6 +262,10 @@ func GetRepositories(ctx context.Context, actor *user_model.User, n int, last st
|
|||
cond = cond.And(builder.Gt{"package_property.value": strings.ToLower(last)})
|
||||
}
|
||||
|
||||
if actor.IsGhost() {
|
||||
actor = nil
|
||||
}
|
||||
|
||||
cond = cond.And(user_model.BuildCanSeeUserCondition(actor))
|
||||
|
||||
sess := db.GetEngine(ctx).
|
||||
|
|
|
@ -42,12 +42,14 @@ func fatalTestError(fmtStr string, args ...interface{}) {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
// InitSettings initializes config provider and load common setttings for tests
|
||||
// InitSettings initializes config provider and load common settings for tests
|
||||
func InitSettings(extraConfigs ...string) {
|
||||
setting.Init(&setting.Options{
|
||||
AllowEmpty: true,
|
||||
ExtraConfig: strings.Join(extraConfigs, "\n"),
|
||||
})
|
||||
if setting.CustomConf == "" {
|
||||
setting.CustomConf = filepath.Join(setting.CustomPath, "conf/app-unittest-tmp.ini")
|
||||
_ = os.Remove(setting.CustomConf)
|
||||
}
|
||||
setting.InitCfgProvider(setting.CustomConf, strings.Join(extraConfigs, "\n"))
|
||||
setting.LoadCommonSettings()
|
||||
|
||||
if err := setting.PrepareAppDataPath(); err != nil {
|
||||
log.Fatalf("Can not prepare APP_DATA_PATH: %v", err)
|
||||
|
@ -69,7 +71,7 @@ type TestOptions struct {
|
|||
// MainTest a reusable TestMain(..) function for unit tests that need to use a
|
||||
// test database. Creates the test database, and sets necessary settings.
|
||||
func MainTest(m *testing.M, testOpts *TestOptions) {
|
||||
setting.SetCustomPathAndConf("", "", "")
|
||||
setting.CustomPath = filepath.Join(testOpts.GiteaRootPath, "custom")
|
||||
InitSettings()
|
||||
|
||||
var err error
|
||||
|
|
|
@ -64,6 +64,10 @@ func NewUserRedirect(ctx context.Context, ID int64, oldUserName, newUserName str
|
|||
oldUserName = strings.ToLower(oldUserName)
|
||||
newUserName = strings.ToLower(newUserName)
|
||||
|
||||
if err := DeleteUserRedirect(ctx, oldUserName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := DeleteUserRedirect(ctx, newUserName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ const (
|
|||
SettingsKeyHiddenCommentTypes = "issue.hidden_comment_types"
|
||||
// SettingsKeyDiffWhitespaceBehavior is the setting key for whitespace behavior of diff
|
||||
SettingsKeyDiffWhitespaceBehavior = "diff.whitespace_behaviour"
|
||||
// SettingsKeyShowOutdatedComments is the setting key wether or not to show outdated comments in PRs
|
||||
SettingsKeyShowOutdatedComments = "comment_code.show_outdated"
|
||||
// UserActivityPubPrivPem is user's private key
|
||||
UserActivityPubPrivPem = "activitypub.priv_pem"
|
||||
// UserActivityPubPubPem is user's public key
|
||||
|
|
|
@ -29,12 +29,28 @@ const (
|
|||
)
|
||||
|
||||
func WriteLogs(ctx context.Context, filename string, offset int64, rows []*runnerv1.LogRow) ([]int, error) {
|
||||
flag := os.O_WRONLY
|
||||
if offset == 0 {
|
||||
// Create file only if offset is 0, or it could result in content holes if the file doesn't exist.
|
||||
flag |= os.O_CREATE
|
||||
}
|
||||
name := DBFSPrefix + filename
|
||||
f, err := dbfs.OpenFile(ctx, name, os.O_WRONLY|os.O_CREATE)
|
||||
f, err := dbfs.OpenFile(ctx, name, flag)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("dbfs OpenFile %q: %w", name, err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
stat, err := f.Stat()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("dbfs Stat %q: %w", name, err)
|
||||
}
|
||||
if stat.Size() < offset {
|
||||
// If the size is less than offset, refuse to write, or it could result in content holes.
|
||||
// However, if the size is greater than offset, we can still write to overwrite the content.
|
||||
return nil, fmt.Errorf("size of %q is less than offset", name)
|
||||
}
|
||||
|
||||
if _, err := f.Seek(offset, io.SeekStart); err != nil {
|
||||
return nil, fmt.Errorf("dbfs Seek %q: %w", name, err)
|
||||
}
|
||||
|
|
|
@ -49,9 +49,9 @@ func (ctx *Context) RedirectToFirst(location ...string) {
|
|||
continue
|
||||
}
|
||||
|
||||
// Unfortunately browsers consider a redirect Location with preceding "//" and "/\" as meaning redirect to "http(s)://REST_OF_PATH"
|
||||
// Unfortunately browsers consider a redirect Location with preceding "//", "\\" and "/\" as meaning redirect to "http(s)://REST_OF_PATH"
|
||||
// Therefore we should ignore these redirect locations to prevent open redirects
|
||||
if len(loc) > 1 && loc[0] == '/' && (loc[1] == '/' || loc[1] == '\\') {
|
||||
if len(loc) > 1 && (loc[0] == '/' || loc[0] == '\\') && (loc[1] == '/' || loc[1] == '\\') {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ type Check struct {
|
|||
}
|
||||
|
||||
func initDBSkipLogger(ctx context.Context) error {
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
setting.LoadDBSetting()
|
||||
if err := db.InitEngine(ctx); err != nil {
|
||||
return fmt.Errorf("db.InitEngine: %w", err)
|
||||
|
|
|
@ -66,7 +66,7 @@ func checkConfigurationFiles(ctx context.Context, logger log.Logger, autofix boo
|
|||
return err
|
||||
}
|
||||
|
||||
setting.Init(&setting.Options{})
|
||||
setting.MustInstalled()
|
||||
|
||||
configurationFiles := []configurationFile{
|
||||
{"Configuration File Path", setting.CustomConf, false, true, false},
|
||||
|
|
|
@ -20,17 +20,18 @@ func (b *Blob) Name() string {
|
|||
return b.name
|
||||
}
|
||||
|
||||
// GetBlobContent Gets the content of the blob as raw text
|
||||
func (b *Blob) GetBlobContent() (string, error) {
|
||||
// GetBlobContent Gets the limited content of the blob as raw text
|
||||
func (b *Blob) GetBlobContent(limit int64) (string, error) {
|
||||
if limit <= 0 {
|
||||
return "", nil
|
||||
}
|
||||
dataRc, err := b.DataAsync()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer dataRc.Close()
|
||||
buf := make([]byte, 1024)
|
||||
n, _ := util.ReadAtMost(dataRc, buf)
|
||||
buf = buf[:n]
|
||||
return string(buf), nil
|
||||
buf, err := util.ReadWithLimit(dataRc, int(limit))
|
||||
return string(buf), err
|
||||
}
|
||||
|
||||
// GetBlobLineCount gets line count of the blob
|
||||
|
|
|
@ -163,6 +163,7 @@ func (ref RefName) ShortName() string {
|
|||
}
|
||||
|
||||
// RefGroup returns the group type of the reference
|
||||
// Using the name of the directory under .git/refs
|
||||
func (ref RefName) RefGroup() string {
|
||||
if ref.IsBranch() {
|
||||
return "heads"
|
||||
|
@ -182,6 +183,19 @@ func (ref RefName) RefGroup() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// RefType returns the simple ref type of the reference, e.g. branch, tag
|
||||
// It's differrent from RefGroup, which is using the name of the directory under .git/refs
|
||||
// Here we using branch but not heads, using tag but not tags
|
||||
func (ref RefName) RefType() string {
|
||||
var refType string
|
||||
if ref.IsBranch() {
|
||||
refType = "branch"
|
||||
} else if ref.IsTag() {
|
||||
refType = "tag"
|
||||
}
|
||||
return refType
|
||||
}
|
||||
|
||||
// RefURL returns the absolute URL for a ref in a repository
|
||||
func RefURL(repoURL, ref string) string {
|
||||
refFullName := RefName(ref)
|
||||
|
|
|
@ -28,6 +28,14 @@ func IsValidSHAPattern(sha string) bool {
|
|||
return shaPattern.MatchString(sha)
|
||||
}
|
||||
|
||||
type ErrInvalidSHA struct {
|
||||
SHA string
|
||||
}
|
||||
|
||||
func (err ErrInvalidSHA) Error() string {
|
||||
return fmt.Sprintf("invalid sha: %s", err.SHA)
|
||||
}
|
||||
|
||||
// MustID always creates a new SHA1 from a [20]byte array with no validation of input.
|
||||
func MustID(b []byte) SHA1 {
|
||||
var id SHA1
|
||||
|
|
|
@ -79,5 +79,5 @@ func SetConsoleLogger(loggerName, writerName string, level Level) {
|
|||
Colorize: CanColorStdout,
|
||||
WriterOption: WriterConsoleOption{},
|
||||
})
|
||||
GetManager().GetLogger(loggerName).RemoveAllWriters().AddWriters(writer)
|
||||
GetManager().GetLogger(loggerName).ReplaceAllWriters(writer)
|
||||
}
|
||||
|
|
|
@ -96,7 +96,10 @@ func (l *LoggerImpl) removeWriterInternal(w EventWriter) {
|
|||
func (l *LoggerImpl) AddWriters(writer ...EventWriter) {
|
||||
l.eventWriterMu.Lock()
|
||||
defer l.eventWriterMu.Unlock()
|
||||
l.addWritersInternal(writer...)
|
||||
}
|
||||
|
||||
func (l *LoggerImpl) addWritersInternal(writer ...EventWriter) {
|
||||
for _, w := range writer {
|
||||
if old, ok := l.eventWriters[w.GetWriterName()]; ok {
|
||||
l.removeWriterInternal(old)
|
||||
|
@ -126,8 +129,8 @@ func (l *LoggerImpl) RemoveWriter(modeName string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// RemoveAllWriters removes all writers from the logger, non-shared writers are closed and flushed
|
||||
func (l *LoggerImpl) RemoveAllWriters() *LoggerImpl {
|
||||
// ReplaceAllWriters replaces all writers from the logger, non-shared writers are closed and flushed
|
||||
func (l *LoggerImpl) ReplaceAllWriters(writer ...EventWriter) {
|
||||
l.eventWriterMu.Lock()
|
||||
defer l.eventWriterMu.Unlock()
|
||||
|
||||
|
@ -135,8 +138,7 @@ func (l *LoggerImpl) RemoveAllWriters() *LoggerImpl {
|
|||
l.removeWriterInternal(w)
|
||||
}
|
||||
l.eventWriters = map[string]EventWriter{}
|
||||
l.syncLevelInternal()
|
||||
return l
|
||||
l.addWritersInternal(writer...)
|
||||
}
|
||||
|
||||
// DumpWriters dumps the writers as a JSON map, it's used for debugging and display purposes.
|
||||
|
@ -161,7 +163,7 @@ func (l *LoggerImpl) DumpWriters() map[string]any {
|
|||
|
||||
// Close closes the logger, non-shared writers are closed and flushed
|
||||
func (l *LoggerImpl) Close() {
|
||||
l.RemoveAllWriters()
|
||||
l.ReplaceAllWriters()
|
||||
l.ctxCancel()
|
||||
}
|
||||
|
||||
|
@ -233,7 +235,6 @@ func NewLoggerWithWriters(ctx context.Context, name string, writer ...EventWrite
|
|||
l.ctx, l.ctxCancel = newProcessTypedContext(ctx, "Logger: "+name)
|
||||
l.LevelLogger = BaseLoggerToGeneralLogger(l)
|
||||
l.eventWriters = map[string]EventWriter{}
|
||||
l.syncLevelInternal()
|
||||
l.AddWriters(writer...)
|
||||
return l
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ func TestSharedWorker(t *testing.T) {
|
|||
loggerTest := m.GetLogger("test")
|
||||
loggerTest.AddWriters(w)
|
||||
loggerTest.Info("msg-1")
|
||||
loggerTest.RemoveAllWriters() // the shared writer is not closed here
|
||||
loggerTest.ReplaceAllWriters() // the shared writer is not closed here
|
||||
loggerTest.Info("never seen")
|
||||
|
||||
// the shared writer can still be used later
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
"code.gitea.io/gitea/modules/emoji"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
@ -28,9 +29,7 @@ var localMetas = map[string]string{
|
|||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
setting.Init(&setting.Options{
|
||||
AllowEmpty: true,
|
||||
})
|
||||
unittest.InitSettings()
|
||||
if err := git.InitSimple(context.Background()); err != nil {
|
||||
log.Fatal("git init failed, err: %v", err)
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue