mirror of https://github.com/go-gitea/gitea.git
Compare commits
339 Commits
Author | SHA1 | Date |
---|---|---|
Lunny Xiao | 2588d73ebf | |
Giteabot | a0b9bd2feb | |
Giteabot | c398c25b18 | |
Giteabot | 2048363f9e | |
Giteabot | b8e6cffd31 | |
Giteabot | 1ddcaedb88 | |
Giteabot | 7291fecab3 | |
6543 | c33886b710 | |
Giteabot | d6eb6c90f4 | |
Giteabot | 55c53080d1 | |
Giteabot | 8766f65add | |
Lunny Xiao | e95006848e | |
Jimmy Praet | 9210ce4045 | |
Giteabot | cebf55f6b1 | |
Giteabot | b508813fe4 | |
Giteabot | fd1edb9d9d | |
Giteabot | 633996db8e | |
FuXiaoHei | 7f0ce2dfc7 | |
Giteabot | b7c944b9e4 | |
Giteabot | cf9a416d62 | |
Giteabot | 8c7bda8755 | |
Giteabot | b7e32b2382 | |
Giteabot | e3dfb512d6 | |
Giteabot | 0d50f27469 | |
Mihir Joshi | 62f2d717b7 | |
Giteabot | 89960c3dfb | |
Giteabot | 8b5c9186a5 | |
Yarden Shoham | 8b4abb1719 | |
Lunny Xiao | f4923854f6 | |
Giteabot | d590607106 | |
Giteabot | 4746291b08 | |
KN4CK3R | 022552d5b6 | |
Giteabot | 376fa0d8c4 | |
Giteabot | be541d9877 | |
KN4CK3R | ae99233db0 | |
Giteabot | cbf366643b | |
Giteabot | df694f6a7d | |
Giteabot | 84282c608c | |
Chongyi Zheng | d1db2b7251 | |
Giteabot | 6493085aee | |
Giteabot | fbf29f29b5 | |
Lunny Xiao | 6e29242ebb | |
Jack Hay | 56e722f825 | |
Giteabot | 80e564087d | |
Giteabot | 571822b6ec | |
Giteabot | 2a0fbe23b8 | |
Giteabot | 95901a99c0 | |
Giteabot | cb33623bb6 | |
Giteabot | 9f0c709637 | |
Giteabot | 5e9fd0ab5e | |
Giteabot | f220f4231a | |
Giteabot | bce27d0a31 | |
Giteabot | 12f418a7e8 | |
wxiaoguang | 9865aa2394 | |
Giteabot | def178ce32 | |
Giteabot | 2399b4d483 | |
Giteabot | ad2cb9863c | |
Giteabot | 7f833d8f71 | |
Giteabot | e67c819cf4 | |
wxiaoguang | 83457805bb | |
Giteabot | 3c79315cf2 | |
Giteabot | 3e1bd61000 | |
Giteabot | 18da3f8483 | |
wxiaoguang | 2165729d16 | |
Giteabot | 683b95f0da | |
Lunny Xiao | ff565a787f | |
Giteabot | f7cca2a290 | |
Giteabot | 373e78895e | |
wxiaoguang | 8ec232817c | |
Giteabot | a5c7ac9980 | |
Giteabot | bf983735fd | |
wxiaoguang | 7a2786ca6c | |
Giteabot | b2588338f0 | |
Giteabot | 8a46a6417e | |
Giteabot | 5b104a5533 | |
Giteabot | f2add36a29 | |
Giteabot | 564068aa99 | |
Giteabot | 6a559ad634 | |
Giteabot | 4dd39eb54a | |
Giteabot | acc8100d47 | |
Giteabot | 1a3803effd | |
Giteabot | 1183002b32 | |
wxiaoguang | 1fc6bc1be2 | |
Lunny Xiao | 2360c7ec6c | |
Giteabot | 8ca32dc873 | |
Giteabot | 47f9b3f484 | |
Giteabot | 16263af971 | |
Giteabot | f096635622 | |
Giteabot | 932e282e15 | |
Giteabot | d9aeb1f09d | |
Giteabot | 411310d698 | |
wxiaoguang | 6d002f8e1e | |
Giteabot | 4462628a26 | |
wxiaoguang | a3f403f438 | |
Giteabot | 8ee1ed877b | |
Giteabot | 2c2e00899d | |
Giteabot | 6cbb6f303a | |
Giteabot | 6af698fb81 | |
Giteabot | 94a05a492d | |
Giteabot | 6de862abdf | |
Giteabot | b47482d58e | |
Giteabot | 74ab798033 | |
Giteabot | 97a0bf151a | |
Giteabot | 5e2bae7716 | |
techknowlogick | 96d3fcf179 | |
Lunny Xiao | 265f485295 | |
Giteabot | f144521aea | |
Giteabot | 6f4d5c0b8c | |
Giteabot | 1ec622db24 | |
Giteabot | 40d51188c0 | |
Lunny Xiao | 87db4a47c8 | |
Giteabot | cd2dd5a67d | |
Giteabot | 46beb7f33f | |
Giteabot | 3107093394 | |
Giteabot | 272ae03341 | |
Giteabot | b56a9f6ded | |
Giteabot | c5c44d0951 | |
Giteabot | 8f2805f757 | |
Giteabot | 5eaf91e919 | |
Giteabot | b7e3adc66c | |
Giteabot | 5b5f8aab19 | |
Giteabot | fef34790bb | |
Giteabot | 8b590de186 | |
Giteabot | 5105d2093c | |
Giteabot | 08445d5d86 | |
Giteabot | b71d4c3ec0 | |
Giteabot | bf537adf8a | |
Giteabot | 8c8c24f8eb | |
Giteabot | fee9c05ed3 | |
Giteabot | e15fe85335 | |
wxiaoguang | 4f5122a7fe | |
Giteabot | 84e65afffd | |
Giteabot | d2908b2794 | |
Giteabot | 24e03a125d | |
Giteabot | 76e892317b | |
Giteabot | 5001f63c07 | |
Giteabot | 6d22ca15ab | |
Giteabot | ea9f5a57e4 | |
yp05327 | 96141e4e55 | |
Giteabot | ca5f0c93c6 | |
Lunny Xiao | 196100a07a | |
Lunny Xiao | bc3d8bff73 | |
Giteabot | 7f81110461 | |
Giteabot | 5ed0eefc9a | |
Giteabot | 4b89c0f996 | |
pitpalme | 7cae4dfc00 | |
Giteabot | 28b8e0b43e | |
Giteabot | 23838c2c2e | |
Giteabot | f9763f1366 | |
Giteabot | a2314ca9c5 | |
Giteabot | 994ba35f11 | |
Giteabot | 447422fe27 | |
Giteabot | 9bfee5014b | |
Giteabot | 7128929a0d | |
Giteabot | efcbaf8fa8 | |
Giteabot | c997e90738 | |
Giteabot | ffab076b72 | |
Giteabot | 117d9a117f | |
Giteabot | f8c5f202b7 | |
John Olheiser | 7213506680 | |
Giteabot | 1f82be6604 | |
Giteabot | 56bedf2bcc | |
Giteabot | f7567f798d | |
Giteabot | 93ede4bc83 | |
Giteabot | 9f63d27ec4 | |
Giteabot | 073d8c50dd | |
Denys Konovalov | bc6477b36b | |
Giteabot | 09efce9da2 | |
Giteabot | 124a9957d0 | |
Giteabot | d72e20627d | |
Giteabot | 00cd5ba6f4 | |
Giteabot | eef4148935 | |
Giteabot | d4122712f7 | |
Nanguan Lin | 97f4239a94 | |
Giteabot | 58d71cdd6f | |
Giteabot | 2691b345e6 | |
Giteabot | 60b51d0648 | |
Giteabot | 824d40edc6 | |
Giteabot | 46ac04ce9d | |
Giteabot | cc7b9eb085 | |
Giteabot | 7aafe5e0b4 | |
Giteabot | 9e15955c68 | |
Giteabot | 6eadad8222 | |
Giteabot | a8e505a44b | |
Giteabot | e47b31c691 | |
Giteabot | 49f82ac4e3 | |
Giteabot | 81d233d987 | |
Giteabot | 2f56ab7999 | |
Giteabot | 61d3d9205b | |
Giteabot | 28e3d0b0d3 | |
Denys Konovalov | 4c67c05480 | |
Giteabot | cf7374c079 | |
Giteabot | 8d0a4d7e9d | |
Giteabot | 9ca1853495 | |
Giteabot | d6f7c49b8b | |
Giteabot | c074af6a6d | |
Giteabot | 39596115da | |
Giteabot | 352906b448 | |
6543 | 6637bbf510 | |
wxiaoguang | 6ac2ade97d | |
Giteabot | 18a782f73d | |
Giteabot | 6af6f81780 | |
Giteabot | d282f5dab8 | |
Giteabot | f3f56d570b | |
Giteabot | 3c03b7db50 | |
Giteabot | ac22116211 | |
Giteabot | 25bc3d562a | |
Giteabot | 991c959110 | |
Giteabot | 2d2a5657ef | |
Giteabot | 977f5db28e | |
Giteabot | 487c573c28 | |
Giteabot | 25acbfed36 | |
Giteabot | 9dd8f34707 | |
Giteabot | 77bd3acb65 | |
Giteabot | 95db95ef91 | |
Denys Konovalov | ffab2b7e4f | |
Giteabot | cb9e10f971 | |
Giteabot | 5087de1a5c | |
Giteabot | f2bac791db | |
wxiaoguang | c279f8aab7 | |
Denys Konovalov | 9f2b8c7ead | |
Giteabot | 48e3aec862 | |
6543 | aabcf2d7ad | |
Giteabot | 6919a02ab7 | |
Giteabot | 1848858a1e | |
Giteabot | a398089301 | |
Giteabot | 8885108c42 | |
Giteabot | 993178b45f | |
Giteabot | 345d70f7e4 | |
Giteabot | 6dce671d02 | |
Giteabot | 6cef7a767b | |
Giteabot | 6befca1695 | |
Giteabot | 89d3766d22 | |
Giteabot | 9b14f1a8ed | |
Giteabot | 0b8b0072a2 | |
Giteabot | dab40cd5f4 | |
Giteabot | 5b80157aad | |
Giteabot | bf76216de1 | |
Giteabot | 21c3513d49 | |
Giteabot | 8cf7548a18 | |
Giteabot | 066aee28a5 | |
Giteabot | 148f6e3776 | |
Nanguan Lin | fa6941cf8c | |
Giteabot | 54dccbeb2e | |
Chongyi Zheng | 9f228704a3 | |
Giteabot | 21f1e223d8 | |
Giteabot | 63a321b83a | |
Giteabot | 844ab9a441 | |
Giteabot | 7ec7c733c7 | |
Giteabot | 4986dc8351 | |
Giteabot | 1380a46623 | |
Nanguan Lin | f19feb0f47 | |
Giteabot | 9da92835d1 | |
Giteabot | 478e7042f5 | |
Giteabot | 63587a4aef | |
yp05327 | 29d3949271 | |
Giteabot | 71f091ef97 | |
Giteabot | 9a64a24f29 | |
Giteabot | d8513fc312 | |
Giteabot | 8c969cdf9c | |
Giteabot | 4c9f7d0710 | |
Giteabot | a1ee172fb0 | |
Giteabot | fb5ae2ab94 | |
silverwind | 8419897fba | |
Giteabot | 17698d4a62 | |
silverwind | 0fb7294027 | |
Giteabot | 8e1ef5787f | |
Giteabot | 65020fdf7f | |
Giteabot | 5b670d83e1 | |
delvh | 9207331f4d | |
Giteabot | 44aca6a65a | |
Giteabot | aaf35ee49c | |
Giteabot | a9d547f55b | |
Giteabot | 51001d9ffe | |
Giteabot | 1ff6b7783c | |
Giteabot | 99e2071eeb | |
Giteabot | 1dd84ec3a1 | |
Giteabot | 290440e1ee | |
Lunny Xiao | 881a844c9d | |
Giteabot | d5da0e622c | |
Giteabot | 8c6464e39b | |
Giteabot | 4f02b4a7b9 | |
Giteabot | 7dc5ab2e95 | |
Giteabot | 28d970e4a6 | |
Giteabot | 4e824a735e | |
Giteabot | eea79ce586 | |
Giteabot | e9340ce9bc | |
Giteabot | de387102b4 | |
Giteabot | 79c17d8b6a | |
Giteabot | 006c15fb5f | |
Giteabot | 0c4f97c112 | |
Giteabot | f9395eaa08 | |
Giteabot | f13a294b47 | |
Giteabot | 84ee02faa7 | |
Giteabot | f77b4cb4a2 | |
Giteabot | 7ea7f2b37f | |
Giteabot | c61b9c5f3c | |
Giteabot | e719bf8ead | |
Giteabot | 9903b8d7ec | |
Giteabot | 77ccd215e2 | |
Giteabot | 71d1bfea7f | |
Giteabot | b00489886d | |
Giteabot | 9b698362a3 | |
Giteabot | 1a923c95dd | |
Giteabot | a6a79add68 | |
Giteabot | d74fba8175 | |
Giteabot | e4cf9d22a7 | |
Giteabot | 755369df56 | |
Giteabot | 42f7c2ad89 | |
Giteabot | fee8522052 | |
Giteabot | 34c440996d | |
Giteabot | 283b19bad5 | |
Giteabot | f0045f4113 | |
Giteabot | 0abd78e6a8 | |
Giteabot | fc7d3f7315 | |
wxiaoguang | 597b04fe2f | |
Giteabot | 2774a2afc6 | |
Giteabot | 89b6f20bf8 | |
Giteabot | 37c7780e85 | |
Giteabot | e0832da7fa | |
Giteabot | daaf0ad473 | |
Giteabot | 9fc24a8f5e | |
Giteabot | a1029cb2ca | |
Giteabot | 134c7636ef | |
Giteabot | 88271167d6 | |
Giteabot | a8086f6148 | |
Giteabot | f4f6885c1f | |
Giteabot | 64c0a6a4e2 | |
Giteabot | 2181b3713e | |
Giteabot | 2084c3933d | |
Giteabot | b6dab855f5 | |
Giteabot | e9fcdf822c | |
Giteabot | 7750a7313d | |
Giteabot | 81ae35aa4f | |
Giteabot | 2e49a4da48 | |
Giteabot | 8d9e2d07f3 | |
Giteabot | b34727c632 | |
Giteabot | 0ca233258d | |
Giteabot | c3b7120042 |
|
@ -13,46 +13,42 @@ groups:
|
||||||
-
|
-
|
||||||
name: BREAKING
|
name: BREAKING
|
||||||
labels:
|
labels:
|
||||||
- kind/breaking
|
- pr/breaking
|
||||||
-
|
-
|
||||||
name: SECURITY
|
name: SECURITY
|
||||||
labels:
|
labels:
|
||||||
- kind/security
|
- topic/security
|
||||||
-
|
-
|
||||||
name: FEATURES
|
name: FEATURES
|
||||||
labels:
|
labels:
|
||||||
- kind/feature
|
- type/feature
|
||||||
-
|
-
|
||||||
name: API
|
name: API
|
||||||
labels:
|
labels:
|
||||||
- kind/api
|
- modifies/api
|
||||||
-
|
-
|
||||||
name: ENHANCEMENTS
|
name: ENHANCEMENTS
|
||||||
labels:
|
labels:
|
||||||
- kind/enhancement
|
- type/enhancement
|
||||||
- kind/refactor
|
- type/refactoring
|
||||||
- kind/ui
|
- topic/ui
|
||||||
-
|
-
|
||||||
name: BUGFIXES
|
name: BUGFIXES
|
||||||
labels:
|
labels:
|
||||||
- kind/bug
|
- type/bug
|
||||||
-
|
-
|
||||||
name: TESTING
|
name: TESTING
|
||||||
labels:
|
labels:
|
||||||
- kind/testing
|
- type/testing
|
||||||
-
|
|
||||||
name: TRANSLATION
|
|
||||||
labels:
|
|
||||||
- kind/translation
|
|
||||||
-
|
-
|
||||||
name: BUILD
|
name: BUILD
|
||||||
labels:
|
labels:
|
||||||
- kind/build
|
- topic/build
|
||||||
- kind/lint
|
- topic/code-linting
|
||||||
-
|
-
|
||||||
name: DOCS
|
name: DOCS
|
||||||
labels:
|
labels:
|
||||||
- kind/docs
|
- type/docs
|
||||||
-
|
-
|
||||||
name: MISC
|
name: MISC
|
||||||
default: true
|
default: true
|
||||||
|
|
425
.drone.yml
425
.drone.yml
|
@ -1,425 +0,0 @@
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: release-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
workspace:
|
|
||||||
base: /source
|
|
||||||
path: /
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
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.21.x
|
|
||||||
pull: always
|
|
||||||
commands:
|
|
||||||
- curl -sL https://deb.nodesource.com/setup_20.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
|
|
||||||
depends_on: [fetch-tags]
|
|
||||||
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
|
|
||||||
depends_on: [static]
|
|
||||||
|
|
||||||
- name: release-tag
|
|
||||||
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_TAG##v}"
|
|
||||||
environment:
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
from_secret: aws_access_key_id
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
from_secret: aws_secret_access_key
|
|
||||||
depends_on: [gpg-sign]
|
|
||||||
|
|
||||||
- name: github
|
|
||||||
image: plugins/github-release:latest
|
|
||||||
pull: always
|
|
||||||
settings:
|
|
||||||
files:
|
|
||||||
- "dist/release/*"
|
|
||||||
file_exists: overwrite
|
|
||||||
environment:
|
|
||||||
GITHUB_TOKEN:
|
|
||||||
from_secret: github_token
|
|
||||||
depends_on: [gpg-sign]
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: docker-linux-amd64-release-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
include:
|
|
||||||
- "refs/tags/**"
|
|
||||||
exclude:
|
|
||||||
- "refs/tags/**-rc*"
|
|
||||||
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: true
|
|
||||||
auto_tag_suffix: 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: true
|
|
||||||
auto_tag_suffix: 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
|
|
||||||
name: docker-linux-amd64-release-candidate-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- "refs/tags/**-rc*"
|
|
||||||
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:
|
|
||||||
tags: ${DRONE_TAG##v}-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
|
|
||||||
tags: ${DRONE_TAG##v}-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
|
|
||||||
name: docker-linux-arm64-release-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
include:
|
|
||||||
- "refs/tags/**"
|
|
||||||
exclude:
|
|
||||||
- "refs/tags/**-rc*"
|
|
||||||
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: true
|
|
||||||
auto_tag_suffix: 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: true
|
|
||||||
auto_tag_suffix: 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
|
|
||||||
name: docker-linux-arm64-release-candidate-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- "refs/tags/**-rc*"
|
|
||||||
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:
|
|
||||||
tags: ${DRONE_TAG##v}-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
|
|
||||||
tags: ${DRONE_TAG##v}-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
|
|
||||||
name: docker-manifest-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: manifest-rootless
|
|
||||||
image: plugins/manifest
|
|
||||||
pull: always
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
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: true
|
|
||||||
ignore_missing: true
|
|
||||||
spec: docker/manifest.tmpl
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- "refs/tags/**"
|
|
||||||
paths:
|
|
||||||
exclude:
|
|
||||||
- "docs/**"
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- docker-linux-amd64-release-version
|
|
||||||
- docker-linux-amd64-release-candidate-version
|
|
||||||
- docker-linux-arm64-release-version
|
|
||||||
- docker-linux-arm64-release-candidate-version
|
|
|
@ -11,7 +11,6 @@ parserOptions:
|
||||||
plugins:
|
plugins:
|
||||||
- "@eslint-community/eslint-plugin-eslint-comments"
|
- "@eslint-community/eslint-plugin-eslint-comments"
|
||||||
- eslint-plugin-array-func
|
- eslint-plugin-array-func
|
||||||
- eslint-plugin-custom-elements
|
|
||||||
- eslint-plugin-import
|
- eslint-plugin-import
|
||||||
- eslint-plugin-jquery
|
- eslint-plugin-jquery
|
||||||
- eslint-plugin-no-jquery
|
- eslint-plugin-no-jquery
|
||||||
|
@ -19,6 +18,7 @@ plugins:
|
||||||
- eslint-plugin-regexp
|
- eslint-plugin-regexp
|
||||||
- eslint-plugin-sonarjs
|
- eslint-plugin-sonarjs
|
||||||
- eslint-plugin-unicorn
|
- eslint-plugin-unicorn
|
||||||
|
- eslint-plugin-vitest-globals
|
||||||
- eslint-plugin-wc
|
- eslint-plugin-wc
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
@ -46,6 +46,9 @@ overrides:
|
||||||
- files: ["*.config.*"]
|
- files: ["*.config.*"]
|
||||||
rules:
|
rules:
|
||||||
import/no-unused-modules: [0]
|
import/no-unused-modules: [0]
|
||||||
|
- files: ["**/*.test.*", "web_src/js/test/setup.js"]
|
||||||
|
env:
|
||||||
|
vitest-globals/env: true
|
||||||
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
|
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
|
||||||
rules:
|
rules:
|
||||||
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
|
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
|
||||||
|
@ -88,19 +91,6 @@ rules:
|
||||||
consistent-this: [0]
|
consistent-this: [0]
|
||||||
constructor-super: [2]
|
constructor-super: [2]
|
||||||
curly: [0]
|
curly: [0]
|
||||||
custom-elements/expose-class-on-global: [0]
|
|
||||||
custom-elements/extends-correct-class: [2]
|
|
||||||
custom-elements/file-name-matches-element: [2]
|
|
||||||
custom-elements/no-constructor: [2]
|
|
||||||
custom-elements/no-customized-built-in-elements: [2]
|
|
||||||
custom-elements/no-dom-traversal-in-attributechangedcallback: [2]
|
|
||||||
custom-elements/no-dom-traversal-in-connectedcallback: [2]
|
|
||||||
custom-elements/no-exports-with-element: [2]
|
|
||||||
custom-elements/no-method-prefixed-with-on: [2]
|
|
||||||
custom-elements/no-unchecked-define: [0]
|
|
||||||
custom-elements/one-element-per-file: [0]
|
|
||||||
custom-elements/tag-name-matches-class: [2]
|
|
||||||
custom-elements/valid-tag-name: [2]
|
|
||||||
default-case-last: [2]
|
default-case-last: [2]
|
||||||
default-case: [0]
|
default-case: [0]
|
||||||
default-param-last: [0]
|
default-param-last: [0]
|
||||||
|
@ -486,7 +476,7 @@ rules:
|
||||||
prefer-exponentiation-operator: [2]
|
prefer-exponentiation-operator: [2]
|
||||||
prefer-named-capture-group: [0]
|
prefer-named-capture-group: [0]
|
||||||
prefer-numeric-literals: [2]
|
prefer-numeric-literals: [2]
|
||||||
prefer-object-has-own: [0]
|
prefer-object-has-own: [2]
|
||||||
prefer-object-spread: [2]
|
prefer-object-spread: [2]
|
||||||
prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
|
prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
|
||||||
prefer-regex-literals: [2]
|
prefer-regex-literals: [2]
|
||||||
|
@ -740,14 +730,27 @@ rules:
|
||||||
valid-typeof: [2, {requireStringLiterals: true}]
|
valid-typeof: [2, {requireStringLiterals: true}]
|
||||||
vars-on-top: [0]
|
vars-on-top: [0]
|
||||||
wc/attach-shadow-constructor: [2]
|
wc/attach-shadow-constructor: [2]
|
||||||
|
wc/define-tag-after-class-definition: [0]
|
||||||
|
wc/expose-class-on-global: [0]
|
||||||
|
wc/file-name-matches-element: [2]
|
||||||
|
wc/guard-define-call: [0]
|
||||||
wc/guard-super-call: [2]
|
wc/guard-super-call: [2]
|
||||||
|
wc/max-elements-per-file: [0]
|
||||||
|
wc/no-child-traversal-in-attributechangedcallback: [2]
|
||||||
|
wc/no-child-traversal-in-connectedcallback: [2]
|
||||||
wc/no-closed-shadow-root: [2]
|
wc/no-closed-shadow-root: [2]
|
||||||
wc/no-constructor-attributes: [2]
|
wc/no-constructor-attributes: [2]
|
||||||
wc/no-constructor-params: [2]
|
wc/no-constructor-params: [2]
|
||||||
wc/no-invalid-element-name: [0] # covered by custom-elements/valid-tag-name
|
wc/no-constructor: [2]
|
||||||
|
wc/no-customized-built-in-elements: [2]
|
||||||
|
wc/no-exports-with-element: [2]
|
||||||
|
wc/no-invalid-element-name: [2]
|
||||||
|
wc/no-invalid-extends: [2]
|
||||||
|
wc/no-method-prefixed-with-on: [2]
|
||||||
wc/no-self-class: [2]
|
wc/no-self-class: [2]
|
||||||
wc/no-typos: [2]
|
wc/no-typos: [2]
|
||||||
wc/require-listener-teardown: [2]
|
wc/require-listener-teardown: [2]
|
||||||
|
wc/tag-name-matches-class: [2]
|
||||||
wrap-iife: [2, inside]
|
wrap-iife: [2, inside]
|
||||||
wrap-regex: [0]
|
wrap-regex: [0]
|
||||||
yield-star-spacing: [2, after]
|
yield-star-spacing: [2, after]
|
||||||
|
|
|
@ -2,3 +2,4 @@ self-hosted-runner:
|
||||||
labels:
|
labels:
|
||||||
- actuated-4cpu-8gb
|
- actuated-4cpu-8gb
|
||||||
- actuated-4cpu-16gb
|
- actuated-4cpu-16gb
|
||||||
|
- nscloud
|
||||||
|
|
|
@ -1,35 +1,36 @@
|
||||||
kind/docs:
|
modifies/docs:
|
||||||
- "**/*.md"
|
- "**/*.md"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
|
|
||||||
kind/ui:
|
modifies/frontend:
|
||||||
- "web_src/**/*"
|
- "web_src/**/*"
|
||||||
|
|
||||||
|
modifies/templates:
|
||||||
- all: ["templates/**", "!templates/swagger/v1_json.tmpl"]
|
- all: ["templates/**", "!templates/swagger/v1_json.tmpl"]
|
||||||
|
|
||||||
kind/api:
|
modifies/api:
|
||||||
- "templates/swagger/v1_json.tmpl"
|
|
||||||
- "routers/api/**"
|
- "routers/api/**"
|
||||||
|
- "templates/swagger/v1_json.tmpl"
|
||||||
|
|
||||||
kind/build:
|
modifies/cli:
|
||||||
|
- "cmd/**"
|
||||||
|
|
||||||
|
modifies/translation:
|
||||||
|
- "options/locale/*.ini"
|
||||||
|
|
||||||
|
modifies/migrations:
|
||||||
|
- "models/migrations/**/*"
|
||||||
|
|
||||||
|
modifies/internal:
|
||||||
- "Makefile"
|
- "Makefile"
|
||||||
- "Dockerfile"
|
- "Dockerfile"
|
||||||
- "Dockerfile.rootless"
|
- "Dockerfile.rootless"
|
||||||
- "docker/**"
|
- "docker/**"
|
||||||
- "webpack.config.js"
|
- "webpack.config.js"
|
||||||
|
|
||||||
theme/package-registry:
|
|
||||||
- "modules/packages/**"
|
|
||||||
- "services/packages/**"
|
|
||||||
- "routers/api/packages/**"
|
|
||||||
- "routers/web/shared/packages/**"
|
|
||||||
|
|
||||||
kind/cli:
|
|
||||||
- "cmd/**"
|
|
||||||
|
|
||||||
kind/lint:
|
|
||||||
- ".eslintrc.yaml"
|
- ".eslintrc.yaml"
|
||||||
- ".golangci.yml"
|
- ".golangci.yml"
|
||||||
- ".markdownlint.yaml"
|
- ".markdownlint.yaml"
|
||||||
- ".spectral.yaml"
|
- ".spectral.yaml"
|
||||||
- ".stylelintrc.yaml"
|
- ".stylelintrc.yaml"
|
||||||
- ".yamllint.yaml"
|
- ".yamllint.yaml"
|
||||||
|
- ".github/**"
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
name: disk-clean
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
triage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# FIXME: https://github.com/jlumbroso/free-disk-space/issues/17
|
||||||
|
- name: same as 'large-packages' but without 'google-cloud-sdk'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get remove -y '^dotnet-.*'
|
||||||
|
sudo apt-get remove -y '^llvm-.*'
|
||||||
|
sudo apt-get remove -y 'php.*'
|
||||||
|
sudo apt-get remove -y '^mongodb-.*'
|
||||||
|
sudo apt-get remove -y '^mysql-.*'
|
||||||
|
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
|
||||||
|
sudo apt-get autoremove -y
|
||||||
|
sudo apt-get clean
|
||||||
|
- name: Free Disk Space (Ubuntu)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
# this might remove tools that are actually needed,
|
||||||
|
# if set to "true" but frees about 6 GB
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
# all of these default to true, but feel free to set to
|
||||||
|
# "false" if necessary for your workflow
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: false
|
||||||
|
docker-images: false
|
||||||
|
swap-storage: true
|
|
@ -1,4 +1,4 @@
|
||||||
name: release-nightly-assets
|
name: release-nightly
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -10,7 +10,7 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nightly-binary:
|
nightly-binary:
|
||||||
runs-on: actuated-4cpu-16gb
|
runs-on: nscloud
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||||
|
@ -46,17 +46,17 @@ jobs:
|
||||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
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 "Cleaned name is ${REF_NAME}"
|
||||||
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: configure aws
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
- name: upload binaries to s3
|
- name: upload binaries to s3
|
||||||
uses: jakejarvis/s3-sync-action@master
|
run: |
|
||||||
env:
|
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
||||||
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-rootful:
|
nightly-docker-rootful:
|
||||||
runs-on: actuated-4cpu-16gb
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||||
|
@ -93,7 +93,7 @@ jobs:
|
||||||
push: true
|
push: true
|
||||||
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
||||||
nightly-docker-rootless:
|
nightly-docker-rootless:
|
||||||
runs-on: actuated-4cpu-16gb
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
name: release-tag-rc
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v1*-rc*'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
binary:
|
||||||
|
runs-on: nscloud
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# 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.21"
|
||||||
|
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\/v//' -e 's/release\/v//')
|
||||||
|
echo "Cleaned name is ${REF_NAME}"
|
||||||
|
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: configure aws
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
- name: upload binaries to s3
|
||||||
|
run: |
|
||||||
|
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
||||||
|
- name: Install GH CLI
|
||||||
|
uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
|
||||||
|
with:
|
||||||
|
gh-cli-version: 2.39.1
|
||||||
|
- name: create github release
|
||||||
|
run: |
|
||||||
|
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
docker-rootful:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# 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
|
||||||
|
- uses: docker/metadata-action@v5
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: gitea/gitea
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
# 1.2.3-rc0
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
- 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: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
docker-rootless:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# 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
|
||||||
|
- uses: docker/metadata-action@v5
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: gitea/gitea
|
||||||
|
# each tag below will have the suffix of -rootless
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
suffix=-rootless
|
||||||
|
# 1.2.3-rc0
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: build rootless docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
file: Dockerfile.rootless
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -0,0 +1,143 @@
|
||||||
|
name: release-tag-version
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v1.*'
|
||||||
|
- '!v1*-rc*'
|
||||||
|
- '!v1*-dev'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
binary:
|
||||||
|
runs-on: nscloud
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# 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.21"
|
||||||
|
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\/v//' -e 's/release\/v//')
|
||||||
|
echo "Cleaned name is ${REF_NAME}"
|
||||||
|
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: configure aws
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
- name: upload binaries to s3
|
||||||
|
run: |
|
||||||
|
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
||||||
|
- name: Install GH CLI
|
||||||
|
uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
|
||||||
|
with:
|
||||||
|
gh-cli-version: 2.39.1
|
||||||
|
- name: create github release
|
||||||
|
run: |
|
||||||
|
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-from-tag dist/release/*
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
docker-rootful:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# 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
|
||||||
|
- uses: docker/metadata-action@v5
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: gitea/gitea
|
||||||
|
# this will generate tags in the following format:
|
||||||
|
# latest
|
||||||
|
# 1
|
||||||
|
# 1.2
|
||||||
|
# 1.2.3
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
- 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: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
docker-rootless:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# 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
|
||||||
|
- uses: docker/metadata-action@v5
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: gitea/gitea
|
||||||
|
# each tag below will have the suffix of -rootless
|
||||||
|
flavor: |
|
||||||
|
suffix=-rootless,onlatest=true
|
||||||
|
# this will generate tags in the following format (with -rootless suffix added):
|
||||||
|
# latest
|
||||||
|
# 1
|
||||||
|
# 1.2
|
||||||
|
# 1.2.3
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: build rootless docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
file: Dockerfile.rootless
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -6,7 +6,6 @@ line-length: {code_blocks: false, tables: false, stern: true, line_length: -1}
|
||||||
no-alt-text: false
|
no-alt-text: false
|
||||||
no-bare-urls: false
|
no-bare-urls: false
|
||||||
no-blanks-blockquote: false
|
no-blanks-blockquote: false
|
||||||
no-duplicate-header: {allow_different_nesting: true}
|
|
||||||
no-emphasis-as-header: false
|
no-emphasis-as-header: false
|
||||||
no-empty-links: false
|
no-empty-links: false
|
||||||
no-hard-tabs: {code_blocks: false}
|
no-hard-tabs: {code_blocks: false}
|
||||||
|
|
|
@ -24,8 +24,6 @@ rules:
|
||||||
document-start:
|
document-start:
|
||||||
level: error
|
level: error
|
||||||
present: false
|
present: false
|
||||||
ignore: |
|
|
||||||
/.drone.yml
|
|
||||||
|
|
||||||
document-end:
|
document-end:
|
||||||
present: false
|
present: false
|
||||||
|
@ -44,5 +42,3 @@ rules:
|
||||||
ignore: |
|
ignore: |
|
||||||
.venv
|
.venv
|
||||||
node_modules
|
node_modules
|
||||||
/models/fixtures
|
|
||||||
/models/migrations/fixtures
|
|
||||||
|
|
|
@ -42,13 +42,13 @@ GARGS = "--no-print-directory"
|
||||||
|
|
||||||
# The GNU convention is to use the lowercased `prefix` variable/macro to
|
# The GNU convention is to use the lowercased `prefix` variable/macro to
|
||||||
# specify the installation directory. Humor them.
|
# specify the installation directory. Humor them.
|
||||||
GPREFIX = ""
|
GPREFIX =
|
||||||
.if defined(PREFIX) && ! defined(prefix)
|
.if defined(PREFIX) && ! defined(prefix)
|
||||||
GPREFIX = 'prefix = "$(PREFIX)"'
|
GPREFIX = 'prefix = "$(PREFIX)"'
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.BEGIN: .SILENT
|
.BEGIN: .SILENT
|
||||||
which $(GMAKE) || printf "Error: GNU Make is required!\n\n" 1>&2 && false
|
which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
|
||||||
|
|
||||||
.PHONY: FRC
|
.PHONY: FRC
|
||||||
$(.TARGETS): FRC
|
$(.TARGETS): FRC
|
||||||
|
|
657
CHANGELOG.md
657
CHANGELOG.md
|
@ -4,6 +4,662 @@ 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
|
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.com).
|
been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||||
|
|
||||||
|
## [1.21.5](https://github.com/go-gitea/gitea/releases/tag/1.21.5) - 2024-01-31
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Prevent anonymous container access if `RequireSignInView` is enabled (#28877) (#28882)
|
||||||
|
* Update go dependencies and fix go-git (#28893) (#28934)
|
||||||
|
* BUGFIXES
|
||||||
|
* Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) (#29007)
|
||||||
|
* Fix an actions schedule bug (#28942) (#28999)
|
||||||
|
* Fix update enable_prune even if mirror_interval is not provided (#28905) (#28929)
|
||||||
|
* Fix uploaded artifacts should be overwritten (#28726) backport v1.21 (#28832)
|
||||||
|
* Preserve BOM in web editor (#28935) (#28959)
|
||||||
|
* Strip `/` from relative links (#28932) (#28952)
|
||||||
|
* Don't remove all mirror repository's releases when mirroring (#28817) (#28939)
|
||||||
|
* Implement `MigrateRepository` for the actions notifier (#28920) (#28923)
|
||||||
|
* Respect branch info for relative links (#28909) (#28922)
|
||||||
|
* Don't reload timeline page when (un)resolving or replying conversation (#28654) (#28917)
|
||||||
|
* Only migrate the first 255 chars of a Github issue title (#28902) (#28912)
|
||||||
|
* Fix sort bug on repository issues list (#28897) (#28901)
|
||||||
|
* Fix `DeleteCollaboration` transaction behaviour (#28886) (#28889)
|
||||||
|
* Fix schedule not trigger bug because matching full ref name with short ref name (#28874) (#28888)
|
||||||
|
* Fix migrate storage bug (#28830) (#28867)
|
||||||
|
* Fix archive creating LFS hooks and breaking pull requests (#28848) (#28851)
|
||||||
|
* Fix reverting a merge commit failing (#28794) (#28825)
|
||||||
|
* Upgrade xorm to v1.3.7 to fix a resource leak problem caused by Iterate (#28891) (#28895)
|
||||||
|
* Fix incorrect PostgreSQL connection string for Unix sockets (#28865) (#28870)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Make loading animation less aggressive (#28955) (#28956)
|
||||||
|
* Avoid duplicate JS error messages on UI (#28873) (#28881)
|
||||||
|
* Bump `@github/relative-time-element` to 4.3.1 (#28819) (#28826)
|
||||||
|
* MISC
|
||||||
|
* Warn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (#28783) (#28868)
|
||||||
|
* Remove duplicated checkinit on git module (#28824) (#28831)
|
||||||
|
|
||||||
|
## [1.21.4](https://github.com/go-gitea/gitea/releases/tag/1.21.4) - 2024-01-16
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Update github.com/cloudflare/circl (#28789) (#28790)
|
||||||
|
* Require token for GET subscription endpoint (#28765) (#28768)
|
||||||
|
* BUGFIXES
|
||||||
|
* Use refname:strip-2 instead of refname:short when syncing tags (#28797) (#28811)
|
||||||
|
* Fix links in issue card (#28806) (#28807)
|
||||||
|
* Fix nil pointer panic when exec some gitea cli command (#28791) (#28795)
|
||||||
|
* Require token for GET subscription endpoint (#28765) (#28778)
|
||||||
|
* Fix button size in "attached header right" (#28770) (#28774)
|
||||||
|
* Fix `convert.ToTeams` on empty input (#28426) (#28767)
|
||||||
|
* Hide code related setting options in repository when code unit is disabled (#28631) (#28749)
|
||||||
|
* Fix incorrect URL for "Reference in New Issue" (#28716) (#28723)
|
||||||
|
* Fix panic when parsing empty pgsql host (#28708) (#28709)
|
||||||
|
* Upgrade xorm to new version which supported update join for all supported databases (#28590) (#28668)
|
||||||
|
* Fix alpine package files are not rebuilt (#28638) (#28665)
|
||||||
|
* Avoid cycle-redirecting user/login page (#28636) (#28658)
|
||||||
|
* Fix empty ref for cron workflow runs (#28640) (#28647)
|
||||||
|
* Remove unnecessary syncbranchToDB with tests (#28624) (#28629)
|
||||||
|
* Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618)
|
||||||
|
* Fix flex container width (#28603) (#28605)
|
||||||
|
* Fix the scroll behavior for emoji/mention list (#28597) (#28601)
|
||||||
|
* Fix wrong due date rendering in issue list page (#28588) (#28591)
|
||||||
|
* Fix `status_check_contexts` matching bug (#28582) (#28589)
|
||||||
|
* Fix 500 error of searching commits (#28576) (#28579)
|
||||||
|
* Use information from previous blame parts (#28572) (#28577)
|
||||||
|
* Update mermaid for 1.21 (#28571)
|
||||||
|
* Fix 405 method not allowed CORS / OIDC (#28583) (#28586) (#28587) (#28611)
|
||||||
|
* Fix `GetCommitStatuses` (#28787) (#28804)
|
||||||
|
* Forbid removing the last admin user (#28337) (#28793)
|
||||||
|
* Fix schedule tasks bugs (#28691) (#28780)
|
||||||
|
* Fix issue dependencies (#27736) (#28776)
|
||||||
|
* Fix system webhooks API bug (#28531) (#28666)
|
||||||
|
* Fix when private user following user, private user will not be counted in his own view (#28037) (#28792)
|
||||||
|
* Render code block in activity tab (#28816) (#28818)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Rework markup link rendering (#26745) (#28803)
|
||||||
|
* Modernize merge button (#28140) (#28786)
|
||||||
|
* Speed up loading the dashboard on mysql/mariadb (#28546) (#28784)
|
||||||
|
* Assign pull request to project during creation (#28227) (#28775)
|
||||||
|
* Show description as tooltip instead of title for labels (#28754) (#28766)
|
||||||
|
* Make template `DateTime` show proper tooltip (#28677) (#28683)
|
||||||
|
* Switch destination directory for apt signing keys (#28639) (#28642)
|
||||||
|
* Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)
|
||||||
|
* DOCS
|
||||||
|
* Suggest to use Type=simple for systemd service (#28717) (#28722)
|
||||||
|
* Extend description for ARTIFACT_RETENTION_DAYS (#28626) (#28630)
|
||||||
|
* MISC
|
||||||
|
* Add -F to commit search to treat keywords as strings (#28744) (#28748)
|
||||||
|
* Add download attribute to release attachments (#28739) (#28740)
|
||||||
|
* Concatenate error in `checkIfPRContentChanged` (#28731) (#28737)
|
||||||
|
* Improve 1.21 document for Database Preparation (#28643) (#28644)
|
||||||
|
|
||||||
|
## [1.21.3](https://github.com/go-gitea/gitea/releases/tag/1.21.3) - 2023-12-21
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Update golang.org/x/crypto (#28519)
|
||||||
|
* API
|
||||||
|
* chore(api): support ignore password if login source type is LDAP for creating user API (#28491) (#28525)
|
||||||
|
* Add endpoint for not implemented Docker auth (#28457) (#28462)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Add option to disable ambiguous unicode characters detection (#28454) (#28499)
|
||||||
|
* Refactor SSH clone URL generation code (#28421) (#28480)
|
||||||
|
* Polyfill SubmitEvent for PaleMoon (#28441) (#28478)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix the issue ref rendering for wiki (#28556) (#28559)
|
||||||
|
* Fix duplicate ID when deleting repo (#28520) (#28528)
|
||||||
|
* Only check online runner when detecting matching runners in workflows (#28286) (#28512)
|
||||||
|
* Initalize stroage for orphaned repository doctor (#28487) (#28490)
|
||||||
|
* Fix possible nil pointer access (#28428) (#28440)
|
||||||
|
* Don't show unnecessary citation JS error on UI (#28433) (#28437)
|
||||||
|
* DOCS
|
||||||
|
* Update actions document about comparsion as Github Actions (#28560) (#28564)
|
||||||
|
* Fix documents for "custom/public/assets/" (#28465) (#28467)
|
||||||
|
* MISC
|
||||||
|
* Fix inperformant query on retrifing review from database. (#28552) (#28562)
|
||||||
|
* Improve the prompt for "ssh-keygen sign" (#28509) (#28510)
|
||||||
|
* Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)
|
||||||
|
* Fix Chinese translation of config cheat sheet[API] (#28472) (#28473)
|
||||||
|
* Retry SSH key verification with additional CRLF if it failed (#28392) (#28464)
|
||||||
|
|
||||||
|
## [1.21.2](https://github.com/go-gitea/gitea/releases/tag/1.21.2) - 2023-12-12
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Rebuild with recently released golang version
|
||||||
|
* Fix missing check (#28406) (#28411)
|
||||||
|
* Do some missing checks (#28423) (#28432)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix margin in server signed signature verification view (#28379) (#28381)
|
||||||
|
* Fix object does not exist error when checking citation file (#28314) (#28369)
|
||||||
|
* Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)
|
||||||
|
* Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) (#28365)
|
||||||
|
* Handle repository.size column being NULL in migration v263 (#28336) (#28363)
|
||||||
|
* Convert git commit summary to valid UTF8. (#28356) (#28358)
|
||||||
|
* Fix migration panic due to an empty review comment diff (#28334) (#28362)
|
||||||
|
* Add `HEAD` support for rpm repo files (#28309) (#28360)
|
||||||
|
* Fix RPM/Debian signature key creation (#28352) (#28353)
|
||||||
|
* Keep profile tab when clicking on Language (#28320) (#28331)
|
||||||
|
* Fix missing issue search index update when changing status (#28325) (#28330)
|
||||||
|
* Fix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)
|
||||||
|
* Read `previous` info from git blame (#28306) (#28310)
|
||||||
|
* Ignore "non-existing" errors when getDirectorySize calculates the size (#28276) (#28285)
|
||||||
|
* Use appSubUrl for OAuth2 callback URL tip (#28266) (#28275)
|
||||||
|
* Meilisearch: require all query terms to be matched (#28293) (#28296)
|
||||||
|
* Fix required error for token name (#28267) (#28284)
|
||||||
|
* Fix issue will be detected as pull request when checking `First-time contributor` (#28237) (#28271)
|
||||||
|
* Use full width for project boards (#28225) (#28245)
|
||||||
|
* Increase "version" when update the setting value to a same value as before (#28243) (#28244)
|
||||||
|
* Also sync DB branches on push if necessary (#28361) (#28403)
|
||||||
|
* Make gogit Repository.GetBranchNames consistent (#28348) (#28386)
|
||||||
|
* Recover from panic in cron task (#28409) (#28425)
|
||||||
|
* Deprecate query string auth tokens (#28390) (#28430)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Improve doctor cli behavior (#28422) (#28424)
|
||||||
|
* Fix margin in server signed signature verification view (#28379) (#28381)
|
||||||
|
* Refactor template empty checks (#28351) (#28354)
|
||||||
|
* Read `previous` info from git blame (#28306) (#28310)
|
||||||
|
* Use full width for project boards (#28225) (#28245)
|
||||||
|
* Enable system users search via the API (#28013) (#28018)
|
||||||
|
|
||||||
|
## [1.21.1](https://github.com/go-gitea/gitea/releases/tag/1.21.1) - 2023-11-26
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Fix comment permissions (#28213) (#28216)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix delete-orphaned-repos (#28200) (#28202)
|
||||||
|
* Make CORS work for oauth2 handlers (#28184) (#28185)
|
||||||
|
* Fix missing buttons (#28179) (#28181)
|
||||||
|
* Fix no ActionTaskOutput table waring (#28149) (#28152)
|
||||||
|
* Fix empty action run title (#28113) (#28148)
|
||||||
|
* Use "is-loading" to avoid duplicate form submit for code comment (#28143) (#28147)
|
||||||
|
* Fix Matrix and MSTeams nil dereference (#28089) (#28105)
|
||||||
|
* Fix incorrect pgsql conn builder behavior (#28085) (#28098)
|
||||||
|
* Fix system config cache expiration timing (#28072) (#28090)
|
||||||
|
* Restricted users only see repos in orgs which their team was assigned to (#28025) (#28051)
|
||||||
|
* API
|
||||||
|
* Fix permissions for Token DELETE endpoint to match GET and POST (#27610) (#28099)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Do not display search box when there's no packages yet (#28146) (#28159)
|
||||||
|
* Add missing `packages.cleanup.success` (#28129) (#28132)
|
||||||
|
* DOCS
|
||||||
|
* Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205) (#28208)
|
||||||
|
* Fix the description about the default setting for action in quick start document (#28160) (#28168)
|
||||||
|
* Add guide page to actions when there's no workflows (#28145) (#28153)
|
||||||
|
* MISC
|
||||||
|
* Use full width for PR comparison (#28182) (#28186)
|
||||||
|
|
||||||
|
## [1.21.0](https://github.com/go-gitea/gitea/releases/tag/v1.21.0) - 2023-11-14
|
||||||
|
|
||||||
|
* BREAKING
|
||||||
|
* Restrict certificate type for builtin SSH server (#26789)
|
||||||
|
* Refactor to use urfave/cli/v2 (#25959)
|
||||||
|
* Move public asset files to the proper directory (#25907)
|
||||||
|
* Remove commit status running and warning to align GitHub (#25839) (partially reverted: Restore warning commit status (#27504) (#27529))
|
||||||
|
* Remove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413)
|
||||||
|
* Set SSH_AUTHORIZED_KEYS_BACKUP to false (#25412)
|
||||||
|
* FEATURES
|
||||||
|
* User details page (#26713)
|
||||||
|
* Chore(actions): support cron schedule task (#26655)
|
||||||
|
* Support rebuilding issue indexer manually (#26546)
|
||||||
|
* Allow to archive labels (#26478)
|
||||||
|
* Add disable workflow feature (#26413)
|
||||||
|
* Support `.git-blame-ignore-revs` file (#26395)
|
||||||
|
* Pre-register OAuth2 applications for git credential helpers (#26291)
|
||||||
|
* Add `Retry` button when creating a mirror-repo fails (#26228)
|
||||||
|
* Artifacts retention and auto clean up (#26131)
|
||||||
|
* Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974)
|
||||||
|
* Implement auto-cancellation of concurrent jobs if the event is push (#25716)
|
||||||
|
* Newly pushed branches hints on repository home page (#25715)
|
||||||
|
* Display branch commit status (#25608)
|
||||||
|
* Add direct serving of package content (#25543)
|
||||||
|
* Add commits dropdown in PR files view and allow commit by commit review (#25528)
|
||||||
|
* Allow package cleanup from admin page (#25307)
|
||||||
|
* Batch delete issue and improve tippy opts (#25253)
|
||||||
|
* Show branches and tags that contain a commit (#25180)
|
||||||
|
* Add actor and status dropdowns to run list (#25118)
|
||||||
|
* Allow Organisations to have a E-Mail (#25082)
|
||||||
|
* Add codeowners feature (#24910)
|
||||||
|
* Actions Artifacts support uploading multiple files and directories (#24874)
|
||||||
|
* Support configuration variables on Gitea Actions (#24724)
|
||||||
|
* Support downloading raw task logs (#24451)
|
||||||
|
* API
|
||||||
|
* Unify two factor check (#27915) (#27929)
|
||||||
|
* Fix package webhook (#27839) (#27855)
|
||||||
|
* Fix/upload artifact error windows (#27802) (#27840)
|
||||||
|
* Fix bad method call when deleting user secrets via API (#27829) (#27831)
|
||||||
|
* Do not force creation of _cargo-index repo on publish (#27266) (#27765)
|
||||||
|
* Delete repos of org when purge delete user (#27273) (#27728)
|
||||||
|
* Fix org team endpoint (#27721) (#27727)
|
||||||
|
* Api: GetPullRequestCommits: return file list (#27483) (#27539)
|
||||||
|
* Don't let API add 2 exclusive labels from same scope (#27433) (#27460)
|
||||||
|
* Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304)
|
||||||
|
* Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251)
|
||||||
|
* Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163)
|
||||||
|
* Allow empty Conan files (#27092)
|
||||||
|
* Fix token endpoints ignore specified account (#27080)
|
||||||
|
* Reduce usage of `db.DefaultContext` (#27073) (#27083) (#27089) (#27103) (#27262) (#27265) (#27347) (#26076)
|
||||||
|
* Make SSPI auth mockable (#27036)
|
||||||
|
* Extract auth middleware from service (#27028)
|
||||||
|
* Add `RemoteAddress` to mirrors (#26952)
|
||||||
|
* Feat(API): add routes and functions for managing user's secrets (#26909)
|
||||||
|
* Feat(API): add secret deletion functionality for repository (#26808)
|
||||||
|
* Feat(API): add route and implementation for creating/updating repository secret (#26766)
|
||||||
|
* Add Upload URL to release API (#26663)
|
||||||
|
* Feat(API): update and delete secret for managing organization secrets (#26660)
|
||||||
|
* Feat: implement organization secret creation API (#26566)
|
||||||
|
* Add API route to list org secrets (#26485)
|
||||||
|
* Set commit id when ref used explicitly (#26447)
|
||||||
|
* PATCH branch-protection updates check list even when checks are disabled (#26351)
|
||||||
|
* Add file status for API "Get a single commit from a repository" (#16205) (#25831)
|
||||||
|
* Add API for changing Avatars (#25369)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix viewing wiki commit on empty repo (#28040) (#28044)
|
||||||
|
* Enable system users for comment.LoadPoster (#28014) (#28032)
|
||||||
|
* Fixed duplicate attachments on dump on windows (#28019) (#28031)
|
||||||
|
* Fix wrong xorm Delete usage(backport for 1.21) (#28002)
|
||||||
|
* Add word-break to repo description in home page (#27924) (#27957)
|
||||||
|
* Fix rendering assignee changed comments without assignee (#27927) (#27952)
|
||||||
|
* Add word break to release title (#27942) (#27947)
|
||||||
|
* Fix JS NPE when viewing specific range of PR commits (#27912) (#27923)
|
||||||
|
* Show correct commit sha when viewing single commit diff (#27916) (#27921)
|
||||||
|
* Fix 500 when deleting a dismissed review (#27903) (#27910)
|
||||||
|
* Fix DownloadFunc when migrating releases (#27887) (#27890)
|
||||||
|
* Fix http protocol auth (#27875) (#27876)
|
||||||
|
* Refactor postgres connection string building (#27723) (#27869)
|
||||||
|
* Close all hashed buffers (#27787) (#27790)
|
||||||
|
* Fix label render containing invalid HTML (#27752) (#27762)
|
||||||
|
* Fix duplicate project board when hitting `enter` key (#27746) (#27751)
|
||||||
|
* Fix `link-action` redirect network error (#27734) (#27749)
|
||||||
|
* Fix sticky diff header background (#27697) (#27712)
|
||||||
|
* Always delete existing scheduled action tasks (#27662) (#27688)
|
||||||
|
* Support allowed hosts for webhook to work with proxy (#27655) (#27675)
|
||||||
|
* Fix poster is not loaded in get default merge message (#27657) (#27666)
|
||||||
|
* Improve dropdown button alignment and fix hover bug (#27632) (#27637)
|
||||||
|
* Improve retrying index issues (#27554) (#27634)
|
||||||
|
* Fix 404 when deleting Docker package with an internal version (#27615) (#27630)
|
||||||
|
* Backport manually for a tmpl issue in v1.21 (#27612)
|
||||||
|
* Don't show Link to TOTP if not set up (#27585) (#27588)
|
||||||
|
* Fix data-race bug when accessing task.LastRun (#27584) (#27586)
|
||||||
|
* Fix attachment download bug (#27486) (#27571)
|
||||||
|
* Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551)
|
||||||
|
* Improve dropdown's behavior when there is a search input in menu (#27526) (#27534)
|
||||||
|
* Fix panic in storageHandler (#27446) (#27479)
|
||||||
|
* When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)
|
||||||
|
* Fix pr template (#27436) (#27440)
|
||||||
|
* Fix git 2.11 error when checking IsEmpty (#27393) (#27397)
|
||||||
|
* Allow get release download files and lfs files with oauth2 token format (#26430) (#27379)
|
||||||
|
* Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375)
|
||||||
|
* Absolute positioned checkboxes overlay floated elements (#26870) (#27366)
|
||||||
|
* Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365)
|
||||||
|
* Fix repo count in org action settings (#27245) (#27353)
|
||||||
|
* Add logs for data broken of comment review (#27326) (#27345)
|
||||||
|
* Fix the approval count of PR when there is no protection branch rule (#27272) (#27343)
|
||||||
|
* Fix Bug in Issue Config when only contact links are set (#26521) (#27334)
|
||||||
|
* Improve issue history dialog and make poster can delete their own history (#27323) (#27327)
|
||||||
|
* Fix orphan check for deleted branch (#27310) (#27321)
|
||||||
|
* Fix protected branch icon location (#26576) (#27317)
|
||||||
|
* Fix yaml test (#27297) (#27303)
|
||||||
|
* Fix some animation bugs (#27287) (#27294)
|
||||||
|
* Fix incorrect change from #27231 (#27275) (#27282)
|
||||||
|
* Add missing public user visibility in user details page (#27246) (#27250)
|
||||||
|
* Fix EOL handling in web editor (#27141) (#27234)
|
||||||
|
* Fix issues on action runners page (#27226) (#27233)
|
||||||
|
* Quote table `release` in sql queries (#27205) (#27218)
|
||||||
|
* Fix release URL in webhooks (#27182) (#27185)
|
||||||
|
* Fix review request number and add more tests (#27104) (#27168)
|
||||||
|
* Fix the variable regexp pattern on web page (#27161) (#27164)
|
||||||
|
* Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124)
|
||||||
|
* Fix NPE when editing OAuth2 applications (#27078)
|
||||||
|
* Fix the incorrect route path in the user edit page. (#27007)
|
||||||
|
* Fix the secret regexp pattern on web page (#26910)
|
||||||
|
* Allow users with write permissions for issues to add attachments with API (#26837)
|
||||||
|
* Make "link-action" backend code respond correct JSON content (#26680)
|
||||||
|
* Use line-height: normal by default (#26635)
|
||||||
|
* Fix NPM packages name validation (#26595)
|
||||||
|
* Rewrite the DiffFileTreeItem and fix misalignment (#26565)
|
||||||
|
* Return empty when searching issues with no repos (#26545)
|
||||||
|
* Explain SearchOptions and fix ToSearchOptions (#26542)
|
||||||
|
* Add missing triggers to update issue indexer (#26539)
|
||||||
|
* Handle base64 decoding correctly to avoid panic (#26483)
|
||||||
|
* Avoiding accessing undefined mentionValues (#26461)
|
||||||
|
* Fix incorrect redirection in new issue using references (#26440)
|
||||||
|
* Fix the bug when getting files changed for `pull_request_target` event (#26320)
|
||||||
|
* Remove IsWarning in tmpl (#26120)
|
||||||
|
* Fix loading `LFS_JWT_SECRET` from wrong section (#26109)
|
||||||
|
* Fixing redirection issue for logged-in users (#26105)
|
||||||
|
* Improve "gitea doctor" sub-command and fix "help" commands (#26072)
|
||||||
|
* Fix the truncate and alignment problem for some admin tables (#26042)
|
||||||
|
* Update minimum password length requirements (#25946)
|
||||||
|
* Do not "guess" the file encoding/BOM when using API to upload files (#25828)
|
||||||
|
* Restructure issue list template, styles (#25750)
|
||||||
|
* Fix `ref` for workflows triggered by `pull_request_target` (#25743)
|
||||||
|
* Fix issues indexer document mapping (#25619)
|
||||||
|
* Use JSON response for "user/logout" (#25522)
|
||||||
|
* Fix migrate page layout on mobile (#25507)
|
||||||
|
* Link to existing PR when trying to open a new PR on the same branches (#25494)
|
||||||
|
* Do not publish docker release images on `-dev` tags (#25471)
|
||||||
|
* Support `pull_request_target` event (#25229)
|
||||||
|
* Modify the content format of the Feishu webhook (#25106)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Render email addresses as such if followed by punctuation (#27987) (#27992)
|
||||||
|
* Show error toast when file size exceeds the limits (#27985) (#27986)
|
||||||
|
* Fix citation error when the file size is larger than 1024 bytes (#27958) (#27965)
|
||||||
|
* Remove action runners on user deletion (#27902) (#27908)
|
||||||
|
* Remove set tabindex on view issue (#27892) (#27896)
|
||||||
|
* Reduce margin/padding on flex-list items and divider (#27872) (#27874)
|
||||||
|
* Change katex limits (#27823) (#27868)
|
||||||
|
* Clean up template locale usage (#27856) (#27857)
|
||||||
|
* Add dedicated class for empty placeholders (#27788) (#27792)
|
||||||
|
* Add gap between diff boxes (#27776) (#27781)
|
||||||
|
* Fix incorrect "tab" parameter for repo search sub-template (#27755) (#27764)
|
||||||
|
* Enable followCursor for language stats bar (#27713) (#27739)
|
||||||
|
* Improve diff tree spacing (#27714) (#27719)
|
||||||
|
* Feed UI Improvements (#27356) (#27717)
|
||||||
|
* Improve feed icons and feed merge text color (#27498) (#27716)
|
||||||
|
* [FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715)
|
||||||
|
* Add doctor dbconsistency fix to delete repos with no owner (#27290) (#27693)
|
||||||
|
* Fix required checkboxes in issue forms (#27592) (#27692)
|
||||||
|
* Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661)
|
||||||
|
* Cleanup repo details icons/labels (#27644) (#27654)
|
||||||
|
* Keep filter when showing unfiltered results on explore page (#27192) (#27589)
|
||||||
|
* Show manual cron run's last time (#27544) (#27577)
|
||||||
|
* Revert "Fix pr template (#27436)" (#27567)
|
||||||
|
* Increase queue length (#27555) (#27562)
|
||||||
|
* Avoid run change title process when the title is same (#27467) (#27558)
|
||||||
|
* Remove max-width and add hide text overflow (#27359) (#27550)
|
||||||
|
* Add hover background to wiki list page (#27507) (#27521)
|
||||||
|
* Fix mermaid flowchart margin issue (#27503) (#27516)
|
||||||
|
* Refactor system setting (#27000) (#27452)
|
||||||
|
* Fix missing `ctx` in new_form.tmpl (#27434) (#27438)
|
||||||
|
* Add Index to `action.user_id` (#27403) (#27425)
|
||||||
|
* Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)
|
||||||
|
* Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)
|
||||||
|
* Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)
|
||||||
|
* Hide archived labels when filtering by labels on the issue list (#27115) (#27381)
|
||||||
|
* Highlight user details link (#26998) (#27376)
|
||||||
|
* Add protected branch name description (#27257) (#27351)
|
||||||
|
* Improve tree not found page (#26570) (#27346)
|
||||||
|
* Add Index to `comment.dependent_issue_id` (#27325) (#27340)
|
||||||
|
* Improve branch list UI (#27319) (#27324)
|
||||||
|
* Fix divider in subscription page (#27298) (#27301)
|
||||||
|
* Add missed return to actions view fetch (#27289) (#27293)
|
||||||
|
* Backport ctx locale refactoring manually (#27231) (#27259) (#27260)
|
||||||
|
* Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253)
|
||||||
|
* Use mask-based fade-out effect for `.new-menu` (#27181) (#27243)
|
||||||
|
* Cleanup locale function usage (#27227) (#27240)
|
||||||
|
* Fix z-index on markdown completion (#27237) (#27239)
|
||||||
|
* Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) (#27228)
|
||||||
|
* Allow copying issue comment link on archived repos and when not logged in (#27193) (#27210)
|
||||||
|
* Fix: text decorator on issue sidebar menu label (#27206) (#27209)
|
||||||
|
* Fix dropdown icon position (#27175) (#27177)
|
||||||
|
* Add index to `issue_user.issue_id` (#27154) (#27158)
|
||||||
|
* Increase auth provider icon size on login page (#27122)
|
||||||
|
* Remove a `gt-float-right` and some unnecessary helpers (#27110)
|
||||||
|
* Change green buttons to primary color (#27099)
|
||||||
|
* Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095)
|
||||||
|
* Use `print` instead of `printf` (#27093)
|
||||||
|
* Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067)
|
||||||
|
* Search branches (#27055)
|
||||||
|
* Display all user types and org types on admin management UI (#27050)
|
||||||
|
* Ui correction in mobile view nav bar left aligned items. (#27046)
|
||||||
|
* Chroma color tweaks (#26978)
|
||||||
|
* Move some functions to service layer (#26969)
|
||||||
|
* Improve "language stats" UI (#26968)
|
||||||
|
* Replace `util.SliceXxx` with `slices.Xxx` (#26958)
|
||||||
|
* Refactor dashboard/feed.tmpl (#26956)
|
||||||
|
* Move repository deletion to service layer (#26948)
|
||||||
|
* Fix the missing repo count (#26942)
|
||||||
|
* Improve hint when uploading a too large avatar (#26935)
|
||||||
|
* Extract common code to new template (#26933)
|
||||||
|
* Move createrepository from module to service layer (#26927)
|
||||||
|
* Move notification interface to services layer (#26915)
|
||||||
|
* Move feed notification service layer (#26908)
|
||||||
|
* Move ui notification to service layer (#26907)
|
||||||
|
* Move indexer notification to service layer (#26906)
|
||||||
|
* Move mail notification logic to service layer (#26905)
|
||||||
|
* Extract common code to new template (#26903)
|
||||||
|
* Show queue's active worker number (#26896)
|
||||||
|
* Fix media description render for orgmode (#26895)
|
||||||
|
* Remove CSS `has` selector and improve various styles (#26891)
|
||||||
|
* Relocate the `RSS user feed` button (#26882)
|
||||||
|
* Refactor "shortsha" (#26877)
|
||||||
|
* Refactor `og:description` to limit the max length (#26876)
|
||||||
|
* Move web/api context related testing function into a separate package (#26859)
|
||||||
|
* Redable error on S3 storage connection failure (#26856)
|
||||||
|
* Improve opengraph previews (#26851)
|
||||||
|
* Add more descriptive error on forgot password page (#26848)
|
||||||
|
* Show always repo count in header (#26842)
|
||||||
|
* Remove "TODO" tasks from CSS file (#26835)
|
||||||
|
* Render code blocks in repo description (#26830)
|
||||||
|
* Minor dashboard tweaks, fix flex-list margins (#26829)
|
||||||
|
* Remove polluted `.ui.right` (#26825)
|
||||||
|
* Display archived labels specially when listing labels (#26820)
|
||||||
|
* Remove polluted ".ui.left" style (#26809)
|
||||||
|
* Make it posible to customize nav text color via css var (#26807)
|
||||||
|
* Refactor lfs requests (#26783)
|
||||||
|
* Improve flex list item padding (#26779)
|
||||||
|
* Remove fomantic `text` module (#26777)
|
||||||
|
* Remove fomantic `item` module (#26775)
|
||||||
|
* Remove redundant nil check in `WalkGitLog` (#26773)
|
||||||
|
* Reduce some allocations in type conversion (#26772)
|
||||||
|
* Refactor some CSS styles and simplify code (#26771)
|
||||||
|
* Unify `border-radius` behavior (#26770)
|
||||||
|
* Improve modal dialog UI (#26764)
|
||||||
|
* Allow "latest" to be used in release vTag when downloading file (#26748)
|
||||||
|
* Adding hint `Archived` to archive label. (#26741)
|
||||||
|
* Move `modules/mirror` to `services` (#26737)
|
||||||
|
* Add "dir=auto" for input/textarea elements by default (#26735)
|
||||||
|
* Add auth-required to config.json for Cargo http registry (#26729)
|
||||||
|
* Simplify helper CSS classes and avoid abuse (#26728)
|
||||||
|
* Make web context initialize correctly for different cases (#26726)
|
||||||
|
* Focus editor on "Write" tab click (#26714)
|
||||||
|
* Remove incorrect CSS helper classes (#26712)
|
||||||
|
* Fix review bar misalignment (#26711)
|
||||||
|
* Add reverseproxy auth for API back with default disabled (#26703)
|
||||||
|
* Add default label in branch select list (#26697)
|
||||||
|
* Improve Image Diff UI (#26696)
|
||||||
|
* Fixed text overflow in dropdown menu (#26694)
|
||||||
|
* [Refactor] getIssueStatsChunk to move inner function into own one (#26671)
|
||||||
|
* Remove fomantic loader module (#26670)
|
||||||
|
* Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658)
|
||||||
|
* Improve some flex layouts (#26649)
|
||||||
|
* Improve the branch selector tab UI (#26631)
|
||||||
|
* Improve show role (#26621)
|
||||||
|
* Remove avatarHTML from template helpers (#26598)
|
||||||
|
* Allow text selection in actions step header (#26588)
|
||||||
|
* Improve translation of milestone filters (#26569)
|
||||||
|
* Add optimistic lock to ActionRun table (#26563)
|
||||||
|
* Update team invitation email link (#26550)
|
||||||
|
* Differentiate better between user settings and admin settings (#26538)
|
||||||
|
* Check disabled workflow when rerun jobs (#26535)
|
||||||
|
* Improve deadline icon location in milestone list page (#26532)
|
||||||
|
* Improve repo sub menu (#26531)
|
||||||
|
* Fix the display of org level badges (#26504)
|
||||||
|
* Rename `Sync2` -> `Sync` (#26479)
|
||||||
|
* Fix stderr usages (#26477)
|
||||||
|
* Remove fomantic transition module (#26469)
|
||||||
|
* Refactor tests (#26464)
|
||||||
|
* Refactor project templates (#26448)
|
||||||
|
* Fall back to esbuild for css minify (#26445)
|
||||||
|
* Always show usernames in reaction tooltips (#26444)
|
||||||
|
* Use correct pull request commit link instead of a generic commit link (#26434)
|
||||||
|
* Refactor "editorconfig" (#26391)
|
||||||
|
* Make `user-content-* ` consistent with github (#26388)
|
||||||
|
* Remove unnecessary template helper repoAvatar (#26387)
|
||||||
|
* Remove unnecessary template helper DisableGravatar (#26386)
|
||||||
|
* Use template context function for avatar rendering (#26385)
|
||||||
|
* Rename code_langauge.go to code_language.go (#26377)
|
||||||
|
* Use more `IssueList` instead of `[]*Issue` (#26369)
|
||||||
|
* Do not highlight `#number` in documents (#26365)
|
||||||
|
* Fix display problems of members and teams unit (#26363)
|
||||||
|
* Fix 404 error when remove self from an organization (#26362)
|
||||||
|
* Improve CLI and messages (#26341)
|
||||||
|
* Refactor backend SVG package and add tests (#26335)
|
||||||
|
* Add link to job details and tooltip to commit status in repo list in dashboard (#26326)
|
||||||
|
* Use yellow if an approved review is stale (#26312)
|
||||||
|
* Remove commit load branches and tags in wiki repo (#26304)
|
||||||
|
* Add highlight to selected repos in milestone dashboard (#26300)
|
||||||
|
* Delete `issue_service.CreateComment` (#26298)
|
||||||
|
* Do not show Profile README when repository is private (#26295)
|
||||||
|
* Tweak actions menu (#26278)
|
||||||
|
* Start using template context function (#26254)
|
||||||
|
* Use calendar icon for `Joined on...` in profiles (#26215)
|
||||||
|
* Add 'Show on a map' button to Location in profile, fix layout (#26214)
|
||||||
|
* Render plaintext task list items for markdown files (#26186)
|
||||||
|
* Add tooltip to describe LFS table column and color `delete LFS file` button red (#26181)
|
||||||
|
* Release attachments duplicated check (#26176)
|
||||||
|
* De-emphasize issue sidebar buttons (#26171)
|
||||||
|
* Fixing the align of commit stats in commit_page template. (#26161)
|
||||||
|
* Allow editing push mirrors after creation (#26151)
|
||||||
|
* Move web JSON functions to web context and simplify code (#26132)
|
||||||
|
* Refactor improve NoBetterThan (#26126)
|
||||||
|
* Improve clickable area in repo action view page (#26115)
|
||||||
|
* Add context parameter to some database functions (#26055)
|
||||||
|
* Docusaurus-ify (#26051)
|
||||||
|
* Improve text for empty issue/pr description (#26047)
|
||||||
|
* Categorize admin settings sidebar panel (#26030)
|
||||||
|
* Remove redundant "RouteMethods" method (#26024)
|
||||||
|
* Refactor and enhance issue indexer to support both searching, filtering and paging (#26012)
|
||||||
|
* Add a link to OpenID Issuer URL in WebFinger response (#26000)
|
||||||
|
* Fix UI for release tag page / wiki page / subscription page (#25948)
|
||||||
|
* Support copy protected branch from template repository (#25889)
|
||||||
|
* Improve display of Labels/Projects/Assignees sort options (#25886)
|
||||||
|
* Fix margin on the new/edit project page. (#25885)
|
||||||
|
* Show image size on view page (#25884)
|
||||||
|
* Remove ref name in PR commits page (#25876)
|
||||||
|
* Allow the use of alternative net.Listener implementations by downstreams (#25855)
|
||||||
|
* Refactor "Content" for file uploading (#25851)
|
||||||
|
* Add error info if no user can fork the repo (#25820)
|
||||||
|
* Show edit title button on commits tab of PR, too (#25791)
|
||||||
|
* Introduce `flex-list` & `flex-item` elements for Gitea UI (#25790)
|
||||||
|
* Don't stack PR tab menu on small screens (#25789)
|
||||||
|
* Repository Archived text title center align (#25767)
|
||||||
|
* Make route middleware/handler mockable (#25766)
|
||||||
|
* Move issue filters to shared template (#25729)
|
||||||
|
* Use frontend fetch for branch dropdown component (#25719)
|
||||||
|
* Add open/closed field support for issue index (#25708)
|
||||||
|
* Some less naked returns (#25682)
|
||||||
|
* Fix inconsistent user profile layout across tabs (#25625)
|
||||||
|
* Get latest commit statuses from database instead of git data on dashboard for repositories (#25605)
|
||||||
|
* Adding branch-name copy to clipboard branches screen. (#25596)
|
||||||
|
* Update emoji set to Unicode 15 (#25595)
|
||||||
|
* Move some files under repo/setting (#25585)
|
||||||
|
* Add custom ansi colors and CSS variables for them (#25546)
|
||||||
|
* Add log line anchor for action logs (#25532)
|
||||||
|
* Use flex instead of float for sort button and search input (#25519)
|
||||||
|
* Update octicons and use `octicon-file-directory-symlink` (#25453)
|
||||||
|
* Add toasts to UI (#25449)
|
||||||
|
* Fine tune project board label colors and modal content background (#25419)
|
||||||
|
* Import additional secrets via file uri (#25408)
|
||||||
|
* Switch to ansi_up for ansi rendering in actions (#25401)
|
||||||
|
* Store and use seconds for timeline time comments (#25392)
|
||||||
|
* Support displaying diff stats in PR tab bar (#25387)
|
||||||
|
* Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380)
|
||||||
|
* Refactor: TotalTimes return seconds (#25370)
|
||||||
|
* Navbar styling rework (#25343)
|
||||||
|
* Introduce shared template for search inputs (#25338)
|
||||||
|
* Only show 'Manage Account Links' when necessary (#25311)
|
||||||
|
* Improve 'Privacy' section in profile settings (#25309)
|
||||||
|
* Substitute variables in path names of template repos too (#25294)
|
||||||
|
* Fix tags line no margin see #25255 (#25280)
|
||||||
|
* Use fetch to send requests to create issues/comments (#25258)
|
||||||
|
* Change form actions to fetch for submit review box (#25219)
|
||||||
|
* Improve AJAX link and modal confirm dialog (#25210)
|
||||||
|
* Reduce unnecessary DB queries for Actions tasks (#25199)
|
||||||
|
* Disable `Create column` button while the column name is empty (#25192)
|
||||||
|
* Refactor indexer (#25174)
|
||||||
|
* Adjust style for action run list (align icons, adjust padding) (#25170)
|
||||||
|
* Remove duplicated functions when deleting a branch (#25128)
|
||||||
|
* Make confusable character warning less jarring (#25069)
|
||||||
|
* Highlight viewed files differently in the PR filetree (#24956)
|
||||||
|
* Support changing labels of Actions runner without re-registration (#24806)
|
||||||
|
* Fix duplicate Reviewed-by trailers (#24796)
|
||||||
|
* Resolve issue with sort icons on admin/users and admin/runners (#24360)
|
||||||
|
* Split lfs size from repository size (#22900)
|
||||||
|
* Sync branches into databases (#22743)
|
||||||
|
* Disable run user change in installation page (#22499)
|
||||||
|
* Add merge files files to GetCommitFileStatus (#20515)
|
||||||
|
* Show OpenID Connect and OAuth on signup page (#20242)
|
||||||
|
* SECURITY
|
||||||
|
* Dont leak private users via extensions (#28023) (#28029)
|
||||||
|
* Expanded minimum RSA Keylength to 3072 (#26604)
|
||||||
|
* TESTING
|
||||||
|
* Add user secrets API integration tests (#27832) (#27852)
|
||||||
|
* Add tests for db indexer in indexer_test.go (#27087)
|
||||||
|
* Speed up TestEventSourceManagerRun (#26262)
|
||||||
|
* Add unit test for user renaming (#26261)
|
||||||
|
* Add some Wiki unit tests (#26260)
|
||||||
|
* Improve unit test for caching (#26185)
|
||||||
|
* Add unit test for `HashAvatar` (#25662)
|
||||||
|
* TRANSLATION
|
||||||
|
* Backport translations to v1.21 (#27899)
|
||||||
|
* Fix issues in translation file (#27699) (#27737)
|
||||||
|
* Add locale for deleted head branch (#26296)
|
||||||
|
* Improve multiple strings in en-US locale (#26213)
|
||||||
|
* Fix broken translations for package documantion (#25742)
|
||||||
|
* Correct translation wrong format (#25643)
|
||||||
|
* BUILD
|
||||||
|
* Dockerfile small refactor (#27757) (#27826)
|
||||||
|
* Fix build errors on BSD (in BSDMakefile) (#27594) (#27608)
|
||||||
|
* Fully replace drone with actions (#27556) (#27575)
|
||||||
|
* Enable markdownlint `no-duplicate-header` (#27500) (#27506)
|
||||||
|
* Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295)
|
||||||
|
* Update snap package (#27021)
|
||||||
|
* Bump go to 1.21 (#26608)
|
||||||
|
* Bump xgo to go-1.21.x and node to 20 in release-version (#26589)
|
||||||
|
* Add template linting via djlint (#25212)
|
||||||
|
* DOCS
|
||||||
|
* Change default size of issue/pr attachments and repo file (#27946) (#28017)
|
||||||
|
* Remove `known issue` section in Gitea Actions Doc (#27930) (#27938)
|
||||||
|
* Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)
|
||||||
|
* Update brew installation documentation since gitea moved to brew core package (#27070)
|
||||||
|
* Actions are no longer experimental, so enable them by default (#27054)
|
||||||
|
* Add a documentation note for Windows Service (#26938)
|
||||||
|
* Add sparse url in cargo package guide (#26937)
|
||||||
|
* Update nginx recommendations (#26924)
|
||||||
|
* Update backup instructions to align with archive structure (#26902)
|
||||||
|
* Expanding documentation in queue.go (#26889)
|
||||||
|
* Update info regarding internet connection for build (#26776)
|
||||||
|
* Docs: template variables (#26547)
|
||||||
|
* Update index doc (#26455)
|
||||||
|
* Update zh-cn documentation (#26406)
|
||||||
|
* Fix typos and grammer problems for actions documentation (#26328)
|
||||||
|
* Update documentation for 1.21 actions (#26317)
|
||||||
|
* Doc update swagger doc for POST /orgs/{org}/teams (#26155)
|
||||||
|
* Doc sync authentication.md to zh-cn (#26117)
|
||||||
|
* Doc guide the user to create the appropriate level runner (#26091)
|
||||||
|
* Make organization redirect warning more clear (#26077)
|
||||||
|
* Update blog links (#25843)
|
||||||
|
* Fix default value for LocalURL (#25426)
|
||||||
|
* Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194)
|
||||||
|
* MISC
|
||||||
|
* Replace deprecated `elliptic.Marshal` (#26800)
|
||||||
|
* Add elapsed time on debug for slow git commands (#25642)
|
||||||
|
|
||||||
|
## [1.20.5](https://github.com/go-gitea/gitea/releases/tag/v1.20.5) - 2023-10-03
|
||||||
|
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Fix z-index on markdown completion (#27237) (#27242 & #27238)
|
||||||
|
* Use secure cookie for HTTPS sites (#26999) (#27013)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix git 2.11 error when checking IsEmpty (#27393) (#27396)
|
||||||
|
* Allow get release download files and lfs files with oauth2 token format (#26430) (#27378)
|
||||||
|
* Fix orphan check for deleted branch (#27310) (#27320)
|
||||||
|
* Quote table `release` in sql queries (#27205) (#27219)
|
||||||
|
* Fix release URL in webhooks (#27182) (#27184)
|
||||||
|
* Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152) (#27156)
|
||||||
|
* fix pagination for followers and following (#27127) (#27138)
|
||||||
|
* Fix issue templates when blank isses are disabled (#27061) (#27082)
|
||||||
|
* Fix context cache bug & enable context cache for dashabord commits' authors(#26991) (#27017)
|
||||||
|
* Fix INI parsing for value with trailing slash (#26995) (#27001)
|
||||||
|
* Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27249)
|
||||||
|
* Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27167 & #27162)
|
||||||
|
* Fix bug of review request number (#27406) (#27104)
|
||||||
|
* TESTING
|
||||||
|
* services/wiki: Close() after error handling (#27129) (#27137)
|
||||||
|
* DOCS
|
||||||
|
* Improve actions docs related to `pull_request` event (#27126) (#27145)
|
||||||
|
* MISC
|
||||||
|
* Add logs for data broken of comment review (#27326) (#27344)
|
||||||
|
* Load reviewer before sending notification (#27063) (#27064)
|
||||||
|
|
||||||
## [1.20.4](https://github.com/go-gitea/gitea/releases/tag/v1.20.4) - 2023-09-08
|
## [1.20.4](https://github.com/go-gitea/gitea/releases/tag/v1.20.4) - 2023-09-08
|
||||||
|
|
||||||
* SECURITY
|
* SECURITY
|
||||||
|
@ -428,7 +1084,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||||
* Add option to search for users is active join a team (#24093)
|
* Add option to search for users is active join a team (#24093)
|
||||||
* Add PDF rendering via PDFObject (#24086)
|
* Add PDF rendering via PDFObject (#24086)
|
||||||
* Refactor web route (#24080)
|
* Refactor web route (#24080)
|
||||||
* Make more functions use ctx instead of db.DefaultContext (#24068)
|
|
||||||
* Make HTML template functions support context (#24056)
|
* Make HTML template functions support context (#24056)
|
||||||
* Refactor rename user and rename organization (#24052)
|
* Refactor rename user and rename organization (#24052)
|
||||||
* Localize milestone related time strings (#24051)
|
* Localize milestone related time strings (#24051)
|
||||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,4 +1,4 @@
|
||||||
#Build stage
|
# Build stage
|
||||||
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
|
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
|
||||||
|
|
||||||
ARG GOPROXY
|
ARG GOPROXY
|
||||||
|
@ -9,20 +9,38 @@ ARG TAGS="sqlite sqlite_unlock_notify"
|
||||||
ENV TAGS "bindata timetzdata $TAGS"
|
ENV TAGS "bindata timetzdata $TAGS"
|
||||||
ARG CGO_EXTRA_CFLAGS
|
ARG CGO_EXTRA_CFLAGS
|
||||||
|
|
||||||
#Build deps
|
# Build deps
|
||||||
RUN apk --no-cache add build-base git nodejs npm
|
RUN apk --no-cache add \
|
||||||
|
build-base \
|
||||||
|
git \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
#Setup repo
|
# Setup repo
|
||||||
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
||||||
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
||||||
|
|
||||||
#Checkout version if set
|
# Checkout version if set
|
||||||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
||||||
&& make clean-all build
|
&& make clean-all build
|
||||||
|
|
||||||
# Begin env-to-ini build
|
# Begin env-to-ini build
|
||||||
RUN go build contrib/environment-to-ini/environment-to-ini.go
|
RUN go build contrib/environment-to-ini/environment-to-ini.go
|
||||||
|
|
||||||
|
# Copy local files
|
||||||
|
COPY docker/root /tmp/local
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
RUN chmod 755 /tmp/local/usr/bin/entrypoint \
|
||||||
|
/tmp/local/usr/local/bin/gitea \
|
||||||
|
/tmp/local/etc/s6/gitea/* \
|
||||||
|
/tmp/local/etc/s6/openssh/* \
|
||||||
|
/tmp/local/etc/s6/.s6-svscan/* \
|
||||||
|
/go/src/code.gitea.io/gitea/gitea \
|
||||||
|
/go/src/code.gitea.io/gitea/environment-to-ini
|
||||||
|
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.18
|
FROM docker.io/library/alpine:3.18
|
||||||
LABEL maintainer="maintainers@gitea.io"
|
LABEL maintainer="maintainers@gitea.io"
|
||||||
|
|
||||||
|
@ -39,7 +57,8 @@ RUN apk --no-cache add \
|
||||||
s6 \
|
s6 \
|
||||||
sqlite \
|
sqlite \
|
||||||
su-exec \
|
su-exec \
|
||||||
gnupg
|
gnupg \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
RUN addgroup \
|
RUN addgroup \
|
||||||
-S -g 1000 \
|
-S -g 1000 \
|
||||||
|
@ -61,10 +80,7 @@ VOLUME ["/data"]
|
||||||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||||
CMD ["/bin/s6-svscan", "/etc/s6"]
|
CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||||
|
|
||||||
COPY docker/root /
|
COPY --from=build-env /tmp/local /
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
||||||
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
|
|
||||||
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
|
|
||||||
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#Build stage
|
# Build stage
|
||||||
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
|
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
|
||||||
|
|
||||||
ARG GOPROXY
|
ARG GOPROXY
|
||||||
|
@ -10,19 +10,35 @@ ENV TAGS "bindata timetzdata $TAGS"
|
||||||
ARG CGO_EXTRA_CFLAGS
|
ARG CGO_EXTRA_CFLAGS
|
||||||
|
|
||||||
#Build deps
|
#Build deps
|
||||||
RUN apk --no-cache add build-base git nodejs npm
|
RUN apk --no-cache add \
|
||||||
|
build-base \
|
||||||
|
git \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
#Setup repo
|
# Setup repo
|
||||||
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
||||||
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
||||||
|
|
||||||
#Checkout version if set
|
# Checkout version if set
|
||||||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
||||||
&& make clean-all build
|
&& make clean-all build
|
||||||
|
|
||||||
# Begin env-to-ini build
|
# Begin env-to-ini build
|
||||||
RUN go build contrib/environment-to-ini/environment-to-ini.go
|
RUN go build contrib/environment-to-ini/environment-to-ini.go
|
||||||
|
|
||||||
|
# Copy local files
|
||||||
|
COPY docker/rootless /tmp/local
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
|
||||||
|
/tmp/local/usr/local/bin/docker-setup.sh \
|
||||||
|
/tmp/local/usr/local/bin/gitea \
|
||||||
|
/go/src/code.gitea.io/gitea/gitea \
|
||||||
|
/go/src/code.gitea.io/gitea/environment-to-ini
|
||||||
|
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.18
|
FROM docker.io/library/alpine:3.18
|
||||||
LABEL maintainer="maintainers@gitea.io"
|
LABEL maintainer="maintainers@gitea.io"
|
||||||
|
|
||||||
|
@ -35,7 +51,8 @@ RUN apk --no-cache add \
|
||||||
gettext \
|
gettext \
|
||||||
git \
|
git \
|
||||||
curl \
|
curl \
|
||||||
gnupg
|
gnupg \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
RUN addgroup \
|
RUN addgroup \
|
||||||
-S -g 1000 \
|
-S -g 1000 \
|
||||||
|
@ -51,21 +68,19 @@ RUN addgroup \
|
||||||
RUN mkdir -p /var/lib/gitea /etc/gitea
|
RUN mkdir -p /var/lib/gitea /etc/gitea
|
||||||
RUN chown git:git /var/lib/gitea /etc/gitea
|
RUN chown git:git /var/lib/gitea /etc/gitea
|
||||||
|
|
||||||
COPY docker/rootless /
|
COPY --from=build-env /tmp/local /
|
||||||
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
||||||
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
||||||
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-setup.sh /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
|
|
||||||
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh
|
|
||||||
|
|
||||||
#git:git
|
# git:git
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
ENV GITEA_WORK_DIR /var/lib/gitea
|
ENV GITEA_WORK_DIR /var/lib/gitea
|
||||||
ENV GITEA_CUSTOM /var/lib/gitea/custom
|
ENV GITEA_CUSTOM /var/lib/gitea/custom
|
||||||
ENV GITEA_TEMP /tmp/gitea
|
ENV GITEA_TEMP /tmp/gitea
|
||||||
ENV TMPDIR /tmp/gitea
|
ENV TMPDIR /tmp/gitea
|
||||||
|
|
||||||
#TODO add to docs the ability to define the ini to load (useful to test and revert a config)
|
# TODO add to docs the ability to define the ini to load (useful to test and revert a config)
|
||||||
ENV GITEA_APP_INI /etc/gitea/app.ini
|
ENV GITEA_APP_INI /etc/gitea/app.ini
|
||||||
ENV HOME "/var/lib/gitea/git"
|
ENV HOME "/var/lib/gitea/git"
|
||||||
VOLUME ["/var/lib/gitea", "/etc/gitea"]
|
VOLUME ["/var/lib/gitea", "/etc/gitea"]
|
||||||
|
@ -73,4 +88,3 @@ WORKDIR /var/lib/gitea
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
||||||
CMD []
|
CMD []
|
||||||
|
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -226,6 +226,7 @@ help:
|
||||||
@echo " - test-frontend test frontend files"
|
@echo " - test-frontend test frontend files"
|
||||||
@echo " - test-backend test backend files"
|
@echo " - test-backend test backend files"
|
||||||
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
|
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
|
||||||
|
@echo " - update update js and py dependencies"
|
||||||
@echo " - update-js update js dependencies"
|
@echo " - update-js update js dependencies"
|
||||||
@echo " - update-py update py dependencies"
|
@echo " - update-py update py dependencies"
|
||||||
@echo " - webpack build webpack files"
|
@echo " - webpack build webpack files"
|
||||||
|
@ -921,9 +922,12 @@ node_modules: package-lock.json
|
||||||
@touch node_modules
|
@touch node_modules
|
||||||
|
|
||||||
.venv: poetry.lock
|
.venv: poetry.lock
|
||||||
poetry install
|
poetry install --no-root
|
||||||
@touch .venv
|
@touch .venv
|
||||||
|
|
||||||
|
.PHONY: update
|
||||||
|
update: update-js update-py
|
||||||
|
|
||||||
.PHONY: update-js
|
.PHONY: update-js
|
||||||
update-js: node-check | node_modules
|
update-js: node-check | node_modules
|
||||||
npx updates -u -f package.json
|
npx updates -u -f package.json
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -389,7 +389,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
|
||||||
}
|
}
|
||||||
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
|
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
|
||||||
|
|
||||||
if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
|
if err = repo_module.SyncReleasesWithTags(ctx, repo, gitRepo); err != nil {
|
||||||
log.Warn(" SyncReleasesWithTags: %v", err)
|
log.Warn(" SyncReleasesWithTags: %v", err)
|
||||||
gitRepo.Close()
|
gitRepo.Close()
|
||||||
continue
|
continue
|
||||||
|
@ -438,7 +438,7 @@ func runRegenerateKeys(_ *cli.Context) error {
|
||||||
if err := initDB(ctx); err != nil {
|
if err := initDB(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return asymkey_model.RewriteAllPublicKeys()
|
return asymkey_model.RewriteAllPublicKeys(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
|
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"code.gitea.io/gitea/models/migrations"
|
"code.gitea.io/gitea/models/migrations"
|
||||||
migrate_base "code.gitea.io/gitea/models/migrations/base"
|
migrate_base "code.gitea.io/gitea/models/migrations/base"
|
||||||
|
"code.gitea.io/gitea/modules/container"
|
||||||
"code.gitea.io/gitea/modules/doctor"
|
"code.gitea.io/gitea/modules/doctor"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
@ -22,6 +23,19 @@ import (
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CmdDoctor represents the available doctor sub-command.
|
||||||
|
var CmdDoctor = &cli.Command{
|
||||||
|
Name: "doctor",
|
||||||
|
Usage: "Diagnose and optionally fix problems",
|
||||||
|
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
|
||||||
|
|
||||||
|
Subcommands: []*cli.Command{
|
||||||
|
cmdDoctorCheck,
|
||||||
|
cmdRecreateTable,
|
||||||
|
cmdDoctorConvert,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
var cmdDoctorCheck = &cli.Command{
|
var cmdDoctorCheck = &cli.Command{
|
||||||
Name: "check",
|
Name: "check",
|
||||||
Usage: "Diagnose and optionally fix problems",
|
Usage: "Diagnose and optionally fix problems",
|
||||||
|
@ -60,19 +74,6 @@ var cmdDoctorCheck = &cli.Command{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// CmdDoctor represents the available doctor sub-command.
|
|
||||||
var CmdDoctor = &cli.Command{
|
|
||||||
Name: "doctor",
|
|
||||||
Usage: "Diagnose and optionally fix problems",
|
|
||||||
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
|
|
||||||
|
|
||||||
Subcommands: []*cli.Command{
|
|
||||||
cmdDoctorCheck,
|
|
||||||
cmdRecreateTable,
|
|
||||||
cmdDoctorConvert,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var cmdRecreateTable = &cli.Command{
|
var cmdRecreateTable = &cli.Command{
|
||||||
Name: "recreate-table",
|
Name: "recreate-table",
|
||||||
Usage: "Recreate tables from XORM definitions and copy the data.",
|
Usage: "Recreate tables from XORM definitions and copy the data.",
|
||||||
|
@ -177,6 +178,7 @@ func runDoctorCheck(ctx *cli.Context) error {
|
||||||
if ctx.IsSet("list") {
|
if ctx.IsSet("list") {
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
|
||||||
_, _ = w.Write([]byte("Default\tName\tTitle\n"))
|
_, _ = w.Write([]byte("Default\tName\tTitle\n"))
|
||||||
|
doctor.SortChecks(doctor.Checks)
|
||||||
for _, check := range doctor.Checks {
|
for _, check := range doctor.Checks {
|
||||||
if check.IsDefault {
|
if check.IsDefault {
|
||||||
_, _ = w.Write([]byte{'*'})
|
_, _ = w.Write([]byte{'*'})
|
||||||
|
@ -192,26 +194,20 @@ func runDoctorCheck(ctx *cli.Context) error {
|
||||||
|
|
||||||
var checks []*doctor.Check
|
var checks []*doctor.Check
|
||||||
if ctx.Bool("all") {
|
if ctx.Bool("all") {
|
||||||
checks = doctor.Checks
|
checks = make([]*doctor.Check, len(doctor.Checks))
|
||||||
|
copy(checks, doctor.Checks)
|
||||||
} else if ctx.IsSet("run") {
|
} else if ctx.IsSet("run") {
|
||||||
addDefault := ctx.Bool("default")
|
addDefault := ctx.Bool("default")
|
||||||
names := ctx.StringSlice("run")
|
runNamesSet := container.SetOf(ctx.StringSlice("run")...)
|
||||||
for i, name := range names {
|
|
||||||
names[i] = strings.ToLower(strings.TrimSpace(name))
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, check := range doctor.Checks {
|
for _, check := range doctor.Checks {
|
||||||
if addDefault && check.IsDefault {
|
if (addDefault && check.IsDefault) || runNamesSet.Contains(check.Name) {
|
||||||
checks = append(checks, check)
|
checks = append(checks, check)
|
||||||
continue
|
runNamesSet.Remove(check.Name)
|
||||||
}
|
|
||||||
for _, name := range names {
|
|
||||||
if name == check.Name {
|
|
||||||
checks = append(checks, check)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(runNamesSet) > 0 {
|
||||||
|
return fmt.Errorf("unknown checks: %q", strings.Join(runNamesSet.Values(), ","))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for _, check := range doctor.Checks {
|
for _, check := range doctor.Checks {
|
||||||
if check.IsDefault {
|
if check.IsDefault {
|
||||||
|
@ -219,6 +215,5 @@ func runDoctorCheck(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return doctor.RunChecks(stdCtx, colorize, ctx.Bool("fix"), checks)
|
return doctor.RunChecks(stdCtx, colorize, ctx.Bool("fix"), checks)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/doctor"
|
||||||
|
"code.gitea.io/gitea/modules/log"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/urfave/cli/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDoctorRun(t *testing.T) {
|
||||||
|
doctor.Register(&doctor.Check{
|
||||||
|
Title: "Test Check",
|
||||||
|
Name: "test-check",
|
||||||
|
Run: func(ctx context.Context, logger log.Logger, autofix bool) error { return nil },
|
||||||
|
|
||||||
|
SkipDatabaseInitialization: true,
|
||||||
|
})
|
||||||
|
app := cli.NewApp()
|
||||||
|
app.Commands = []*cli.Command{cmdDoctorCheck}
|
||||||
|
err := app.Run([]string{"./gitea", "check", "--run", "test-check"})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
err = app.Run([]string{"./gitea", "check", "--run", "no-such"})
|
||||||
|
assert.ErrorContains(t, err, `unknown checks: "no-such"`)
|
||||||
|
err = app.Run([]string{"./gitea", "check", "--run", "test-check,no-such"})
|
||||||
|
assert.ErrorContains(t, err, `unknown checks: "no-such"`)
|
||||||
|
}
|
|
@ -452,7 +452,7 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
currentAbsPath := path.Join(absPath, file.Name())
|
currentAbsPath := filepath.Join(absPath, file.Name())
|
||||||
currentInsidePath := path.Join(insidePath, file.Name())
|
currentInsidePath := path.Join(insidePath, file.Name())
|
||||||
if file.IsDir() {
|
if file.IsDir() {
|
||||||
if !util.SliceContainsString(excludeAbsPath, currentAbsPath) {
|
if !util.SliceContainsString(excludeAbsPath, currentAbsPath) {
|
||||||
|
|
|
@ -110,6 +110,9 @@ func migrateLFS(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
||||||
|
|
||||||
func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
||||||
return db.Iterate(ctx, nil, func(ctx context.Context, user *user_model.User) error {
|
return db.Iterate(ctx, nil, func(ctx context.Context, user *user_model.User) error {
|
||||||
|
if user.CustomAvatarRelativePath() == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
_, err := storage.Copy(dstStorage, user.CustomAvatarRelativePath(), storage.Avatars, user.CustomAvatarRelativePath())
|
_, err := storage.Copy(dstStorage, user.CustomAvatarRelativePath(), storage.Avatars, user.CustomAvatarRelativePath())
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
|
@ -117,6 +120,9 @@ func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error
|
||||||
|
|
||||||
func migrateRepoAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
func migrateRepoAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
||||||
return db.Iterate(ctx, nil, func(ctx context.Context, repo *repo_model.Repository) error {
|
return db.Iterate(ctx, nil, func(ctx context.Context, repo *repo_model.Repository) error {
|
||||||
|
if repo.CustomAvatarRelativePath() == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
|
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/models/db"
|
||||||
"code.gitea.io/gitea/models/packages"
|
"code.gitea.io/gitea/models/packages"
|
||||||
"code.gitea.io/gitea/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
@ -30,7 +31,7 @@ func TestMigratePackages(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
defer buf.Close()
|
defer buf.Close()
|
||||||
|
|
||||||
v, f, err := packages_service.CreatePackageAndAddFile(&packages_service.PackageCreationInfo{
|
v, f, err := packages_service.CreatePackageAndAddFile(db.DefaultContext, &packages_service.PackageCreationInfo{
|
||||||
PackageInfo: packages_service.PackageInfo{
|
PackageInfo: packages_service.PackageInfo{
|
||||||
Owner: creator,
|
Owner: creator,
|
||||||
PackageType: packages.TypeGeneric,
|
PackageType: packages.TypeGeneric,
|
||||||
|
|
|
@ -47,24 +47,28 @@ func main() {
|
||||||
on the configuration cheat sheet.`
|
on the configuration cheat sheet.`
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "custom-path, C",
|
Name: "custom-path",
|
||||||
Value: setting.CustomPath,
|
Aliases: []string{"C"},
|
||||||
Usage: "Custom path file path",
|
Value: setting.CustomPath,
|
||||||
|
Usage: "Custom path file path",
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "config, c",
|
Name: "config",
|
||||||
Value: setting.CustomConf,
|
Aliases: []string{"c"},
|
||||||
Usage: "Custom configuration file path",
|
Value: setting.CustomConf,
|
||||||
|
Usage: "Custom configuration file path",
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "work-path, w",
|
Name: "work-path",
|
||||||
Value: setting.AppWorkPath,
|
Aliases: []string{"w"},
|
||||||
Usage: "Set the gitea working path",
|
Value: setting.AppWorkPath,
|
||||||
|
Usage: "Set the gitea working path",
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "out, o",
|
Name: "out",
|
||||||
Value: "",
|
Aliases: []string{"o"},
|
||||||
Usage: "Destination file to write to",
|
Value: "",
|
||||||
|
Usage: "Destination file to write to",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
app.Action = runEnvironmentToIni
|
app.Action = runEnvironmentToIni
|
||||||
|
|
|
@ -52,7 +52,7 @@ After=network.target
|
||||||
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
|
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
|
||||||
# LimitNOFILE=524288:524288
|
# LimitNOFILE=524288:524288
|
||||||
RestartSec=2s
|
RestartSec=2s
|
||||||
Type=notify
|
Type=simple
|
||||||
User=git
|
User=git
|
||||||
Group=git
|
Group=git
|
||||||
WorkingDirectory=/var/lib/gitea/
|
WorkingDirectory=/var/lib/gitea/
|
||||||
|
@ -62,7 +62,6 @@ WorkingDirectory=/var/lib/gitea/
|
||||||
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
|
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
|
||||||
Restart=always
|
Restart=always
|
||||||
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
|
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
|
||||||
WatchdogSec=30s
|
|
||||||
# If you install Git to directory prefix other than default PATH (which happens
|
# If you install Git to directory prefix other than default PATH (which happens
|
||||||
# for example if you install other versions of Git side-to-side with
|
# for example if you install other versions of Git side-to-side with
|
||||||
# distribution version), uncomment below line and add that prefix to PATH
|
# distribution version), uncomment below line and add that prefix to PATH
|
||||||
|
|
|
@ -491,6 +491,11 @@ INTERNAL_TOKEN=
|
||||||
;; Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations.
|
;; Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations.
|
||||||
;; This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security.
|
;; This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security.
|
||||||
;SUCCESSFUL_TOKENS_CACHE_SIZE = 20
|
;SUCCESSFUL_TOKENS_CACHE_SIZE = 20
|
||||||
|
;;
|
||||||
|
;; Reject API tokens sent in URL query string (Accept Header-based API tokens only). This avoids security vulnerabilities
|
||||||
|
;; stemming from cached/logged plain-text API tokens.
|
||||||
|
;; In future releases, this will become the default behavior
|
||||||
|
;DISABLE_QUERY_AUTH_TOKEN = false
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
@ -1014,8 +1019,8 @@ LEVEL = Info
|
||||||
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
;ALLOWED_TYPES =
|
;ALLOWED_TYPES =
|
||||||
;;
|
;;
|
||||||
;; Max size of each file in megabytes. Defaults to 3MB
|
;; Max size of each file in megabytes. Defaults to 50MB
|
||||||
;FILE_MAX_SIZE = 3
|
;FILE_MAX_SIZE = 50
|
||||||
;;
|
;;
|
||||||
;; Max number of files per upload. Defaults to 5
|
;; Max number of files per upload. Defaults to 5
|
||||||
;MAX_FILES = 5
|
;MAX_FILES = 5
|
||||||
|
@ -1151,15 +1156,9 @@ LEVEL = Info
|
||||||
;; enable cors headers (disabled by default)
|
;; enable cors headers (disabled by default)
|
||||||
;ENABLED = false
|
;ENABLED = false
|
||||||
;;
|
;;
|
||||||
;; scheme of allowed requests
|
;; list of requesting origins that are allowed, eg: "https://*.example.com"
|
||||||
;SCHEME = http
|
|
||||||
;;
|
|
||||||
;; list of requesting domains that are allowed
|
|
||||||
;ALLOW_DOMAIN = *
|
;ALLOW_DOMAIN = *
|
||||||
;;
|
;;
|
||||||
;; allow subdomains of headers listed above to request
|
|
||||||
;ALLOW_SUBDOMAIN = false
|
|
||||||
;;
|
|
||||||
;; list of methods allowed to request
|
;; list of methods allowed to request
|
||||||
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
|
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
|
||||||
;;
|
;;
|
||||||
|
@ -1205,6 +1204,9 @@ LEVEL = Info
|
||||||
;; Max size of files to be displayed (default is 8MiB)
|
;; Max size of files to be displayed (default is 8MiB)
|
||||||
;MAX_DISPLAY_FILE_SIZE = 8388608
|
;MAX_DISPLAY_FILE_SIZE = 8388608
|
||||||
;;
|
;;
|
||||||
|
;; Detect ambiguous unicode characters in file contents and show warnings on the UI
|
||||||
|
;AMBIGUOUS_UNICODE_DETECTION = true
|
||||||
|
;;
|
||||||
;; Whether the email of the user should be shown in the Explore Users page
|
;; Whether the email of the user should be shown in the Explore Users page
|
||||||
;SHOW_USER_EMAIL = true
|
;SHOW_USER_EMAIL = true
|
||||||
;;
|
;;
|
||||||
|
@ -1219,6 +1221,9 @@ LEVEL = Info
|
||||||
;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
|
;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
|
||||||
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
|
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
|
||||||
;;
|
;;
|
||||||
|
;; Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
|
||||||
|
;REACTION_MAX_USER_NUM = 10
|
||||||
|
;;
|
||||||
;; Additional Emojis not defined in the utf8 standard
|
;; Additional Emojis not defined in the utf8 standard
|
||||||
;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.
|
;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.
|
||||||
;; Dont mistake it for Reactions.
|
;; Dont mistake it for Reactions.
|
||||||
|
@ -1420,7 +1425,7 @@ LEVEL = Info
|
||||||
;DATADIR = queues/ ; Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
|
;DATADIR = queues/ ; Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
|
||||||
;;
|
;;
|
||||||
;; Default queue length before a channel queue will block
|
;; Default queue length before a channel queue will block
|
||||||
;LENGTH = 100
|
;LENGTH = 100000
|
||||||
;;
|
;;
|
||||||
;; Batch size to send for batched queues
|
;; Batch size to send for batched queues
|
||||||
;BATCH_LENGTH = 20
|
;BATCH_LENGTH = 20
|
||||||
|
@ -1812,8 +1817,8 @@ LEVEL = Info
|
||||||
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
|
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
|
||||||
;;
|
;;
|
||||||
;; Max size of each file. Defaults to 4MB
|
;; Max size of each file. Defaults to 2048MB
|
||||||
;MAX_SIZE = 4
|
;MAX_SIZE = 2048
|
||||||
;;
|
;;
|
||||||
;; Max number of files per upload. Defaults to 5
|
;; Max number of files per upload. Defaults to 5
|
||||||
;MAX_FILES = 5
|
;MAX_FILES = 5
|
||||||
|
@ -2566,8 +2571,14 @@ LEVEL = Info
|
||||||
;;
|
;;
|
||||||
;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
|
;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
|
||||||
;DEFAULT_ACTIONS_URL = github
|
;DEFAULT_ACTIONS_URL = github
|
||||||
;; Default artifact retention time in days, default is 90 days
|
;; Default artifact retention time in days. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step.
|
||||||
;ARTIFACT_RETENTION_DAYS = 90
|
;ARTIFACT_RETENTION_DAYS = 90
|
||||||
|
;; Timeout to stop the task which have running status, but haven't been updated for a long time
|
||||||
|
;ZOMBIE_TASK_TIMEOUT = 10m
|
||||||
|
;; Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time
|
||||||
|
;ENDLESS_TASK_TIMEOUT = 3h
|
||||||
|
;; Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time
|
||||||
|
;ABANDONED_JOB_TIMEOUT = 24h
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
@ -7,7 +7,7 @@ if [ ! -x /bin/sh ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${USER}" != "git" ]; then
|
if [ "${USER}" != "git" ]; then
|
||||||
# rename user
|
# Rename user
|
||||||
sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd
|
sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ if [ -z "${USER_UID}" ]; then
|
||||||
USER_UID="`id -u ${USER}`"
|
USER_UID="`id -u ${USER}`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Change GID for USER?
|
# Change GID for USER?
|
||||||
if [ -n "${USER_GID}" ] && [ "${USER_GID}" != "`id -g ${USER}`" ]; then
|
if [ -n "${USER_GID}" ] && [ "${USER_GID}" != "`id -g ${USER}`" ]; then
|
||||||
sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group
|
sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group
|
||||||
sed -i -e "s/^${USER}:\([^:]*\):\([0-9]*\):[0-9]*/${USER}:\1:\2:${USER_GID}/" /etc/passwd
|
sed -i -e "s/^${USER}:\([^:]*\):\([0-9]*\):[0-9]*/${USER}:\1:\2:${USER_GID}/" /etc/passwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Change UID for USER?
|
# Change UID for USER?
|
||||||
if [ -n "${USER_UID}" ] && [ "${USER_UID}" != "`id -u ${USER}`" ]; then
|
if [ -n "${USER_UID}" ] && [ "${USER_UID}" != "`id -u ${USER}`" ]; then
|
||||||
sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:\([0-9]*\)/${USER}:\1:${USER_UID}:\2/" /etc/passwd
|
sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:\([0-9]*\)/${USER}:\1:${USER_UID}:\2/" /etc/passwd
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,10 +19,10 @@ Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Poli
|
||||||
|
|
||||||
## Getting Pages
|
## Getting Pages
|
||||||
|
|
||||||
Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/`. For example, to add Privacy Policy:
|
Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
|
wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you need to edit the page to meet your requirements. In particular you must change the email addresses, web addresses and references to "Your Gitea Instance" to match your situation.
|
Now you need to edit the page to meet your requirements. In particular you must change the email addresses, web addresses and references to "Your Gitea Instance" to match your situation.
|
||||||
|
|
|
@ -19,10 +19,10 @@ menu:
|
||||||
|
|
||||||
## 获取页面
|
## 获取页面
|
||||||
|
|
||||||
Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/` 目录下。例如,如果要添加隐私政策:
|
Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
|
wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
|
||||||
```
|
```
|
||||||
|
|
||||||
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。
|
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。
|
||||||
|
|
|
@ -50,7 +50,7 @@ a special meaning for your command shell.
|
||||||
|
|
||||||
If no pattern is provided, all files are listed.
|
If no pattern is provided, all files are listed.
|
||||||
|
|
||||||
### Example
|
### Example: Listing all embedded files
|
||||||
|
|
||||||
Listing all embedded files with `openid` in their path:
|
Listing all embedded files with `openid` in their path:
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ When Gitea is upgraded to a new version (by replacing the executable), many of t
|
||||||
embedded files will suffer changes. Gitea will honor and use any files found
|
embedded files will suffer changes. Gitea will honor and use any files found
|
||||||
in the `custom` directory, even if they are old and incompatible.
|
in the `custom` directory, even if they are old and incompatible.
|
||||||
|
|
||||||
### Example
|
### Example: Extracting mail templates
|
||||||
|
|
||||||
Extracting mail templates to a temporary directory:
|
Extracting mail templates to a temporary directory:
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ gitea embedded list [--include-vendored] [patterns...]
|
||||||
|
|
||||||
如果未提供模式,则列出所有文件。
|
如果未提供模式,则列出所有文件。
|
||||||
|
|
||||||
### 示例
|
### 示例:列出所有嵌入文件
|
||||||
|
|
||||||
列出所有路径中包含 `openid` 的嵌入文件:
|
列出所有路径中包含 `openid` 的嵌入文件:
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overw
|
||||||
|
|
||||||
请确保**只提取需要自定义的文件**。位于 `custom` 目录中的文件不会受到 Gitea 的升级过程的影响。当 Gitea 升级到新版本(通过替换可执行文件)时,许多嵌入文件将发生变化。Gitea 将尊重并使用在 `custom` 目录中找到的任何文件,即使这些文件是旧的和不兼容的。
|
请确保**只提取需要自定义的文件**。位于 `custom` 目录中的文件不会受到 Gitea 的升级过程的影响。当 Gitea 升级到新版本(通过替换可执行文件)时,许多嵌入文件将发生变化。Gitea 将尊重并使用在 `custom` 目录中找到的任何文件,即使这些文件是旧的和不兼容的。
|
||||||
|
|
||||||
### 示例
|
### 示例:提取邮件模板
|
||||||
|
|
||||||
将邮件模板提取到临时目录:
|
将邮件模板提取到临时目录:
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build
|
||||||
- `ENABLED`: **true**: Whether repository file uploads are enabled
|
- `ENABLED`: **true**: Whether repository file uploads are enabled
|
||||||
- `TEMP_PATH`: **data/tmp/uploads**: Path for uploads (content gets deleted on Gitea restart)
|
- `TEMP_PATH`: **data/tmp/uploads**: Path for uploads (content gets deleted on Gitea restart)
|
||||||
- `ALLOWED_TYPES`: **_empty_**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
- `ALLOWED_TYPES`: **_empty_**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
- `FILE_MAX_SIZE`: **3**: Max size of each file in megabytes.
|
- `FILE_MAX_SIZE`: **50**: Max size of each file in megabytes.
|
||||||
- `MAX_FILES`: **5**: Max number of files per upload
|
- `MAX_FILES`: **5**: Max number of files per upload
|
||||||
|
|
||||||
### Repository - Release (`repository.release`)
|
### Repository - Release (`repository.release`)
|
||||||
|
@ -196,9 +196,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
||||||
## CORS (`cors`)
|
## CORS (`cors`)
|
||||||
|
|
||||||
- `ENABLED`: **false**: enable cors headers (disabled by default)
|
- `ENABLED`: **false**: enable cors headers (disabled by default)
|
||||||
- `SCHEME`: **http**: scheme of allowed requests
|
- `ALLOW_DOMAIN`: **\***: list of requesting origins that are allowed, eg: "https://*.example.com"
|
||||||
- `ALLOW_DOMAIN`: **\***: list of requesting domains that are allowed
|
|
||||||
- `ALLOW_SUBDOMAIN`: **false**: allow subdomains of headers listed above to request
|
|
||||||
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request
|
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request
|
||||||
- `MAX_AGE`: **10m**: max time to cache response
|
- `MAX_AGE`: **10m**: max time to cache response
|
||||||
- `ALLOW_CREDENTIALS`: **false**: allow request with credentials
|
- `ALLOW_CREDENTIALS`: **false**: allow request with credentials
|
||||||
|
@ -220,9 +218,11 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
||||||
- `THEMES`: **auto,gitea,arc-green**: All available themes. Allow users select personalized themes.
|
- `THEMES`: **auto,gitea,arc-green**: All available themes. Allow users select personalized themes.
|
||||||
regardless of the value of `DEFAULT_THEME`.
|
regardless of the value of `DEFAULT_THEME`.
|
||||||
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
|
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
|
||||||
|
- `AMBIGUOUS_UNICODE_DETECTION`: **true**: Detect ambiguous unicode characters in file contents and show warnings on the UI
|
||||||
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
|
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
|
||||||
Values can be emoji alias (:smile:) or a unicode emoji.
|
Values can be emoji alias (:smile:) or a unicode emoji.
|
||||||
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
|
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
|
||||||
|
- `REACTION_MAX_USER_NUM`: **10**: Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
|
||||||
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
|
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
|
||||||
By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and
|
By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and
|
||||||
add it to this config.
|
add it to this config.
|
||||||
|
@ -340,7 +340,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
||||||
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set.
|
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set.
|
||||||
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
|
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
|
||||||
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
|
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
|
||||||
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted.
|
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted.
|
||||||
- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
|
- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
|
||||||
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
|
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
|
||||||
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
|
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
|
||||||
|
@ -423,7 +423,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
||||||
## Database (`database`)
|
## Database (`database`)
|
||||||
|
|
||||||
- `DB_TYPE`: **mysql**: The database type in use \[mysql, postgres, mssql, sqlite3\].
|
- `DB_TYPE`: **mysql**: The database type in use \[mysql, postgres, mssql, sqlite3\].
|
||||||
- `HOST`: **127.0.0.1:3306**: Database host address and port or absolute path for unix socket \[mysql, postgres\] (ex: /var/run/mysqld/mysqld.sock).
|
- `HOST`: **127.0.0.1:3306**: Database host address and port or absolute path for unix socket \[mysql, postgres[^1]\] (ex: /var/run/mysqld/mysqld.sock).
|
||||||
- `NAME`: **gitea**: Database name.
|
- `NAME`: **gitea**: Database name.
|
||||||
- `USER`: **root**: Database username.
|
- `USER`: **root**: Database username.
|
||||||
- `PASSWD`: **_empty_**: Database user password. Use \`your password\` or """your password""" for quoting if you use special characters in the password.
|
- `PASSWD`: **_empty_**: Database user password. Use \`your password\` or """your password""" for quoting if you use special characters in the password.
|
||||||
|
@ -454,6 +454,8 @@ The following configuration set `Content-Type: application/vnd.android.package-a
|
||||||
- `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071).
|
- `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071).
|
||||||
- `AUTO_MIGRATION` **true**: Whether execute database models migrations automatically.
|
- `AUTO_MIGRATION` **true**: Whether execute database models migrations automatically.
|
||||||
|
|
||||||
|
[^1]: It may be necessary to specify a hostport even when listening on a unix socket, as the port is part of the socket name. see [#24552](https://github.com/go-gitea/gitea/issues/24552#issuecomment-1681649367) for additional details.
|
||||||
|
|
||||||
Please see #8540 & #8273 for further discussion of the appropriate values for `MAX_OPEN_CONNS`, `MAX_IDLE_CONNS` & `CONN_MAX_LIFETIME` and their
|
Please see #8540 & #8273 for further discussion of the appropriate values for `MAX_OPEN_CONNS`, `MAX_IDLE_CONNS` & `CONN_MAX_LIFETIME` and their
|
||||||
relation to port exhaustion.
|
relation to port exhaustion.
|
||||||
|
|
||||||
|
@ -483,7 +485,7 @@ Configuration at `[queue]` will set defaults for queues with overrides for indiv
|
||||||
|
|
||||||
- `TYPE`: **level**: General queue type, currently support: `level` (uses a LevelDB internally), `channel`, `redis`, `dummy`. Invalid types are treated as `level`.
|
- `TYPE`: **level**: General queue type, currently support: `level` (uses a LevelDB internally), `channel`, `redis`, `dummy`. Invalid types are treated as `level`.
|
||||||
- `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
|
- `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
|
||||||
- `LENGTH`: **100**: Maximal queue size before channel queues block
|
- `LENGTH`: **100000**: Maximal queue size before channel queues block
|
||||||
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
|
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
|
||||||
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR`
|
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR`
|
||||||
- `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section.
|
- `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section.
|
||||||
|
@ -568,6 +570,7 @@ And the following unique queues:
|
||||||
- off - do not check password complexity
|
- off - do not check password complexity
|
||||||
- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed.
|
- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed.
|
||||||
- `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security.
|
- `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security.
|
||||||
|
- `DISABLE_QUERY_AUTH_TOKEN`: **false**: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default to `true` in Gitea 1.23 and be deprecated in Gitea 1.24.
|
||||||
|
|
||||||
## Camo (`camo`)
|
## Camo (`camo`)
|
||||||
|
|
||||||
|
@ -819,7 +822,7 @@ Default templates for project boards:
|
||||||
|
|
||||||
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
|
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
|
||||||
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
- `MAX_SIZE`: **4**: Maximum size (MB).
|
- `MAX_SIZE`: **2048**: Maximum size (MB).
|
||||||
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
|
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
|
||||||
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
||||||
- `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.
|
- `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.
|
||||||
|
@ -1388,7 +1391,10 @@ PROXY_HOSTS = *.github.com
|
||||||
- `DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
|
- `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]`
|
- `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`
|
- `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
|
||||||
- `ARTIFACT_RETENTION_DAYS`: **90**: Number of days to keep artifacts. Set to 0 to disable artifact retention. Default is 90 days if not set.
|
- `ARTIFACT_RETENTION_DAYS`: **90**: Default number of days to keep artifacts. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step.
|
||||||
|
- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time
|
||||||
|
- `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time
|
||||||
|
- `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time
|
||||||
|
|
||||||
`DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path.
|
`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`.
|
For example, `uses: actions/checkout@v3` means `https://github.com/actions/checkout@v3` since the value of `DEFAULT_ACTIONS_URL` is `github`.
|
||||||
|
@ -1398,7 +1404,7 @@ Please note that using `self` is not recommended for most cases, as it could mak
|
||||||
Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it.
|
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.
|
Therefore, please use `self` only if you understand what you are doing.
|
||||||
|
|
||||||
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`.
|
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, 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).
|
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`.
|
Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`.
|
||||||
|
|
|
@ -145,7 +145,7 @@ menu:
|
||||||
- `ENABLED`: **true**: 是否启用仓库文件上传。
|
- `ENABLED`: **true**: 是否启用仓库文件上传。
|
||||||
- `TEMP_PATH`: **data/tmp/uploads**: 文件上传的临时保存路径(在Gitea重启的时候该目录会被清空)。
|
- `TEMP_PATH`: **data/tmp/uploads**: 文件上传的临时保存路径(在Gitea重启的时候该目录会被清空)。
|
||||||
- `ALLOWED_TYPES`: **_empty_**: 以逗号分割的列表,代表支持上传的文件类型。(`.zip`), mime类型 (`text/plain`) or 通配符类型 (`image/*`, `audio/*`, `video/*`). 为空或者 `*/*`代表允许所有类型文件。
|
- `ALLOWED_TYPES`: **_empty_**: 以逗号分割的列表,代表支持上传的文件类型。(`.zip`), mime类型 (`text/plain`) or 通配符类型 (`image/*`, `audio/*`, `video/*`). 为空或者 `*/*`代表允许所有类型文件。
|
||||||
- `FILE_MAX_SIZE`: **3**: 每个文件的最大大小(MB)。
|
- `FILE_MAX_SIZE`: **50**: 每个文件的最大大小(MB)。
|
||||||
- `MAX_FILES`: **5**: 每次上传的最大文件数。
|
- `MAX_FILES`: **5**: 每次上传的最大文件数。
|
||||||
|
|
||||||
### 仓库 - 版本发布 (`repository.release`)
|
### 仓库 - 版本发布 (`repository.release`)
|
||||||
|
@ -195,9 +195,7 @@ menu:
|
||||||
## 跨域 (`cors`)
|
## 跨域 (`cors`)
|
||||||
|
|
||||||
- `ENABLED`: **false**: 启用 CORS 头部(默认禁用)
|
- `ENABLED`: **false**: 启用 CORS 头部(默认禁用)
|
||||||
- `SCHEME`: **http**: 允许请求的协议
|
|
||||||
- `ALLOW_DOMAIN`: **\***: 允许请求的域名列表
|
- `ALLOW_DOMAIN`: **\***: 允许请求的域名列表
|
||||||
- `ALLOW_SUBDOMAIN`: **false**: 允许上述列出的头部的子域名发出请求。
|
|
||||||
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: 允许发起的请求方式列表
|
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: 允许发起的请求方式列表
|
||||||
- `MAX_AGE`: **10m**: 缓存响应的最大时间
|
- `MAX_AGE`: **10m**: 缓存响应的最大时间
|
||||||
- `ALLOW_CREDENTIALS`: **false**: 允许带有凭据的请求
|
- `ALLOW_CREDENTIALS`: **false**: 允许带有凭据的请求
|
||||||
|
@ -335,7 +333,7 @@ menu:
|
||||||
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** 或 **username, email**:\[off, username, email, anything\]:指定允许用户用作 principal 的值。当设置为 `anything` 时,对 principal 字符串不执行任何检查。当设置为 `off` 时,不允许设置授权的 principal。
|
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** 或 **username, email**:\[off, username, email, anything\]:指定允许用户用作 principal 的值。当设置为 `anything` 时,对 principal 字符串不执行任何检查。当设置为 `off` 时,不允许设置授权的 principal。
|
||||||
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**:当 Gitea 不使用内置 SSH 服务器且 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off` 时,默认情况下 Gitea 会创建一个 authorized_principals 文件。
|
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**:当 Gitea 不使用内置 SSH 服务器且 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off` 时,默认情况下 Gitea 会创建一个 authorized_principals 文件。
|
||||||
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**:在重写所有密钥时启用 SSH 授权 principal 备份,默认值为 true(如果 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off`)。
|
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**:在重写所有密钥时启用 SSH 授权 principal 备份,默认值为 true(如果 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off`)。
|
||||||
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**:设置用于传递授权密钥的命令模板。可能的密钥是:AppPath、AppWorkPath、CustomConf、CustomPath、Key,其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。
|
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**:设置用于传递授权密钥的命令模板。可能的密钥是:AppPath、AppWorkPath、CustomConf、CustomPath、Key,其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。
|
||||||
- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**:对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
|
- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**:对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
|
||||||
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
|
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
|
||||||
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
|
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
|
||||||
|
@ -472,7 +470,7 @@ menu:
|
||||||
|
|
||||||
- `TYPE`:**level**:通用队列类型,当前支持:`level`(在内部使用 LevelDB)、`channel`、`redis`、`dummy`。无效的类型将视为 `level`。
|
- `TYPE`:**level**:通用队列类型,当前支持:`level`(在内部使用 LevelDB)、`channel`、`redis`、`dummy`。无效的类型将视为 `level`。
|
||||||
- `DATADIR`:**queues/common**:用于存储 level 队列的基本 DataDir。单独的队列的 `DATADIR` 可以在 `queue.name` 部分进行设置。相对路径将根据 `%(APP_DATA_PATH)s` 变为绝对路径。
|
- `DATADIR`:**queues/common**:用于存储 level 队列的基本 DataDir。单独的队列的 `DATADIR` 可以在 `queue.name` 部分进行设置。相对路径将根据 `%(APP_DATA_PATH)s` 变为绝对路径。
|
||||||
- `LENGTH`:**100**:通道队列阻塞之前的最大队列大小
|
- `LENGTH`:**100000**:通道队列阻塞之前的最大队列大小
|
||||||
- `BATCH_LENGTH`:**20**:在传递给处理程序之前批处理数据
|
- `BATCH_LENGTH`:**20**:在传递给处理程序之前批处理数据
|
||||||
- `CONN_STR`:**redis://127.0.0.1:6379/0**:redis 队列类型的连接字符串。对于 `redis-cluster`,使用 `redis+cluster://127.0.0.1:6379/0`。可以使用查询参数来设置选项。类似地,LevelDB 选项也可以使用:**leveldb://relative/path?option=value** 或 **leveldb:///absolute/path?option=value** 进行设置,并将覆盖 `DATADIR`。
|
- `CONN_STR`:**redis://127.0.0.1:6379/0**:redis 队列类型的连接字符串。对于 `redis-cluster`,使用 `redis+cluster://127.0.0.1:6379/0`。可以使用查询参数来设置选项。类似地,LevelDB 选项也可以使用:**leveldb://relative/path?option=value** 或 **leveldb:///absolute/path?option=value** 进行设置,并将覆盖 `DATADIR`。
|
||||||
- `QUEUE_NAME`:**_queue**:默认的 redis 和磁盘队列名称的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`,但可以在特定的 `queue.name` 部分中进行覆盖。
|
- `QUEUE_NAME`:**_queue**:默认的 redis 和磁盘队列名称的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`,但可以在特定的 `queue.name` 部分中进行覆盖。
|
||||||
|
@ -784,7 +782,7 @@ Gitea 创建以下非唯一队列:
|
||||||
|
|
||||||
- `ENABLED`: **true**: 是否允许用户上传附件。
|
- `ENABLED`: **true**: 是否允许用户上传附件。
|
||||||
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`)、mime 类型(`text/plain`)或通配符类型(`image/*`、`audio/*`、`video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。
|
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`)、mime 类型(`text/plain`)或通配符类型(`image/*`、`audio/*`、`video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。
|
||||||
- `MAX_SIZE`: **4**: 附件的最大限制(MB)。
|
- `MAX_SIZE`: **2048**: 附件的最大限制(MB)。
|
||||||
- `MAX_FILES`: **5**: 一次最多上传的附件数量。
|
- `MAX_FILES`: **5**: 一次最多上传的附件数量。
|
||||||
- `STORAGE_TYPE`: **local**: 附件的存储类型,`local` 表示本地磁盘,`minio` 表示兼容 S3 的对象存储服务,如果未设置将使用默认值 `local` 或其他在 `[storage.xxx]` 中定义的名称。
|
- `STORAGE_TYPE`: **local**: 附件的存储类型,`local` 表示本地磁盘,`minio` 表示兼容 S3 的对象存储服务,如果未设置将使用默认值 `local` 或其他在 `[storage.xxx]` 中定义的名称。
|
||||||
- `SERVE_DIRECT`: **false**: 允许存储驱动器重定向到经过身份验证的 URL 以直接提供文件。目前,只支持 Minio/S3 通过签名 URL 提供支持,local 不会执行任何操作。
|
- `SERVE_DIRECT`: **false**: 允许存储驱动器重定向到经过身份验证的 URL 以直接提供文件。目前,只支持 Minio/S3 通过签名 URL 提供支持,local 不会执行任何操作。
|
||||||
|
@ -1040,10 +1038,11 @@ Gitea 创建以下非唯一队列:
|
||||||
|
|
||||||
## API (`api`)
|
## API (`api`)
|
||||||
|
|
||||||
- `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 (`/api/swagger`, `/api/v1/swagger`, …)。
|
- `ENABLE_SWAGGER`: **true**: 启用API文档接口 (`/api/swagger`, `/api/v1/swagger`, …). True or false。
|
||||||
- `MAX_RESPONSE_ITEMS`: **50**: 单个页面的最大 Feed.
|
- `MAX_RESPONSE_ITEMS`: **50**: API分页的最大单页项目数。
|
||||||
- `ENABLE_OPENID_SIGNIN`: **false**: 允许使用OpenID登录,当设置为`true`时可以通过 `/user/login` 页面进行OpenID登录。
|
- `DEFAULT_PAGING_NUM`: **30**: API分页的默认分页数。
|
||||||
- `DISABLE_REGISTRATION`: **false**: 关闭用户注册。
|
- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Git trees API的默认单页项目数。
|
||||||
|
- `DEFAULT_MAX_BLOB_SIZE`: **10485760** (10MiB): blobs API的默认最大文件大小。
|
||||||
|
|
||||||
## OAuth2 (`oauth2`)
|
## OAuth2 (`oauth2`)
|
||||||
|
|
||||||
|
@ -1344,7 +1343,7 @@ PROXY_HOSTS = *.github.com
|
||||||
此外,它要求您将所有所需的操作镜像到您的 Gitea 实例,这可能不值得。
|
此外,它要求您将所有所需的操作镜像到您的 Gitea 实例,这可能不值得。
|
||||||
因此,请仅在您了解自己在做什么的情况下使用 `self`。
|
因此,请仅在您了解自己在做什么的情况下使用 `self`。
|
||||||
|
|
||||||
在早期版本(<= 1.19)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL,例如 `https://gitea.com` 或 `http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`。
|
在早期版本(`<= 1.19`)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL,例如 `https://gitea.com` 或 `http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`。
|
||||||
然而,后来的更新删除了这些选项,现在唯一的选项是 `github` 和 `self`,默认值为 `github`。
|
然而,后来的更新删除了这些选项,现在唯一的选项是 `github` 和 `self`,默认值为 `github`。
|
||||||
但是,如果您想要使用其他 Git 服务器中的操作,您可以在 `uses` 字段中使用完整的 URL,Gitea 支持此功能(GitHub 不支持)。
|
但是,如果您想要使用其他 Git 服务器中的操作,您可以在 `uses` 字段中使用完整的 URL,Gitea 支持此功能(GitHub 不支持)。
|
||||||
例如 `uses: https://gitea.com/actions/checkout@v3` 或 `uses: http://your-git-server/actions/checkout@v3`。
|
例如 `uses: https://gitea.com/actions/checkout@v3` 或 `uses: http://your-git-server/actions/checkout@v3`。
|
||||||
|
|
|
@ -42,11 +42,11 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
|
||||||
|
|
||||||
将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
|
将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
|
||||||
|
|
||||||
举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。
|
举例说明:`image.png` 存放在 `custom/public/assets/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。
|
||||||
|
|
||||||
## 修改默认头像
|
## 修改默认头像
|
||||||
|
|
||||||
替换以下目录中的 png 图片: `custom/public/img/avatar\_default.png`
|
替换以下目录中的 png 图片: `custom/public/assets/img/avatar\_default.png`
|
||||||
|
|
||||||
## 自定义 Gitea 页面
|
## 自定义 Gitea 页面
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ Please note: authentication is only supported when the SMTP server communication
|
||||||
|
|
||||||
- STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it.
|
- STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it.
|
||||||
- SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning.
|
- SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning.
|
||||||
- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.)
|
- Forced SMTPS connection with `PROTOCOL=smtps`. (These are both known as Implicit TLS.)
|
||||||
This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
|
This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
|
||||||
|
|
||||||
Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018.
|
Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018.
|
||||||
|
|
|
@ -55,13 +55,13 @@ PASSWD = `password`
|
||||||
|
|
||||||
要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。
|
要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。
|
||||||
|
|
||||||
有关所有选项的完整列表,请查看[配置速查表](doc/administration/config-cheat-sheet.zh-cn.md)。
|
有关所有选项的完整列表,请查看[配置速查表](administration/config-cheat-sheet.md)。
|
||||||
|
|
||||||
请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行:
|
请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行:
|
||||||
|
|
||||||
- 通过端口 587 的 STARTTLS(也称为 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级为 TLS。
|
- 通过端口 587 的 STARTTLS(也称为 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级为 TLS。
|
||||||
- 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。
|
- 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。
|
||||||
- 使用 `IS_TLS_ENABLED=true` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS)
|
- 使用 `PROTOCOL=smtps` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS)
|
||||||
这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。
|
这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。
|
||||||
|
|
||||||
请注意,自2018年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。
|
请注意,自2018年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。
|
||||||
|
|
|
@ -194,7 +194,7 @@ ALLOW_DATA_URI_IMAGES = true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
将您的样式表添加到自定义目录中,例如 `custom/public/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入:
|
将您的样式表添加到自定义目录中,例如 `custom/public/assets/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />
|
<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />
|
||||||
|
|
|
@ -33,7 +33,7 @@ CERT_FILE = cert.pem
|
||||||
KEY_FILE = key.pem
|
KEY_FILE = key.pem
|
||||||
```
|
```
|
||||||
|
|
||||||
请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](../config-cheat-sheet#server-server)。
|
请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](administration/config-cheat-sheet#server-server)。
|
||||||
|
|
||||||
对于“CERT_FILE”或“KEY_FILE”字段,当文件路径是相对路径时,文件路径相对于“GITEA_CUSTOM”环境变量。它也可以是绝对路径。
|
对于“CERT_FILE”或“KEY_FILE”字段,当文件路径是相对路径时,文件路径相对于“GITEA_CUSTOM”环境变量。它也可以是绝对路径。
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,12 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h
|
||||||
10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event.
|
10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event.
|
||||||
11. Custom event names are recommended to use `ce-` prefix.
|
11. Custom event names are recommended to use `ce-` prefix.
|
||||||
12. Gitea's tailwind-style CSS classes use `gt-` prefix (`gt-relative`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
|
12. Gitea's tailwind-style CSS classes use `gt-` prefix (`gt-relative`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
|
||||||
|
13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided.
|
||||||
|
|
||||||
### Accessibility / ARIA
|
### Accessibility / ARIA
|
||||||
|
|
||||||
In history, Gitea heavily uses Fomantic UI which is not an accessibility-friendly framework.
|
In history, Gitea heavily uses Fomantic UI which is not an accessibility-friendly framework.
|
||||||
Gitea uses some patches to make Fomantic UI more accessible (see the `aria.js` and `aria.md`),
|
Gitea uses some patches to make Fomantic UI more accessible (see `aria.md` and related JS files),
|
||||||
but there are still many problems which need a lot of work and time to fix.
|
but there are still many problems which need a lot of work and time to fix.
|
||||||
|
|
||||||
### Framework Usage
|
### Framework Usage
|
||||||
|
|
|
@ -19,10 +19,7 @@ menu:
|
||||||
|
|
||||||
## Enabling/configuring API access
|
## Enabling/configuring API access
|
||||||
|
|
||||||
By default, `ENABLE_SWAGGER` is true, and
|
By default, `ENABLE_SWAGGER` is true, and `MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat Sheet](administration/config-cheat-sheet.md) for more information.
|
||||||
`MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat
|
|
||||||
Sheet](administration/config-cheat-sheet.md) for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
## Authentication
|
## Authentication
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@ menu:
|
||||||
|
|
||||||
## 开启/配置 API 访问
|
## 开启/配置 API 访问
|
||||||
|
|
||||||
通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat
|
通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。
|
||||||
Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。
|
|
||||||
|
|
||||||
## 通过 API 认证
|
## 通过 API 认证
|
||||||
|
|
||||||
|
|
|
@ -138,9 +138,9 @@ All Gitea instances have the built-in API and there is no way to disable it comp
|
||||||
You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`.
|
You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`.
|
||||||
For more information, refer to Gitea's [API docs](development/api-usage.md).
|
For more information, refer to Gitea's [API docs](development/api-usage.md).
|
||||||
|
|
||||||
You can see the latest API (for example) on <https://try.gitea.io/api/swagger>.
|
You can see the latest API (for example) on https://try.gitea.io/api/swagger
|
||||||
|
|
||||||
You can also see an example of the `swagger.json` file at <https://try.gitea.io/swagger.v1.json>.
|
You can also see an example of the `swagger.json` file at https://try.gitea.io/swagger.v1.json
|
||||||
|
|
||||||
## Adjusting your server for public/private use
|
## Adjusting your server for public/private use
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,9 @@ Gitea不提供内置的Pages服务器。您需要一个专用的域名来提供
|
||||||
但是,您可以在app.ini的api部分将ENABLE_SWAGGER设置为false,以禁用其文档显示。
|
但是,您可以在app.ini的api部分将ENABLE_SWAGGER设置为false,以禁用其文档显示。
|
||||||
有关更多信息,请参阅Gitea的[API文档](development/api-usage.md)。
|
有关更多信息,请参阅Gitea的[API文档](development/api-usage.md)。
|
||||||
|
|
||||||
您可以在上查看最新的API(例如)<https://try.gitea.io/api/swagger>。
|
您可以在上查看最新的API(例如)https://try.gitea.io/api/swagger
|
||||||
|
|
||||||
您还可以在上查看`swagger.json`文件的示例 <https://try.gitea.io/swagger.v1.json>。
|
您还可以在上查看`swagger.json`文件的示例 https://try.gitea.io/swagger.v1.json
|
||||||
|
|
||||||
## 调整服务器用于公共/私有使用
|
## 调整服务器用于公共/私有使用
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ Gitea 目前支持三个官方主题,分别是 `gitea`(亮色)、`arc-gree
|
||||||
|
|
||||||
假设我们的主题是 `arc-blue`(这是一个真实的主题,可以在[此问题](https://github.com/go-gitea/gitea/issues/6011)中找到)
|
假设我们的主题是 `arc-blue`(这是一个真实的主题,可以在[此问题](https://github.com/go-gitea/gitea/issues/6011)中找到)
|
||||||
|
|
||||||
将`.css`文件命名为`theme-arc-blue.css`并将其添加到`custom/public/css`文件夹中
|
将`.css`文件命名为`theme-arc-blue.css`并将其添加到`custom/public/assets/css`文件夹中
|
||||||
|
|
||||||
通过将`arc-blue`添加到`app.ini`中的`THEMES`列表中,允许用户使用该主题
|
通过将`arc-blue`添加到`app.ini`中的`THEMES`列表中,允许用户使用该主题
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,15 @@ menu:
|
||||||
|
|
||||||
# Database Preparation
|
# Database Preparation
|
||||||
|
|
||||||
You need a database to use Gitea. Gitea supports PostgreSQL (>=10), MySQL (>=5.7), SQLite, and MSSQL (>=2008R2 SP3). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter.
|
You need a database to use Gitea. Gitea supports PostgreSQL (>= 12), MySQL (>= 8.0), MariaDB (>= 10.4), SQLite (builtin), and MSSQL (>= 2012 SP4). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter.
|
||||||
|
|
||||||
|
If you use an unsupported database version, please [get in touch](/help/support) with us for information on our Extended Support Contracts. We can provide testing and support for older databases and integrate those fixes into the Gitea codebase.
|
||||||
|
|
||||||
Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database).
|
Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database).
|
||||||
|
|
||||||
Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server application on database instance and client program on your Gitea server. The client program is used to test connection to the database from Gitea server, while Gitea itself use database driver provided by Go to accomplish the same thing. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers.
|
Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server application on database instance and client program on your Gitea server. The client program is used to test connection to the database from Gitea server, while Gitea itself use database driver provided by Go to accomplish the same thing. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers.
|
||||||
|
|
||||||
## MySQL
|
## MySQL/MariaDB
|
||||||
|
|
||||||
1. For remote database setup, you will need to make MySQL listen to your IP address. Edit `bind-address` option on `/etc/mysql/my.cnf` on database instance to:
|
1. For remote database setup, you will need to make MySQL listen to your IP address. Edit `bind-address` option on `/etc/mysql/my.cnf` on database instance to:
|
||||||
|
|
||||||
|
@ -45,7 +47,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SET old_passwords=0;
|
SET old_passwords=0;
|
||||||
CREATE USER 'gitea' IDENTIFIED BY 'gitea';
|
CREATE USER 'gitea'@'%' IDENTIFIED BY 'gitea';
|
||||||
```
|
```
|
||||||
|
|
||||||
For remote database:
|
For remote database:
|
||||||
|
@ -182,7 +184,7 @@ If the communication between Gitea and your database instance is performed throu
|
||||||
- On the database server certificate, one of `Subject Alternative Name` or `Common Name` entries must be the fully-qualified domain name (FQDN) of the database instance (e.g. `db.example.com`). On the database client certificate, one of the entries mentioned above must contain the database username that Gitea will be using to connect.
|
- On the database server certificate, one of `Subject Alternative Name` or `Common Name` entries must be the fully-qualified domain name (FQDN) of the database instance (e.g. `db.example.com`). On the database client certificate, one of the entries mentioned above must contain the database username that Gitea will be using to connect.
|
||||||
- You need domain name mappings of both Gitea and database servers to their respective IP addresses. Either set up DNS records for them or add local mappings to `/etc/hosts` (`%WINDIR%\System32\drivers\etc\hosts` in Windows) on each system. This allows the database connections to be performed by domain name instead of IP address. See documentation of your system for details.
|
- You need domain name mappings of both Gitea and database servers to their respective IP addresses. Either set up DNS records for them or add local mappings to `/etc/hosts` (`%WINDIR%\System32\drivers\etc\hosts` in Windows) on each system. This allows the database connections to be performed by domain name instead of IP address. See documentation of your system for details.
|
||||||
|
|
||||||
### PostgreSQL
|
### PostgreSQL TLS
|
||||||
|
|
||||||
The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both database client and server authenticate each other by sending their respective certificates to their respective opposite for validation. In other words, the server verifies client certificate, and the client verifies server certificate.
|
The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both database client and server authenticate each other by sending their respective certificates to their respective opposite for validation. In other words, the server verifies client certificate, and the client verifies server certificate.
|
||||||
|
|
||||||
|
@ -250,7 +252,7 @@ The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both d
|
||||||
|
|
||||||
You should be prompted to enter password for the database user, and then be connected to the database.
|
You should be prompted to enter password for the database user, and then be connected to the database.
|
||||||
|
|
||||||
### MySQL
|
### MySQL/MariaDB TLS
|
||||||
|
|
||||||
While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details.
|
While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details.
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ menu:
|
||||||
|
|
||||||
注意:以下所有步骤要求您的选择的数据库引擎已安装在您的系统上。对于远程数据库设置,请在数据库实例上安装服务器应用程序,在 Gitea 服务器上安装客户端程序。客户端程序用于测试 Gitea 服务器与数据库之间的连接,而 Gitea 本身使用 Go 提供的数据库驱动程序完成相同的任务。此外,请确保服务器和客户端使用相同的引擎版本,以使某些引擎功能正常工作。出于安全原因,请使用安全密码保护 `root`(MySQL)或 `postgres`(PostgreSQL)数据库超级用户。以下步骤假设您在数据库和 Gitea 服务器上都使用 Linux。
|
注意:以下所有步骤要求您的选择的数据库引擎已安装在您的系统上。对于远程数据库设置,请在数据库实例上安装服务器应用程序,在 Gitea 服务器上安装客户端程序。客户端程序用于测试 Gitea 服务器与数据库之间的连接,而 Gitea 本身使用 Go 提供的数据库驱动程序完成相同的任务。此外,请确保服务器和客户端使用相同的引擎版本,以使某些引擎功能正常工作。出于安全原因,请使用安全密码保护 `root`(MySQL)或 `postgres`(PostgreSQL)数据库超级用户。以下步骤假设您在数据库和 Gitea 服务器上都使用 Linux。
|
||||||
|
|
||||||
## MySQL
|
## MySQL/MariaDB
|
||||||
|
|
||||||
1. 对于远程数据库设置,您需要让 MySQL 监听您的 IP 地址。编辑数据库实例上的 `/etc/mysql/my.cnf` 文件中的 `bind-address` 选项为:
|
1. 对于远程数据库设置,您需要让 MySQL 监听您的 IP 地址。编辑数据库实例上的 `/etc/mysql/my.cnf` 文件中的 `bind-address` 选项为:
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ menu:
|
||||||
- 在数据库服务器证书中,`Subject Alternative Name` 或 `Common Name` 条目之一必须是数据库实例的完全限定域名(FQDN)(例如 `db.example.com`)。在数据库客户端证书中,上述提到的条目之一必须包含 Gitea 将用于连接的数据库用户名。
|
- 在数据库服务器证书中,`Subject Alternative Name` 或 `Common Name` 条目之一必须是数据库实例的完全限定域名(FQDN)(例如 `db.example.com`)。在数据库客户端证书中,上述提到的条目之一必须包含 Gitea 将用于连接的数据库用户名。
|
||||||
- 您需要将 Gitea 和数据库服务器的域名映射到它们各自的 IP 地址。可以为它们设置 DNS 记录,也可以在每个系统上的 `/etc/hosts`(Windows 中的 `%WINDIR%\System32\drivers\etc\hosts`)中添加本地映射。这样可以通过域名而不是 IP 地址进行数据库连接。有关详细信息,请参阅您系统的文档。
|
- 您需要将 Gitea 和数据库服务器的域名映射到它们各自的 IP 地址。可以为它们设置 DNS 记录,也可以在每个系统上的 `/etc/hosts`(Windows 中的 `%WINDIR%\System32\drivers\etc\hosts`)中添加本地映射。这样可以通过域名而不是 IP 地址进行数据库连接。有关详细信息,请参阅您系统的文档。
|
||||||
|
|
||||||
### PostgreSQL
|
### PostgreSQL TLS
|
||||||
|
|
||||||
Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中,数据库客户端和服务器通过将各自的证书发送给对方进行验证来相互认证。换句话说,服务器验证客户端证书,客户端验证服务器证书。
|
Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中,数据库客户端和服务器通过将各自的证书发送给对方进行验证来相互认证。换句话说,服务器验证客户端证书,客户端验证服务器证书。
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中,
|
||||||
|
|
||||||
您将被提示输入数据库用户的密码,然后连接到数据库。
|
您将被提示输入数据库用户的密码,然后连接到数据库。
|
||||||
|
|
||||||
### MySQL
|
### MySQL/MariaDB TLS
|
||||||
|
|
||||||
虽然 Gitea 使用的MySQL驱动程序也支持双向 TLS,但目前 Gitea 仅支持单向 TLS。有关详细信息,请参见工单#10828。
|
虽然 Gitea 使用的MySQL驱动程序也支持双向 TLS,但目前 Gitea 仅支持单向 TLS。有关详细信息,请参见工单#10828。
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ chmod 770 /etc/gitea
|
||||||
- 使用 `gitea generate secret` 创建 `SECRET_KEY` 和 `INTERNAL_TOKEN`
|
- 使用 `gitea generate secret` 创建 `SECRET_KEY` 和 `INTERNAL_TOKEN`
|
||||||
- 提供所有必要的密钥
|
- 提供所有必要的密钥
|
||||||
|
|
||||||
详情参考 [命令行文档](/zh-cn/command-line/) 中有关 `gitea generate secret` 的内容。
|
详情参考 [命令行文档](administration/command-line.md) 中有关 `gitea generate secret` 的内容。
|
||||||
|
|
||||||
### 配置 Gitea 工作路径
|
### 配置 Gitea 工作路径
|
||||||
|
|
||||||
|
@ -209,6 +209,6 @@ remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory
|
||||||
|
|
||||||
如果您没有使用 Gitea 内置的 SSH 服务器,您还需要通过在管理选项中运行任务 `Update the '.ssh/authorized_keys' file with Gitea SSH keys.` 来重新编写授权密钥文件。
|
如果您没有使用 Gitea 内置的 SSH 服务器,您还需要通过在管理选项中运行任务 `Update the '.ssh/authorized_keys' file with Gitea SSH keys.` 来重新编写授权密钥文件。
|
||||||
|
|
||||||
> 更多经验总结,请参考英文版 [Troubleshooting](/en-us/install-from-binary/#troubleshooting)
|
> 更多经验总结,请参考英文版 [Troubleshooting](https://docs.gitea.com/installation/install-from-binary#troubleshooting)
|
||||||
|
|
||||||
如果从本页中没有找到你需要的内容,请访问 [帮助页面](help/support.md)
|
如果从本页中没有找到你需要的内容,请访问 [帮助页面](help/support.md)
|
||||||
|
|
|
@ -128,8 +128,6 @@ If pre-built frontend files are present it is possible to only build the backend
|
||||||
TAGS="bindata" make backend
|
TAGS="bindata" make backend
|
||||||
```
|
```
|
||||||
|
|
||||||
Webpack source maps are by default enabled in development builds and disabled in production builds. They can be enabled by setting the `ENABLE_SOURCEMAP=true` environment variable.
|
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
|
|
||||||
After following the steps above, a `gitea` binary will be available in the working directory.
|
After following the steps above, a `gitea` binary will be available in the working directory.
|
||||||
|
@ -260,3 +258,11 @@ GOARCH=amd64 \
|
||||||
TAGS="bindata sqlite sqlite_unlock_notify" \
|
TAGS="bindata sqlite sqlite_unlock_notify" \
|
||||||
make build
|
make build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Source Maps
|
||||||
|
|
||||||
|
By default, gitea generates reduced source maps for frontend files to conserve space. This can be controlled with the `ENABLE_SOURCEMAP` environment variable:
|
||||||
|
|
||||||
|
- `ENABLE_SOURCEMAP=true` generates all source maps, the default for development builds
|
||||||
|
- `ENABLE_SOURCEMAP=reduced` generates limited source maps, the default for production builds
|
||||||
|
- `ENABLE_SOURCEMAP=false` generates no source maps
|
||||||
|
|
|
@ -64,7 +64,7 @@ git checkout v@version@ # or git checkout pr-xyz
|
||||||
|
|
||||||
- `go` @minGoVersion@ 或更高版本,请参阅 [这里](https://golang.org/dl/)
|
- `go` @minGoVersion@ 或更高版本,请参阅 [这里](https://golang.org/dl/)
|
||||||
- `node` @minNodeVersion@ 或更高版本,并且安装 `npm`, 请参阅 [这里](https://nodejs.org/zh-cn/download/)
|
- `node` @minNodeVersion@ 或更高版本,并且安装 `npm`, 请参阅 [这里](https://nodejs.org/zh-cn/download/)
|
||||||
- `make`, 请参阅 [这里](/zh-cn/hacking-on-gitea/)
|
- `make`, 请参阅 [这里](development/hacking-on-gitea.md)
|
||||||
|
|
||||||
为了尽可能简化编译过程,提供了各种 [make任务](https://github.com/go-gitea/gitea/blob/main/Makefile)。
|
为了尽可能简化编译过程,提供了各种 [make任务](https://github.com/go-gitea/gitea/blob/main/Makefile)。
|
||||||
|
|
||||||
|
@ -100,8 +100,6 @@ TAGS="bindata sqlite sqlite_unlock_notify" make build
|
||||||
TAGS="bindata" make backend
|
TAGS="bindata" make backend
|
||||||
```
|
```
|
||||||
|
|
||||||
在开发构建中,默认启用 Webpack 源映射,在生产构建中禁用。可以通过设置`ENABLE_SOURCEMAP=true`环境变量来启用它们。
|
|
||||||
|
|
||||||
## 测试
|
## 测试
|
||||||
|
|
||||||
按照上述步骤完成后,工作目录中将会有一个`gitea`二进制文件。可以从该目录进行测试,或将其移动到带有测试数据的目录中。当手动从命令行启动 Gitea 时,可以通过按下`Ctrl + C`来停止程序。
|
按照上述步骤完成后,工作目录中将会有一个`gitea`二进制文件。可以从该目录进行测试,或将其移动到带有测试数据的目录中。当手动从命令行启动 Gitea 时,可以通过按下`Ctrl + C`来停止程序。
|
||||||
|
@ -221,3 +219,11 @@ GOARCH=amd64 \
|
||||||
TAGS="bindata sqlite sqlite_unlock_notify" \
|
TAGS="bindata sqlite sqlite_unlock_notify" \
|
||||||
make build
|
make build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 源映射
|
||||||
|
|
||||||
|
默认情况下,gitea 会为前端文件生成精简的源映射以节省空间。 这可以通过“ENABLE_SOURCEMAP”环境变量进行控制:
|
||||||
|
|
||||||
|
- `ENABLE_SOURCEMAP=true` 生成所有源映射,这是开发版本的默认设置
|
||||||
|
- `ENABLE_SOURCEMAP=reduced` 生成有限的源映射,这是生产版本的默认设置
|
||||||
|
- `ENABLE_SOURCEMAP=false` 不生成源映射
|
||||||
|
|
|
@ -114,6 +114,12 @@ If you cannot see the settings page, please make sure that you have the right pe
|
||||||
|
|
||||||
The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`.
|
The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`.
|
||||||
|
|
||||||
|
A registration token can also be obtained from the gitea [command-line interface](administration/command-line.md#actions-generate-runner-token):
|
||||||
|
|
||||||
|
```
|
||||||
|
gitea --config /etc/gitea/app.ini actions generate-runner-token
|
||||||
|
```
|
||||||
|
|
||||||
### Register the runner
|
### Register the runner
|
||||||
|
|
||||||
The act runner can be registered by running the following command:
|
The act runner can be registered by running the following command:
|
||||||
|
@ -262,6 +268,40 @@ The runner will fetch jobs from the Gitea instance and run them automatically.
|
||||||
|
|
||||||
Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly.
|
Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly.
|
||||||
|
|
||||||
|
## Systemd service
|
||||||
|
|
||||||
|
It is also possible to run act-runner as a [systemd](https://en.wikipedia.org/wiki/Systemd) service. Create an unprivileged `act_runner` user on your system, and the following file in `/etc/systemd/system/act_runner.service`. The paths in `ExecStart` and `WorkingDirectory` may need to be adjusted depending on where you installed the `act_runner` binary, its configuration file, and the home directory of the `act_runner` user.
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[Unit]
|
||||||
|
Description=Gitea Actions runner
|
||||||
|
Documentation=https://gitea.com/gitea/act_runner
|
||||||
|
After=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml
|
||||||
|
ExecReload=/bin/kill -s HUP $MAINPID
|
||||||
|
WorkingDirectory=/var/lib/act_runner
|
||||||
|
TimeoutSec=0
|
||||||
|
RestartSec=10
|
||||||
|
Restart=always
|
||||||
|
User=act_runner
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
Then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# load the new systemd unit file
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
# start the service and enable it at boot
|
||||||
|
sudo systemctl enable act_runner --now
|
||||||
|
```
|
||||||
|
|
||||||
|
If using Docker, the `act_runner` user should also be added to the `docker` group before starting the service. Keep in mind that this effectively gives `act_runner` root access to the system [[1]](https://docs.docker.com/engine/security/#docker-daemon-attack-surface).
|
||||||
|
|
||||||
## Configuration variable
|
## Configuration variable
|
||||||
|
|
||||||
You can create configuration variables on the user, organization and repository level.
|
You can create configuration variables on the user, organization and repository level.
|
||||||
|
|
|
@ -113,6 +113,8 @@ Runner级别决定了从哪里获取注册令牌。
|
||||||
|
|
||||||
注册令牌的格式是一个随机字符串 `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`。
|
注册令牌的格式是一个随机字符串 `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`。
|
||||||
|
|
||||||
|
注册令牌也可以通过 Gitea 的 [命令行](administration/command-line.md#actions-generate-runner-token) 获得:
|
||||||
|
|
||||||
### 注册Runner
|
### 注册Runner
|
||||||
|
|
||||||
可以通过运行以下命令来注册Act Runner:
|
可以通过运行以下命令来注册Act Runner:
|
||||||
|
|
|
@ -29,6 +29,10 @@ Like `uses: https://github.com/actions/checkout@v3` or `uses: http://your_gitea.
|
||||||
Gitea Actions supports writing actions in Go.
|
Gitea Actions supports writing actions in Go.
|
||||||
See [Creating Go Actions](https://blog.gitea.com/creating-go-actions/).
|
See [Creating Go Actions](https://blog.gitea.com/creating-go-actions/).
|
||||||
|
|
||||||
|
### Support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly on schedule
|
||||||
|
|
||||||
|
Github Actions doesn't support that. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
|
||||||
|
|
||||||
## Unsupported workflows syntax
|
## Unsupported workflows syntax
|
||||||
|
|
||||||
### `concurrency`
|
### `concurrency`
|
||||||
|
@ -110,14 +114,18 @@ It's ignored by Gitea Actions now.
|
||||||
|
|
||||||
Pre and Post steps don't have their own section in the job log user interface.
|
Pre and Post steps don't have their own section in the job log user interface.
|
||||||
|
|
||||||
|
### Services steps
|
||||||
|
|
||||||
|
Services steps don't have their own section in the job log user interface.
|
||||||
|
|
||||||
## Different behavior
|
## Different behavior
|
||||||
|
|
||||||
### Downloading actions
|
### Downloading actions
|
||||||
|
|
||||||
Previously (Pre 1.21.0), `[actions].DEFAULT_ACTIONS_URL` defaulted to `https://gitea.com`.
|
Previously (Pre 1.21.0), `[actions].DEFAULT_ACTIONS_URL` defaulted to `https://gitea.com`.
|
||||||
We have since restricted this option to only allow two values (`github` and `self`).
|
We have since restricted this option to only allow two values (`github` and `self`).
|
||||||
When set to `github`, the new default, Gitea will download non-fully-qualified actions from <https://github.com>.
|
When set to `github`, the new default, Gitea will download non-fully-qualified actions from `https://github.com`.
|
||||||
For example, if you use `uses: actions/checkout@v3`, it will download the checkout repository from <https://github.com/actions/checkout.git>.
|
For example, if you use `uses: actions/checkout@v3`, it will download the checkout repository from `https://github.com/actions/checkout.git`.
|
||||||
|
|
||||||
If you want to download an action from another git hoster, you can use an absolute URL, e.g. `uses: https://gitea.com/actions/checkout@v3`.
|
If you want to download an action from another git hoster, you can use an absolute URL, e.g. `uses: https://gitea.com/actions/checkout@v3`.
|
||||||
|
|
||||||
|
@ -130,34 +138,3 @@ More details about the `[actions].DEFAULT_ACTIONS_URL` configuration can be foun
|
||||||
|
|
||||||
Context availability is not checked, so you can use the env context on more places.
|
Context availability is not checked, so you can use the env context on more places.
|
||||||
See [Context availability](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability).
|
See [Context availability](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability).
|
||||||
|
|
||||||
## Known issues
|
|
||||||
|
|
||||||
### `docker/build-push-action@v4`
|
|
||||||
|
|
||||||
See [act_runner#119](https://gitea.com/gitea/act_runner/issues/119#issuecomment-738294).
|
|
||||||
|
|
||||||
`ACTIONS_RUNTIME_TOKEN` is a random string in Gitea Actions, not a JWT.
|
|
||||||
But the `docker/build-push-action@v4` tries to parse the token as JWT and doesn't handle the error, so the job fails.
|
|
||||||
|
|
||||||
There are two workarounds:
|
|
||||||
|
|
||||||
Set the `ACTIONS_RUNTIME_TOKEN` to empty manually, like:
|
|
||||||
|
|
||||||
``` yml
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
env:
|
|
||||||
ACTIONS_RUNTIME_TOKEN: ''
|
|
||||||
with:
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
The bug has been fixed in a newer [commit](https://gitea.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba?style=split&whitespace=show-all#diff-1af9a5bdf96ddff3a2f3427ed520b7005e9564ad), but it has not been released. So you could use the latest version by specifying the branch name, like:
|
|
||||||
|
|
||||||
``` yml
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@master
|
|
||||||
with:
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
|
@ -29,6 +29,10 @@ Gitea Actions支持通过URL绝对路径定义actions,这意味着您可以使
|
||||||
Gitea Actions支持使用Go编写Actions。
|
Gitea Actions支持使用Go编写Actions。
|
||||||
请参阅[创建Go Actions](https://blog.gitea.com/creating-go-actions/)。
|
请参阅[创建Go Actions](https://blog.gitea.com/creating-go-actions/)。
|
||||||
|
|
||||||
|
### 支持非标准的调度语法 @yearly, @monthly, @weekly, @daily, @hourly
|
||||||
|
|
||||||
|
Github Actions 不支持这些语法,详见: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
|
||||||
|
|
||||||
## 不支持的工作流语法
|
## 不支持的工作流语法
|
||||||
|
|
||||||
### `concurrency`
|
### `concurrency`
|
||||||
|
@ -116,6 +120,10 @@ Gitea Actions目前不支持此功能。
|
||||||
|
|
||||||
预处理和后处理步骤在Job日志用户界面中没有自己的用户界面。
|
预处理和后处理步骤在Job日志用户界面中没有自己的用户界面。
|
||||||
|
|
||||||
|
### 服务步骤
|
||||||
|
|
||||||
|
服务步骤在Job日志用户界面中没有自己的用户界面。
|
||||||
|
|
||||||
## 不一样的行为
|
## 不一样的行为
|
||||||
|
|
||||||
### 下载Actions
|
### 下载Actions
|
||||||
|
@ -132,34 +140,3 @@ Gitea Actions目前不支持此功能。
|
||||||
|
|
||||||
不检查上下文可用性,因此您可以在更多地方使用env上下文。
|
不检查上下文可用性,因此您可以在更多地方使用env上下文。
|
||||||
请参阅[上下文可用性](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability)。
|
请参阅[上下文可用性](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability)。
|
||||||
|
|
||||||
## 已知问题
|
|
||||||
|
|
||||||
### `docker/build-push-action@v4`
|
|
||||||
|
|
||||||
请参阅[act_runner#119](https://gitea.com/gitea/act_runner/issues/119#issuecomment-738294)。
|
|
||||||
|
|
||||||
`ACTIONS_RUNTIME_TOKEN`在Gitea Actions中是一个随机字符串,而不是JWT。
|
|
||||||
但是`DOCKER/BUILD-PUSH-ACTION@V4尝试将令牌解析为JWT,并且不处理错误,因此Job失败。
|
|
||||||
|
|
||||||
有两种解决方法:
|
|
||||||
|
|
||||||
手动将`ACTIONS_RUNTIME_TOKEN`设置为空字符串,例如:
|
|
||||||
|
|
||||||
``` yml
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
env:
|
|
||||||
ACTIONS_RUNTIME_TOKEN: ''
|
|
||||||
with:
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
该问题已在较新的[提交](https://gitea.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba?style=split&whitespace=show-all#diff-1af9a5bdf96ddff3a2f3427ed520b7005e9564ad)中修复,但尚未发布。因此,您可以通过指定分支名称来使用最新版本,例如:
|
|
||||||
|
|
||||||
``` yml
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@master
|
|
||||||
with:
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ First of all, you need a Gitea instance.
|
||||||
You can follow the [documentation](installation/from-package.md) to set up a new instance or upgrade your existing one.
|
You can follow the [documentation](installation/from-package.md) to set up a new instance or upgrade your existing one.
|
||||||
It doesn't matter how you install or run Gitea, as long as its version is 1.19.0 or higher.
|
It doesn't matter how you install or run Gitea, as long as its version is 1.19.0 or higher.
|
||||||
|
|
||||||
Actions are disabled by default, so you need to add the following to the configuration file to enable it:
|
Since 1.21.0, Actions are enabled by default. If you are using versions before 1.21.0, you need to add the following to the configuration file to enable it:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[actions]
|
[actions]
|
||||||
|
|
|
@ -23,7 +23,7 @@ menu:
|
||||||
您可以按照[文档](installation/from-package.md) 来设置一个新实例或升级现有实例。
|
您可以按照[文档](installation/from-package.md) 来设置一个新实例或升级现有实例。
|
||||||
无论您如何安装或运行Gitea,只要版本号是1.19.0或更高即可。
|
无论您如何安装或运行Gitea,只要版本号是1.19.0或更高即可。
|
||||||
|
|
||||||
默认情况下,Actions是禁用的,因此您需要将以下内容添加到配置文件中以启用它:
|
从1.21.0开始,默认情况下,Actions是启用的。如果您正在使用1.21.0之前的版本,您需要将以下内容添加到配置文件中以启用它:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[actions]
|
[actions]
|
||||||
|
|
|
@ -26,7 +26,7 @@ This can be done by pushing to the branch followed by a specific refspec (a loca
|
||||||
The following example illustrates this:
|
The following example illustrates this:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git push origin HEAD:refs/for/master
|
git push origin HEAD:refs/for/main
|
||||||
```
|
```
|
||||||
|
|
||||||
The command has the following structure:
|
The command has the following structure:
|
||||||
|
@ -42,8 +42,8 @@ The command has the following structure:
|
||||||
- `description`: The PR description
|
- `description`: The PR description
|
||||||
- `force-push`: confirm force update the target branch
|
- `force-push`: confirm force update the target branch
|
||||||
|
|
||||||
Here's another advanced example for creating a new PR targeting `master` with `topic`, `title`, and `description`:
|
Here's another advanced example for creating a new PR targeting `main` with `topic`, `title`, and `description`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok"
|
git push origin HEAD:refs/for/main -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok"
|
||||||
```
|
```
|
||||||
|
|
|
@ -26,7 +26,7 @@ Agit 允许在推送代码到远程仓库时创建 PR(合并请求)。
|
||||||
下面的示例说明了这一点:
|
下面的示例说明了这一点:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git push origin HEAD:refs/for/master
|
git push origin HEAD:refs/for/main
|
||||||
```
|
```
|
||||||
|
|
||||||
该命令的结构如下:
|
该命令的结构如下:
|
||||||
|
@ -42,8 +42,8 @@ git push origin HEAD:refs/for/master
|
||||||
- `description`:PR 的描述
|
- `description`:PR 的描述
|
||||||
- `force-push`:确认强制更新目标分支
|
- `force-push`:确认强制更新目标分支
|
||||||
|
|
||||||
下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `master`:
|
下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `main`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok"
|
git push origin HEAD:refs/for/main -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok"
|
||||||
```
|
```
|
||||||
|
|
|
@ -198,7 +198,7 @@ administrative user.
|
||||||
field is set to `mail.com`, then Gitea will expect the `user email` field
|
field is set to `mail.com`, then Gitea will expect the `user email` field
|
||||||
for an authenticated GIT instance to be `gituser@mail.com`.[^2]
|
for an authenticated GIT instance to be `gituser@mail.com`.[^2]
|
||||||
|
|
||||||
**Note**: PAM support is added via [build-time flags](installation/install-from-source.md#build),
|
**Note**: PAM support is added via [build-time flags](installation/from-source.md#build),
|
||||||
and the official binaries provided do not have this enabled. PAM requires that
|
and the official binaries provided do not have this enabled. PAM requires that
|
||||||
the necessary libpam dynamic library be available and the necessary PAM
|
the necessary libpam dynamic library be available and the necessary PAM
|
||||||
development headers be accessible to the compiler.
|
development headers be accessible to the compiler.
|
||||||
|
|
|
@ -162,7 +162,7 @@ PAM提供了一种机制,通过对用户进行PAM认证来自动将其添加
|
||||||
- PAM电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为gituse的用户,
|
- PAM电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为gituse的用户,
|
||||||
并且将此字段设置为mail.com,那么Gitea在验证一个GIT实例的用户时将期望user emai字段为gituser@mail.com[^2]。
|
并且将此字段设置为mail.com,那么Gitea在验证一个GIT实例的用户时将期望user emai字段为gituser@mail.com[^2]。
|
||||||
|
|
||||||
**Note**: PAM 支持通过[build-time flags](installation/install-from-source.md#build)添加,
|
**Note**: PAM 支持通过[build-time flags](installation/from-source.md#build)添加,
|
||||||
而官方提供的二进制文件通常不会默认启用此功能。PAM需要确保系统上有必要的libpam动态库,并且编译器可以访问必要的PAM开发头文件。
|
而官方提供的二进制文件通常不会默认启用此功能。PAM需要确保系统上有必要的libpam动态库,并且编译器可以访问必要的PAM开发头文件。
|
||||||
|
|
||||||
[^1]: 例如,在Debian "Bullseye"上使用标准Linux登录,可以使用`common-session-noninteractive`。这个值对于其他版本的Debian,
|
[^1]: 例如,在Debian "Bullseye"上使用标准Linux登录,可以使用`common-session-noninteractive`。这个值对于其他版本的Debian,
|
||||||
|
|
|
@ -27,7 +27,7 @@ The following examples use `apt`.
|
||||||
To register the Debian registry add the url to the list of known apt sources:
|
To register the Debian registry add the url to the list of known apt sources:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
||||||
```
|
```
|
||||||
|
|
||||||
| Placeholder | Description |
|
| Placeholder | Description |
|
||||||
|
@ -39,13 +39,13 @@ echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} {
|
||||||
If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication):
|
If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
echo "deb https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
||||||
```
|
```
|
||||||
|
|
||||||
The Debian registry files are signed with a PGP key which must be known to apt:
|
The Debian registry files are signed with a PGP key which must be known to apt:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/trusted.gpg.d/gitea-{owner}.asc
|
sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/keyrings/gitea-{owner}.asc
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards update the local package index:
|
Afterwards update the local package index:
|
||||||
|
|
|
@ -27,7 +27,7 @@ menu:
|
||||||
要注册 Debian 注册表,请将 URL 添加到已知 `apt` 源列表中:
|
要注册 Debian 注册表,请将 URL 添加到已知 `apt` 源列表中:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
||||||
```
|
```
|
||||||
|
|
||||||
| 占位符 | 描述 |
|
| 占位符 | 描述 |
|
||||||
|
@ -39,13 +39,13 @@ echo "deb https://gitea.example.com/api/packages/{owner}/debian {distribution} {
|
||||||
如果注册表是私有的,请在 URL 中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证):
|
如果注册表是私有的,请在 URL 中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
echo "deb https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
|
||||||
```
|
```
|
||||||
|
|
||||||
Debian 注册表文件使用 PGP 密钥进行签名,`apt` 必须知道该密钥:
|
Debian 注册表文件使用 PGP 密钥进行签名,`apt` 必须知道该密钥:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/trusted.gpg.d/gitea-{owner}.asc
|
sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/keyrings/gitea-{owner}.asc
|
||||||
```
|
```
|
||||||
|
|
||||||
然后更新本地软件包索引:
|
然后更新本地软件包索引:
|
||||||
|
|
148
go.mod
148
go.mod
|
@ -4,8 +4,8 @@ go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.gitea.io/actions-proto-go v0.3.1
|
code.gitea.io/actions-proto-go v0.3.1
|
||||||
code.gitea.io/gitea-vet v0.2.2
|
code.gitea.io/gitea-vet v0.2.3
|
||||||
code.gitea.io/sdk/gitea v0.15.1
|
code.gitea.io/sdk/gitea v0.16.0
|
||||||
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
|
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
|
||||||
gitea.com/go-chi/binding v0.0.0-20230415142243-04b515c6d669
|
gitea.com/go-chi/binding v0.0.0-20230415142243-04b515c6d669
|
||||||
gitea.com/go-chi/cache v0.2.0
|
gitea.com/go-chi/cache v0.2.0
|
||||||
|
@ -17,9 +17,9 @@ require (
|
||||||
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
|
||||||
github.com/NYTimes/gziphandler v1.1.1
|
github.com/NYTimes/gziphandler v1.1.1
|
||||||
github.com/PuerkitoBio/goquery v1.8.1
|
github.com/PuerkitoBio/goquery v1.8.1
|
||||||
github.com/alecthomas/chroma/v2 v2.9.1
|
github.com/alecthomas/chroma/v2 v2.10.0
|
||||||
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
||||||
github.com/blevesearch/bleve/v2 v2.3.9
|
github.com/blevesearch/bleve/v2 v2.3.10
|
||||||
github.com/bufbuild/connect-go v1.10.0
|
github.com/bufbuild/connect-go v1.10.0
|
||||||
github.com/buildkite/terminal-to-html/v3 v3.9.1
|
github.com/buildkite/terminal-to-html/v3 v3.9.1
|
||||||
github.com/caddyserver/certmagic v0.19.2
|
github.com/caddyserver/certmagic v0.19.2
|
||||||
|
@ -30,23 +30,23 @@ require (
|
||||||
github.com/djherbis/nio/v3 v3.0.1
|
github.com/djherbis/nio/v3 v3.0.1
|
||||||
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
|
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
|
||||||
github.com/dustin/go-humanize v1.0.1
|
github.com/dustin/go-humanize v1.0.1
|
||||||
github.com/editorconfig/editorconfig-core-go/v2 v2.5.2
|
github.com/editorconfig/editorconfig-core-go/v2 v2.6.0
|
||||||
github.com/emersion/go-imap v1.2.1
|
github.com/emersion/go-imap v1.2.1
|
||||||
github.com/emirpasic/gods v1.18.1
|
github.com/emirpasic/gods v1.18.1
|
||||||
github.com/ethantkoenig/rupture v1.0.1
|
github.com/ethantkoenig/rupture v1.0.1
|
||||||
github.com/felixge/fgprof v0.9.3
|
github.com/felixge/fgprof v0.9.3
|
||||||
github.com/fsnotify/fsnotify v1.6.0
|
github.com/fsnotify/fsnotify v1.6.0
|
||||||
github.com/gliderlabs/ssh v0.3.5
|
github.com/gliderlabs/ssh v0.3.5
|
||||||
github.com/go-ap/activitypub v0.0.0-20230807182453-602f717f6ca3
|
github.com/go-ap/activitypub v0.0.0-20231003111253-1fba3772399b
|
||||||
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
|
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
|
||||||
github.com/go-chi/chi/v5 v5.0.10
|
github.com/go-chi/chi/v5 v5.0.10
|
||||||
github.com/go-chi/cors v1.2.1
|
github.com/go-chi/cors v1.2.1
|
||||||
github.com/go-co-op/gocron v1.31.1
|
github.com/go-co-op/gocron v1.31.1
|
||||||
github.com/go-enry/go-enry/v2 v2.8.4
|
github.com/go-enry/go-enry/v2 v2.8.6
|
||||||
github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e
|
github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e
|
||||||
github.com/go-git/go-billy/v5 v5.4.1
|
github.com/go-git/go-billy/v5 v5.5.0
|
||||||
github.com/go-git/go-git/v5 v5.8.1
|
github.com/go-git/go-git/v5 v5.11.0
|
||||||
github.com/go-ldap/ldap/v3 v3.4.5
|
github.com/go-ldap/ldap/v3 v3.4.6
|
||||||
github.com/go-sql-driver/mysql v1.7.1
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
github.com/go-swagger/go-swagger v0.30.5
|
github.com/go-swagger/go-swagger v0.30.5
|
||||||
github.com/go-testfixtures/testfixtures/v3 v3.9.0
|
github.com/go-testfixtures/testfixtures/v3 v3.9.0
|
||||||
|
@ -56,40 +56,40 @@ require (
|
||||||
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
|
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
|
||||||
github.com/golang-jwt/jwt/v5 v5.0.0
|
github.com/golang-jwt/jwt/v5 v5.0.0
|
||||||
github.com/google/go-github/v53 v53.2.0
|
github.com/google/go-github/v53 v53.2.0
|
||||||
github.com/google/pprof v0.0.0-20230901174712-0191c66da455
|
github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98
|
||||||
github.com/google/uuid v1.3.1
|
github.com/google/uuid v1.3.1
|
||||||
github.com/gorilla/feeds v1.1.1
|
github.com/gorilla/feeds v1.1.1
|
||||||
github.com/gorilla/sessions v1.2.1
|
github.com/gorilla/sessions v1.2.1
|
||||||
github.com/hashicorp/go-version v1.6.0
|
github.com/hashicorp/go-version v1.6.0
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.6
|
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||||
github.com/huandu/xstrings v1.4.0
|
github.com/huandu/xstrings v1.4.0
|
||||||
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
|
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
|
||||||
github.com/jhillyerd/enmime v1.0.0
|
github.com/jhillyerd/enmime v1.0.1
|
||||||
github.com/json-iterator/go v1.1.12
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||||
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
|
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
|
||||||
github.com/klauspost/compress v1.16.7
|
github.com/klauspost/compress v1.17.0
|
||||||
github.com/klauspost/cpuid/v2 v2.2.5
|
github.com/klauspost/cpuid/v2 v2.2.5
|
||||||
github.com/lib/pq v1.10.9
|
github.com/lib/pq v1.10.9
|
||||||
github.com/markbates/goth v1.77.0
|
github.com/markbates/goth v1.78.0
|
||||||
github.com/mattn/go-isatty v0.0.19
|
github.com/mattn/go-isatty v0.0.19
|
||||||
github.com/mattn/go-sqlite3 v1.14.17
|
github.com/mattn/go-sqlite3 v1.14.17
|
||||||
github.com/meilisearch/meilisearch-go v0.25.0
|
github.com/meilisearch/meilisearch-go v0.25.1
|
||||||
github.com/mholt/archiver/v3 v3.5.1
|
github.com/mholt/archiver/v3 v3.5.1
|
||||||
github.com/microcosm-cc/bluemonday v1.0.25
|
github.com/microcosm-cc/bluemonday v1.0.26
|
||||||
github.com/minio/minio-go/v7 v7.0.63
|
github.com/minio/minio-go/v7 v7.0.63
|
||||||
github.com/minio/sha256-simd v1.0.1
|
github.com/minio/sha256-simd v1.0.1
|
||||||
github.com/msteinert/pam v1.1.0
|
github.com/msteinert/pam v1.2.0
|
||||||
github.com/nektos/act v0.2.48
|
github.com/nektos/act v0.2.52
|
||||||
github.com/niklasfasching/go-org v1.7.0
|
github.com/niklasfasching/go-org v1.7.0
|
||||||
github.com/olivere/elastic/v7 v7.0.32
|
github.com/olivere/elastic/v7 v7.0.32
|
||||||
github.com/opencontainers/go-digest v1.0.0
|
github.com/opencontainers/go-digest v1.0.0
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc4
|
github.com/opencontainers/image-spec v1.1.0-rc5
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/pquerna/otp v1.4.0
|
github.com/pquerna/otp v1.4.0
|
||||||
github.com/prometheus/client_golang v1.16.0
|
github.com/prometheus/client_golang v1.17.0
|
||||||
github.com/quasoft/websspi v1.1.2
|
github.com/quasoft/websspi v1.1.2
|
||||||
github.com/redis/go-redis/v9 v9.1.0
|
github.com/redis/go-redis/v9 v9.2.1
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
|
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
|
||||||
github.com/sassoftware/go-rpmutils v0.2.0
|
github.com/sassoftware/go-rpmutils v0.2.0
|
||||||
|
@ -100,20 +100,20 @@ require (
|
||||||
github.com/tstranex/u2f v1.0.0
|
github.com/tstranex/u2f v1.0.0
|
||||||
github.com/ulikunitz/xz v0.5.11
|
github.com/ulikunitz/xz v0.5.11
|
||||||
github.com/urfave/cli/v2 v2.25.7
|
github.com/urfave/cli/v2 v2.25.7
|
||||||
github.com/xanzy/go-gitlab v0.91.0
|
github.com/xanzy/go-gitlab v0.93.1
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0
|
github.com/xeipuuv/gojsonschema v1.2.0
|
||||||
github.com/yohcop/openid-go v1.0.1
|
github.com/yohcop/openid-go v1.0.1
|
||||||
github.com/yuin/goldmark v1.5.6
|
github.com/yuin/goldmark v1.5.6
|
||||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
||||||
github.com/yuin/goldmark-meta v1.1.0
|
github.com/yuin/goldmark-meta v1.1.0
|
||||||
golang.org/x/crypto v0.12.0
|
golang.org/x/crypto v0.18.0
|
||||||
golang.org/x/image v0.11.0
|
golang.org/x/image v0.13.0
|
||||||
golang.org/x/net v0.14.0
|
golang.org/x/net v0.20.0
|
||||||
golang.org/x/oauth2 v0.11.0
|
golang.org/x/oauth2 v0.13.0
|
||||||
golang.org/x/sys v0.12.0
|
golang.org/x/sys v0.16.0
|
||||||
golang.org/x/text v0.13.0
|
golang.org/x/text v0.14.0
|
||||||
golang.org/x/tools v0.12.0
|
golang.org/x/tools v0.17.0
|
||||||
google.golang.org/grpc v1.57.0
|
google.golang.org/grpc v1.58.3
|
||||||
google.golang.org/protobuf v1.31.0
|
google.golang.org/protobuf v1.31.0
|
||||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
||||||
gopkg.in/ini.v1 v1.67.0
|
gopkg.in/ini.v1 v1.67.0
|
||||||
|
@ -121,64 +121,65 @@ require (
|
||||||
mvdan.cc/xurls/v2 v2.5.0
|
mvdan.cc/xurls/v2 v2.5.0
|
||||||
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
|
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
|
||||||
xorm.io/builder v0.3.13
|
xorm.io/builder v0.3.13
|
||||||
xorm.io/xorm v1.3.3-0.20230725140238-59b727260d35
|
xorm.io/xorm v1.3.7
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute v1.23.0 // indirect
|
cloud.google.com/go/compute v1.23.1 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
dario.cat/mergo v1.0.0 // indirect
|
dario.cat/mergo v1.0.0 // indirect
|
||||||
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
|
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
|
||||||
github.com/ClickHouse/ch-go v0.58.2 // indirect
|
github.com/ClickHouse/ch-go v0.58.2 // indirect
|
||||||
github.com/ClickHouse/clickhouse-go/v2 v2.13.4 // indirect
|
github.com/ClickHouse/clickhouse-go/v2 v2.14.3 // indirect
|
||||||
github.com/DataDog/zstd v1.5.5 // indirect
|
github.com/DataDog/zstd v1.5.5 // indirect
|
||||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||||
github.com/Masterminds/semver/v3 v3.2.1 // indirect
|
github.com/Masterminds/semver/v3 v3.2.1 // indirect
|
||||||
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
|
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
|
github.com/ProtonMail/go-crypto v1.0.0 // indirect
|
||||||
github.com/RoaringBitmap/roaring v1.5.0 // indirect
|
github.com/RoaringBitmap/roaring v1.6.0 // indirect
|
||||||
github.com/acomagu/bufpipe v1.0.4 // indirect
|
|
||||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||||
github.com/andybalholm/cascadia v1.3.2 // indirect
|
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
|
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||||
github.com/aymerick/douceur v0.2.0 // indirect
|
github.com/aymerick/douceur v0.2.0 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.8.0 // indirect
|
github.com/bits-and-blooms/bitset v1.9.0 // indirect
|
||||||
github.com/blevesearch/bleve_index_api v1.0.5 // indirect
|
github.com/blevesearch/bleve_index_api v1.0.6 // indirect
|
||||||
github.com/blevesearch/geo v0.1.17 // indirect
|
github.com/blevesearch/geo v0.1.18 // indirect
|
||||||
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
|
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
|
||||||
github.com/blevesearch/gtreap v0.1.1 // indirect
|
github.com/blevesearch/gtreap v0.1.1 // indirect
|
||||||
github.com/blevesearch/mmap-go v1.0.4 // indirect
|
github.com/blevesearch/mmap-go v1.0.4 // indirect
|
||||||
github.com/blevesearch/scorch_segment_api/v2 v2.1.5 // indirect
|
github.com/blevesearch/scorch_segment_api/v2 v2.1.6 // indirect
|
||||||
github.com/blevesearch/segment v0.9.1 // indirect
|
github.com/blevesearch/segment v0.9.1 // indirect
|
||||||
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
||||||
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
|
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
|
||||||
github.com/blevesearch/vellum v1.0.10 // indirect
|
github.com/blevesearch/vellum v1.0.10 // indirect
|
||||||
github.com/blevesearch/zapx/v11 v11.3.9 // indirect
|
github.com/blevesearch/zapx/v11 v11.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v12 v12.3.9 // indirect
|
github.com/blevesearch/zapx/v12 v12.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v13 v13.3.9 // indirect
|
github.com/blevesearch/zapx/v13 v13.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v14 v14.3.9 // indirect
|
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v15 v15.3.12 // indirect
|
github.com/blevesearch/zapx/v15 v15.3.13 // indirect
|
||||||
github.com/boombuler/barcode v1.0.1 // indirect
|
github.com/boombuler/barcode v1.0.1 // indirect
|
||||||
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285 // indirect
|
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
|
||||||
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
|
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/cloudflare/circl v1.3.3 // indirect
|
github.com/cloudflare/circl v1.3.7 // indirect
|
||||||
github.com/couchbase/go-couchbase v0.1.1 // indirect
|
github.com/couchbase/go-couchbase v0.1.1 // indirect
|
||||||
github.com/couchbase/gomemcached v0.2.1 // indirect
|
github.com/couchbase/gomemcached v0.2.1 // indirect
|
||||||
github.com/couchbase/goutils v0.1.2 // indirect
|
github.com/couchbase/goutils v0.1.2 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
|
github.com/davidmz/go-pageant v1.0.2 // indirect
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
github.com/dlclark/regexp2 v1.10.0 // indirect
|
github.com/dlclark/regexp2 v1.10.0 // indirect
|
||||||
github.com/emersion/go-sasl v0.0.0-20220912192320-0145f2c60ead // indirect
|
github.com/emersion/go-sasl v0.0.0-20220912192320-0145f2c60ead // indirect
|
||||||
github.com/fatih/color v1.15.0 // indirect
|
github.com/fatih/color v1.15.0 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||||
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
|
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
|
||||||
github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea // indirect
|
github.com/go-ap/errors v0.0.0-20231003111023-183eef4b31b7 // indirect
|
||||||
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
|
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
|
||||||
github.com/go-enry/go-oniguruma v1.2.1 // indirect
|
github.com/go-enry/go-oniguruma v1.2.1 // indirect
|
||||||
github.com/go-faster/city v1.0.1 // indirect
|
github.com/go-faster/city v1.0.1 // indirect
|
||||||
github.com/go-faster/errors v0.6.1 // indirect
|
github.com/go-faster/errors v0.6.1 // indirect
|
||||||
|
@ -209,9 +210,7 @@ require (
|
||||||
github.com/gorilla/handlers v1.5.1 // indirect
|
github.com/gorilla/handlers v1.5.1 // indirect
|
||||||
github.com/gorilla/mux v1.8.0 // indirect
|
github.com/gorilla/mux v1.8.0 // indirect
|
||||||
github.com/gorilla/securecookie v1.1.1 // indirect
|
github.com/gorilla/securecookie v1.1.1 // indirect
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
|
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/imdario/mergo v0.3.16 // indirect
|
github.com/imdario/mergo v0.3.16 // indirect
|
||||||
|
@ -230,7 +229,7 @@ require (
|
||||||
github.com/mattn/go-runewidth v0.0.15 // indirect
|
github.com/mattn/go-runewidth v0.0.15 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||||
github.com/mholt/acmez v1.2.0 // indirect
|
github.com/mholt/acmez v1.2.0 // indirect
|
||||||
github.com/miekg/dns v1.1.55 // indirect
|
github.com/miekg/dns v1.1.56 // indirect
|
||||||
github.com/minio/md5-simd v1.1.2 // indirect
|
github.com/minio/md5-simd v1.1.2 // indirect
|
||||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
|
@ -243,37 +242,37 @@ require (
|
||||||
github.com/oklog/ulid v1.3.1 // indirect
|
github.com/oklog/ulid v1.3.1 // indirect
|
||||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||||
github.com/onsi/gomega v1.27.8 // indirect
|
|
||||||
github.com/paulmach/orb v0.10.0 // indirect
|
github.com/paulmach/orb v0.10.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
||||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/prometheus/client_model v0.4.0 // indirect
|
github.com/prometheus/client_model v0.5.0 // indirect
|
||||||
github.com/prometheus/common v0.44.0 // indirect
|
github.com/prometheus/common v0.44.0 // indirect
|
||||||
github.com/prometheus/procfs v0.11.1 // indirect
|
github.com/prometheus/procfs v0.12.0 // indirect
|
||||||
github.com/rhysd/actionlint v1.6.25 // indirect
|
github.com/rhysd/actionlint v1.6.26 // indirect
|
||||||
github.com/rivo/uniseg v0.4.4 // indirect
|
github.com/rivo/uniseg v0.4.4 // indirect
|
||||||
github.com/robfig/cron v1.2.0 // indirect
|
|
||||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||||
github.com/rs/xid v1.5.0 // indirect
|
github.com/rs/xid v1.5.0 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
|
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
||||||
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/segmentio/asm v1.2.0 // indirect
|
github.com/segmentio/asm v1.2.0 // indirect
|
||||||
github.com/shopspring/decimal v1.3.1 // indirect
|
github.com/shopspring/decimal v1.3.1 // indirect
|
||||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
||||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||||
github.com/skeema/knownhosts v1.2.0 // indirect
|
github.com/skeema/knownhosts v1.2.1 // indirect
|
||||||
github.com/spf13/afero v1.9.5 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
|
github.com/spf13/afero v1.10.0 // indirect
|
||||||
github.com/spf13/cast v1.5.1 // indirect
|
github.com/spf13/cast v1.5.1 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/spf13/viper v1.16.0 // indirect
|
github.com/spf13/viper v1.17.0 // indirect
|
||||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
|
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/toqueteos/webbrowser v1.2.0 // indirect
|
github.com/toqueteos/webbrowser v1.2.0 // indirect
|
||||||
github.com/unknwon/com v1.0.1 // indirect
|
github.com/unknwon/com v1.0.1 // indirect
|
||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
github.com/valyala/fasthttp v1.49.0 // indirect
|
github.com/valyala/fasthttp v1.50.0 // indirect
|
||||||
github.com/valyala/fastjson v1.6.4 // indirect
|
github.com/valyala/fastjson v1.6.4 // indirect
|
||||||
github.com/x448/float16 v0.8.4 // indirect
|
github.com/x448/float16 v0.8.4 // indirect
|
||||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||||
|
@ -284,16 +283,17 @@ require (
|
||||||
github.com/zeebo/blake3 v0.2.3 // indirect
|
github.com/zeebo/blake3 v0.2.3 // indirect
|
||||||
go.etcd.io/bbolt v1.3.7 // indirect
|
go.etcd.io/bbolt v1.3.7 // indirect
|
||||||
go.mongodb.org/mongo-driver v1.12.1 // indirect
|
go.mongodb.org/mongo-driver v1.12.1 // indirect
|
||||||
go.opentelemetry.io/otel v1.17.0 // indirect
|
go.opentelemetry.io/otel v1.19.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.17.0 // indirect
|
go.opentelemetry.io/otel/trace v1.19.0 // indirect
|
||||||
go.uber.org/atomic v1.11.0 // indirect
|
go.uber.org/atomic v1.11.0 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
go.uber.org/zap v1.25.0 // indirect
|
go.uber.org/zap v1.26.0 // indirect
|
||||||
golang.org/x/mod v0.12.0 // indirect
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||||
golang.org/x/sync v0.3.0 // indirect
|
golang.org/x/mod v0.14.0 // indirect
|
||||||
|
golang.org/x/sync v0.6.0 // indirect
|
||||||
golang.org/x/time v0.3.0 // indirect
|
golang.org/x/time v0.3.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.8 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
|
@ -303,7 +303,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
|
||||||
|
|
||||||
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
|
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
|
||||||
|
|
||||||
replace github.com/nektos/act => gitea.com/gitea/act v0.243.4
|
replace github.com/nektos/act => gitea.com/gitea/act v0.2.51
|
||||||
|
|
||||||
exclude github.com/gofrs/uuid v3.2.0+incompatible
|
exclude github.com/gofrs/uuid v3.2.0+incompatible
|
||||||
|
|
||||||
|
|
|
@ -168,13 +168,14 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err
|
||||||
}
|
}
|
||||||
|
|
||||||
// CancelRunningJobs cancels all running and waiting jobs associated with a specific workflow.
|
// CancelRunningJobs cancels all running and waiting jobs associated with a specific workflow.
|
||||||
func CancelRunningJobs(ctx context.Context, repoID int64, ref, workflowID string) error {
|
func CancelRunningJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
|
||||||
// Find all runs in the specified repository, reference, and workflow with statuses 'Running' or 'Waiting'.
|
// Find all runs in the specified repository, reference, and workflow with statuses 'Running' or 'Waiting'.
|
||||||
runs, total, err := FindRuns(ctx, FindRunOptions{
|
runs, total, err := FindRuns(ctx, FindRunOptions{
|
||||||
RepoID: repoID,
|
RepoID: repoID,
|
||||||
Ref: ref,
|
Ref: ref,
|
||||||
WorkflowID: workflowID,
|
WorkflowID: workflowID,
|
||||||
Status: []Status{StatusRunning, StatusWaiting},
|
TriggerEvent: event,
|
||||||
|
Status: []Status{StatusRunning, StatusWaiting},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
repo_model "code.gitea.io/gitea/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
|
webhook_module "code.gitea.io/gitea/modules/webhook"
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
)
|
)
|
||||||
|
@ -71,6 +72,7 @@ type FindRunOptions struct {
|
||||||
WorkflowID string
|
WorkflowID string
|
||||||
Ref string // the commit/tag/… that caused this workflow
|
Ref string // the commit/tag/… that caused this workflow
|
||||||
TriggerUserID int64
|
TriggerUserID int64
|
||||||
|
TriggerEvent webhook_module.HookEventType
|
||||||
Approved bool // not util.OptionalBool, it works only when it's true
|
Approved bool // not util.OptionalBool, it works only when it's true
|
||||||
Status []Status
|
Status []Status
|
||||||
}
|
}
|
||||||
|
@ -98,6 +100,9 @@ func (opts FindRunOptions) toConds() builder.Cond {
|
||||||
if opts.Ref != "" {
|
if opts.Ref != "" {
|
||||||
cond = cond.And(builder.Eq{"ref": opts.Ref})
|
cond = cond.And(builder.Eq{"ref": opts.Ref})
|
||||||
}
|
}
|
||||||
|
if opts.TriggerEvent != "" {
|
||||||
|
cond = cond.And(builder.Eq{"trigger_event": opts.TriggerEvent})
|
||||||
|
}
|
||||||
return cond
|
return cond
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,11 @@ type ActionRunner struct {
|
||||||
Deleted timeutil.TimeStamp `xorm:"deleted"`
|
Deleted timeutil.TimeStamp `xorm:"deleted"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
RunnerOfflineTime = time.Minute
|
||||||
|
RunnerIdleTime = 10 * time.Second
|
||||||
|
)
|
||||||
|
|
||||||
// BelongsToOwnerName before calling, should guarantee that all attributes are loaded
|
// BelongsToOwnerName before calling, should guarantee that all attributes are loaded
|
||||||
func (r *ActionRunner) BelongsToOwnerName() string {
|
func (r *ActionRunner) BelongsToOwnerName() string {
|
||||||
if r.RepoID != 0 {
|
if r.RepoID != 0 {
|
||||||
|
@ -76,11 +81,12 @@ func (r *ActionRunner) BelongsToOwnerType() types.OwnerType {
|
||||||
return types.OwnerTypeSystemGlobal
|
return types.OwnerTypeSystemGlobal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the logic here changed, you should also modify FindRunnerOptions.ToCond
|
||||||
func (r *ActionRunner) Status() runnerv1.RunnerStatus {
|
func (r *ActionRunner) Status() runnerv1.RunnerStatus {
|
||||||
if time.Since(r.LastOnline.AsTime()) > time.Minute {
|
if time.Since(r.LastOnline.AsTime()) > RunnerOfflineTime {
|
||||||
return runnerv1.RunnerStatus_RUNNER_STATUS_OFFLINE
|
return runnerv1.RunnerStatus_RUNNER_STATUS_OFFLINE
|
||||||
}
|
}
|
||||||
if time.Since(r.LastActive.AsTime()) > 10*time.Second {
|
if time.Since(r.LastActive.AsTime()) > RunnerIdleTime {
|
||||||
return runnerv1.RunnerStatus_RUNNER_STATUS_IDLE
|
return runnerv1.RunnerStatus_RUNNER_STATUS_IDLE
|
||||||
}
|
}
|
||||||
return runnerv1.RunnerStatus_RUNNER_STATUS_ACTIVE
|
return runnerv1.RunnerStatus_RUNNER_STATUS_ACTIVE
|
||||||
|
@ -153,6 +159,7 @@ type FindRunnerOptions struct {
|
||||||
OwnerID int64
|
OwnerID int64
|
||||||
Sort string
|
Sort string
|
||||||
Filter string
|
Filter string
|
||||||
|
IsOnline util.OptionalBool
|
||||||
WithAvailable bool // not only runners belong to, but also runners can be used
|
WithAvailable bool // not only runners belong to, but also runners can be used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +185,12 @@ func (opts FindRunnerOptions) toCond() builder.Cond {
|
||||||
if opts.Filter != "" {
|
if opts.Filter != "" {
|
||||||
cond = cond.And(builder.Like{"name", opts.Filter})
|
cond = cond.And(builder.Like{"name", opts.Filter})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if opts.IsOnline.IsTrue() {
|
||||||
|
cond = cond.And(builder.Gt{"last_online": time.Now().Add(-RunnerOfflineTime).Unix()})
|
||||||
|
} else if opts.IsOnline.IsFalse() {
|
||||||
|
cond = cond.And(builder.Lte{"last_online": time.Now().Add(-RunnerOfflineTime).Unix()})
|
||||||
|
}
|
||||||
return cond
|
return cond
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,3 +279,27 @@ func CreateRunner(ctx context.Context, t *ActionRunner) error {
|
||||||
_, err := db.GetEngine(ctx).Insert(t)
|
_, err := db.GetEngine(ctx).Insert(t)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CountRunnersWithoutBelongingOwner(ctx context.Context) (int64, error) {
|
||||||
|
// Only affect action runners were a owner ID is set, as actions runners
|
||||||
|
// could also be created on a repository.
|
||||||
|
return db.GetEngine(ctx).Table("action_runner").
|
||||||
|
Join("LEFT", "user", "`action_runner`.owner_id = `user`.id").
|
||||||
|
Where("`action_runner`.owner_id != ?", 0).
|
||||||
|
And(builder.IsNull{"`user`.id"}).
|
||||||
|
Count(new(ActionRunner))
|
||||||
|
}
|
||||||
|
|
||||||
|
func FixRunnersWithoutBelongingOwner(ctx context.Context) (int64, error) {
|
||||||
|
subQuery := builder.Select("`action_runner`.id").
|
||||||
|
From("`action_runner`").
|
||||||
|
Join("LEFT", "user", "`action_runner`.owner_id = `user`.id").
|
||||||
|
Where(builder.Neq{"`action_runner`.owner_id": 0}).
|
||||||
|
And(builder.IsNull{"`user`.id"})
|
||||||
|
b := builder.Delete(builder.In("id", subQuery)).From("`action_runner`")
|
||||||
|
res, err := db.GetEngine(ctx).Exec(b)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
return res.RowsAffected()
|
||||||
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ type ActionRunnerToken struct {
|
||||||
Owner *user_model.User `xorm:"-"`
|
Owner *user_model.User `xorm:"-"`
|
||||||
RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global
|
RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global
|
||||||
Repo *repo_model.Repository `xorm:"-"`
|
Repo *repo_model.Repository `xorm:"-"`
|
||||||
IsActive bool
|
IsActive bool // true means it can be used
|
||||||
|
|
||||||
Created timeutil.TimeStamp `xorm:"created"`
|
Created timeutil.TimeStamp `xorm:"created"`
|
||||||
Updated timeutil.TimeStamp `xorm:"updated"`
|
Updated timeutil.TimeStamp `xorm:"updated"`
|
||||||
|
@ -57,7 +57,7 @@ func UpdateRunnerToken(ctx context.Context, r *ActionRunnerToken, cols ...string
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRunnerToken creates a new runner token
|
// NewRunnerToken creates a new active runner token and invalidate all old tokens
|
||||||
func NewRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerToken, error) {
|
func NewRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerToken, error) {
|
||||||
token, err := util.CryptoRandomString(40)
|
token, err := util.CryptoRandomString(40)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -66,17 +66,27 @@ func NewRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerTo
|
||||||
runnerToken := &ActionRunnerToken{
|
runnerToken := &ActionRunnerToken{
|
||||||
OwnerID: ownerID,
|
OwnerID: ownerID,
|
||||||
RepoID: repoID,
|
RepoID: repoID,
|
||||||
IsActive: false,
|
IsActive: true,
|
||||||
Token: token,
|
Token: token,
|
||||||
}
|
}
|
||||||
_, err = db.GetEngine(ctx).Insert(runnerToken)
|
|
||||||
return runnerToken, err
|
return runnerToken, db.WithTx(ctx, func(ctx context.Context) error {
|
||||||
|
if _, err := db.GetEngine(ctx).Where("owner_id =? AND repo_id = ?", ownerID, repoID).Cols("is_active").Update(&ActionRunnerToken{
|
||||||
|
IsActive: false,
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = db.GetEngine(ctx).Insert(runnerToken)
|
||||||
|
return err
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUnactivatedRunnerToken returns a unactivated runner token
|
// GetLastestRunnerToken returns the latest runner token
|
||||||
func GetUnactivatedRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerToken, error) {
|
func GetLastestRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerToken, error) {
|
||||||
var runnerToken ActionRunnerToken
|
var runnerToken ActionRunnerToken
|
||||||
has, err := db.GetEngine(ctx).Where("owner_id=? AND repo_id=? AND is_active=?", ownerID, repoID, false).OrderBy("id DESC").Get(&runnerToken)
|
has, err := db.GetEngine(ctx).Where("owner_id=? AND repo_id=?", ownerID, repoID).
|
||||||
|
OrderBy("id DESC").Get(&runnerToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if !has {
|
} else if !has {
|
||||||
|
|
|
@ -5,6 +5,7 @@ package actions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
|
@ -118,3 +119,22 @@ func DeleteScheduleTaskByRepo(ctx context.Context, id int64) error {
|
||||||
|
|
||||||
return committer.Commit()
|
return committer.Commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) error {
|
||||||
|
// If actions disabled when there is schedule task, this will remove the outdated schedule tasks
|
||||||
|
// There is no other place we can do this because the app.ini will be changed manually
|
||||||
|
if err := DeleteScheduleTaskByRepo(ctx, repo.ID); err != nil {
|
||||||
|
return fmt.Errorf("DeleteCronTaskByRepo: %v", err)
|
||||||
|
}
|
||||||
|
// cancel running cron jobs of this repository and delete old schedules
|
||||||
|
if err := CancelRunningJobs(
|
||||||
|
ctx,
|
||||||
|
repo.ID,
|
||||||
|
repo.DefaultBranch,
|
||||||
|
"",
|
||||||
|
webhook_module.HookEventSchedule,
|
||||||
|
); err != nil {
|
||||||
|
return fmt.Errorf("CancelRunningJobs: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -20,6 +20,10 @@ type ActionTaskOutput struct {
|
||||||
OutputValue string `xorm:"MEDIUMTEXT"`
|
OutputValue string `xorm:"MEDIUMTEXT"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterModel(new(ActionTaskOutput))
|
||||||
|
}
|
||||||
|
|
||||||
// FindTaskOutputByTaskID returns the outputs of the task.
|
// FindTaskOutputByTaskID returns the outputs of the task.
|
||||||
func FindTaskOutputByTaskID(ctx context.Context, taskID int64) ([]*ActionTaskOutput, error) {
|
func FindTaskOutputByTaskID(ctx context.Context, taskID int64) ([]*ActionTaskOutput, error) {
|
||||||
var outputs []*ActionTaskOutput
|
var outputs []*ActionTaskOutput
|
||||||
|
|
|
@ -140,7 +140,7 @@ func (at ActionType) InActions(actions ...string) bool {
|
||||||
// used in template render.
|
// used in template render.
|
||||||
type Action struct {
|
type Action struct {
|
||||||
ID int64 `xorm:"pk autoincr"`
|
ID int64 `xorm:"pk autoincr"`
|
||||||
UserID int64 // Receiver user id.
|
UserID int64 `xorm:"INDEX"` // Receiver user id.
|
||||||
OpType ActionType
|
OpType ActionType
|
||||||
ActUserID int64 // Action user id.
|
ActUserID int64 // Action user id.
|
||||||
ActUser *user_model.User `xorm:"-"`
|
ActUser *user_model.User `xorm:"-"`
|
||||||
|
@ -208,91 +208,91 @@ func (a *Action) loadRepo(ctx context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetActFullName gets the action's user full name.
|
// GetActFullName gets the action's user full name.
|
||||||
func (a *Action) GetActFullName() string {
|
func (a *Action) GetActFullName(ctx context.Context) string {
|
||||||
a.LoadActUser(db.DefaultContext)
|
a.LoadActUser(ctx)
|
||||||
return a.ActUser.FullName
|
return a.ActUser.FullName
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetActUserName gets the action's user name.
|
// GetActUserName gets the action's user name.
|
||||||
func (a *Action) GetActUserName() string {
|
func (a *Action) GetActUserName(ctx context.Context) string {
|
||||||
a.LoadActUser(db.DefaultContext)
|
a.LoadActUser(ctx)
|
||||||
return a.ActUser.Name
|
return a.ActUser.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShortActUserName gets the action's user name trimmed to max 20
|
// ShortActUserName gets the action's user name trimmed to max 20
|
||||||
// chars.
|
// chars.
|
||||||
func (a *Action) ShortActUserName() string {
|
func (a *Action) ShortActUserName(ctx context.Context) string {
|
||||||
return base.EllipsisString(a.GetActUserName(), 20)
|
return base.EllipsisString(a.GetActUserName(ctx), 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
|
// GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
|
||||||
func (a *Action) GetDisplayName() string {
|
func (a *Action) GetDisplayName(ctx context.Context) string {
|
||||||
if setting.UI.DefaultShowFullName {
|
if setting.UI.DefaultShowFullName {
|
||||||
trimmedFullName := strings.TrimSpace(a.GetActFullName())
|
trimmedFullName := strings.TrimSpace(a.GetActFullName(ctx))
|
||||||
if len(trimmedFullName) > 0 {
|
if len(trimmedFullName) > 0 {
|
||||||
return trimmedFullName
|
return trimmedFullName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return a.ShortActUserName()
|
return a.ShortActUserName(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
|
// GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
|
||||||
func (a *Action) GetDisplayNameTitle() string {
|
func (a *Action) GetDisplayNameTitle(ctx context.Context) string {
|
||||||
if setting.UI.DefaultShowFullName {
|
if setting.UI.DefaultShowFullName {
|
||||||
return a.ShortActUserName()
|
return a.ShortActUserName(ctx)
|
||||||
}
|
}
|
||||||
return a.GetActFullName()
|
return a.GetActFullName(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRepoUserName returns the name of the action repository owner.
|
// GetRepoUserName returns the name of the action repository owner.
|
||||||
func (a *Action) GetRepoUserName() string {
|
func (a *Action) GetRepoUserName(ctx context.Context) string {
|
||||||
a.loadRepo(db.DefaultContext)
|
a.loadRepo(ctx)
|
||||||
return a.Repo.OwnerName
|
return a.Repo.OwnerName
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShortRepoUserName returns the name of the action repository owner
|
// ShortRepoUserName returns the name of the action repository owner
|
||||||
// trimmed to max 20 chars.
|
// trimmed to max 20 chars.
|
||||||
func (a *Action) ShortRepoUserName() string {
|
func (a *Action) ShortRepoUserName(ctx context.Context) string {
|
||||||
return base.EllipsisString(a.GetRepoUserName(), 20)
|
return base.EllipsisString(a.GetRepoUserName(ctx), 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRepoName returns the name of the action repository.
|
// GetRepoName returns the name of the action repository.
|
||||||
func (a *Action) GetRepoName() string {
|
func (a *Action) GetRepoName(ctx context.Context) string {
|
||||||
a.loadRepo(db.DefaultContext)
|
a.loadRepo(ctx)
|
||||||
return a.Repo.Name
|
return a.Repo.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShortRepoName returns the name of the action repository
|
// ShortRepoName returns the name of the action repository
|
||||||
// trimmed to max 33 chars.
|
// trimmed to max 33 chars.
|
||||||
func (a *Action) ShortRepoName() string {
|
func (a *Action) ShortRepoName(ctx context.Context) string {
|
||||||
return base.EllipsisString(a.GetRepoName(), 33)
|
return base.EllipsisString(a.GetRepoName(ctx), 33)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRepoPath returns the virtual path to the action repository.
|
// GetRepoPath returns the virtual path to the action repository.
|
||||||
func (a *Action) GetRepoPath() string {
|
func (a *Action) GetRepoPath(ctx context.Context) string {
|
||||||
return path.Join(a.GetRepoUserName(), a.GetRepoName())
|
return path.Join(a.GetRepoUserName(ctx), a.GetRepoName(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShortRepoPath returns the virtual path to the action repository
|
// ShortRepoPath returns the virtual path to the action repository
|
||||||
// trimmed to max 20 + 1 + 33 chars.
|
// trimmed to max 20 + 1 + 33 chars.
|
||||||
func (a *Action) ShortRepoPath() string {
|
func (a *Action) ShortRepoPath(ctx context.Context) string {
|
||||||
return path.Join(a.ShortRepoUserName(), a.ShortRepoName())
|
return path.Join(a.ShortRepoUserName(ctx), a.ShortRepoName(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRepoLink returns relative link to action repository.
|
// GetRepoLink returns relative link to action repository.
|
||||||
func (a *Action) GetRepoLink() string {
|
func (a *Action) GetRepoLink(ctx context.Context) string {
|
||||||
// path.Join will skip empty strings
|
// path.Join will skip empty strings
|
||||||
return path.Join(setting.AppSubURL, "/", url.PathEscape(a.GetRepoUserName()), url.PathEscape(a.GetRepoName()))
|
return path.Join(setting.AppSubURL, "/", url.PathEscape(a.GetRepoUserName(ctx)), url.PathEscape(a.GetRepoName(ctx)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRepoAbsoluteLink returns the absolute link to action repository.
|
// GetRepoAbsoluteLink returns the absolute link to action repository.
|
||||||
func (a *Action) GetRepoAbsoluteLink() string {
|
func (a *Action) GetRepoAbsoluteLink(ctx context.Context) string {
|
||||||
return setting.AppURL + url.PathEscape(a.GetRepoUserName()) + "/" + url.PathEscape(a.GetRepoName())
|
return setting.AppURL + url.PathEscape(a.GetRepoUserName(ctx)) + "/" + url.PathEscape(a.GetRepoName(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCommentHTMLURL returns link to action comment.
|
// GetCommentHTMLURL returns link to action comment.
|
||||||
func (a *Action) GetCommentHTMLURL() string {
|
func (a *Action) GetCommentHTMLURL(ctx context.Context) string {
|
||||||
return a.getCommentHTMLURL(db.DefaultContext)
|
return a.getCommentHTMLURL(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Action) loadComment(ctx context.Context) (err error) {
|
func (a *Action) loadComment(ctx context.Context) (err error) {
|
||||||
|
@ -309,7 +309,7 @@ func (a *Action) getCommentHTMLURL(ctx context.Context) string {
|
||||||
}
|
}
|
||||||
_ = a.loadComment(ctx)
|
_ = a.loadComment(ctx)
|
||||||
if a.Comment != nil {
|
if a.Comment != nil {
|
||||||
return a.Comment.HTMLURL()
|
return a.Comment.HTMLURL(ctx)
|
||||||
}
|
}
|
||||||
if len(a.GetIssueInfos()) == 0 {
|
if len(a.GetIssueInfos()) == 0 {
|
||||||
return "#"
|
return "#"
|
||||||
|
@ -334,8 +334,8 @@ func (a *Action) getCommentHTMLURL(ctx context.Context) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCommentLink returns link to action comment.
|
// GetCommentLink returns link to action comment.
|
||||||
func (a *Action) GetCommentLink() string {
|
func (a *Action) GetCommentLink(ctx context.Context) string {
|
||||||
return a.getCommentLink(db.DefaultContext)
|
return a.getCommentLink(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Action) getCommentLink(ctx context.Context) string {
|
func (a *Action) getCommentLink(ctx context.Context) string {
|
||||||
|
@ -344,7 +344,7 @@ func (a *Action) getCommentLink(ctx context.Context) string {
|
||||||
}
|
}
|
||||||
_ = a.loadComment(ctx)
|
_ = a.loadComment(ctx)
|
||||||
if a.Comment != nil {
|
if a.Comment != nil {
|
||||||
return a.Comment.Link()
|
return a.Comment.Link(ctx)
|
||||||
}
|
}
|
||||||
if len(a.GetIssueInfos()) == 0 {
|
if len(a.GetIssueInfos()) == 0 {
|
||||||
return "#"
|
return "#"
|
||||||
|
@ -374,8 +374,8 @@ func (a *Action) GetBranch() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRefLink returns the action's ref link.
|
// GetRefLink returns the action's ref link.
|
||||||
func (a *Action) GetRefLink() string {
|
func (a *Action) GetRefLink(ctx context.Context) string {
|
||||||
return git.RefURL(a.GetRepoLink(), a.RefName)
|
return git.RefURL(a.GetRepoLink(ctx), a.RefName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTag returns the action's repository tag.
|
// GetTag returns the action's repository tag.
|
||||||
|
@ -399,11 +399,10 @@ func (a *Action) GetIssueInfos() []string {
|
||||||
return strings.SplitN(a.Content, "|", 3)
|
return strings.SplitN(a.Content, "|", 3)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIssueTitle returns the title of first issue associated
|
// GetIssueTitle returns the title of first issue associated with the action.
|
||||||
// with the action. This function will be invoked in template so keep db.DefaultContext here
|
func (a *Action) GetIssueTitle(ctx context.Context) string {
|
||||||
func (a *Action) GetIssueTitle() string {
|
|
||||||
index, _ := strconv.ParseInt(a.GetIssueInfos()[0], 10, 64)
|
index, _ := strconv.ParseInt(a.GetIssueInfos()[0], 10, 64)
|
||||||
issue, err := issues_model.GetIssueByIndex(db.DefaultContext, a.RepoID, index)
|
issue, err := issues_model.GetIssueByIndex(ctx, a.RepoID, index)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("GetIssueByIndex: %v", err)
|
log.Error("GetIssueByIndex: %v", err)
|
||||||
return "500 when get issue"
|
return "500 when get issue"
|
||||||
|
@ -442,7 +441,7 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
|
||||||
return nil, 0, fmt.Errorf("need at least one of these filters: RequestedUser, RequestedTeam, RequestedRepo")
|
return nil, 0, fmt.Errorf("need at least one of these filters: RequestedUser, RequestedTeam, RequestedRepo")
|
||||||
}
|
}
|
||||||
|
|
||||||
cond, err := activityQueryCondition(opts)
|
cond, err := activityQueryCondition(ctx, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
@ -473,11 +472,11 @@ func ActivityReadable(user, doer *user_model.User) bool {
|
||||||
doer != nil && (doer.IsAdmin || user.ID == doer.ID)
|
doer != nil && (doer.IsAdmin || user.ID == doer.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
|
func activityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.Cond, error) {
|
||||||
cond := builder.NewCond()
|
cond := builder.NewCond()
|
||||||
|
|
||||||
if opts.RequestedTeam != nil && opts.RequestedUser == nil {
|
if opts.RequestedTeam != nil && opts.RequestedUser == nil {
|
||||||
org, err := user_model.GetUserByID(db.DefaultContext, opts.RequestedTeam.OrgID)
|
org, err := user_model.GetUserByID(ctx, opts.RequestedTeam.OrgID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -564,12 +563,12 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteOldActions deletes all old actions from database.
|
// DeleteOldActions deletes all old actions from database.
|
||||||
func DeleteOldActions(olderThan time.Duration) (err error) {
|
func DeleteOldActions(ctx context.Context, olderThan time.Duration) (err error) {
|
||||||
if olderThan <= 0 {
|
if olderThan <= 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = db.GetEngine(db.DefaultContext).Where("created_unix < ?", time.Now().Add(-olderThan).Unix()).Delete(&Action{})
|
_, err = db.GetEngine(ctx).Where("created_unix < ?", time.Now().Add(-olderThan).Unix()).Delete(&Action{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,8 +678,8 @@ func NotifyWatchers(ctx context.Context, actions ...*Action) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotifyWatchersActions creates batch of actions for every watcher.
|
// NotifyWatchersActions creates batch of actions for every watcher.
|
||||||
func NotifyWatchersActions(acts []*Action) error {
|
func NotifyWatchersActions(ctx context.Context, acts []*Action) error {
|
||||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
ctx, committer, err := db.TxContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ func TestAction_GetRepoPath(t *testing.T) {
|
||||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
||||||
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
|
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
|
||||||
action := &activities_model.Action{RepoID: repo.ID}
|
action := &activities_model.Action{RepoID: repo.ID}
|
||||||
assert.Equal(t, path.Join(owner.Name, repo.Name), action.GetRepoPath())
|
assert.Equal(t, path.Join(owner.Name, repo.Name), action.GetRepoPath(db.DefaultContext))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAction_GetRepoLink(t *testing.T) {
|
func TestAction_GetRepoLink(t *testing.T) {
|
||||||
|
@ -35,9 +35,9 @@ func TestAction_GetRepoLink(t *testing.T) {
|
||||||
action := &activities_model.Action{RepoID: repo.ID, CommentID: comment.ID}
|
action := &activities_model.Action{RepoID: repo.ID, CommentID: comment.ID}
|
||||||
setting.AppSubURL = "/suburl"
|
setting.AppSubURL = "/suburl"
|
||||||
expected := path.Join(setting.AppSubURL, owner.Name, repo.Name)
|
expected := path.Join(setting.AppSubURL, owner.Name, repo.Name)
|
||||||
assert.Equal(t, expected, action.GetRepoLink())
|
assert.Equal(t, expected, action.GetRepoLink(db.DefaultContext))
|
||||||
assert.Equal(t, repo.HTMLURL(), action.GetRepoAbsoluteLink())
|
assert.Equal(t, repo.HTMLURL(), action.GetRepoAbsoluteLink(db.DefaultContext))
|
||||||
assert.Equal(t, comment.HTMLURL(), action.GetCommentHTMLURL())
|
assert.Equal(t, comment.HTMLURL(db.DefaultContext), action.GetCommentHTMLURL(db.DefaultContext))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetFeeds(t *testing.T) {
|
func TestGetFeeds(t *testing.T) {
|
||||||
|
|
|
@ -175,8 +175,8 @@ func CreateRepoTransferNotification(ctx context.Context, doer, newOwner *user_mo
|
||||||
// CreateOrUpdateIssueNotifications creates an issue notification
|
// CreateOrUpdateIssueNotifications creates an issue notification
|
||||||
// for each watcher, or updates it if already exists
|
// for each watcher, or updates it if already exists
|
||||||
// receiverID > 0 just send to receiver, else send to all watcher
|
// receiverID > 0 just send to receiver, else send to all watcher
|
||||||
func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error {
|
func CreateOrUpdateIssueNotifications(ctx context.Context, issueID, commentID, notificationAuthorID, receiverID int64) error {
|
||||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
ctx, committer, err := db.TxContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -435,21 +435,21 @@ func (n *Notification) loadUser(ctx context.Context) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRepo returns the repo of the notification
|
// GetRepo returns the repo of the notification
|
||||||
func (n *Notification) GetRepo() (*repo_model.Repository, error) {
|
func (n *Notification) GetRepo(ctx context.Context) (*repo_model.Repository, error) {
|
||||||
return n.Repository, n.loadRepo(db.DefaultContext)
|
return n.Repository, n.loadRepo(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIssue returns the issue of the notification
|
// GetIssue returns the issue of the notification
|
||||||
func (n *Notification) GetIssue() (*issues_model.Issue, error) {
|
func (n *Notification) GetIssue(ctx context.Context) (*issues_model.Issue, error) {
|
||||||
return n.Issue, n.loadIssue(db.DefaultContext)
|
return n.Issue, n.loadIssue(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTMLURL formats a URL-string to the notification
|
// HTMLURL formats a URL-string to the notification
|
||||||
func (n *Notification) HTMLURL() string {
|
func (n *Notification) HTMLURL(ctx context.Context) string {
|
||||||
switch n.Source {
|
switch n.Source {
|
||||||
case NotificationSourceIssue, NotificationSourcePullRequest:
|
case NotificationSourceIssue, NotificationSourcePullRequest:
|
||||||
if n.Comment != nil {
|
if n.Comment != nil {
|
||||||
return n.Comment.HTMLURL()
|
return n.Comment.HTMLURL(ctx)
|
||||||
}
|
}
|
||||||
return n.Issue.HTMLURL()
|
return n.Issue.HTMLURL()
|
||||||
case NotificationSourceCommit:
|
case NotificationSourceCommit:
|
||||||
|
@ -461,11 +461,11 @@ func (n *Notification) HTMLURL() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link formats a relative URL-string to the notification
|
// Link formats a relative URL-string to the notification
|
||||||
func (n *Notification) Link() string {
|
func (n *Notification) Link(ctx context.Context) string {
|
||||||
switch n.Source {
|
switch n.Source {
|
||||||
case NotificationSourceIssue, NotificationSourcePullRequest:
|
case NotificationSourceIssue, NotificationSourcePullRequest:
|
||||||
if n.Comment != nil {
|
if n.Comment != nil {
|
||||||
return n.Comment.Link()
|
return n.Comment.Link(ctx)
|
||||||
}
|
}
|
||||||
return n.Issue.Link()
|
return n.Issue.Link()
|
||||||
case NotificationSourceCommit:
|
case NotificationSourceCommit:
|
||||||
|
@ -733,12 +733,12 @@ type UserIDCount struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUIDsAndNotificationCounts between the two provided times
|
// GetUIDsAndNotificationCounts between the two provided times
|
||||||
func GetUIDsAndNotificationCounts(since, until timeutil.TimeStamp) ([]UserIDCount, error) {
|
func GetUIDsAndNotificationCounts(ctx context.Context, since, until timeutil.TimeStamp) ([]UserIDCount, error) {
|
||||||
sql := `SELECT user_id, count(*) AS count FROM notification ` +
|
sql := `SELECT user_id, count(*) AS count FROM notification ` +
|
||||||
`WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= ? AND ` +
|
`WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= ? AND ` +
|
||||||
`updated_unix < ?) AND status = ? GROUP BY user_id`
|
`updated_unix < ?) AND status = ? GROUP BY user_id`
|
||||||
var res []UserIDCount
|
var res []UserIDCount
|
||||||
return res, db.GetEngine(db.DefaultContext).SQL(sql, since, until, NotificationStatusUnread).Find(&res)
|
return res, db.GetEngine(ctx).SQL(sql, since, until, NotificationStatusUnread).Find(&res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetIssueReadBy sets issue to be read by given user.
|
// SetIssueReadBy sets issue to be read by given user.
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestCreateOrUpdateIssueNotifications(t *testing.T) {
|
||||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1})
|
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1})
|
||||||
|
|
||||||
assert.NoError(t, activities_model.CreateOrUpdateIssueNotifications(issue.ID, 0, 2, 0))
|
assert.NoError(t, activities_model.CreateOrUpdateIssueNotifications(db.DefaultContext, issue.ID, 0, 2, 0))
|
||||||
|
|
||||||
// User 9 is inactive, thus notifications for user 1 and 4 are created
|
// User 9 is inactive, thus notifications for user 1 and 4 are created
|
||||||
notf := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{UserID: 1, IssueID: issue.ID})
|
notf := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{UserID: 1, IssueID: issue.ID})
|
||||||
|
@ -50,7 +50,7 @@ func TestNotificationsForUser(t *testing.T) {
|
||||||
func TestNotification_GetRepo(t *testing.T) {
|
func TestNotification_GetRepo(t *testing.T) {
|
||||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||||
notf := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{RepoID: 1})
|
notf := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{RepoID: 1})
|
||||||
repo, err := notf.GetRepo()
|
repo, err := notf.GetRepo(db.DefaultContext)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, repo, notf.Repository)
|
assert.Equal(t, repo, notf.Repository)
|
||||||
assert.EqualValues(t, notf.RepoID, repo.ID)
|
assert.EqualValues(t, notf.RepoID, repo.ID)
|
||||||
|
@ -59,7 +59,7 @@ func TestNotification_GetRepo(t *testing.T) {
|
||||||
func TestNotification_GetIssue(t *testing.T) {
|
func TestNotification_GetIssue(t *testing.T) {
|
||||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||||
notf := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{RepoID: 1})
|
notf := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{RepoID: 1})
|
||||||
issue, err := notf.GetIssue()
|
issue, err := notf.GetIssue(db.DefaultContext)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, issue, notf.Issue)
|
assert.Equal(t, issue, notf.Issue)
|
||||||
assert.EqualValues(t, notf.IssueID, issue.ID)
|
assert.EqualValues(t, notf.IssueID, issue.ID)
|
||||||
|
|
|
@ -342,7 +342,7 @@ func (stats *ActivityStats) FillReleases(ctx context.Context, repoID int64, from
|
||||||
|
|
||||||
// Published releases list
|
// Published releases list
|
||||||
sess := releasesForActivityStatement(ctx, repoID, fromTime)
|
sess := releasesForActivityStatement(ctx, repoID, fromTime)
|
||||||
sess.OrderBy("release.created_unix DESC")
|
sess.OrderBy("`release`.created_unix DESC")
|
||||||
stats.PublishedReleases = make([]*repo_model.Release, 0)
|
stats.PublishedReleases = make([]*repo_model.Release, 0)
|
||||||
if err = sess.Find(&stats.PublishedReleases); err != nil {
|
if err = sess.Find(&stats.PublishedReleases); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -350,7 +350,7 @@ func (stats *ActivityStats) FillReleases(ctx context.Context, repoID int64, from
|
||||||
|
|
||||||
// Published releases authors
|
// Published releases authors
|
||||||
sess = releasesForActivityStatement(ctx, repoID, fromTime)
|
sess = releasesForActivityStatement(ctx, repoID, fromTime)
|
||||||
if _, err = sess.Select("count(distinct release.publisher_id) as `count`").Table("release").Get(&count); err != nil {
|
if _, err = sess.Select("count(distinct `release`.publisher_id) as `count`").Table("release").Get(&count); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
stats.PublishedReleaseAuthorCount = count
|
stats.PublishedReleaseAuthorCount = count
|
||||||
|
@ -359,7 +359,7 @@ func (stats *ActivityStats) FillReleases(ctx context.Context, repoID int64, from
|
||||||
}
|
}
|
||||||
|
|
||||||
func releasesForActivityStatement(ctx context.Context, repoID int64, fromTime time.Time) *xorm.Session {
|
func releasesForActivityStatement(ctx context.Context, repoID int64, fromTime time.Time) *xorm.Session {
|
||||||
return db.GetEngine(ctx).Where("release.repo_id = ?", repoID).
|
return db.GetEngine(ctx).Where("`release`.repo_id = ?", repoID).
|
||||||
And("release.is_draft = ?", false).
|
And("`release`.is_draft = ?", false).
|
||||||
And("release.created_unix >= ?", fromTime.Unix())
|
And("`release`.created_unix >= ?", fromTime.Unix())
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
package activities
|
package activities
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"code.gitea.io/gitea/models/organization"
|
"code.gitea.io/gitea/models/organization"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
@ -18,16 +20,16 @@ type UserHeatmapData struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserHeatmapDataByUser returns an array of UserHeatmapData
|
// GetUserHeatmapDataByUser returns an array of UserHeatmapData
|
||||||
func GetUserHeatmapDataByUser(user, doer *user_model.User) ([]*UserHeatmapData, error) {
|
func GetUserHeatmapDataByUser(ctx context.Context, user, doer *user_model.User) ([]*UserHeatmapData, error) {
|
||||||
return getUserHeatmapData(user, nil, doer)
|
return getUserHeatmapData(ctx, user, nil, doer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserHeatmapDataByUserTeam returns an array of UserHeatmapData
|
// GetUserHeatmapDataByUserTeam returns an array of UserHeatmapData
|
||||||
func GetUserHeatmapDataByUserTeam(user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error) {
|
func GetUserHeatmapDataByUserTeam(ctx context.Context, user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error) {
|
||||||
return getUserHeatmapData(user, team, doer)
|
return getUserHeatmapData(ctx, user, team, doer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUserHeatmapData(user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error) {
|
func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organization.Team, doer *user_model.User) ([]*UserHeatmapData, error) {
|
||||||
hdata := make([]*UserHeatmapData, 0)
|
hdata := make([]*UserHeatmapData, 0)
|
||||||
|
|
||||||
if !ActivityReadable(user, doer) {
|
if !ActivityReadable(user, doer) {
|
||||||
|
@ -45,7 +47,7 @@ func getUserHeatmapData(user *user_model.User, team *organization.Team, doer *us
|
||||||
groupByName = groupBy
|
groupByName = groupBy
|
||||||
}
|
}
|
||||||
|
|
||||||
cond, err := activityQueryCondition(GetFeedsOptions{
|
cond, err := activityQueryCondition(ctx, GetFeedsOptions{
|
||||||
RequestedUser: user,
|
RequestedUser: user,
|
||||||
RequestedTeam: team,
|
RequestedTeam: team,
|
||||||
Actor: doer,
|
Actor: doer,
|
||||||
|
@ -60,7 +62,7 @@ func getUserHeatmapData(user *user_model.User, team *organization.Team, doer *us
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return hdata, db.GetEngine(db.DefaultContext).
|
return hdata, db.GetEngine(ctx).
|
||||||
Select(groupBy+" AS timestamp, count(user_id) as contributions").
|
Select(groupBy+" AS timestamp, count(user_id) as contributions").
|
||||||
Table("action").
|
Table("action").
|
||||||
Where(cond).
|
Where(cond).
|
||||||
|
|
|
@ -83,7 +83,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
// Get the heatmap and compare
|
// Get the heatmap and compare
|
||||||
heatmap, err := activities_model.GetUserHeatmapDataByUser(user, doer)
|
heatmap, err := activities_model.GetUserHeatmapDataByUser(db.DefaultContext, user, doer)
|
||||||
var contributions int
|
var contributions int
|
||||||
for _, hm := range heatmap {
|
for _, hm := range heatmap {
|
||||||
contributions += int(hm.Contributions)
|
contributions += int(hm.Contributions)
|
||||||
|
|
|
@ -88,14 +88,13 @@ func ListGPGKeys(ctx context.Context, uid int64, listOptions db.ListOptions) ([]
|
||||||
}
|
}
|
||||||
|
|
||||||
// CountUserGPGKeys return number of gpg keys a user own
|
// CountUserGPGKeys return number of gpg keys a user own
|
||||||
func CountUserGPGKeys(userID int64) (int64, error) {
|
func CountUserGPGKeys(ctx context.Context, userID int64) (int64, error) {
|
||||||
return db.GetEngine(db.DefaultContext).Where("owner_id=? AND primary_key_id=''", userID).Count(&GPGKey{})
|
return db.GetEngine(ctx).Where("owner_id=? AND primary_key_id=''", userID).Count(&GPGKey{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGPGKeyByID returns public key by given ID.
|
func GetGPGKeyForUserByID(ctx context.Context, ownerID, keyID int64) (*GPGKey, error) {
|
||||||
func GetGPGKeyByID(keyID int64) (*GPGKey, error) {
|
|
||||||
key := new(GPGKey)
|
key := new(GPGKey)
|
||||||
has, err := db.GetEngine(db.DefaultContext).ID(keyID).Get(key)
|
has, err := db.GetEngine(ctx).Where("id=? AND owner_id=?", keyID, ownerID).Get(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if !has {
|
} else if !has {
|
||||||
|
@ -105,9 +104,9 @@ func GetGPGKeyByID(keyID int64) (*GPGKey, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGPGKeysByKeyID returns public key by given ID.
|
// GetGPGKeysByKeyID returns public key by given ID.
|
||||||
func GetGPGKeysByKeyID(keyID string) ([]*GPGKey, error) {
|
func GetGPGKeysByKeyID(ctx context.Context, keyID string) ([]*GPGKey, error) {
|
||||||
keys := make([]*GPGKey, 0, 1)
|
keys := make([]*GPGKey, 0, 1)
|
||||||
return keys, db.GetEngine(db.DefaultContext).Where("key_id=?", keyID).Find(&keys)
|
return keys, db.GetEngine(ctx).Where("key_id=?", keyID).Find(&keys)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GPGKeyToEntity retrieve the imported key and the traducted entity
|
// GPGKeyToEntity retrieve the imported key and the traducted entity
|
||||||
|
@ -224,8 +223,8 @@ func deleteGPGKey(ctx context.Context, keyID string) (int64, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteGPGKey deletes GPG key information in database.
|
// DeleteGPGKey deletes GPG key information in database.
|
||||||
func DeleteGPGKey(doer *user_model.User, id int64) (err error) {
|
func DeleteGPGKey(ctx context.Context, doer *user_model.User, id int64) (err error) {
|
||||||
key, err := GetGPGKeyByID(id)
|
key, err := GetGPGKeyForUserByID(ctx, doer.ID, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if IsErrGPGKeyNotExist(err) {
|
if IsErrGPGKeyNotExist(err) {
|
||||||
return nil
|
return nil
|
||||||
|
@ -233,12 +232,7 @@ func DeleteGPGKey(doer *user_model.User, id int64) (err error) {
|
||||||
return fmt.Errorf("GetPublicKeyByID: %w", err)
|
return fmt.Errorf("GetPublicKeyByID: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if user has access to delete this key.
|
ctx, committer, err := db.TxContext(ctx)
|
||||||
if !doer.IsAdmin && doer.ID != key.OwnerID {
|
|
||||||
return ErrGPGKeyAccessDenied{doer.ID, key.ID}
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,13 +66,13 @@ func addGPGSubKey(ctx context.Context, key *GPGKey) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddGPGKey adds new public key to database.
|
// AddGPGKey adds new public key to database.
|
||||||
func AddGPGKey(ownerID int64, content, token, signature string) ([]*GPGKey, error) {
|
func AddGPGKey(ctx context.Context, ownerID int64, content, token, signature string) ([]*GPGKey, error) {
|
||||||
ekeys, err := checkArmoredGPGKeyString(content)
|
ekeys, err := checkArmoredGPGKeyString(content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
ctx, committer, err := db.TxContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,7 +392,7 @@ func hashAndVerifyForKeyID(ctx context.Context, sig *packet.Signature, payload s
|
||||||
if keyID == "" {
|
if keyID == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
keys, err := GetGPGKeysByKeyID(keyID)
|
keys, err := GetGPGKeysByKeyID(ctx, keyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("GetGPGKeysByKeyID: %v", err)
|
log.Error("GetGPGKeysByKeyID: %v", err)
|
||||||
return &CommitVerification{
|
return &CommitVerification{
|
||||||
|
@ -407,7 +407,7 @@ func hashAndVerifyForKeyID(ctx context.Context, sig *packet.Signature, payload s
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
var primaryKeys []*GPGKey
|
var primaryKeys []*GPGKey
|
||||||
if key.PrimaryKeyID != "" {
|
if key.PrimaryKeyID != "" {
|
||||||
primaryKeys, err = GetGPGKeysByKeyID(key.PrimaryKeyID)
|
primaryKeys, err = GetGPGKeysByKeyID(ctx, key.PrimaryKeyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("GetGPGKeysByKeyID: %v", err)
|
log.Error("GetGPGKeysByKeyID: %v", err)
|
||||||
return &CommitVerification{
|
return &CommitVerification{
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/models/db"
|
||||||
"code.gitea.io/gitea/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
|
@ -228,7 +229,7 @@ Q0KHb+QcycSgbDx0ZAvdIacuKvBBcbxrsmFUI4LR+oIup0G9gUc0roPvr014jYQL
|
||||||
=zHo9
|
=zHo9
|
||||||
-----END PGP PUBLIC KEY BLOCK-----`
|
-----END PGP PUBLIC KEY BLOCK-----`
|
||||||
|
|
||||||
keys, err := AddGPGKey(1, testEmailWithUpperCaseLetters, "", "")
|
keys, err := AddGPGKey(db.DefaultContext, 1, testEmailWithUpperCaseLetters, "", "")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
if assert.NotEmpty(t, keys) {
|
if assert.NotEmpty(t, keys) {
|
||||||
key := keys[0]
|
key := keys[0]
|
||||||
|
|
|
@ -117,7 +117,7 @@ func appendAuthorizedKeysToFile(keys ...*PublicKey) error {
|
||||||
// RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again.
|
// RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again.
|
||||||
// Note: db.GetEngine(db.DefaultContext).Iterate does not get latest data after insert/delete, so we have to call this function
|
// Note: db.GetEngine(db.DefaultContext).Iterate does not get latest data after insert/delete, so we have to call this function
|
||||||
// outside any session scope independently.
|
// outside any session scope independently.
|
||||||
func RewriteAllPublicKeys() error {
|
func RewriteAllPublicKeys(ctx context.Context) error {
|
||||||
// Don't rewrite key if internal server
|
// Don't rewrite key if internal server
|
||||||
if setting.SSH.StartBuiltinServer || !setting.SSH.CreateAuthorizedKeysFile {
|
if setting.SSH.StartBuiltinServer || !setting.SSH.CreateAuthorizedKeysFile {
|
||||||
return nil
|
return nil
|
||||||
|
@ -165,7 +165,7 @@ func RewriteAllPublicKeys() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := RegeneratePublicKeys(db.DefaultContext, t); err != nil {
|
if err := RegeneratePublicKeys(ctx, t); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ func CalcFingerprint(publicKeyContent string) (string, error) {
|
||||||
fnName, fp string
|
fnName, fp string
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if setting.SSH.StartBuiltinServer {
|
if len(setting.SSH.KeygenPath) == 0 {
|
||||||
fnName = "calcFingerprintNative"
|
fnName = "calcFingerprintNative"
|
||||||
fp, err = calcFingerprintNative(publicKeyContent)
|
fp, err = calcFingerprintNative(publicKeyContent)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -29,10 +29,15 @@ func VerifySSHKey(ownerID int64, fingerprint, token, signature string) (string,
|
||||||
return "", ErrKeyNotExist{}
|
return "", ErrKeyNotExist{}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := sshsig.Verify(bytes.NewBuffer([]byte(token)), []byte(signature), []byte(key.Content), "gitea"); err != nil {
|
err = sshsig.Verify(bytes.NewBuffer([]byte(token)), []byte(signature), []byte(key.Content), "gitea")
|
||||||
log.Error("Unable to validate token signature. Error: %v", err)
|
if err != nil {
|
||||||
return "", ErrSSHInvalidTokenSignature{
|
// edge case for Windows based shells that will add CR LF if piped to ssh-keygen command
|
||||||
Fingerprint: key.Fingerprint,
|
// see https://github.com/PowerShell/PowerShell/issues/5974
|
||||||
|
if sshsig.Verify(bytes.NewBuffer([]byte(token+"\r\n")), []byte(signature), []byte(key.Content), "gitea") != nil {
|
||||||
|
log.Error("Unable to validate token signature. Error: %v", err)
|
||||||
|
return "", ErrSSHInvalidTokenSignature{
|
||||||
|
Fingerprint: key.Fingerprint,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ func CreateSource(source *Source) error {
|
||||||
err = registerableSource.RegisterSource()
|
err = registerableSource.RegisterSource()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// remove the AuthSource in case of errors while registering configuration
|
// remove the AuthSource in case of errors while registering configuration
|
||||||
if _, err := db.GetEngine(db.DefaultContext).Delete(source); err != nil {
|
if _, err := db.GetEngine(db.DefaultContext).ID(source.ID).Delete(new(Source)); err != nil {
|
||||||
log.Error("CreateSource: Error while wrapOpenIDConnectInitializeError: %v", err)
|
log.Error("CreateSource: Error while wrapOpenIDConnectInitializeError: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,9 +275,6 @@ func ActiveSources(tp Type) ([]*Source, error) {
|
||||||
// IsSSPIEnabled returns true if there is at least one activated login
|
// IsSSPIEnabled returns true if there is at least one activated login
|
||||||
// source of type LoginSSPI
|
// source of type LoginSSPI
|
||||||
func IsSSPIEnabled() bool {
|
func IsSSPIEnabled() bool {
|
||||||
if !db.HasEngine {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
sources, err := ActiveSources(SSPI)
|
sources, err := ActiveSources(SSPI)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("ActiveSources: %v", err)
|
log.Error("ActiveSources: %v", err)
|
||||||
|
|
|
@ -5,18 +5,20 @@ package avatars
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync/atomic"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
system_model "code.gitea.io/gitea/models/system"
|
|
||||||
"code.gitea.io/gitea/modules/base"
|
"code.gitea.io/gitea/modules/base"
|
||||||
"code.gitea.io/gitea/modules/cache"
|
"code.gitea.io/gitea/modules/cache"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
|
"strk.kbt.io/projects/go/libravatar"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -36,24 +38,54 @@ func init() {
|
||||||
db.RegisterModel(new(EmailHash))
|
db.RegisterModel(new(EmailHash))
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
type avatarSettingStruct struct {
|
||||||
defaultAvatarLink string
|
defaultAvatarLink string
|
||||||
once sync.Once
|
gravatarSource string
|
||||||
)
|
gravatarSourceURL *url.URL
|
||||||
|
libravatar *libravatar.Libravatar
|
||||||
|
}
|
||||||
|
|
||||||
// DefaultAvatarLink the default avatar link
|
var avatarSettingAtomic atomic.Pointer[avatarSettingStruct]
|
||||||
func DefaultAvatarLink() string {
|
|
||||||
once.Do(func() {
|
func loadAvatarSetting() (*avatarSettingStruct, error) {
|
||||||
|
s := avatarSettingAtomic.Load()
|
||||||
|
if s == nil || s.gravatarSource != setting.GravatarSource {
|
||||||
|
s = &avatarSettingStruct{}
|
||||||
u, err := url.Parse(setting.AppSubURL)
|
u, err := url.Parse(setting.AppSubURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Can not parse AppSubURL: %v", err)
|
return nil, fmt.Errorf("unable to parse AppSubURL: %w", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u.Path = path.Join(u.Path, "/assets/img/avatar_default.png")
|
u.Path = path.Join(u.Path, "/assets/img/avatar_default.png")
|
||||||
defaultAvatarLink = u.String()
|
s.defaultAvatarLink = u.String()
|
||||||
})
|
|
||||||
return defaultAvatarLink
|
s.gravatarSourceURL, err = url.Parse(setting.GravatarSource)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to parse GravatarSource %q: %w", setting.GravatarSource, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
s.libravatar = libravatar.New()
|
||||||
|
if s.gravatarSourceURL.Scheme == "https" {
|
||||||
|
s.libravatar.SetUseHTTPS(true)
|
||||||
|
s.libravatar.SetSecureFallbackHost(s.gravatarSourceURL.Host)
|
||||||
|
} else {
|
||||||
|
s.libravatar.SetUseHTTPS(false)
|
||||||
|
s.libravatar.SetFallbackHost(s.gravatarSourceURL.Host)
|
||||||
|
}
|
||||||
|
|
||||||
|
avatarSettingAtomic.Store(s)
|
||||||
|
}
|
||||||
|
return s, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DefaultAvatarLink the default avatar link
|
||||||
|
func DefaultAvatarLink() string {
|
||||||
|
a, err := loadAvatarSetting()
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Failed to loadAvatarSetting: %v", err)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return a.defaultAvatarLink
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashEmail hashes email address to MD5 string. https://en.gravatar.com/site/implement/hash/
|
// HashEmail hashes email address to MD5 string. https://en.gravatar.com/site/implement/hash/
|
||||||
|
@ -76,7 +108,11 @@ func GetEmailForHash(md5Sum string) (string, error) {
|
||||||
// LibravatarURL returns the URL for the given email. Slow due to the DNS lookup.
|
// LibravatarURL returns the URL for the given email. Slow due to the DNS lookup.
|
||||||
// This function should only be called if a federated avatar service is enabled.
|
// This function should only be called if a federated avatar service is enabled.
|
||||||
func LibravatarURL(email string) (*url.URL, error) {
|
func LibravatarURL(email string) (*url.URL, error) {
|
||||||
urlStr, err := system_model.LibravatarService.FromEmail(email)
|
a, err := loadAvatarSetting()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
urlStr, err := a.libravatar.FromEmail(email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("LibravatarService.FromEmail(email=%s): error %v", email, err)
|
log.Error("LibravatarService.FromEmail(email=%s): error %v", email, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -153,15 +189,13 @@ func generateEmailAvatarLink(ctx context.Context, email string, size int, final
|
||||||
return DefaultAvatarLink()
|
return DefaultAvatarLink()
|
||||||
}
|
}
|
||||||
|
|
||||||
disableGravatar := system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar,
|
avatarSetting, err := loadAvatarSetting()
|
||||||
setting.GetDefaultDisableGravatar(),
|
if err != nil {
|
||||||
)
|
return DefaultAvatarLink()
|
||||||
|
}
|
||||||
|
|
||||||
enableFederatedAvatar := system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureEnableFederatedAvatar,
|
enableFederatedAvatar := setting.Config().Picture.EnableFederatedAvatar.Value(ctx)
|
||||||
setting.GetDefaultEnableFederatedAvatar(disableGravatar))
|
if enableFederatedAvatar {
|
||||||
|
|
||||||
var err error
|
|
||||||
if enableFederatedAvatar && system_model.LibravatarService != nil {
|
|
||||||
emailHash := saveEmailHash(email)
|
emailHash := saveEmailHash(email)
|
||||||
if final {
|
if final {
|
||||||
// for final link, we can spend more time on slow external query
|
// for final link, we can spend more time on slow external query
|
||||||
|
@ -179,9 +213,10 @@ func generateEmailAvatarLink(ctx context.Context, email string, size int, final
|
||||||
return urlStr
|
return urlStr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disableGravatar := setting.Config().Picture.DisableGravatar.Value(ctx)
|
||||||
if !disableGravatar {
|
if !disableGravatar {
|
||||||
// copy GravatarSourceURL, because we will modify its Path.
|
// copy GravatarSourceURL, because we will modify its Path.
|
||||||
avatarURLCopy := *system_model.GravatarSourceURL
|
avatarURLCopy := *avatarSetting.gravatarSourceURL
|
||||||
avatarURLCopy.Path = path.Join(avatarURLCopy.Path, HashEmail(email))
|
avatarURLCopy.Path = path.Join(avatarURLCopy.Path, HashEmail(email))
|
||||||
return generateRecognizedAvatarURL(avatarURLCopy, size)
|
return generateRecognizedAvatarURL(avatarURLCopy, size)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
system_model "code.gitea.io/gitea/models/system"
|
system_model "code.gitea.io/gitea/models/system"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/setting/config"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
@ -17,19 +18,16 @@ import (
|
||||||
const gravatarSource = "https://secure.gravatar.com/avatar/"
|
const gravatarSource = "https://secure.gravatar.com/avatar/"
|
||||||
|
|
||||||
func disableGravatar(t *testing.T) {
|
func disableGravatar(t *testing.T) {
|
||||||
err := system_model.SetSettingNoVersion(db.DefaultContext, system_model.KeyPictureEnableFederatedAvatar, "false")
|
err := system_model.SetSettings(db.DefaultContext, map[string]string{setting.Config().Picture.EnableFederatedAvatar.DynKey(): "false"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
err = system_model.SetSettingNoVersion(db.DefaultContext, system_model.KeyPictureDisableGravatar, "true")
|
err = system_model.SetSettings(db.DefaultContext, map[string]string{setting.Config().Picture.DisableGravatar.DynKey(): "true"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
system_model.LibravatarService = nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func enableGravatar(t *testing.T) {
|
func enableGravatar(t *testing.T) {
|
||||||
err := system_model.SetSettingNoVersion(db.DefaultContext, system_model.KeyPictureDisableGravatar, "false")
|
err := system_model.SetSettings(db.DefaultContext, map[string]string{setting.Config().Picture.DisableGravatar.DynKey(): "false"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
setting.GravatarSource = gravatarSource
|
setting.GravatarSource = gravatarSource
|
||||||
err = system_model.Init(db.DefaultContext)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHashEmail(t *testing.T) {
|
func TestHashEmail(t *testing.T) {
|
||||||
|
@ -47,10 +45,12 @@ func TestSizedAvatarLink(t *testing.T) {
|
||||||
setting.AppSubURL = "/testsuburl"
|
setting.AppSubURL = "/testsuburl"
|
||||||
|
|
||||||
disableGravatar(t)
|
disableGravatar(t)
|
||||||
|
config.GetDynGetter().InvalidateCache()
|
||||||
assert.Equal(t, "/testsuburl/assets/img/avatar_default.png",
|
assert.Equal(t, "/testsuburl/assets/img/avatar_default.png",
|
||||||
avatars_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100))
|
avatars_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100))
|
||||||
|
|
||||||
enableGravatar(t)
|
enableGravatar(t)
|
||||||
|
config.GetDynGetter().InvalidateCache()
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
"https://secure.gravatar.com/avatar/353cbad9b58e69c96154ad99f92bedc7?d=identicon&s=100",
|
"https://secure.gravatar.com/avatar/353cbad9b58e69c96154ad99f92bedc7?d=identicon&s=100",
|
||||||
avatars_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100),
|
avatars_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100),
|
||||||
|
|
|
@ -178,6 +178,15 @@ func GetByBean(ctx context.Context, bean any) (bool, error) {
|
||||||
return GetEngine(ctx).Get(bean)
|
return GetEngine(ctx).Get(bean)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Exist[T any](ctx context.Context, cond builder.Cond) (bool, error) {
|
||||||
|
if !cond.IsValid() {
|
||||||
|
return false, ErrConditionRequired{}
|
||||||
|
}
|
||||||
|
|
||||||
|
var bean T
|
||||||
|
return GetEngine(ctx).Where(cond).NoAutoCondition().Exist(&bean)
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteByBean deletes all records according non-empty fields of the bean as conditions.
|
// DeleteByBean deletes all records according non-empty fields of the bean as conditions.
|
||||||
func DeleteByBean(ctx context.Context, bean any) (int64, error) {
|
func DeleteByBean(ctx context.Context, bean any) (int64, error) {
|
||||||
return GetEngine(ctx).Delete(bean)
|
return GetEngine(ctx).Delete(bean)
|
||||||
|
|
|
@ -27,9 +27,6 @@ var (
|
||||||
x *xorm.Engine
|
x *xorm.Engine
|
||||||
tables []any
|
tables []any
|
||||||
initFuncs []func() error
|
initFuncs []func() error
|
||||||
|
|
||||||
// HasEngine specifies if we have a xorm.Engine
|
|
||||||
HasEngine bool
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Engine represents a xorm engine or session.
|
// Engine represents a xorm engine or session.
|
||||||
|
|
|
@ -72,3 +72,21 @@ func (err ErrNotExist) Error() string {
|
||||||
func (err ErrNotExist) Unwrap() error {
|
func (err ErrNotExist) Unwrap() error {
|
||||||
return util.ErrNotExist
|
return util.ErrNotExist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrConditionRequired represents an error which require condition.
|
||||||
|
type ErrConditionRequired struct{}
|
||||||
|
|
||||||
|
// IsErrConditionRequired checks if an error is an ErrConditionRequired
|
||||||
|
func IsErrConditionRequired(err error) bool {
|
||||||
|
_, ok := err.(ErrConditionRequired)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func (err ErrConditionRequired) Error() string {
|
||||||
|
return "condition is required"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unwrap unwraps this as a ErrNotExist err
|
||||||
|
func (err ErrConditionRequired) Unwrap() error {
|
||||||
|
return util.ErrInvalidArgument
|
||||||
|
}
|
||||||
|
|
|
@ -57,6 +57,21 @@ func (err ErrUserOwnPackages) Error() string {
|
||||||
return fmt.Sprintf("user still has ownership of packages [uid: %d]", err.UID)
|
return fmt.Sprintf("user still has ownership of packages [uid: %d]", err.UID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrDeleteLastAdminUser represents a "DeleteLastAdminUser" kind of error.
|
||||||
|
type ErrDeleteLastAdminUser struct {
|
||||||
|
UID int64
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsErrDeleteLastAdminUser checks if an error is a ErrDeleteLastAdminUser.
|
||||||
|
func IsErrDeleteLastAdminUser(err error) bool {
|
||||||
|
_, ok := err.(ErrDeleteLastAdminUser)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func (err ErrDeleteLastAdminUser) Error() string {
|
||||||
|
return fmt.Sprintf("can not delete the last admin user [uid: %d]", err.UID)
|
||||||
|
}
|
||||||
|
|
||||||
// ErrNoPendingRepoTransfer is an error type for repositories without a pending
|
// ErrNoPendingRepoTransfer is an error type for repositories without a pending
|
||||||
// transfer request
|
// transfer request
|
||||||
type ErrNoPendingRepoTransfer struct {
|
type ErrNoPendingRepoTransfer struct {
|
||||||
|
|
|
@ -40,7 +40,9 @@ func GetYamlFixturesAccess() (string, error) {
|
||||||
fmt.Fprintf(&b, " user_id: %d\n", a.UserID)
|
fmt.Fprintf(&b, " user_id: %d\n", a.UserID)
|
||||||
fmt.Fprintf(&b, " repo_id: %d\n", a.RepoID)
|
fmt.Fprintf(&b, " repo_id: %d\n", a.RepoID)
|
||||||
fmt.Fprintf(&b, " mode: %d\n", a.Mode)
|
fmt.Fprintf(&b, " mode: %d\n", a.Mode)
|
||||||
fmt.Fprintf(&b, "\n")
|
if i < len(accesses)-1 {
|
||||||
|
fmt.Fprintf(&b, "\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.String(), nil
|
return b.String(), nil
|
||||||
|
|
|
@ -22,12 +22,13 @@ func TestFixtureGeneration(t *testing.T) {
|
||||||
if !assert.NoError(t, err) {
|
if !assert.NoError(t, err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
bytes, err := os.ReadFile(filepath.Join(unittest.FixturesDir(), name+".yml"))
|
p := filepath.Join(unittest.FixturesDir(), name+".yml")
|
||||||
|
bytes, err := os.ReadFile(p)
|
||||||
if !assert.NoError(t, err) {
|
if !assert.NoError(t, err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data := string(util.NormalizeEOL(bytes))
|
data := string(util.NormalizeEOL(bytes))
|
||||||
assert.True(t, data == expected, "Differences detected for %s.yml", name)
|
assert.EqualValues(t, expected, data, "Differences detected for %s", p)
|
||||||
}
|
}
|
||||||
|
|
||||||
test(GetYamlFixturesAccess, "access")
|
test(GetYamlFixturesAccess, "access")
|
||||||
|
|
|
@ -135,4 +135,3 @@
|
||||||
user_id: 31
|
user_id: 31
|
||||||
repo_id: 28
|
repo_id: 28
|
||||||
mode: 4
|
mode: 4
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
id: 1
|
id: 1
|
||||||
uid: 1
|
uid: 1
|
||||||
name: Token A
|
name: Token A
|
||||||
#token: d2c6c1ba3890b309189a8e618c72a162e4efbf36
|
# token: d2c6c1ba3890b309189a8e618c72a162e4efbf36
|
||||||
token_hash: 2b3668e11cb82d3af8c6e4524fc7841297668f5008d1626f0ad3417e9fa39af84c268248b78c481daa7e5dc437784003494f
|
token_hash: 2b3668e11cb82d3af8c6e4524fc7841297668f5008d1626f0ad3417e9fa39af84c268248b78c481daa7e5dc437784003494f
|
||||||
token_salt: QuSiZr1byZ
|
token_salt: QuSiZr1byZ
|
||||||
token_last_eight: e4efbf36
|
token_last_eight: e4efbf36
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
id: 2
|
id: 2
|
||||||
uid: 1
|
uid: 1
|
||||||
name: Token B
|
name: Token B
|
||||||
#token: 4c6f36e6cf498e2a448662f915d932c09c5a146c
|
# token: 4c6f36e6cf498e2a448662f915d932c09c5a146c
|
||||||
token_hash: 1a0e32a231ebbd582dc626c1543a42d3c63d4fa76c07c72862721467c55e8f81c923d60700f0528b5f5f443f055559d3a279
|
token_hash: 1a0e32a231ebbd582dc626c1543a42d3c63d4fa76c07c72862721467c55e8f81c923d60700f0528b5f5f443f055559d3a279
|
||||||
token_salt: Lfwopukrq5
|
token_salt: Lfwopukrq5
|
||||||
token_last_eight: 9c5a146c
|
token_last_eight: 9c5a146c
|
||||||
|
@ -24,10 +24,10 @@
|
||||||
id: 3
|
id: 3
|
||||||
uid: 2
|
uid: 2
|
||||||
name: Token A
|
name: Token A
|
||||||
#token: 90a18faa671dc43924b795806ffe4fd169d28c91
|
# token: 90a18faa671dc43924b795806ffe4fd169d28c91
|
||||||
token_hash: d6d404048048812d9e911d93aefbe94fc768d4876fdf75e3bef0bdc67828e0af422846d3056f2f25ec35c51dc92075685ec5
|
token_hash: d6d404048048812d9e911d93aefbe94fc768d4876fdf75e3bef0bdc67828e0af422846d3056f2f25ec35c51dc92075685ec5
|
||||||
token_salt: 99ArgXKlQQ
|
token_salt: 99ArgXKlQQ
|
||||||
token_last_eight: 69d28c91
|
token_last_eight: 69d28c91
|
||||||
created_unix: 946687980
|
created_unix: 946687980
|
||||||
updated_unix: 946687980
|
updated_unix: 946687980
|
||||||
#commented out tokens so you can see what they are in plaintext
|
# commented out tokens so you can see what they are in plaintext
|
||||||
|
|
|
@ -140,3 +140,16 @@
|
||||||
download_count: 0
|
download_count: 0
|
||||||
size: 0
|
size: 0
|
||||||
created_unix: 946684800
|
created_unix: 946684800
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 12
|
||||||
|
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a22
|
||||||
|
repo_id: 2
|
||||||
|
issue_id: 0
|
||||||
|
release_id: 11
|
||||||
|
uploader_id: 2
|
||||||
|
comment_id: 0
|
||||||
|
name: README.md
|
||||||
|
download_count: 0
|
||||||
|
size: 0
|
||||||
|
created_unix: 946684800
|
||||||
|
|
|
@ -66,3 +66,12 @@
|
||||||
tree_path: "README.md"
|
tree_path: "README.md"
|
||||||
created_unix: 946684812
|
created_unix: 946684812
|
||||||
invalidated: true
|
invalidated: true
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 8
|
||||||
|
type: 0 # comment
|
||||||
|
poster_id: 2
|
||||||
|
issue_id: 4 # in repo_id 2
|
||||||
|
content: "comment in private pository"
|
||||||
|
created_unix: 946684811
|
||||||
|
updated_unix: 946684811
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
priority: 0
|
priority: 0
|
||||||
is_closed: true
|
is_closed: true
|
||||||
is_pull: false
|
is_pull: false
|
||||||
num_comments: 0
|
num_comments: 1
|
||||||
created_unix: 946684830
|
created_unix: 946684830
|
||||||
updated_unix: 978307200
|
updated_unix: 978307200
|
||||||
is_locked: false
|
is_locked: false
|
||||||
|
@ -321,3 +321,20 @@
|
||||||
created_unix: 946684830
|
created_unix: 946684830
|
||||||
updated_unix: 978307200
|
updated_unix: 978307200
|
||||||
is_locked: false
|
is_locked: false
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 20
|
||||||
|
repo_id: 23
|
||||||
|
index: 1
|
||||||
|
poster_id: 2
|
||||||
|
original_author_id: 0
|
||||||
|
name: issue for pr
|
||||||
|
content: content
|
||||||
|
milestone_id: 0
|
||||||
|
priority: 0
|
||||||
|
is_closed: false
|
||||||
|
is_pull: true
|
||||||
|
num_comments: 0
|
||||||
|
created_unix: 978307210
|
||||||
|
updated_unix: 978307210
|
||||||
|
is_locked: false
|
||||||
|
|
|
@ -89,3 +89,12 @@
|
||||||
base_branch: main
|
base_branch: main
|
||||||
merge_base: cbff181af4c9c7fee3cf6c106699e07d9a3f54e6
|
merge_base: cbff181af4c9c7fee3cf6c106699e07d9a3f54e6
|
||||||
has_merged: false
|
has_merged: false
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 8
|
||||||
|
type: 0 # gitea pull request
|
||||||
|
status: 2 # mergable
|
||||||
|
issue_id: 20
|
||||||
|
index: 1
|
||||||
|
head_repo_id: 23
|
||||||
|
base_repo_id: 23
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
-
|
-
|
||||||
id: 1 #issue reaction
|
id: 1 # issue reaction
|
||||||
type: zzz # not allowed reaction (added before allowed reaction list has changed)
|
type: zzz # not allowed reaction (added before allowed reaction list has changed)
|
||||||
issue_id: 1
|
issue_id: 1
|
||||||
comment_id: 0
|
comment_id: 0
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
created_unix: 1573248001
|
created_unix: 1573248001
|
||||||
|
|
||||||
-
|
-
|
||||||
id: 2 #issue reaction
|
id: 2 # issue reaction
|
||||||
type: zzz # not allowed reaction (added before allowed reaction list has changed)
|
type: zzz # not allowed reaction (added before allowed reaction list has changed)
|
||||||
issue_id: 1
|
issue_id: 1
|
||||||
comment_id: 0
|
comment_id: 0
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
created_unix: 1573248002
|
created_unix: 1573248002
|
||||||
|
|
||||||
-
|
-
|
||||||
id: 3 #issue reaction
|
id: 3 # issue reaction
|
||||||
type: eyes # allowed reaction
|
type: eyes # allowed reaction
|
||||||
issue_id: 1
|
issue_id: 1
|
||||||
comment_id: 0
|
comment_id: 0
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
created_unix: 1573248003
|
created_unix: 1573248003
|
||||||
|
|
||||||
-
|
-
|
||||||
id: 4 #comment reaction
|
id: 4 # comment reaction
|
||||||
type: laugh # allowed reaction
|
type: laugh # allowed reaction
|
||||||
issue_id: 1
|
issue_id: 1
|
||||||
comment_id: 2
|
comment_id: 2
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
created_unix: 1573248004
|
created_unix: 1573248004
|
||||||
|
|
||||||
-
|
-
|
||||||
id: 5 #comment reaction
|
id: 5 # comment reaction
|
||||||
type: laugh # allowed reaction
|
type: laugh # allowed reaction
|
||||||
issue_id: 1
|
issue_id: 1
|
||||||
comment_id: 2
|
comment_id: 2
|
||||||
|
|
|
@ -136,3 +136,17 @@
|
||||||
is_prerelease: false
|
is_prerelease: false
|
||||||
is_tag: false
|
is_tag: false
|
||||||
created_unix: 946684803
|
created_unix: 946684803
|
||||||
|
|
||||||
|
- id: 11
|
||||||
|
repo_id: 2
|
||||||
|
publisher_id: 2
|
||||||
|
tag_name: "v1.1"
|
||||||
|
lower_tag_name: "v1.1"
|
||||||
|
target: ""
|
||||||
|
title: "v1.1"
|
||||||
|
sha1: "205ac761f3326a7ebe416e8673760016450b5cec"
|
||||||
|
num_commits: 2
|
||||||
|
is_draft: false
|
||||||
|
is_prerelease: false
|
||||||
|
is_tag: false
|
||||||
|
created_unix: 946684803
|
||||||
|
|
|
@ -649,3 +649,10 @@
|
||||||
repo_id: 49
|
repo_id: 49
|
||||||
type: 2
|
type: 2
|
||||||
created_unix: 946684810
|
created_unix: 946684810
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 98
|
||||||
|
repo_id: 59
|
||||||
|
type: 1
|
||||||
|
config: "{}"
|
||||||
|
created_unix: 946684810
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue