mirror of https://github.com/go-gitea/gitea.git
Merge branch 'main' into add-issue-planned-time
This commit is contained in:
commit
2a9009fb02
428
.drone.yml
428
.drone.yml
|
@ -1,428 +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:
|
||||
- apt-get update && apt-get -qqy install ca-certificates curl gnupg
|
||||
- mkdir -p /etc/apt/keyrings && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
- echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
|
||||
- apt-get update && 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
|
|
@ -1,6 +1,6 @@
|
|||
name: Bug Report
|
||||
description: Found something you weren't expecting? Report it here!
|
||||
labels: ["kind/bug"]
|
||||
labels: ["type/bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: Feature Request
|
||||
description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here!
|
||||
labels: ["kind/proposal"]
|
||||
labels: ["type/proposal"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: Web Interface Bug Report
|
||||
description: Something doesn't look quite as it should? Report it here!
|
||||
labels: ["kind/bug", "kind/ui"]
|
||||
labels: ["type/bug", "topic/ui"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
|
|
@ -12,14 +12,17 @@ jobs:
|
|||
- 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 update
|
||||
sudo apt-get remove -y '^dotnet-.*' || true
|
||||
sudo apt-get remove -y '^llvm-.*' || true
|
||||
sudo apt-get remove -y 'php.*' || true
|
||||
sudo apt-get remove -y '^mongodb-.*' || true
|
||||
sudo apt-get remove -y '^mysql-.*' || true
|
||||
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri || true
|
||||
sudo apt-get autoremove -y
|
||||
sudo apt-get clean
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name: release-nightly-assets
|
||||
name: release-nightly
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -48,15 +48,15 @@ jobs:
|
|||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
||||
echo "Cleaned name is ${REF_NAME}"
|
||||
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||
- name: 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
|
||||
uses: jakejarvis/s3-sync-action@master
|
||||
env:
|
||||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||
SOURCE_DIR: dist/release
|
||||
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
|
||||
run: |
|
||||
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
||||
nightly-docker-rootful:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
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\///' -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: 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
|
||||
# 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: |
|
||||
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,141 @@
|
|||
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\///' -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: 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
|
||||
# this will generate tags in the following format:
|
||||
# latest
|
||||
# 1
|
||||
# 1.2
|
||||
# 1.2.3
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
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
|
||||
# this will generate tags in the following format (with -rootless suffix added):
|
||||
# latest
|
||||
# 1
|
||||
# 1.2
|
||||
# 1.2.3
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
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 }}
|
|
@ -103,7 +103,7 @@ rules:
|
|||
property-no-vendor-prefix: null
|
||||
rule-empty-line-before: null
|
||||
rule-selector-property-disallowed-list: null
|
||||
scale-unlimited/declaration-strict-value: [[color, background-color, border-color, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true}]
|
||||
scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}]
|
||||
selector-attribute-name-disallowed-list: null
|
||||
selector-attribute-operator-allowed-list: null
|
||||
selector-attribute-operator-disallowed-list: null
|
||||
|
|
|
@ -24,8 +24,6 @@ rules:
|
|||
document-start:
|
||||
level: error
|
||||
present: false
|
||||
ignore: |
|
||||
/.drone.yml
|
||||
|
||||
document-end:
|
||||
present: false
|
||||
|
|
|
@ -42,13 +42,13 @@ GARGS = "--no-print-directory"
|
|||
|
||||
# The GNU convention is to use the lowercased `prefix` variable/macro to
|
||||
# specify the installation directory. Humor them.
|
||||
GPREFIX = ""
|
||||
GPREFIX =
|
||||
.if defined(PREFIX) && ! defined(prefix)
|
||||
GPREFIX = 'prefix = "$(PREFIX)"'
|
||||
.endif
|
||||
|
||||
.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
|
||||
$(.TARGETS): FRC
|
||||
|
|
|
@ -225,17 +225,20 @@ PRs without a milestone may not be merged.
|
|||
|
||||
### Labels
|
||||
|
||||
Every PR should be labeled correctly with every label that applies. \
|
||||
This includes especially the distinction between `bug` (fixing existing functionality), `feature` (new functionality), `enhancement` (upgrades for existing functionality), and `refactoring` (improving the internal code structure without changing the output (much)). \
|
||||
Furthermore,
|
||||
Almost all labels used inside Gitea can be classified as one of the following:
|
||||
|
||||
- `modifies/…`: Determines which parts of the codebase are affected. These labels will be set through the CI.
|
||||
- `topic/…`: Determines the conceptual component of Gitea that is affected, i.e. issues, projects, or authentication. At best, PRs should only target one component but there might be overlap. Must be set manually.
|
||||
- `type/…`: Determines the type of an issue or PR (feature, refactoring, docs, bug, …). If GitHub supported scoped labels, these labels would be exclusive, so you should set **exactly** one, not more or less (every PR should fall into one of the provided categories, and only one).
|
||||
- `issue/…` / `pr/…`: Labels that are specific to issues or PRs respectively and that are only necessary in a given context, i.e. `issue/not-a-bug` or `pr/need-2-approvals`
|
||||
|
||||
Every PR should be labeled correctly with every label that applies.
|
||||
|
||||
There are also some labels that will be managed automatically.\
|
||||
In particular, these are
|
||||
|
||||
- the amount of pending required approvals
|
||||
- whether this PR is `blocked`, a `backport` or `breaking`
|
||||
- if it targets the `ui` or `api`
|
||||
- if it increases the application `speed`
|
||||
- reduces `memory usage`
|
||||
|
||||
are oftentimes notable labels.
|
||||
- has all `backport`s or needs a manual backport
|
||||
|
||||
### Breaking PRs
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<h1 align="center">Gitea - Git with a cup of tea</h1>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
|
||||
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
|
||||
<a href="https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml?query=branch%3Amain" title="Release Nightly">
|
||||
<img src="https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml/badge.svg?branch=main">
|
||||
</a>
|
||||
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
|
||||
<img src="https://img.shields.io/discord/322538954119184384.svg">
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<h1 align="center">Gitea - Git with a cup of tea</h1>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
|
||||
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
|
||||
<a href="https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml?query=branch%3Amain" title="Release Nightly">
|
||||
<img src="https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml/badge.svg?branch=main">
|
||||
</a>
|
||||
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
|
||||
<img src="https://img.shields.io/discord/322538954119184384.svg">
|
||||
|
|
|
@ -62,7 +62,7 @@ func runListAuth(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
authSources, err := auth_model.Sources()
|
||||
authSources, err := auth_model.Sources(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -100,10 +100,10 @@ func runDeleteAuth(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
source, err := auth_model.GetSourceByID(c.Int64("id"))
|
||||
source, err := auth_model.GetSourceByID(ctx, c.Int64("id"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return auth_service.DeleteSource(source)
|
||||
return auth_service.DeleteSource(ctx, source)
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ import (
|
|||
type (
|
||||
authService struct {
|
||||
initDB func(ctx context.Context) error
|
||||
createAuthSource func(*auth.Source) error
|
||||
updateAuthSource func(*auth.Source) error
|
||||
getAuthSourceByID func(id int64) (*auth.Source, error)
|
||||
createAuthSource func(context.Context, *auth.Source) error
|
||||
updateAuthSource func(context.Context, *auth.Source) error
|
||||
getAuthSourceByID func(ctx context.Context, id int64) (*auth.Source, error)
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -289,12 +289,12 @@ func findLdapSecurityProtocolByName(name string) (ldap.SecurityProtocol, bool) {
|
|||
|
||||
// getAuthSource gets the login source by its id defined in the command line flags.
|
||||
// It returns an error if the id is not set, does not match any source or if the source is not of expected type.
|
||||
func (a *authService) getAuthSource(c *cli.Context, authType auth.Type) (*auth.Source, error) {
|
||||
func (a *authService) getAuthSource(ctx context.Context, c *cli.Context, authType auth.Type) (*auth.Source, error) {
|
||||
if err := argsSet(c, "id"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
authSource, err := a.getAuthSourceByID(c.Int64("id"))
|
||||
authSource, err := a.getAuthSourceByID(ctx, c.Int64("id"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ func (a *authService) addLdapBindDn(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return a.createAuthSource(authSource)
|
||||
return a.createAuthSource(ctx, authSource)
|
||||
}
|
||||
|
||||
// updateLdapBindDn updates a new LDAP via Bind DN authentication source.
|
||||
|
@ -344,7 +344,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
authSource, err := a.getAuthSource(c, auth.LDAP)
|
||||
authSource, err := a.getAuthSource(ctx, c, auth.LDAP)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return a.updateAuthSource(authSource)
|
||||
return a.updateAuthSource(ctx, authSource)
|
||||
}
|
||||
|
||||
// addLdapSimpleAuth adds a new LDAP (simple auth) authentication source.
|
||||
|
@ -383,7 +383,7 @@ func (a *authService) addLdapSimpleAuth(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return a.createAuthSource(authSource)
|
||||
return a.createAuthSource(ctx, authSource)
|
||||
}
|
||||
|
||||
// updateLdapBindDn updates a new LDAP (simple auth) authentication source.
|
||||
|
@ -395,7 +395,7 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
authSource, err := a.getAuthSource(c, auth.DLDAP)
|
||||
authSource, err := a.getAuthSource(ctx, c, auth.DLDAP)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -405,5 +405,5 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return a.updateAuthSource(authSource)
|
||||
return a.updateAuthSource(ctx, authSource)
|
||||
}
|
||||
|
|
|
@ -210,15 +210,15 @@ func TestAddLdapBindDn(t *testing.T) {
|
|||
initDB: func(context.Context) error {
|
||||
return nil
|
||||
},
|
||||
createAuthSource: func(authSource *auth.Source) error {
|
||||
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
createdAuthSource = authSource
|
||||
return nil
|
||||
},
|
||||
updateAuthSource: func(authSource *auth.Source) error {
|
||||
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
assert.FailNow(t, "case %d: should not call updateAuthSource", n)
|
||||
return nil
|
||||
},
|
||||
getAuthSourceByID: func(id int64) (*auth.Source, error) {
|
||||
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
|
||||
assert.FailNow(t, "case %d: should not call getAuthSourceByID", n)
|
||||
return nil, nil
|
||||
},
|
||||
|
@ -441,15 +441,15 @@ func TestAddLdapSimpleAuth(t *testing.T) {
|
|||
initDB: func(context.Context) error {
|
||||
return nil
|
||||
},
|
||||
createAuthSource: func(authSource *auth.Source) error {
|
||||
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
createdAuthSource = authSource
|
||||
return nil
|
||||
},
|
||||
updateAuthSource: func(authSource *auth.Source) error {
|
||||
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
assert.FailNow(t, "case %d: should not call updateAuthSource", n)
|
||||
return nil
|
||||
},
|
||||
getAuthSourceByID: func(id int64) (*auth.Source, error) {
|
||||
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
|
||||
assert.FailNow(t, "case %d: should not call getAuthSourceByID", n)
|
||||
return nil, nil
|
||||
},
|
||||
|
@ -896,15 +896,15 @@ func TestUpdateLdapBindDn(t *testing.T) {
|
|||
initDB: func(context.Context) error {
|
||||
return nil
|
||||
},
|
||||
createAuthSource: func(authSource *auth.Source) error {
|
||||
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
assert.FailNow(t, "case %d: should not call createAuthSource", n)
|
||||
return nil
|
||||
},
|
||||
updateAuthSource: func(authSource *auth.Source) error {
|
||||
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
updatedAuthSource = authSource
|
||||
return nil
|
||||
},
|
||||
getAuthSourceByID: func(id int64) (*auth.Source, error) {
|
||||
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
|
||||
if c.id != 0 {
|
||||
assert.Equal(t, c.id, id, "case %d: wrong id", n)
|
||||
}
|
||||
|
@ -1286,15 +1286,15 @@ func TestUpdateLdapSimpleAuth(t *testing.T) {
|
|||
initDB: func(context.Context) error {
|
||||
return nil
|
||||
},
|
||||
createAuthSource: func(authSource *auth.Source) error {
|
||||
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
assert.FailNow(t, "case %d: should not call createAuthSource", n)
|
||||
return nil
|
||||
},
|
||||
updateAuthSource: func(authSource *auth.Source) error {
|
||||
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
|
||||
updatedAuthSource = authSource
|
||||
return nil
|
||||
},
|
||||
getAuthSourceByID: func(id int64) (*auth.Source, error) {
|
||||
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
|
||||
if c.id != 0 {
|
||||
assert.Equal(t, c.id, id, "case %d: wrong id", n)
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ func runAddOauth(c *cli.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
return auth_model.CreateSource(&auth_model.Source{
|
||||
return auth_model.CreateSource(ctx, &auth_model.Source{
|
||||
Type: auth_model.OAuth2,
|
||||
Name: c.String("name"),
|
||||
IsActive: true,
|
||||
|
@ -203,7 +203,7 @@ func runUpdateOauth(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
source, err := auth_model.GetSourceByID(c.Int64("id"))
|
||||
source, err := auth_model.GetSourceByID(ctx, c.Int64("id"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -294,5 +294,5 @@ func runUpdateOauth(c *cli.Context) error {
|
|||
oAuth2Config.CustomURLMapping = customURLMapping
|
||||
source.Cfg = oAuth2Config
|
||||
|
||||
return auth_model.UpdateSource(source)
|
||||
return auth_model.UpdateSource(ctx, source)
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ func runAddSMTP(c *cli.Context) error {
|
|||
smtpConfig.Auth = "PLAIN"
|
||||
}
|
||||
|
||||
return auth_model.CreateSource(&auth_model.Source{
|
||||
return auth_model.CreateSource(ctx, &auth_model.Source{
|
||||
Type: auth_model.SMTP,
|
||||
Name: c.String("name"),
|
||||
IsActive: active,
|
||||
|
@ -176,7 +176,7 @@ func runUpdateSMTP(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
source, err := auth_model.GetSourceByID(c.Int64("id"))
|
||||
source, err := auth_model.GetSourceByID(ctx, c.Int64("id"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -197,5 +197,5 @@ func runUpdateSMTP(c *cli.Context) error {
|
|||
|
||||
source.Cfg = smtpConfig
|
||||
|
||||
return auth_model.UpdateSource(source)
|
||||
return auth_model.UpdateSource(ctx, source)
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -18,7 +19,7 @@ import (
|
|||
|
||||
var (
|
||||
generators = []struct {
|
||||
gen func() (string, error)
|
||||
gen func(ctx context.Context) (string, error)
|
||||
name string
|
||||
}{
|
||||
{
|
||||
|
@ -41,16 +42,17 @@ func main() {
|
|||
fmt.Printf("PrepareTestDatabase: %+v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
ctx := context.Background()
|
||||
if len(os.Args) == 0 {
|
||||
for _, r := range os.Args {
|
||||
if err := generate(r); err != nil {
|
||||
if err := generate(ctx, r); err != nil {
|
||||
fmt.Printf("generate '%s': %+v\n", r, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for _, g := range generators {
|
||||
if err := generate(g.name); err != nil {
|
||||
if err := generate(ctx, g.name); err != nil {
|
||||
fmt.Printf("generate '%s': %+v\n", g.name, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
@ -58,10 +60,10 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
func generate(name string) error {
|
||||
func generate(ctx context.Context, name string) error {
|
||||
for _, g := range generators {
|
||||
if g.name == name {
|
||||
data, err := g.gen()
|
||||
data, err := g.gen(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -951,7 +951,7 @@ LEVEL = Info
|
|||
;; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility.
|
||||
;; External wiki and issue tracker can't be enabled by default as it requires additional settings.
|
||||
;; Disabled repo units will not be added to new repositories regardless if it is in the default list.
|
||||
;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages
|
||||
;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions
|
||||
;;
|
||||
;; Comma separated list of default forked repo units.
|
||||
;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS.
|
||||
|
@ -1421,7 +1421,7 @@ LEVEL = Info
|
|||
;DATADIR = queues/ ; Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
|
||||
;;
|
||||
;; Default queue length before a channel queue will block
|
||||
;LENGTH = 100
|
||||
;LENGTH = 100000
|
||||
;;
|
||||
;; Batch size to send for batched queues
|
||||
;BATCH_LENGTH = 20
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Avancé"
|
||||
slug: "administration"
|
||||
sidebar_position: 30
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Avancé"
|
||||
sidebar_position: 20
|
||||
identifier: "administration"
|
||||
---
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "運維"
|
||||
slug: "administration"
|
||||
sidebar_position: 30
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "運維"
|
||||
sidebar_position: 20
|
||||
identifier: "administration"
|
||||
---
|
|
@ -1,68 +0,0 @@
|
|||
---
|
||||
date: "2017-01-01T16:00:00+02:00"
|
||||
title: "用法: 備份與還原"
|
||||
slug: "backup-and-restore"
|
||||
sidebar_position: 11
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/backup-and-restore
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "administration"
|
||||
name: "備份與還原"
|
||||
sidebar_position: 11
|
||||
identifier: "backup-and-restore"
|
||||
---
|
||||
|
||||
# 備份與還原
|
||||
|
||||
Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續會提供還原指令,讓你可以輕易的將備份資料及還原到另外一台機器。
|
||||
|
||||
## 備份指令 (`dump`)
|
||||
|
||||
首先,切換到執行 Gitea 的使用者: `su git` (請修改成您指定的使用者),並在安裝目錄內執行 `./gitea dump` 指令,你可以看到 console 畫面如下:
|
||||
|
||||
```
|
||||
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
|
||||
2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
|
||||
2016/12/27 22:32:22 Dumping database...
|
||||
2016/12/27 22:32:22 Packing dump files...
|
||||
2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001
|
||||
2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
|
||||
```
|
||||
|
||||
備份出來的 `gitea-dump-1482906742.zip` 檔案,檔案內會包含底下內容:
|
||||
|
||||
* `custom/conf/app.ini` - 伺服器設定檔。
|
||||
* `gitea-db.sql` - SQL 備份檔案。
|
||||
* `gitea-repo.zip` - 此 zip 檔案為全部的 repo 目錄。
|
||||
請參考 Config -> repository -> `ROOT` 所設定的路徑。
|
||||
* `log/` - 全部 logs 檔案,如果你要 migrate 到其他伺服器,此目錄不用保留。
|
||||
|
||||
你可以透過設定 `--tempdir` 指令參數來指定備份檔案目錄,或者是設定 `TMPDIR` 環境變數來達到此功能。
|
||||
|
||||
## 還原指令 (`restore`)
|
||||
|
||||
持續更新中: 此文件尚未完成.
|
||||
|
||||
例:
|
||||
|
||||
```sh
|
||||
unzip gitea-dump-1610949662.zip
|
||||
cd gitea-dump-1610949662
|
||||
mv data/conf/app.ini /etc/gitea/conf/app.ini
|
||||
mv data/* /var/lib/gitea/data/
|
||||
mv log/* /var/lib/gitea/log/
|
||||
mv repos/* /var/lib/gitea/repositories/
|
||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
||||
|
||||
# mysql
|
||||
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
||||
# sqlite3
|
||||
sqlite3 $DATABASE_PATH <gitea-db.sql
|
||||
# postgres
|
||||
psql -U $USER -d $DATABASE < gitea-db.sql
|
||||
|
||||
service gitea restart
|
||||
```
|
|
@ -102,7 +102,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build
|
|||
- `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user.
|
||||
- `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org.
|
||||
- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\]
|
||||
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
|
||||
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
|
||||
- `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: Comma separated list of default forked repo units. The set of allowed values and rules is the same as `DEFAULT_REPO_UNITS`.
|
||||
- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository.
|
||||
- `DISABLE_MIGRATIONS`: **false**: Disable migrating feature.
|
||||
|
@ -483,7 +483,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`.
|
||||
- `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
|
||||
- `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.
|
||||
|
@ -517,7 +517,6 @@ And the following unique queues:
|
|||
- `SECRET_KEY`: **\<random at every install\>**: Global secret key. This key is VERY IMPORTANT, if you lost it, the data encrypted by it (like 2FA secret) can't be decrypted anymore.
|
||||
- `SECRET_KEY_URI`: **_empty_**: Instead of defining SECRET_KEY, this option can be used to use the key stored in a file (example value: `file:/etc/gitea/secret_key`). It shouldn't be lost like SECRET_KEY.
|
||||
- `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days.
|
||||
- `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username.
|
||||
- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication
|
||||
information.
|
||||
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy
|
||||
|
|
|
@ -102,7 +102,7 @@ menu:
|
|||
- `ENABLE_PUSH_CREATE_USER`: **false**: 允许用户将本地存储库推送到Gitea,并为用户自动创建它们。
|
||||
- `ENABLE_PUSH_CREATE_ORG`: **false**: 允许用户将本地存储库推送到Gitea,并为组织自动创建它们。
|
||||
- `DISABLED_REPO_UNITS`: **_empty_**: 逗号分隔的全局禁用的仓库单元列表。允许的值是:: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\]
|
||||
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: 逗号分隔的默认新仓库单元列表。允许的值是:: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. 注意:目前无法停用代码和发布。如果您指定了默认的仓库单元,您仍应将它们列出以保持未来的兼容性。外部wiki和问题跟踪器不能默认启用,因为它需要额外的设置。禁用的仓库单元将不会添加到新的仓库中,无论它是否在默认列表中。
|
||||
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions**: 逗号分隔的默认新仓库单元列表。允许的值是:: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. 注意:目前无法停用代码和发布。如果您指定了默认的仓库单元,您仍应将它们列出以保持未来的兼容性。外部wiki和问题跟踪器不能默认启用,因为它需要额外的设置。禁用的仓库单元将不会添加到新的仓库中,无论它是否在默认列表中。
|
||||
- `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: 逗号分隔的默认分叉仓库单元列表。允许的值和规则与`DEFAULT_REPO_UNITS`相同。
|
||||
- `PREFIX_ARCHIVE_FILES`: **true**: 通过将存档文件放置在以仓库命名的目录中来添加前缀。
|
||||
- `DISABLE_MIGRATIONS`: **false**: 禁用迁移功能。
|
||||
|
@ -472,7 +472,7 @@ menu:
|
|||
|
||||
- `TYPE`:**level**:通用队列类型,当前支持:`level`(在内部使用 LevelDB)、`channel`、`redis`、`dummy`。无效的类型将视为 `level`。
|
||||
- `DATADIR`:**queues/common**:用于存储 level 队列的基本 DataDir。单独的队列的 `DATADIR` 可以在 `queue.name` 部分进行设置。相对路径将根据 `%(APP_DATA_PATH)s` 变为绝对路径。
|
||||
- `LENGTH`:**100**:通道队列阻塞之前的最大队列大小
|
||||
- `LENGTH`:**100000**:通道队列阻塞之前的最大队列大小
|
||||
- `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`。
|
||||
- `QUEUE_NAME`:**_queue**:默认的 redis 和磁盘队列名称的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`,但可以在特定的 `queue.name` 部分中进行覆盖。
|
||||
|
@ -506,7 +506,6 @@ Gitea 创建以下非唯一队列:
|
|||
- `SECRET_KEY`: **\<每次安装时随机生成\>**:全局服务器安全密钥。这个密钥非常重要,如果丢失将无法解密加密的数据(例如 2FA)。
|
||||
- `SECRET_KEY_URI`: **_empty_**:与定义 `SECRET_KEY` 不同,此选项可用于使用存储在文件中的密钥(示例值:`file:/etc/gitea/secret_key`)。它不应该像 `SECRET_KEY` 一样容易丢失。
|
||||
- `LOGIN_REMEMBER_DAYS`: **7**:Cookie 保存时间,单位为天。
|
||||
- `COOKIE_USERNAME`: **gitea\_awesome**:保存用户名的 Cookie 名称。
|
||||
- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**:保存自动登录信息的 Cookie 名称。
|
||||
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**:反向代理认证的 HTTP 头部名称,用于提供用户信息。
|
||||
- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**:反向代理认证的 HTTP 头部名称,用于提供邮箱信息。
|
||||
|
|
|
@ -381,3 +381,9 @@ If you really need to do so, to make Gitea works with sub-path (eg: `http://exam
|
|||
1. Set `[server] ROOT_URL = http://example.com/gitea/` in your `app.ini` file.
|
||||
2. Make the reverse-proxy pass `http://example.com/gitea/foo` to `http://gitea-server:3000/foo`.
|
||||
3. Make sure the reverse-proxy not decode the URI, the request `http://example.com/gitea/a%2Fb` should be passed as `http://gitea-server:3000/a%2Fb`.
|
||||
|
||||
## Docker / Container Registry
|
||||
|
||||
The container registry uses a fixed sub-path `/v2` which can't be changed.
|
||||
Even if you deploy Gitea with a different sub-path, `/v2` will be used by the `docker` client.
|
||||
Therefore you may need to add an additional route to your reverse proxy configuration.
|
||||
|
|
|
@ -23,7 +23,7 @@ If you don't want your repository to be visible for search engines read further.
|
|||
## Block search engines indexation using robots.txt
|
||||
|
||||
To make Gitea serve a custom `robots.txt` (default: empty 404) for top level installations,
|
||||
create a file called `robots.txt` in the [`custom` folder or `CustomPath`](administration/customizing-gitea.md)
|
||||
create a file with path `public/robots.txt` in the [`custom` folder or `CustomPath`](administration/customizing-gitea.md)
|
||||
|
||||
Examples on how to configure the `robots.txt` can be found at [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt).
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ menu:
|
|||
|
||||
## 使用 robots.txt 阻止搜索引擎索引
|
||||
|
||||
为了使 Gitea 为顶级安装提供自定义的`robots.txt`(默认为空的 404),请在[`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中创建一个名为 `robots.txt` 的文件。
|
||||
为了使 Gitea 为顶级安装提供自定义的`robots.txt`(默认为空的 404),请在 [`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中创建一个名为 `public/robots.txt` 的文件。
|
||||
|
||||
有关如何配置 `robots.txt` 的示例,请参考 [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt)。
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2021-01-22T00:00:00+02:00"
|
||||
title: "Übersetzung"
|
||||
slug: "contributing"
|
||||
sidebar_position: 35
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Übersetzung"
|
||||
sidebar_position: 50
|
||||
identifier: "contributing"
|
||||
---
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2021-01-22T00:00:00+02:00"
|
||||
title: "貢獻"
|
||||
slug: "contributing"
|
||||
sidebar_position: 35
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "貢獻"
|
||||
sidebar_position: 50
|
||||
identifier: "contributing"
|
||||
---
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "在地化"
|
||||
slug: "localization"
|
||||
sidebar_position: 70
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/localization
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "contributing"
|
||||
name: "在地化"
|
||||
sidebar_position: 70
|
||||
identifier: "localization"
|
||||
---
|
||||
|
||||
# 在地化
|
||||
|
||||
我們在 [Crowdin 專案](https://crowdin.com/project/gitea)上進行在地化工作。
|
||||
|
||||
**英語系**的翻譯,可在修改[英文語言檔](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini)後提出合併請求。
|
||||
|
||||
**非英語系**的翻譯,請前往上述的 Crowdin 專案。
|
||||
|
||||
## 已支援的語言
|
||||
|
||||
上述 Crowdin 專案中列出的語言在翻譯超過 25% 後將被支援。
|
||||
|
||||
翻譯被認可後將在下次 Crowdin 同步後進入到主儲存庫,通常是在任何合併請求被合併之後。
|
||||
|
||||
這表示更改的翻譯要到下次 Gitea 發佈後才會出現。
|
||||
|
||||
如果您使用的是最新建置,它將會在同步完成、您更新後出現。
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "開發"
|
||||
slug: "development"
|
||||
sidebar_position: 40
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "開發"
|
||||
sidebar_position: 40
|
||||
identifier: "development"
|
||||
---
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
date: "2019-04-15T17:29:00+08:00"
|
||||
title: "整合"
|
||||
slug: "integrations"
|
||||
sidebar_position: 65
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/integrations
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "development"
|
||||
name: "整合"
|
||||
sidebar_position: 65
|
||||
identifier: "integrations"
|
||||
---
|
||||
|
||||
# 整合
|
||||
|
||||
Gitea 有著很棒的第三方整合社群, 以及其它有著一流支援的專案。
|
||||
|
||||
我們持續的整理一份清單以追蹤他們!請到 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 查看。
|
||||
|
||||
如果您正在找尋有關 [CI/CD](https://gitea.com/gitea/awesome-gitea#user-content-devops)、[SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk) 或是其它佈景主題,您可以在存儲庫 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 找到他們。
|
|
@ -1,41 +0,0 @@
|
|||
---
|
||||
date: "2019-04-15T17:29:00+08:00"
|
||||
title: "遷移介面"
|
||||
slug: "migrations-interfaces"
|
||||
sidebar_position: 55
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/migrations-interfaces
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "development"
|
||||
name: "遷移介面"
|
||||
sidebar_position: 55
|
||||
identifier: "migrations-interfaces"
|
||||
---
|
||||
|
||||
# 遷移功能
|
||||
|
||||
完整的遷移從 Gitea 1.9.0 開始提供。它定義了兩個介面用來從其它 Git 託管平臺遷移儲存庫資料到 Gitea,未來或許會提供遷移到其它 git 託管平臺。
|
||||
目前已實作了從 Github, Gitlab 和其它 Gitea 遷移資料。
|
||||
|
||||
Gitea 定義了一些基本物件於套件 [modules/migration](https://github.com/go-gitea/gitea/tree/master/modules/migration)。
|
||||
分別是 `Repository`, `Milestone`, `Release`, `ReleaseAsset`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`。
|
||||
|
||||
## Downloader 介面
|
||||
|
||||
從新的 Git 託管平臺遷移,有兩個新的步驟。
|
||||
|
||||
- 您必須實作一個 `Downloader`,它用來取得儲存庫資訊。
|
||||
- 您必須實作一個 `DownloaderFactory`,它用來偵測 URL 是否符合並建立上述的 `Downloader`。
|
||||
- 您需要在 `init()` 透過 `RegisterDownloaderFactory` 來註冊 `DownloaderFactory`。
|
||||
|
||||
您可以在 [downloader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/downloader.go) 中找到這些介面。
|
||||
|
||||
## Uploader 介面
|
||||
|
||||
目前只有 `GiteaLocalUploader` 被實作出來,所以我們只能通過 `Uploader` 儲存已下載的資料到本地的 Gitea 實例。
|
||||
目前尚未支援其它 Uploader。
|
||||
|
||||
您可以在 [uploader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/uploader.go) 中找到這些介面。
|
|
@ -1,96 +0,0 @@
|
|||
---
|
||||
date: "2019-04-19:44:00+01:00"
|
||||
title: "OAuth2 提供者"
|
||||
slug: "oauth2-provider"
|
||||
sidebar_position: 41
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/oauth2-provider
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "development"
|
||||
name: "OAuth2 提供者"
|
||||
sidebar_position: 41
|
||||
identifier: "oauth2-provider"
|
||||
---
|
||||
|
||||
# OAuth2 提供者
|
||||
|
||||
**目錄**
|
||||
|
||||
Gitea 支援作為 OAuth2 提供者,能讓第三方程式能在使用者同意下存取 Gitea 的資源。此功能自 1.8.0 版開始提供。
|
||||
|
||||
## Endpoint
|
||||
|
||||
| Endpoint | URL |
|
||||
| ---------------------- | --------------------------- |
|
||||
| Authorization Endpoint | `/login/oauth/authorize` |
|
||||
| Access Token Endpoint | `/login/oauth/access_token` |
|
||||
|
||||
## 支援的 OAuth2 Grant
|
||||
|
||||
目前 Gitea 只支援 [**Authorization Code Grant**](https://tools.ietf.org/html/rfc6749#section-1.3.1) 標準並額外支援下列擴充標準:
|
||||
|
||||
- [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636)
|
||||
- [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth)
|
||||
|
||||
若想要讓第三方程式使用 Authorization Code Grant,需先在「設定」(`/user/settings/applications`)中註冊一個新的應用程式。
|
||||
|
||||
## Scope
|
||||
|
||||
目前 Gitea 尚未支援 scope (參見 [#4300](https://github.com/go-gitea/gitea/issues/4300)),所有的第三方程式都可獲得該使用者及他所屬的組織中所有資源的存取權。
|
||||
|
||||
## 範例
|
||||
|
||||
**備註:** 此範例未使用 PKCE。
|
||||
|
||||
1. 重新導向使用者到 authorization endpoint 以獲得他同意授權存取資源:
|
||||
<!-- 1. Redirect to user to the authorization endpoint in order to get their consent for accessing the resources: -->
|
||||
|
||||
```curl
|
||||
https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE
|
||||
```
|
||||
|
||||
在設定中註冊應用程式以獲得 `CLIENT_ID`。`STATE` 是一個隨機的字串,它將在使用者授權後發送回您的應用程式。`state` 參數是選用的,但應該要用它來防止 CSRF 攻擊。
|
||||
|
||||
![Authorization Page](/authorize.png)
|
||||
|
||||
使用者將會被詢問是否授權給您的應用程式。如果它們同意了,使用者將被重新導向到 `REDIRECT_URL`,例如:
|
||||
|
||||
```curl
|
||||
https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE
|
||||
```
|
||||
|
||||
1. 使用重新導向提供的 `code`,您可以要求一個新的應用程式和 Refresh Token。Access Token Endpoint 接受 POST 請求使用 `application/json` 或 `application/x-www-form-urlencoded` 類型的請求內容,例如:
|
||||
|
||||
```curl
|
||||
POST https://[YOUR-GITEA-URL]/login/oauth/access_token
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"client_id": "YOUR_CLIENT_ID",
|
||||
"client_secret": "YOUR_CLIENT_SECRET",
|
||||
"code": "RETURNED_CODE",
|
||||
"grant_type": "authorization_code",
|
||||
"redirect_uri": "REDIRECT_URI"
|
||||
}
|
||||
```
|
||||
|
||||
回應:
|
||||
|
||||
```json
|
||||
{
|
||||
"access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug",
|
||||
"token_type": "bearer",
|
||||
"expires_in": 3600,
|
||||
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw"
|
||||
}
|
||||
```
|
||||
|
||||
`CLIENT_SECRET` 是產生給此應用程式的唯一密鑰。請記住該密鑰只會在您於 Gitea 建立/註冊應用程式時出現一次。若您遺失密鑰,您必須在該應用程式的設定中重新產生密鑰。
|
||||
|
||||
`access_token` 請求中的 `REDIRECT_URI` 必須符合 `authorize` 請求中的 `REDIRECT_URI`。
|
||||
|
||||
1. 發送 [API requests](development/api-usage.md#oauth2-provider) 時使用 `access_token` 以存取使用者的資源。
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2017-01-20T15:00:00+08:00"
|
||||
title: "Aide"
|
||||
slug: "help"
|
||||
sidebar_position: 5
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Aide"
|
||||
sidebar_position: 100
|
||||
identifier: "help"
|
||||
---
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2017-01-20T15:00:00+08:00"
|
||||
title: "幫助"
|
||||
slug: "help"
|
||||
sidebar_position: 5
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "幫助"
|
||||
sidebar_position: 100
|
||||
identifier: "help"
|
||||
---
|
|
@ -1,35 +0,0 @@
|
|||
---
|
||||
date: "2018-05-21T15:00:00+00:00"
|
||||
title: "取得協助"
|
||||
slug: "support"
|
||||
sidebar_position: 20
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/seek-help
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "help"
|
||||
name: "取得協助"
|
||||
sidebar_position: 20
|
||||
identifier: "support"
|
||||
---
|
||||
|
||||
# 取得協助
|
||||
|
||||
- [Discord 聊天室](https://discord.gg/Gitea)
|
||||
- [Discourse 討論區](https://discourse.gitea.io/)
|
||||
|
||||
**備註:** 尋求支援時,若能先備妥下列資訊將可讓提供協助的人能快速地分析您的問題:
|
||||
|
||||
1. 您的 `app.ini` (必要時清除掉任何機密資訊)
|
||||
2. `gitea.log` (以及任何有關的日誌檔案)
|
||||
- 例:如果錯誤和資料庫相關,提供 `xorm.log` 可能會有幫助
|
||||
3. 您看到的任何錯誤訊息
|
||||
4. 儘可能地在 [try.gitea.io](https://try.gitea.io) 觸發您的問題並記下步驟,以便其他人能重現那個問題。
|
||||
- 這將讓我們更有機會快速地找出問題的根源並解決它。
|
||||
5. 堆棧跟踪,[請參考英文文檔](https://docs.gitea.com/help/support)
|
||||
|
||||
## 錯誤回報
|
||||
|
||||
如果您發現錯誤,請到 [GitHub 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
date: "2023-01-07T22:03:00+01:00"
|
||||
title: "Dokumentation"
|
||||
slug: /
|
||||
sidebar_position: 10
|
||||
toc: false
|
||||
draft: false
|
||||
---
|
||||
|
||||
# Was ist Gitea?
|
||||
|
||||
Gitea ist ein einfacher, selbst gehosteter Git-Service. Änlich wie GitHub, Bitbucket oder GitLab.
|
||||
|
||||
Gitea ist ein [Gogs](http://gogs.io)-Fork.
|
||||
|
||||
## Ziele
|
||||
|
||||
* Einfach zu installieren
|
||||
* Plattformübergreifend
|
||||
* Leichtgewichtig
|
||||
* Quelloffen
|
||||
|
||||
## System Voraussetzungen
|
||||
|
||||
* Ein Raspberry Pi 3 ist leistungsstark genug, um Gitea für kleine Belastungen laufen zu lassen.
|
||||
* 2 CPU Kerne und 1GB RAM sind für kleine Teams/Projekte ausreichend.
|
||||
* Gitea sollte unter einem seperaten nicht-root Account auf UNIX-Systemen ausgeführt werden.
|
||||
* Achtung: Gitea verwaltet die `~/.ssh/authorized_keys` Datei. Gitea unter einem normalen Benutzer auszuführen könnte dazu führen, dass dieser sich nicht mehr anmelden kann.
|
||||
* [Git](https://git-scm.com/) Version 2.0 oder aktueller wird benötigt.
|
||||
* Wenn Git >= 2.1.2 und [Git LFS](https://git-lfs.github.com/) vorhanden ist, dann wird Git LFS Support automatisch für Gitea aktiviert.
|
||||
* Wenn Git >= 2.18, dann wird das Rendern von Commit-Graphen automatisch aktiviert.
|
||||
|
||||
## Browser Unterstützung
|
||||
|
||||
* Die neuesten zwei Versionen von Chrome, Firefox, Safari und Edge
|
||||
* Firefox ESR
|
|
@ -1,273 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Documentation"
|
||||
slug: /
|
||||
sidebar_position: 10
|
||||
toc: false
|
||||
draft: false
|
||||
---
|
||||
|
||||
# A propos de Gitea
|
||||
|
||||
Gitea est un service Git auto-hébergé très simple à installer et à utiliser. Il est similaire à GitHub, Bitbucket ou Gitlab. Le développement initial provient sur [Gogs] (http://gogs.io), mais nous l'avons forké puis renommé Gitea. Si vous souhaitez en savoir plus sur les raisons pour lesquelles nous avons fait cela, lisez [cette publication] (https://blog.gitea.com/welcome-to-gitea/) sur le blog.
|
||||
|
||||
## Objectif
|
||||
|
||||
Le but de ce projet est de fournir de la manière la plus simple, la plus rapide et sans complication un service Git auto-hébergé. Grâce à Go, cela peut se faire via un binaire indépendant fonctionnant sur toutes les plateformes que Go prend en charge, y compris Linux, macOS et Windows, même sur des architectures comme ARM ou PowerPC.
|
||||
|
||||
## Fonctionalités
|
||||
|
||||
- Tableau de bord de l'utilisateur
|
||||
- Choix du contexte (organisation ou utilisateur actuel)
|
||||
- Chronologie de l'activité
|
||||
- Révisions (_Commits_)
|
||||
- Tickets
|
||||
- Demande d'ajout (_Pull request_)
|
||||
- Création de dépôts
|
||||
- Liste des dépôts
|
||||
- Liste de vos organisations
|
||||
- Liste des dépôts miroires
|
||||
- Tableau de bord des tickets
|
||||
- Choix du contexte (organisation ou utilisateur actuel)
|
||||
- Filtres
|
||||
- Ouvert
|
||||
- Fermé
|
||||
- Vos dépôts
|
||||
- Tickets assignés
|
||||
- Vos tickets
|
||||
- Dépôts
|
||||
- Options de tri
|
||||
- Plus vieux
|
||||
- Dernière mise à jour
|
||||
- Nombre de commentaires
|
||||
- Tableau de bord des demandes d'ajout
|
||||
- Identique au tableau de bord des tickets
|
||||
- Types de dépôt
|
||||
- Miroire
|
||||
- Normal
|
||||
- Migré
|
||||
- Notifications (courriel et web)
|
||||
- Lu
|
||||
- Non lu
|
||||
- Épinglé
|
||||
- Page d'exploration
|
||||
- Utilisateurs
|
||||
- Dépôts
|
||||
- Organisations
|
||||
- Moteur de recherche
|
||||
- Interface personnalisables
|
||||
- Fichiers publiques remplaçables (logo, css, etc)
|
||||
- Protection CSRF et XSS
|
||||
- Support d'HTTPS
|
||||
- Configuration des types et de la taille maximale des fichiers téléversés
|
||||
- Journalisation (_Log_)
|
||||
- Configuration
|
||||
- Base de données
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- SQLite3
|
||||
- MSSQL
|
||||
- [TiDB](https://github.com/pingcap/tidb) (MySQL protocol)
|
||||
- Fichier de configuration
|
||||
- Voir [ici](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
|
||||
- Panel d'administration
|
||||
- Statistiques
|
||||
- Actions
|
||||
- Suppression des comptes inactifs
|
||||
- Suppression des dépôts archivés
|
||||
- Suppression des dépôts pour lesquels il manque leurs fichiers
|
||||
- Exécution du _garbage collector_ sur les dépôts
|
||||
- Ré-écriture des clefs SSH
|
||||
- Resynchronisation des hooks
|
||||
- Recreation des dépôts manquants
|
||||
- Status du server
|
||||
- Temps de disponibilité
|
||||
- Mémoire
|
||||
- Nombre de goroutines
|
||||
- et bien plus...
|
||||
- Gestion des utilisateurs
|
||||
- Recherche
|
||||
- Tri
|
||||
- Dernière connexion
|
||||
- Méthode d'authentification
|
||||
- Nombre maximum de dépôts
|
||||
- Désactivation du compte
|
||||
- Permissions d'administration
|
||||
- Permission pour crééer des hooks
|
||||
- Permission pour crééer des organisations
|
||||
- Permission pour importer des dépôts
|
||||
- Gestion des organisations
|
||||
- Membres
|
||||
- Équipes
|
||||
- Avatar
|
||||
- Hooks
|
||||
- Gestion des depôts
|
||||
- Voir toutes les informations pour un dépôt donné et gérer tous les dépôts
|
||||
- Méthodes d'authentification
|
||||
- OAuth
|
||||
- PAM
|
||||
- LDAP
|
||||
- SMTP
|
||||
- Visualisation de la configuration
|
||||
- Tout ce que contient le fichier de configuration
|
||||
- Alertes du système
|
||||
- Quand quelque chose d'inattendu survient
|
||||
- Surveillance
|
||||
- Processus courrants
|
||||
- Tâches CRON
|
||||
- Mise à jour des dépôts miroires
|
||||
- Vérification de l'état des dépôts
|
||||
- Vérification des statistiques des dépôts
|
||||
- Nettoyage des anciennes archives
|
||||
- Variables d'environement
|
||||
- Options de ligne de commande
|
||||
- Internationalisation ([21 langues](https://github.com/go-gitea/gitea/tree/master/options/locale))
|
||||
- Courriel
|
||||
- Notifications
|
||||
- Confirmation d'inscription
|
||||
- Ré-initialisation du mot de passe
|
||||
- Support de _reverse proxy_
|
||||
- _subpaths_ inclus
|
||||
- Utilisateurs
|
||||
- Profil
|
||||
- Nom
|
||||
- Prénom
|
||||
- Courriel
|
||||
- Site internet
|
||||
- Date de création
|
||||
- Abonnés et abonnements
|
||||
- Organisations
|
||||
- Dépôts
|
||||
- Activité
|
||||
- Dépôts suivis
|
||||
- Paramètres
|
||||
- Identiques au profil avec en plus les éléments ci-dessous
|
||||
- Rendre l'adresse de courriel privée
|
||||
- Avatar
|
||||
- Gravatar
|
||||
- Libravatar
|
||||
- Personnalisé
|
||||
- Mot de passe
|
||||
- Courriels multiples
|
||||
- Clefs SSH
|
||||
- Applications connectées
|
||||
- Authentification à double facteurs
|
||||
- Identités OAuth2 attachées
|
||||
- Suppression du compte
|
||||
- Dépôts
|
||||
- Clone à partir de SSH / HTTP / HTTPS
|
||||
- Git LFS
|
||||
- Suivre, Voter, Fork
|
||||
- Voir les personnes qui suivent, les votes et les forks
|
||||
- Code
|
||||
- Navigation entre les branches
|
||||
- Création ou téléversement de fichier depuis le navigateur
|
||||
- URLs pour clôner le dépôt
|
||||
- Téléchargement
|
||||
- ZIP
|
||||
- TAR.GZ
|
||||
- Édition en ligne
|
||||
- Éditeur Markdown
|
||||
- Éditeur de texte
|
||||
- Coloration syntaxique
|
||||
- Visualisation des Diffs
|
||||
- Visualisation
|
||||
- Possibilité de choisir où sauvegarder la révision
|
||||
- Historiques des fichiers
|
||||
- Suppression de fichiers
|
||||
- Voir le fichier brut
|
||||
- Tickets
|
||||
- Modèle de ticket
|
||||
- Jalons
|
||||
- Étiquettes
|
||||
- Affecter des tickets
|
||||
- Filtres
|
||||
- Ouvert
|
||||
- Ferme
|
||||
- Personne assignée
|
||||
- Créer par vous
|
||||
- Qui vous mentionne
|
||||
- Tri
|
||||
- Plus vieux
|
||||
- Dernière mise à jour
|
||||
- Nombre de commentaires
|
||||
- Moteur de recherche
|
||||
- Commentaires
|
||||
- Joindre des fichiers
|
||||
- Demande d’ajout (_Pull request_)
|
||||
- Les mêmes fonctionnalités que pour les tickets
|
||||
- Révisions (_Commits_)
|
||||
- Representation graphique des révisions
|
||||
- Révisions par branches
|
||||
- Moteur de recherche
|
||||
- Voir les différences
|
||||
- Voir les numéro de révision SHA
|
||||
- Voir l'auteur
|
||||
- Naviguer dans les fichiers d'une révision donnée
|
||||
- Publication
|
||||
- Pièces jointes
|
||||
- Titre
|
||||
- Contenu
|
||||
- Suppression
|
||||
- Définir comme une pré-publication
|
||||
- Choix de la branche
|
||||
- Wiki
|
||||
- Import
|
||||
- Éditeur Markdown
|
||||
- Paramètres
|
||||
- Options
|
||||
- Nom
|
||||
- Description
|
||||
- Privé / Publique
|
||||
- Site internet
|
||||
- Wiki
|
||||
- Activé / Désactivé
|
||||
- Interne / externe
|
||||
- Tickets
|
||||
- Activé / Désactivé
|
||||
- Interne / externe
|
||||
- URL personnalisable pour une meilleur intégration avec un gestionnaire de tickets externe
|
||||
- Activer / désactiver les demandes d'ajout (_Pull request_)
|
||||
- Transfert du dépôt
|
||||
- Suppression du wiki
|
||||
- Suppression du dépôt
|
||||
- Collaboration
|
||||
- Lecture / Écriture / Administration
|
||||
- Branches
|
||||
- Branche par défaut
|
||||
- Protection
|
||||
- Webhooks
|
||||
- Git hooks
|
||||
- Clefs de déploiement
|
||||
|
||||
## Configuration requise
|
||||
|
||||
- Un simple Raspberry Pi est assez puissant pour les fonctionnalités de base.
|
||||
- Un processeur double coeurs et 1Gb de RAM est une bonne base pour une utilisation en équipe.
|
||||
- Gitea est censé être exécuté avec un compte utilisateur dédié et non root, aucun autre mode de fonctionnement n'est pris en charge. (**NOTE**: Dans le cas où vous l'exécutez avec votre propre compte d'utilisateur et que le serveur SSH intégré est désactivé, Gitea modifie le fichier `~ /.ssh /authorized_keys` afin que vous ne soyez **plus capable** de vous connecter interactivement).
|
||||
|
||||
## Navigateurs supportés
|
||||
|
||||
- Chrome, Firefox, Safari, Edge
|
||||
|
||||
## Composants
|
||||
|
||||
- Framework web : [Chi](http://github.com/go-chi/chi)
|
||||
- ORM: [XORM](https://xorm.io)
|
||||
- Interface graphique :
|
||||
- [jQuery](https://jquery.com)
|
||||
- [Fomantic UI](https://fomantic-ui.com)
|
||||
- [Vue3](https://vuejs.org)
|
||||
- [CodeMirror](https://codemirror.net)
|
||||
- [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
|
||||
- [Monaco Editor](https://microsoft.github.io/monaco-editor)
|
||||
- ... (package.json)
|
||||
- Connecteurs de base de données :
|
||||
- [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||
- [github.com/lib/pq](https://github.com/lib/pq)
|
||||
- [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
|
||||
- [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
|
||||
|
||||
## Logiciels et services
|
||||
|
||||
- [Drone](https://github.com/drone/drone) (Intégration continue)
|
|
@ -1,79 +0,0 @@
|
|||
---
|
||||
date: "2016-11-08T16:00:00+02:00"
|
||||
title: "文件"
|
||||
slug: /
|
||||
sidebar_position: 10
|
||||
toc: false
|
||||
draft: false
|
||||
---
|
||||
|
||||
# 關於 Gitea
|
||||
|
||||
Gitea 是一個可自行託管的 Git 服務。你可以拿 GitHub、Bitbucket 或 Gitlab 來比較看看。
|
||||
Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [Gitea 公告](https://blog.gitea.com/welcome-to-gitea/)以了解我們 Fork 的理由。
|
||||
|
||||
## 目標
|
||||
|
||||
本專案的首要目標是建立一個容易安裝,執行快速,安装和使用體驗良好的自建 Git 服務。我們採用 GO 為後端語言,Go 可以產生各平台使用的執行檔。它支援 Linux、macOS 和 Windows 外,處理器架構包含 amd64、i386、ARM 和 PowerPC 等。
|
||||
|
||||
## 功能
|
||||
|
||||
- 代碼託管:Gitea 支援建立和管理存儲庫、瀏覽提交歷史和程式碼檔案、審查和合併程式碼提交、管理協作者、處理分支等。它還支援許多常見的 Git 功能,如標籤、Cherry-pick、鉤子、集成協作工具等。
|
||||
|
||||
- 輕量級和快速:Gitea 的設計目標之一就是輕量級和快速響應。與某些大型代碼託管平台不同,它保持了精簡,在速度方面表現出色,適用於資源有限的伺服器環境。由於其輕量級設計,Gitea 的資源消耗相對較低,在資源受限的環境中表現出色。
|
||||
|
||||
- 易於部署和維護:它可以輕鬆地部署在各種伺服器上,無需複雜的配置或依賴。這使得個人開發者或小團隊可以方便地設置和管理自己的 Git 服務。
|
||||
|
||||
- 安全性:Gitea 強調安全性,提供用戶權限管理、訪問控制列表等功能,確保程式碼和數據的安全性。
|
||||
|
||||
- 代碼審查:代碼審查同時支援拉取請求工作流和 AGit 工作流。審查者可以在線瀏覽程式碼並提供審查意見或反饋。提交者可以接收審查意見並在線回覆或修改程式碼。代碼審查可以幫助個人和組織提升程式碼質量。
|
||||
|
||||
- CI/CD:Gitea Actions 支援 CI/CD 功能,與 GitHub Actions 相容。用戶可以使用熟悉的 YAML 格式編寫工作流程,並重複使用各種現有的 Actions 插件。Actions 插件支援從任何 Git 網站下載。
|
||||
|
||||
- 專案管理:Gitea 通過看板和工單來追蹤一個專案的需求、功能和錯誤。工單支援分支、標籤、里程碑、指派、時間追蹤、到期日期、依賴關係等功能。
|
||||
|
||||
- 制品庫:Gitea 支援超過 20 種不同類型的公有或私有軟體包管理,包括:Cargo、Chef、Composer、Conan、Conda、Container、Helm、Maven、npm、NuGet、Pub、PyPI、RubyGems、Vagrant 等。
|
||||
|
||||
- 開源社區支援:Gitea 是一個基於 MIT 許可證的開源專案,擁有活躍的開源社區,能夠持續進行開發和改進,同時也積極接受社區貢獻,保持了平台的更新和創新。
|
||||
|
||||
- 多語言支援:Gitea 提供多種語言界面,適應全球範圍內的用戶,促進了國際化和本地化。
|
||||
|
||||
更多功能特性:詳見:https://docs.gitea.com/installation/comparison#general-features
|
||||
|
||||
## 系統需求
|
||||
|
||||
- Raspberry Pi 3 的效能足夠讓 Gitea 承擔小型工作負載。
|
||||
- 雙核心 CPU 和 1GB 記憶體通常足以應付小型團隊/專案。
|
||||
- 在類 UNIX 系統上, 應該以專用的非 root 系統帳號來執行 Gitea。
|
||||
- 備註:Gitea 管理著 `~/.ssh/authorized_keys` 檔案。以一般身份使用者執行 Gitea 可能會破壞該使用者的登入能力。
|
||||
|
||||
- [Git](https://git-scm.com/) 的最低需求為 2.0 或更新版本。
|
||||
- 當 git 版本 >= 2.1.2 時,可啟用 Git [large file storage](https://git-lfs.github.com/)。
|
||||
- 當 git 版本 >= 2.18 時,將自動啟用 Git 提交線圖渲染。
|
||||
|
||||
## 瀏覽器支援
|
||||
|
||||
- 最近 2 個版本的 Chrome, Firefox, Safari, Edge
|
||||
- Firefox ESR
|
||||
|
||||
## 元件
|
||||
|
||||
- Web 框架: [Chi](http://github.com/go-chi/chi)
|
||||
- ORM: [XORM](https://xorm.io)
|
||||
- UI 元件:
|
||||
- [jQuery](https://jquery.com)
|
||||
- [Fomantic UI](https://fomantic-ui.com)
|
||||
- [Vue3](https://vuejs.org)
|
||||
- [CodeMirror](https://codemirror.net)
|
||||
- [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
|
||||
- [Monaco Editor](https://microsoft.github.io/monaco-editor)
|
||||
- ... (package.json)
|
||||
- 資料庫驅動程式:
|
||||
- [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||
- [github.com/lib/pq](https://github.com/lib/pq)
|
||||
- [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
|
||||
- [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
|
||||
|
||||
## 集成支持
|
||||
|
||||
請訪問 [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) 獲得更多的第三方集成支持
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Installation"
|
||||
slug: "installation"
|
||||
sidebar_position: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Installation"
|
||||
sidebar_position: 10
|
||||
identifier: "installation"
|
||||
---
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "安裝"
|
||||
slug: "installation"
|
||||
sidebar_position: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "安裝"
|
||||
sidebar_position: 10
|
||||
identifier: "installation"
|
||||
---
|
|
@ -1,137 +0,0 @@
|
|||
---
|
||||
date: "2018-05-07T13:00:00+02:00"
|
||||
title: "比較 Gitea 和其它自託管 Git 服務"
|
||||
slug: "comparison"
|
||||
sidebar_position: 5
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/comparison
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "比較"
|
||||
sidebar_position: 5
|
||||
identifier: "comparison"
|
||||
---
|
||||
|
||||
# 比較 Gitea 和其它自託管 Git 服務
|
||||
|
||||
**目錄**
|
||||
|
||||
為了幫助您判斷 Gitea 是否適合您的需求,這裡列出了它和其它自託管 Git 服務的比較。
|
||||
|
||||
請注意我們不會經常檢查其它產品的功能異動,所以這份清單可能過期,如果您在下方表格中找到需要更新的資料,請在 [GitHub 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。
|
||||
|
||||
表格中使用的符號:
|
||||
|
||||
- ✓ - 支援
|
||||
|
||||
- ⁄ - 有限度的支援
|
||||
|
||||
- ✘ - 不支援
|
||||
|
||||
- _⚙️ - 由第三方服務或外掛程式支援_
|
||||
|
||||
## 一般功能
|
||||
|
||||
| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ------------------------ | -------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||
| 免費及開放原始碼 | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ |
|
||||
| 低資源使用 (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
| 支援多種資料庫 | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ |
|
||||
| 支援多種作業系統 | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ |
|
||||
| 簡單的升級程序 | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 支援 Markdown | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 支援 Orgmode | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ? |
|
||||
| 支援 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? |
|
||||
| 支援第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? |
|
||||
| Git 驅動的靜態頁面 | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| Git 驅動的整合 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 部署 Token | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 有寫入權限的儲存庫 Token | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 內建 Container Registry | [✘](https://github.com/go-gitea/gitea/issues/2316) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 對外部 Git 鏡像 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ |
|
||||
| FIDO (2FA) | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 內建 CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 子群組: 群組中的群組 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
|
||||
## 程式碼管理
|
||||
|
||||
| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ----------------------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||
| 儲存庫主題描述 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 儲存庫程式碼搜尋 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 全域程式碼搜尋 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
|
||||
| Git LFS 2.0 | ✓ | ✘ | ✓ | ✓ | ✓ | ⁄ | ✓ |
|
||||
| 群組里程碑 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 精細的使用者權限(程式碼, 問題, Wiki 等) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 驗證提交者 | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ |
|
||||
| GPG 簽署提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 拒絕未經簽署的提交 | [✓](https://github.com/go-gitea/gitea/pull/9708) | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 儲存庫動態頁 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 分支管理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 建立新分支 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 網頁程式碼編輯器 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 提交線圖 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 儲存庫範本 | [✓](https://github.com/go-gitea/gitea/pull/8768) | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ |
|
||||
|
||||
## 問題追蹤器
|
||||
|
||||
| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| -------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | ----------------------------------------------------------------------- | --------- | --------- | ------------ |
|
||||
| 問題追蹤器 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 問題範本 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 標籤 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 時間追蹤 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 指派問題給多個成員 | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
|
||||
| 相關問題 | ✘ | ✘ | ⁄ | [✓](https://docs.gitlab.com/ce/user/project/issues/related_issues.html) | ✓ | ✘ | ✘ |
|
||||
| 機密問題 | [✘](https://github.com/go-gitea/gitea/issues/3217) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 對留言的反應 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 鎖定對話 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 批次處理問題 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 問題看板(看板方法) | [✓](https://github.com/go-gitea/gitea/pull/8346) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 從問題建立新分支 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 問題搜尋 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 全域問題搜尋 | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 問題相依 | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
| 從電子郵件建立問題 | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 服務台 | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | [✓](https://gitlab.com/groups/gitlab-org/-/epics/3103) | ✓ | ✘ | ✘ |
|
||||
|
||||
## 拉取/合併請求
|
||||
|
||||
| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| -------------------------- | -------------------------------------------------- | ---- | --------- | --------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------ | ------------ |
|
||||
| 拉取/合併請求 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Squash 合併 | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ |
|
||||
| Rebase 合併 | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ |
|
||||
| 拉取/合併請求的行內留言 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 拉取/合併請求的核可 | ✓ | ✘ | ⁄ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 解決合併衝突 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 限制某些使用者的推送及合併 | ✓ | ✘ | ✓ | ⁄ | ✓ | ✓ | ✓ |
|
||||
| 還原指定的提交或合併請求 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 拉取/合併請求範本 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| Cherry-picking 變更 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 下載 Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ |
|
||||
|
||||
## 第三方整合
|
||||
|
||||
| 功能 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||
| 支援 Webhook | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 自訂 Git Hook | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 整合 AD / LDAP | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 支援多重 LDAP / AD 伺服器 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ |
|
||||
| 同步 LDAP 使用者 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| SAML 2.0 service provider | [✘](https://github.com/go-gitea/gitea/issues/5512) | [✘](https://github.com/gogs/gogs/issues/1221) | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 支援 OpenId Connect | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ |
|
||||
| 整合 OAuth 2.0 (外部驗證) | ✓ | ✘ | ⁄ | ✓ | ✓ | ? | ✓ |
|
||||
| 成為 OAuth 2.0 提供者 | [✓](https://github.com/go-gitea/gitea/pull/5378) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 兩步驟驗證 (2FA) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 整合 Mattermost/Slack | ✓ | ✓ | ⁄ | ✓ | ✓ | ⁄ | ✓ |
|
||||
| 整合 Discord | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 整合 Microsoft Teams | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 顯示外部 CI/CD 狀態 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
|
||||
[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea
|
||||
[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server
|
|
@ -1,47 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Installation avec le binaire pré-compilé"
|
||||
slug: "install-from-binary"
|
||||
sidebar_position: 15
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /fr-fr/install-from-binary
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Binaire pré-compilé"
|
||||
sidebar_position: 15
|
||||
identifier: "install-from-binary"
|
||||
---
|
||||
|
||||
# Installation avec le binaire pré-compilé
|
||||
|
||||
Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.com/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle:
|
||||
|
||||
```
|
||||
wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64
|
||||
chmod +x gitea
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
Après avoir suivi les étapes ci-dessus, vous aurez un binaire `gitea` dans votre répertoire de travail. En premier lieu, vous pouvez tester si le binaire fonctionne comme prévu et ensuite vous pouvez le copier vers la destination où vous souhaitez le stocker. Lorsque vous lancez Gitea manuellement à partir de votre CLI, vous pouvez toujours le tuer en appuyant sur `Ctrl + C`.
|
||||
|
||||
```
|
||||
./gitea web
|
||||
```
|
||||
|
||||
## Dépannage
|
||||
|
||||
### Anciennes version de glibc
|
||||
|
||||
Les anciennes distributions Linux (comme Debian 7 ou CentOS 6) peuvent ne pas être capable d'exécuter le binaire Gitea, résultant généralement une erreur du type ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. Cette erreur est due au driver SQLite que nous intégrons dans le binaire Gitea. Dans le futur, nous fournirons des binaires sans la dépendance pour la bibliothèque glibc. En attendant, vous pouvez mettre à jour votre distribution ou installer Gitea depuis le [code source](installation/from-source.md).
|
||||
|
||||
### Exécuter Gitea avec un autre port
|
||||
|
||||
Si vous obtenez l'erreur `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use`, Gitea à besoin d'utiliser un autre port. Vous pouvez changer le port par défaut en utilisant `./gitea web -p $PORT`.
|
||||
|
||||
## Il manque quelque chose ?
|
||||
|
||||
Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement.
|
|
@ -1,37 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "執行檔安裝"
|
||||
slug: "install-from-binary"
|
||||
sidebar_position: 15
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/install-from-binary
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "執行檔"
|
||||
sidebar_position: 15
|
||||
identifier: "install-from-binary"
|
||||
---
|
||||
|
||||
# 從執行檔安裝
|
||||
|
||||
所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.com/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了:
|
||||
|
||||
```
|
||||
wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64
|
||||
chmod +x gitea
|
||||
```
|
||||
|
||||
## 測試
|
||||
|
||||
執行完上述步驟,您將會得到 `gita` 執行檔,在複製到遠端伺服器前,您可以先測試看看,在命令列執行完成後,可以透過 `Ctrl + C` 關閉程式。
|
||||
|
||||
```
|
||||
./gitea web
|
||||
```
|
||||
|
||||
## 需要協助?
|
||||
|
||||
如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。
|
|
@ -1,58 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Installation depuis le gestionnaire de paquets"
|
||||
slug: "install-from-package"
|
||||
sidebar_position: 20
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /fr-fr/install-from-package
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Gestionnaire de paquets"
|
||||
sidebar_position: 20
|
||||
identifier: "install-from-package"
|
||||
---
|
||||
|
||||
# Installation depuis le gestionnaire de paquets
|
||||
|
||||
## Linux
|
||||
|
||||
Nous n'avons pas encore publié de paquet pour Linux, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets pour toutes distributions Linux. En attendant, vous devriez suivre les [instructions d'installation](installation/from-binary.md) avec le binaire pré-compilé.
|
||||
|
||||
## Windows
|
||||
|
||||
Nous n'avons pas encore publié de paquet pour Windows, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets sous la forme de fichiers `MSI` ou via [Chocolatey](https://chocolatey.org/). En attendant, vous devriez suivre les [instructions d'installation](installation/from-binary.md) avec le binaire pré-compilé.
|
||||
|
||||
## macOS
|
||||
|
||||
Actuellement, nous ne supportons que l'installation via `brew` pour macOS. Si vous n'utilisez pas [Homebrew](http://brew.sh/), vous pouvez suivre les [instructions d'installation](installation/from-binary.md) avec le binaire pré-compilé. Pour installer Gitea depuis `brew`, utilisez les commandes suivantes :
|
||||
|
||||
```
|
||||
brew install gitea
|
||||
```
|
||||
|
||||
## FreeBSD
|
||||
|
||||
Le portage FreeBSD `www/gitea` est disponible. Vous pouvez également installer le paquet pré-compilé avec la commande suivante:
|
||||
|
||||
```
|
||||
pkg install gitea
|
||||
```
|
||||
|
||||
Pour une version plus récente, ou pour les instructions de compilations, veuillez consulter la documentation officielle de FreeBSD : [install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html)
|
||||
|
||||
```
|
||||
su -
|
||||
cd /usr/ports/www/gitea
|
||||
make install clean
|
||||
```
|
||||
|
||||
Le port utilise la schéma standard du système de fichiers FreeBSD : Les fichiers de configuration sont localisés dans le répertoire `/usr/local/etc/gitea`, les modèles, options, plugins et thèmes sont localisés dans le répertoire `/usr/local/share/gitea`, et le script de démarrage se situe dans `/usr/local/etc/rc.d/gitea`.
|
||||
|
||||
Pour exécuter Gitea en tant que service, utilisez la commande `sysrc gitea_enable=YES` et la commande `service gitea start` pour démarrer le service.
|
||||
|
||||
## Il manque quelque chose ?
|
||||
|
||||
Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement.
|
|
@ -1,60 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "套件安裝"
|
||||
slug: "install-from-package"
|
||||
sidebar_position: 20
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/install-from-package
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "套件安裝"
|
||||
sidebar_position: 20
|
||||
identifier: "install-from-package"
|
||||
---
|
||||
|
||||
# 從套件安裝
|
||||
|
||||
## Linux
|
||||
|
||||
目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝](installation/from-binary.md)方式。
|
||||
|
||||
## Windows
|
||||
|
||||
在 Windows 作業系統你可以透過 [Chocolatey](https://chocolatey.org/) 套件管理器安裝 [Gitea](https://chocolatey.org/packages/gitea) 套件:
|
||||
|
||||
```sh
|
||||
choco install gitea
|
||||
```
|
||||
|
||||
也可以參考[執行檔安裝](installation/from-binary.md)方式。
|
||||
|
||||
## macOS
|
||||
|
||||
目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝](installation/from-binary.md)方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令:
|
||||
|
||||
```
|
||||
brew install gitea
|
||||
```
|
||||
|
||||
## FreeBSD
|
||||
|
||||
下載 FreeBSD port `www/gitea` 套件。你可以安裝 pre-built 執行檔:
|
||||
|
||||
```
|
||||
pkg install gitea
|
||||
```
|
||||
|
||||
對於最新版本或想要自行編譯特定選項,請使用 [port 安裝](https://www.freebsd.org/doc/handbook/ports-using.html):
|
||||
|
||||
```
|
||||
su -
|
||||
cd /usr/ports/www/gitea
|
||||
make install clean
|
||||
```
|
||||
|
||||
## 需要協助?
|
||||
|
||||
如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。
|
|
@ -1,80 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Installation depuis le code source"
|
||||
slug: "install-from-source"
|
||||
sidebar_position: 30
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /fr-fr/install-from-source
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Code source"
|
||||
sidebar_position: 30
|
||||
identifier: "install-from-source"
|
||||
---
|
||||
|
||||
# Installation depuis le code source
|
||||
|
||||
Nous ne couvrirons pas les bases de la configuration de Golang dans ce guide. Si vous ne savez pas comment démarrer un environnement fonctionnel, vous devrez suivre les [instructions d'installation](https://golang.org/doc/install) officielles.
|
||||
|
||||
**Attention**: La version 1.7 ou suppérieur de Go est nécessaire
|
||||
|
||||
## Téléchargement
|
||||
|
||||
Tout d'abord, vous devez récupérer le code source, la manière la plus simple est d'utiliser directement Go. Il suffit d'appeler les commandes suivantes pour récupérer le code source et passer au répertoire de travail.
|
||||
|
||||
```
|
||||
go get -d -u code.gitea.io/gitea
|
||||
cd $GOPATH/src/code.gitea.io/gitea
|
||||
```
|
||||
|
||||
Maintenant, il est temps de décider quelle version de Gitea vous souhaitez compiler et installer. Actuellement, ils existent plusieurs options possibles. Si vous voulez compiler notre branche `master`, vous pouvez directement passer à la [section compilation](#compilation), cette branche représente la dernière version en cours de développement et n'a pas vocation à être utiliser en production.
|
||||
|
||||
Si vous souhaitez compiler la dernière version stable, utilisez les étiquettes ou les différentes branches disponibles. Vous pouvez voir les branches disponibles et comment utiliser cette branche avec ces commandes:
|
||||
|
||||
```
|
||||
git branch -a
|
||||
git checkout v@version@
|
||||
```
|
||||
|
||||
Si vous souhaitez valider une demande d'ajout (_Pull request_), vous devez activer cette branche en premier :
|
||||
|
||||
```
|
||||
git fetch origin pull/xyz/head:pr-xyz # xyz is PR value
|
||||
```
|
||||
|
||||
Enfin, vous pouvez directement utiliser les versions étiquettées (ex : `v@version@`). Pour utiliser les étiquettes, vous devez lister les étiquettes disponibles et choisir une étiquette spécifique avec les commandes suivantes :
|
||||
|
||||
```
|
||||
git tag -l
|
||||
git checkout v@version@
|
||||
git checkout pr-xyz
|
||||
```
|
||||
|
||||
## Compilation
|
||||
|
||||
Comme nous regroupons déjà toutes les bibliothèques requises pour compiler Gitea, vous pouvez continuer avec le processus de compilation lui-même. Nous fournissons diverses [tâches Make](https://github.com/go-gitea/gitea/blob/main/Makefile) pour rendre le processus de construction aussi simple que possible. [Voyez ici comment obtenir Make](/fr-fr/hacking-on-gitea/). Selon vos besoins, vous pourrez éventuellement ajouter diverses options de compilation, vous pouvez choisir entre ces options :
|
||||
|
||||
* `bindata`: Intègre toutes les ressources nécessaires à l'exécution d'une instance de Gitea, ce qui rend un déploiement facile car il n'est pas nécessaire de se préoccuper des fichiers supplémentaires.
|
||||
* `sqlite sqlite_unlock_notify`: Active la prise en charge d'une base de données [SQLite3](https://sqlite.org/), ceci n'est recommandé que pour les petites installations de Gitea.
|
||||
* `pam`: Active la prise en charge de PAM (mLinux Pluggable Authentication Modules), très utile si vos utilisateurs doivent être authentifiés avec les comptes du système.
|
||||
|
||||
Il est temps de compiler le binaire, nous suggérons d'intégrer les ressources avec l'option de compilation `bindata`:
|
||||
|
||||
```
|
||||
TAGS="bindata" make build
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
Après avoir suivi toutes les étapes, vous devriez avoir le binaire `gitea` dans votre répertoire courant. Dans un premier temps, vous pouvez tester qu'il fonctionne puis, dans un second temps, vous pouvez le copier dans la destination de votre choix. Lorsque vous lancez Gitea manuellement à partir de votre CLI, vous pouvez toujours le tuer en appuyant sur `Ctrl + C`.
|
||||
|
||||
```
|
||||
./gitea web
|
||||
```
|
||||
|
||||
## Il manque quelque chose ?
|
||||
|
||||
Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement.
|
|
@ -1,73 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "原始碼安裝"
|
||||
slug: "install-from-source"
|
||||
sidebar_position: 30
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/install-from-source
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "原始碼安裝"
|
||||
sidebar_position: 30
|
||||
identifier: "install-from-source"
|
||||
---
|
||||
|
||||
# 從原始碼安裝
|
||||
|
||||
我們不會在本文教大家如何安裝 Golang 環境。假如您不知道如何設定環境,請直接參考[官方安裝文件](https://golang.org/doc/install)。
|
||||
|
||||
## 下載
|
||||
|
||||
首先您必須先下載原始碼,最簡單的方式就是透過 Go 指令下載,請透過底下指令下載原始碼並且切換到工作目錄。
|
||||
|
||||
```
|
||||
go get -d -u code.gitea.io/gitea
|
||||
cd $GOPATH/src/code.gitea.io/gitea
|
||||
```
|
||||
|
||||
現在該決定您要編譯或安裝的 Gitea 版本,您有很多可以選擇。如果您想編譯 `master` 版本,你可以直接跳到[編譯章節](#編譯),這是我們開發分支,雖然很穩定,但是不建議用在正式環境。
|
||||
|
||||
假如您想要編譯最新穩定版本,可以執行底下命令切換到正確版本:
|
||||
|
||||
```
|
||||
git branch -a
|
||||
git checkout v@version@
|
||||
```
|
||||
|
||||
最後您也可以直接編譯最新的標籤版本像是 `v@version@`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令::
|
||||
|
||||
```
|
||||
git tag -l
|
||||
git checkout v@version@
|
||||
```
|
||||
|
||||
## 編譯
|
||||
|
||||
完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/main/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明:
|
||||
|
||||
* `bindata`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。
|
||||
* `sqlite sqlite_unlock_notify`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。
|
||||
* `pam`: 使用此標籤來啟用 PAM (Linux Pluggable Authentication Modules) 認證,對於系統使用者來說,此方式最方便了。
|
||||
|
||||
現在您可以開始編譯執行檔了,我們建議使用 `bindata` 編譯選項:
|
||||
|
||||
```
|
||||
TAGS="bindata" make build
|
||||
```
|
||||
|
||||
**注意**: 因為使用了套件管理工具,我們建議 Go 環境版本為 1.6 或者是更高,這樣不用在 Go 1.5 版本設定全域變數 `GO15VENDOREXPERIMENT`。
|
||||
|
||||
## 測試
|
||||
|
||||
完成上述步驟後,您可以在當下目錄發現 `gitea` 執行檔,在複製執行檔到遠端環境之前,您必須透過底下指令執行測試,使用 `Ctrl + C` 則可以關閉當下 gitea 程序。
|
||||
|
||||
```
|
||||
./gitea web
|
||||
```
|
||||
|
||||
## 需要協助?
|
||||
|
||||
如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。
|
|
@ -1,72 +0,0 @@
|
|||
---
|
||||
date: "2020-03-19T19:27:00+02:00"
|
||||
title: "在 Kubernetes 安裝"
|
||||
slug: "install-on-kubernetes"
|
||||
sidebar_position: 80
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/install-on-kubernetes
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Kubernetes"
|
||||
sidebar_position: 80
|
||||
identifier: "install-on-kubernetes"
|
||||
---
|
||||
|
||||
# 使用 Helm 安裝 (在 Kubernetes)
|
||||
|
||||
Gitea 提供 Helm Chart 用來安裝於 kubernetes。
|
||||
|
||||
非自訂安裝可使用下列指令:
|
||||
|
||||
```
|
||||
helm repo add gitea-charts https://dl.gitea.com/charts/
|
||||
helm install gitea gitea-charts/gitea
|
||||
```
|
||||
|
||||
若您想自訂安裝(包括使用 kubernetes ingress),請前往完整的 [Gitea helm chart configuration details](https://gitea.com/gitea/helm-chart/)
|
||||
|
||||
## 運行狀況檢查終端節點
|
||||
|
||||
Gitea 附帶了一個運行狀況檢查端點 `/api/healthz`,你可以像這樣在 kubernetes 中配置它:
|
||||
|
||||
```yaml
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/healthz
|
||||
port: http
|
||||
initialDelaySeconds: 200
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 10
|
||||
```
|
||||
|
||||
成功的運行狀況檢查回應將使用 HTTP 代碼 `200` 進行回應,下面是示例:
|
||||
|
||||
```
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
{
|
||||
"status": "pass",
|
||||
"description": "Gitea: Git with a cup of tea",
|
||||
"checks": {
|
||||
"cache:ping": [
|
||||
{
|
||||
"status": "pass",
|
||||
"time": "2022-02-19T09:16:08Z"
|
||||
}
|
||||
],
|
||||
"database:ping": [
|
||||
{
|
||||
"status": "pass",
|
||||
"time": "2022-02-19T09:16:08Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
有關更多信息,請參考kubernetes文檔[定義一個存活態 HTTP請求接口](https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
date: "2017-07-21T12:00:00+02:00"
|
||||
title: "Run as service in Linux"
|
||||
title: "Run as a Linux service"
|
||||
slug: "linux-service"
|
||||
sidebar_position: 40
|
||||
toc: false
|
||||
|
@ -15,11 +15,11 @@ menu:
|
|||
identifier: "linux-service"
|
||||
---
|
||||
|
||||
### Run Gitea as Linux service
|
||||
# Run as a Linux service
|
||||
|
||||
You can run Gitea as service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification).
|
||||
You can run Gitea as a Linux service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification).
|
||||
|
||||
#### Using systemd
|
||||
## Using systemd
|
||||
|
||||
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
|
||||
|
||||
|
@ -41,7 +41,7 @@ If you have systemd version 220 or later, you can enable and immediately start G
|
|||
sudo systemctl enable gitea --now
|
||||
```
|
||||
|
||||
#### Using supervisor
|
||||
## Using supervisor
|
||||
|
||||
Install supervisor by running below command in terminal:
|
||||
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
---
|
||||
date: "2017-07-21T12:00:00+02:00"
|
||||
title: "在 Linux 中以服務執行"
|
||||
slug: "linux-service"
|
||||
sidebar_position: 40
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/linux-service
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Linux 服務"
|
||||
sidebar_position: 40
|
||||
identifier: "linux-service"
|
||||
---
|
||||
|
||||
### 以 Linux 服務執行 Gitea
|
||||
|
||||
您可使用 systemd 或 supervisor 以服務的方式執行 Gitea。下列步驟已在 Ubuntu 16.04 中測試,但它們應該適用於所有的 Linux 發行版(只需要一些小小的調整)。
|
||||
|
||||
#### 使用 systemd
|
||||
|
||||
複製範例 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 到 `/etc/systemd/system/gitea.service` 後用您喜愛的文字編輯器開啟檔案。
|
||||
|
||||
取消註解任何需要在此系統上啟動的服務像是 MySQL。
|
||||
|
||||
修改 user, home directory 和其它必要的啟動參數。若預設埠已被占用請修改埠號或移除「-p」旗標。
|
||||
|
||||
在系統啟動時啟用並執行 Gitea:
|
||||
|
||||
```
|
||||
sudo systemctl enable gitea
|
||||
sudo systemctl start gitea
|
||||
```
|
||||
|
||||
若您使用 systemd 220 或更新版本,您能以一行指令啟動並立即執行 Gitea:
|
||||
|
||||
```
|
||||
sudo systemctl enable gitea --now
|
||||
```
|
||||
|
||||
#### 使用 supervisor
|
||||
|
||||
在終端機使用下列指令安裝 supervisor:
|
||||
|
||||
```
|
||||
sudo apt install supervisor
|
||||
```
|
||||
|
||||
為 supervisor 建立 log 資料夾:
|
||||
|
||||
```
|
||||
# assuming Gitea is installed in /home/git/gitea/
|
||||
mkdir /home/git/gitea/log/supervisor
|
||||
```
|
||||
|
||||
附加範例 [supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea) 的設定值到 `/etc/supervisor/supervisord.conf`。
|
||||
|
||||
用您喜愛的文字編輯器修改使用者(git)和家目錄(/home/git)設定以符合部署環境。若預設埠已被占用請修改埠號或移除「-p」旗標。
|
||||
|
||||
最後設定在系統啟動時啟用並執行 supervisor:
|
||||
|
||||
```
|
||||
sudo systemctl enable supervisor
|
||||
sudo systemctl start supervisor
|
||||
```
|
||||
|
||||
若您使用 systemd 220 或更新版本,您能以一行指令啟動並立即執行 supervisor:
|
||||
|
||||
```
|
||||
sudo systemctl enable supervisor --now
|
||||
```
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
date: "2016-12-21T15:00:00-02:00"
|
||||
title: "Register as a Windows Service"
|
||||
title: "Register as a Windows service"
|
||||
slug: "windows-service"
|
||||
sidebar_position: 50
|
||||
toc: false
|
||||
|
@ -14,8 +14,9 @@ menu:
|
|||
sidebar_position: 50
|
||||
identifier: "windows-service"
|
||||
---
|
||||
# Register as a Windows service
|
||||
|
||||
# Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
The following changes are made in C:\gitea\custom\conf\app.ini:
|
||||
|
||||
|
@ -27,7 +28,7 @@ Sets Gitea to run as the local system user.
|
|||
|
||||
COMPUTERNAME is whatever the response is from `echo %COMPUTERNAME%` on the command line. If the response is `USER-PC` then `RUN_USER = USER-PC$`
|
||||
|
||||
## Use absolute paths
|
||||
### Use absolute paths
|
||||
|
||||
If you use SQLite3, change the `PATH` to include the full path:
|
||||
|
||||
|
@ -36,7 +37,7 @@ If you use SQLite3, change the `PATH` to include the full path:
|
|||
PATH = c:/gitea/data/gitea.db
|
||||
```
|
||||
|
||||
# Register as a Windows Service
|
||||
## Register Gitea
|
||||
|
||||
To register Gitea as a Windows service, open a command prompt (cmd) as an Administrator,
|
||||
then run the following command:
|
||||
|
@ -51,7 +52,7 @@ Open "Windows Services", search for the service named "gitea", right-click it an
|
|||
"Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port
|
||||
that was configured).
|
||||
|
||||
## Service startup type
|
||||
### Service startup type
|
||||
|
||||
It was observed that on loaded systems during boot Gitea service may fail to start with timeout records in Windows Event Log.
|
||||
In that case change startup type to `Automatic-Delayed`. This can be done during service creation, or by running config command
|
||||
|
@ -60,7 +61,7 @@ In that case change startup type to `Automatic-Delayed`. This can be done during
|
|||
sc.exe config gitea start= delayed-auto
|
||||
```
|
||||
|
||||
## Adding startup dependencies
|
||||
### Adding startup dependencies
|
||||
|
||||
To add a startup dependency to the Gitea Windows service (eg Mysql, Mariadb), as an Administrator, then run the following command:
|
||||
|
||||
|
@ -70,9 +71,9 @@ sc.exe config gitea depend= mariadb
|
|||
|
||||
This will ensure that when the Windows machine restarts, the automatic starting of Gitea is postponed until the database is ready and thus mitigate failed startups.
|
||||
|
||||
## Unregister as a service
|
||||
## Unregister Gitea
|
||||
|
||||
To unregister Gitea as a service, open a command prompt (cmd) as an Administrator and run:
|
||||
To unregister Gitea as a Windows service, open a command prompt (cmd) as an Administrator and run:
|
||||
|
||||
```
|
||||
sc.exe delete gitea
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Démarrer en tant que service Windows"
|
||||
slug: "windows-service"
|
||||
sidebar_position: 50
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /fr-fr/windows-service
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Service Windows"
|
||||
sidebar_position: 50
|
||||
identifier: "windows-service"
|
||||
---
|
||||
|
||||
# Activer un service Windows
|
||||
|
||||
Pour activer le service Windows Gitea, ouvrez une `cmd` en tant qu'Administrateur puis utilisez la commande suivante :
|
||||
|
||||
```
|
||||
sc create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\""
|
||||
```
|
||||
|
||||
N'oubliez pas de remplacer `C:\gitea` par le chemin que vous avez utilisé pour votre installation.
|
||||
|
||||
Ensuite, ouvrez "Services Windows", puis recherchez le service `gitea`, faites un clic droit et selectionnez "Run". Si tout fonctionne, vous devriez être capable d'accèder à Gitea à l'URL `http://localhost:3000` (ou sur le port configuré si différent de 3000).
|
||||
|
||||
## Désactiver un service Windows
|
||||
|
||||
Pour désactiver le service Windows Gitea, ouvrez une `cmd` en tant qu'Administrateur puis utilisez la commande suivante :
|
||||
|
||||
```
|
||||
sc delete gitea
|
||||
```
|
|
@ -1,57 +0,0 @@
|
|||
---
|
||||
date: "2016-12-21T15:00:00-02:00"
|
||||
title: "註冊為 Windows 服務"
|
||||
slug: "windows-service"
|
||||
sidebar_position: 50
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/windows-service
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Windows 服務"
|
||||
sidebar_position: 50
|
||||
identifier: "windows-service"
|
||||
---
|
||||
|
||||
# 事前準備
|
||||
|
||||
確認您的 C:\gitea\custom\conf\app.ini 中包含:
|
||||
|
||||
```
|
||||
RUN_USER = COMPUTERNAME$
|
||||
```
|
||||
|
||||
設定 Gitea 以本地使用者身份執行。
|
||||
|
||||
請將在命令提示字元(cmd)執行 `echo %COMPUTERNAME%` 的結果輸入 `COMPUTERNAME`。若回應為 `USER-PC`,請輸入 `RUN_USER = USER-PC$`
|
||||
|
||||
## 使用絕對路徑
|
||||
|
||||
如果您使用 sqlite3,修改 `PATH` 為完整路徑:
|
||||
|
||||
```
|
||||
[database]
|
||||
PATH = c:/gitea/data/gitea.db
|
||||
```
|
||||
|
||||
# 註冊為 Windows 服務
|
||||
|
||||
要註冊為 Windows 服務,請先以系統管理員身份開啟命令提示字元,接著執行下列指令:
|
||||
|
||||
```
|
||||
sc.exe create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\""
|
||||
```
|
||||
|
||||
別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。
|
||||
|
||||
開啟 Windows 的「服務」,並且搜尋服務名稱「gitea」,按右鍵選擇「啟動」。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。
|
||||
|
||||
## 刪除服務
|
||||
|
||||
要刪除 Gitea 服務,請用系統管理員身份開啟命令提示字元,接著執行下列指令:
|
||||
|
||||
```
|
||||
sc.exe delete gitea
|
||||
```
|
|
@ -1,112 +0,0 @@
|
|||
---
|
||||
date: "2017-08-23T09:00:00+02:00"
|
||||
title: "Installation avec Docker"
|
||||
slug: "install-with-docker"
|
||||
sidebar_position: 70
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /fr-fr/install-with-docker
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Docker"
|
||||
sidebar_position: 70
|
||||
identifier: "install-with-docker"
|
||||
---
|
||||
|
||||
# Installation avec Docker
|
||||
|
||||
Nous fournissons des images Docker mises à jour automatiquement via le Docker Hub de notre organisation. C'est à vous, lors devotre déploiement, de vous assurez d'utiliser toujours la dernière version stable ou d'utiliser un autre service qui met à jour l'image Docker pour vous.
|
||||
|
||||
## Données stockées sur l'hôte
|
||||
|
||||
Tout d'abord, vous devez simplement récupérer l'image Docker avec la commande suivante :
|
||||
|
||||
```
|
||||
docker pull gitea/gitea:latest
|
||||
```
|
||||
|
||||
Pour garder vos dépôts et certaines autres données persistantes, vous devez créer un répertoire qui contiendra ces données à l'avenir.
|
||||
|
||||
```
|
||||
sudo mkdir -p /var/lib/gitea
|
||||
```
|
||||
|
||||
Il est temps de démarrer votre instance Docker, c'est un processus assez simple. Vous avez à définir le mappage des ports et le volume à utiliser pour la persistance de vos données :
|
||||
|
||||
```
|
||||
docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest
|
||||
```
|
||||
|
||||
Vous devriez avoir une instance fonctionnelle de Gitea. Pour accèder à l'interface web, visitez l'adresse http://hostname:10080 avec votre navigateur web préféré. Si vous voulez clôner un dépôt, vous pouvez le faire avec la commande `git clone ssh://git@hostname:10022/username/repo.git`.
|
||||
|
||||
## Named Volumes
|
||||
|
||||
Ce guide aboutira à une installation avec les données Gitea et PostgreSQL stockées dans des volumes nommés. Cela permet une sauvegarde, une restauration et des mises à niveau en toute simplicité.
|
||||
|
||||
### The Database
|
||||
|
||||
Création du volume nommé pour la base de données :
|
||||
|
||||
```
|
||||
$ docker volume create --name gitea-db-data
|
||||
```
|
||||
|
||||
Une fois votre volume pret, vous pouvez récupérer l'image Docker de PostgreSQL et créer une instance. Tout comme Gitea, c'est également une image Docker basée sur Alpine Linux, Le montage des données se fera sans aucun problème.
|
||||
|
||||
```
|
||||
$ docker pull postgres:alpine
|
||||
$ docker run -d --name gitea-db \
|
||||
-e POSTGRES_PASSWORD=<PASSWORD> \
|
||||
-v gitea-db-data:/var/lib/postgresql/data \
|
||||
-p 5432:5432 \
|
||||
postgres:alpine
|
||||
```
|
||||
|
||||
Maintenant que la base de données est démarrée, il faut la configurer. N'oubliez pas le mot de passe que vous avez choisi, vous en aurez besoin lors de l'installation de Gitea.
|
||||
|
||||
```
|
||||
$ docker exec -it gitea-db psql -U postgres
|
||||
psql (9.6.1)
|
||||
Type "help" for help.
|
||||
|
||||
postgres=# CREATE USER gitea WITH PASSWORD '<PASSWORD>';
|
||||
CREATE ROLE
|
||||
postgres=# CREATE DATABASE gitea OWNER gitea;
|
||||
CREATE DATABASE
|
||||
postgres=# \q
|
||||
$
|
||||
```
|
||||
|
||||
### Gitea
|
||||
|
||||
Premièrement, le volume nommé :
|
||||
|
||||
```
|
||||
$ docker volume create --name gitea-data
|
||||
```
|
||||
|
||||
Puis l'instance de Gitea :
|
||||
|
||||
```
|
||||
$ docker run -d --name gitea \
|
||||
--link gitea-db:gitea-db \
|
||||
--dns 10.12.10.160 \
|
||||
-p 11180:3000 \
|
||||
-p 8322:22 \
|
||||
-v gitea-data:/data \
|
||||
gitea/gitea:latest
|
||||
```
|
||||
|
||||
Vous devriez maintenant avoir deux conteneurs Docker pour Gitea et PostgreSQL plus deux volumes nommés Docker.
|
||||
|
||||
# Personnalisation
|
||||
|
||||
Les fichier personnalisés ([voir les instructions](administration/customizing-gitea.md)) peuvent être placés dans le répertoire `/data/gitea`.
|
||||
|
||||
Le fichier de configuration sera sauvegardé à l'emplacement suivant : `/data/gitea/conf/app.ini`
|
||||
|
||||
## Il manque quelque chose ?
|
||||
|
||||
Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/Gitea), vous obtiendrez des réponses à toute vos questions assez rapidement.
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Docker 安裝"
|
||||
slug: "install-with-docker"
|
||||
sidebar_position: 70
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/install-with-docker
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "installation"
|
||||
name: "Docker 安裝"
|
||||
sidebar_position: 70
|
||||
identifier: "install-with-docker"
|
||||
---
|
||||
|
||||
# 用 Docker 安裝
|
||||
|
||||
我們在 Docker Hub 提供了自動更新的映像檔,它會保持最新穩定版。根據您的部屬環境來使用最新版本或用其他服務來更新 Docker 映像檔。首先您需要下載映像檔:
|
||||
|
||||
```
|
||||
docker pull gitea/gitea:latest
|
||||
```
|
||||
|
||||
為了儲存您的所有 Git 儲存庫資料,您應該建立一個目錄,用來存放資料的地方。
|
||||
|
||||
```
|
||||
sudo mkdir -p /var/lib/gitea
|
||||
```
|
||||
|
||||
現在就可以直接啟動 Docker 容器,這是一個非常簡單的過程,您必須定義啟動連接埠,並且提供上面所建立的資料儲存路徑:
|
||||
|
||||
```
|
||||
docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest
|
||||
```
|
||||
|
||||
然後 Gitea 容器已經開始運行,您可以透過個人喜愛的瀏覽器來訪問 http://hostname:10080,假如您想要開始 Clone 儲存庫,可以直接執行 `git clone ssh://git@hostname:10022/username/repo.git` 指令。
|
||||
|
||||
## 需要協助?
|
||||
|
||||
如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/Gitea),在那邊可以快速得到協助。
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
date: "2019-11-12T16:00:00+02:00"
|
||||
title: "Search"
|
||||
slug: "search"
|
||||
sidebar_position: 1
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /de-de/help/search
|
||||
sitemap:
|
||||
priority : 1
|
||||
layout: "search"
|
||||
---
|
||||
|
||||
This file exists solely to respond to /search URL with the related `search` layout template.
|
||||
|
||||
No content shown here is rendered, all content is based in the template layouts/doc/search.html
|
||||
|
||||
Setting a very low sitemap priority will tell search engines this is not important content.
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
date: "2019-11-12T16:00:00+02:00"
|
||||
title: "Chercher"
|
||||
slug: "search"
|
||||
sidebar_position: 1
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /fr-fr/help/search
|
||||
sitemap:
|
||||
priority : 1
|
||||
layout: "search"
|
||||
---
|
||||
|
||||
This file exists solely to respond to /search URL with the related `search` layout template.
|
||||
|
||||
No content shown here is rendered, all content is based in the template layouts/doc/search.html
|
||||
|
||||
Setting a very low sitemap priority will tell search engines this is not important content.
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
date: "2019-11-12T16:00:00+02:00"
|
||||
title: "搜尋"
|
||||
slug: "search"
|
||||
sidebar_position: 1
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/help/search
|
||||
sitemap:
|
||||
priority : 1
|
||||
layout: "search"
|
||||
---
|
||||
|
||||
This file exists solely to respond to /search URL with the related `search` layout template.
|
||||
|
||||
No content shown here is rendered, all content is based in the template layouts/doc/search.html
|
||||
|
||||
Setting a very low sitemap priority will tell search engines this is not important content.
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
date: "2016-12-27T16:00:00+02:00"
|
||||
title: "使用"
|
||||
slug: "usage"
|
||||
sidebar_position: 35
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "使用"
|
||||
sidebar_position: 30
|
||||
identifier: "usage"
|
||||
---
|
|
@ -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:
|
||||
|
||||
```shell
|
||||
git push origin HEAD:refs/for/master
|
||||
git push origin HEAD:refs/for/main
|
||||
```
|
||||
|
||||
The command has the following structure:
|
||||
|
@ -42,8 +42,8 @@ The command has the following structure:
|
|||
- `description`: The PR description
|
||||
- `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
|
||||
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
|
||||
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 的描述
|
||||
- `force-push`:确认强制更新目标分支
|
||||
|
||||
下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `master`:
|
||||
下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `main`:
|
||||
|
||||
```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"
|
||||
```
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "認證"
|
||||
slug: "authentication"
|
||||
sidebar_position: 10
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/authentication
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "認證"
|
||||
sidebar_position: 10
|
||||
identifier: "authentication"
|
||||
---
|
||||
|
||||
# 認證
|
||||
|
||||
## TBD
|
|
@ -77,6 +77,7 @@ curl --user your_username:your_password_or_token \
|
|||
```
|
||||
|
||||
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
|
||||
|
||||
You cannot publish a file with the same name twice to a package. You must delete the existing package file first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
|
|
@ -25,6 +25,7 @@ To work with the Composer package registry, you can use [Composer](https://getco
|
|||
|
||||
To publish a Composer package perform a HTTP PUT operation with the package content in the request body.
|
||||
The package content must be the zipped PHP project with the `composer.json` file.
|
||||
|
||||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
|
||||
|
||||
```
|
||||
|
@ -64,7 +65,8 @@ The server responds with the following HTTP Status codes.
|
|||
| HTTP Status Code | Meaning |
|
||||
| ----------------- | ------- |
|
||||
| `201 Created` | The package has been published. |
|
||||
| `400 Bad Request` | The package name and/or version are invalid or a package with the same name and version already exist. |
|
||||
| `400 Bad Request` | The package is invalid. |
|
||||
| `409 Conflict` | A package file with the same combination of parameters exists already. |
|
||||
|
||||
## Configuring the package registry
|
||||
|
||||
|
|
|
@ -63,6 +63,8 @@ For example:
|
|||
conan upload --remote=gitea ConanPackage/1.2@gitea/final
|
||||
```
|
||||
|
||||
You cannot publish a file with the same name twice to a package. You must delete the existing package or file first.
|
||||
|
||||
The Gitea Conan package registry has full [revision](https://docs.conan.io/en/latest/versioning/revisions.html) support.
|
||||
|
||||
## Install a package
|
||||
|
|
|
@ -63,8 +63,18 @@ curl --user your_username:your_password_or_token \
|
|||
https://gitea.example.com/api/packages/testuser/conda/package-1.0.conda
|
||||
```
|
||||
|
||||
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
|
||||
|
||||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
||||
| HTTP Status Code | Meaning |
|
||||
| ----------------- | ------- |
|
||||
| `201 Created` | The package has been published. |
|
||||
| `400 Bad Request` | The package is invalid. |
|
||||
| `409 Conflict` | A package file with the same combination of parameters exists already. |
|
||||
|
||||
## Install a package
|
||||
|
||||
To install a package from the package registry, execute one of the following commands:
|
||||
|
|
|
@ -68,8 +68,18 @@ curl --user your_username:your_password_or_token \
|
|||
https://gitea.example.com/api/packages/testuser/cran/bin?platform=windows&rversion=4.2
|
||||
```
|
||||
|
||||
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
|
||||
|
||||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
||||
| HTTP Status Code | Meaning |
|
||||
| ----------------- | ------- |
|
||||
| `201 Created` | The package has been published. |
|
||||
| `400 Bad Request` | The package is invalid. |
|
||||
| `409 Conflict` | A package file with the same combination of parameters exists already. |
|
||||
|
||||
## Install a package
|
||||
|
||||
To install a R package from the package registry, execute the following command:
|
||||
|
|
|
@ -77,14 +77,15 @@ curl --user your_username:your_password_or_token \
|
|||
```
|
||||
|
||||
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
|
||||
You cannot publish a file with the same name twice to a package. You must delete the existing package version first.
|
||||
|
||||
You cannot publish a package if a package of the same name, version, distribution, component and architecture already exists. You must delete the existing package first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
||||
| HTTP Status Code | Meaning |
|
||||
| ----------------- | ------- |
|
||||
| `201 Created` | The package has been published. |
|
||||
| `400 Bad Request` | The package name, version, distribution, component or architecture are invalid. |
|
||||
| `400 Bad Request` | The package is invalid. |
|
||||
| `409 Conflict` | A package file with the same combination of parameters exists already. |
|
||||
|
||||
## Delete a package
|
||||
|
|
|
@ -41,6 +41,8 @@ curl --user your_username:your_password_or_token \
|
|||
|
||||
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
|
||||
|
||||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
||||
| HTTP Status Code | Meaning |
|
||||
|
|
|
@ -67,6 +67,14 @@ curl -X PUT --user {username}:{password} \
|
|||
|
||||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
||||
| HTTP Status Code | Meaning |
|
||||
| ----------------- | ------- |
|
||||
| `201 Created` | The package has been published. |
|
||||
| `400 Bad Request` | The package is invalid. |
|
||||
| `409 Conflict` | A package file with the same combination of parameters exists already. |
|
||||
|
||||
## Install a package
|
||||
|
||||
To install a Swift package from the package registry, add it in the `Package.swift` file dependencies list:
|
||||
|
|
|
@ -44,8 +44,18 @@ curl --user your_username:your_password_or_token \
|
|||
https://gitea.example.com/api/packages/testuser/vagrant/test_system/1.0.0/hyperv.box
|
||||
```
|
||||
|
||||
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
|
||||
|
||||
You cannot publish a box if a box of the same name, version and provider already exists. You must delete the existing package first.
|
||||
|
||||
The server responds with the following HTTP Status codes.
|
||||
|
||||
| HTTP Status Code | Meaning |
|
||||
| ----------------- | ------- |
|
||||
| `201 Created` | The package has been published. |
|
||||
| `400 Bad Request` | The package is invalid. |
|
||||
| `409 Conflict` | A package with the same combination of parameters exists already. |
|
||||
|
||||
## Install a package
|
||||
|
||||
To install a box from the package registry, execute the following command:
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
date: "2018-06-01T19:00:00+02:00"
|
||||
title: "合併請求"
|
||||
slug: "pull-request"
|
||||
sidebar_position: 13
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/pull-request
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "合併請求"
|
||||
sidebar_position: 13
|
||||
identifier: "pull-request"
|
||||
---
|
||||
|
||||
# 合併請求
|
||||
|
||||
## 「還在進行中(WIP)」的合併請求
|
||||
|
||||
將合併請求標記為還在進行中(Work In Progress, WIP)可避免意外地被合併。
|
||||
要將合併請求標記為還在進行中請在標題中使用 `WIP:` 或 `[WIP]` 前綴(不分大小寫)。這些值可在您的 `app.ini` 中設定:
|
||||
|
||||
```ini
|
||||
[repository.pull-request]
|
||||
WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP]
|
||||
```
|
||||
|
||||
網頁提示會使用第一個值作為範例。
|
||||
|
||||
## 合併請求範本
|
||||
|
||||
您可以在[問題與合併請求範本](usage/issue-pull-request-templates.md)找到更多關於合併請求範本的資訊。
|
|
@ -1,67 +0,0 @@
|
|||
---
|
||||
date: "2020-07-06T16:00:00+02:00"
|
||||
title: "使用: Push"
|
||||
slug: "push"
|
||||
sidebar_position: 15
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/push-options
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "Push"
|
||||
sidebar_position: 15
|
||||
identifier: "push"
|
||||
---
|
||||
|
||||
There are some additional features when pushing commits to Gitea server.
|
||||
|
||||
# Push Merge Hint
|
||||
|
||||
When you pushing commits to a non-default branch, you will get an information from
|
||||
Gitea which is a link, you can click the link and go to a compare page. It's a quick
|
||||
way to create a pull request or a code review yourself in the Gitea UI.
|
||||
|
||||
![Gitea Push Hint](/gitea-push-hint.png)
|
||||
|
||||
# Push Options
|
||||
|
||||
Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)
|
||||
。
|
||||
|
||||
## 支援的 Options
|
||||
|
||||
- `repo.private` (true|false) - 修改儲存庫的可見性。
|
||||
|
||||
與 push-to-create 一起使用時特別有用。
|
||||
|
||||
- `repo.template` (true|false) - 修改儲存庫是否為範本儲存庫。
|
||||
|
||||
以下範例修改儲存庫的可見性為公開:
|
||||
|
||||
```shell
|
||||
git push -o repo.private=false -u origin main
|
||||
```
|
||||
|
||||
# Push To Create
|
||||
|
||||
Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default.
|
||||
|
||||
## Enabling Push To Create
|
||||
|
||||
In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet](administration/config-cheat-sheet.md#repository-repository).
|
||||
|
||||
## Using Push To Create
|
||||
|
||||
Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command:
|
||||
|
||||
```shell
|
||||
# Add the remote you want to push to
|
||||
git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git
|
||||
|
||||
# push to the remote
|
||||
git push -u origin main
|
||||
```
|
||||
|
||||
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.
|
|
@ -1,190 +0,0 @@
|
|||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Webhook"
|
||||
slug: "webhooks"
|
||||
sidebar_position: 30
|
||||
toc: false
|
||||
draft: false
|
||||
aliases:
|
||||
- /zh-tw/webhooks
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "Webhook"
|
||||
sidebar_position: 30
|
||||
identifier: "webhooks"
|
||||
---
|
||||
|
||||
# Webhook
|
||||
|
||||
Gitea 的儲存庫事件支援 web hook。這可以有儲存庫管理員在設定頁 `/:username/:reponame/settings/hooks` 中調整。Webhook 也可以按照組織調整或按照全系統調整。
|
||||
所有的事件推送都是 POST 請求。此方法目前被下列服務支援:
|
||||
|
||||
- Gitea (也可以是 GET 請求)
|
||||
- Gogs
|
||||
- Slack
|
||||
- Discord
|
||||
- Dingtalk
|
||||
- Telegram
|
||||
- Microsoft Teams
|
||||
- Feishu
|
||||
- Wechatwork
|
||||
- Packagist
|
||||
|
||||
### 事件資訊
|
||||
|
||||
**警告**: Payload 中的 `secret` 欄位已經在 Gitea 1.13.0 棄用,並且將在 1.14.0 移除: https://github.com/go-gitea/gitea/issues/11755
|
||||
|
||||
下面是一個將由 Gitea 發送到 Payload URL 的事件資訊的範例:
|
||||
|
||||
```
|
||||
X-GitHub-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
|
||||
X-GitHub-Event: push
|
||||
X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
|
||||
X-Gogs-Event: push
|
||||
X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
|
||||
X-Gitea-Event: push
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3",
|
||||
"ref": "refs/heads/develop",
|
||||
"before": "28e1879d029cb852e4844d9c718537df08844e03",
|
||||
"after": "bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"commits": [
|
||||
{
|
||||
"id": "bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"message": "Webhooks Yay!",
|
||||
"url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"author": {
|
||||
"name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"username": "gitea"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"username": "gitea"
|
||||
},
|
||||
"timestamp": "2017-03-13T13:52:11-04:00"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"id": 140,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"login": "gitea",
|
||||
"full_name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"avatar_url": "https://localhost:3000/avatars/1",
|
||||
"username": "gitea"
|
||||
},
|
||||
"name": "webhooks",
|
||||
"full_name": "gitea/webhooks",
|
||||
"description": "",
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"html_url": "http://localhost:3000/gitea/webhooks",
|
||||
"ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git",
|
||||
"clone_url": "http://localhost:3000/gitea/webhooks.git",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 1,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 7,
|
||||
"default_branch": "master",
|
||||
"created_at": "2017-02-26T04:29:06-05:00",
|
||||
"updated_at": "2017-03-13T13:51:58-04:00"
|
||||
},
|
||||
"pusher": {
|
||||
"id": 1,
|
||||
"login": "gitea",
|
||||
"full_name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"avatar_url": "https://localhost:3000/avatars/1",
|
||||
"username": "gitea"
|
||||
},
|
||||
"sender": {
|
||||
"id": 1,
|
||||
"login": "gitea",
|
||||
"full_name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"avatar_url": "https://localhost:3000/avatars/1",
|
||||
"username": "gitea"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 範例
|
||||
|
||||
此範例示範在發生推送事件時,如何使用 webhook 觸發 php 程式。
|
||||
使用下列參數在您的儲存庫設定 Webhook 中建立一個 Gitea webhook:
|
||||
|
||||
- 目標 URL: http://mydomain.com/webhook.php
|
||||
- HTTP 請求方法:POST
|
||||
- POST Content Type:application/json
|
||||
- Secret:123
|
||||
- 觸發條件:推送事件
|
||||
- 啟用:勾選
|
||||
|
||||
現在請到您的伺服器上建立 webhook.php 檔案
|
||||
|
||||
```
|
||||
<?php
|
||||
|
||||
$secret_key = '123';
|
||||
|
||||
// check for POST request
|
||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||
error_log('FAILED - not POST - '. $_SERVER['REQUEST_METHOD']);
|
||||
exit();
|
||||
}
|
||||
|
||||
// get content type
|
||||
$content_type = isset($_SERVER['CONTENT_TYPE']) ? strtolower(trim($_SERVER['CONTENT_TYPE'])) : '';
|
||||
|
||||
if ($content_type != 'application/json') {
|
||||
error_log('FAILED - not application/json - '. $content_type);
|
||||
exit();
|
||||
}
|
||||
|
||||
// get payload
|
||||
$payload = trim(file_get_contents("php://input"));
|
||||
|
||||
if (empty($payload)) {
|
||||
error_log('FAILED - no payload');
|
||||
exit();
|
||||
}
|
||||
|
||||
// get header signature
|
||||
$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : '';
|
||||
|
||||
if (empty($header_signature)) {
|
||||
error_log('FAILED - header signature missing');
|
||||
exit();
|
||||
}
|
||||
|
||||
// calculate payload signature
|
||||
$payload_signature = hash_hmac('sha256', $payload, $secret_key, false);
|
||||
|
||||
// check payload signature against header signature
|
||||
if ($header_signature !== $payload_signature) {
|
||||
error_log('FAILED - payload signature');
|
||||
exit();
|
||||
}
|
||||
|
||||
// convert json to array
|
||||
$decoded = json_decode($payload, true);
|
||||
|
||||
// check for json decode errors
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
error_log('FAILED - json decode - '. json_last_error());
|
||||
exit();
|
||||
}
|
||||
|
||||
// success, do something
|
||||
```
|
||||
|
||||
Webhook 設定中有一個傳送測試資料按鈕,它可讓你測試您的設定並將結果顯示於最近傳送記錄。
|
44
go.mod
44
go.mod
|
@ -4,8 +4,8 @@ go 1.21
|
|||
|
||||
require (
|
||||
code.gitea.io/actions-proto-go v0.3.1
|
||||
code.gitea.io/gitea-vet v0.2.2
|
||||
code.gitea.io/sdk/gitea v0.15.1
|
||||
code.gitea.io/gitea-vet v0.2.3
|
||||
code.gitea.io/sdk/gitea v0.16.0
|
||||
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
|
||||
gitea.com/go-chi/binding v0.0.0-20230415142243-04b515c6d669
|
||||
gitea.com/go-chi/cache v0.2.0
|
||||
|
@ -76,7 +76,7 @@ require (
|
|||
github.com/mattn/go-sqlite3 v1.14.17
|
||||
github.com/meilisearch/meilisearch-go v0.25.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/sha256-simd v1.0.1
|
||||
github.com/msteinert/pam v1.2.0
|
||||
|
@ -100,20 +100,20 @@ require (
|
|||
github.com/tstranex/u2f v1.0.0
|
||||
github.com/ulikunitz/xz v0.5.11
|
||||
github.com/urfave/cli/v2 v2.25.7
|
||||
github.com/xanzy/go-gitlab v0.93.0
|
||||
github.com/xanzy/go-gitlab v0.93.1
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
github.com/yohcop/openid-go v1.0.1
|
||||
github.com/yuin/goldmark v1.5.6
|
||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
||||
github.com/yuin/goldmark-meta v1.1.0
|
||||
golang.org/x/crypto v0.14.0
|
||||
golang.org/x/image v0.11.0
|
||||
golang.org/x/net v0.16.0
|
||||
golang.org/x/image v0.13.0
|
||||
golang.org/x/net v0.17.0
|
||||
golang.org/x/oauth2 v0.13.0
|
||||
golang.org/x/sys v0.13.0
|
||||
golang.org/x/text v0.13.0
|
||||
golang.org/x/tools v0.14.0
|
||||
google.golang.org/grpc v1.57.0
|
||||
google.golang.org/grpc v1.58.3
|
||||
google.golang.org/protobuf v1.31.0
|
||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
||||
gopkg.in/ini.v1 v1.67.0
|
||||
|
@ -121,16 +121,16 @@ require (
|
|||
mvdan.cc/xurls/v2 v2.5.0
|
||||
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
|
||||
xorm.io/builder v0.3.13
|
||||
xorm.io/xorm v1.3.3-0.20230725140238-59b727260d35
|
||||
xorm.io/xorm v1.3.3
|
||||
)
|
||||
|
||||
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
|
||||
dario.cat/mergo v1.0.0 // 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/clickhouse-go/v2 v2.14.2 // indirect
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.14.3 // indirect
|
||||
github.com/DataDog/zstd v1.5.5 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.2.1 // indirect
|
||||
|
@ -162,16 +162,17 @@ require (
|
|||
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
|
||||
github.com/blevesearch/zapx/v15 v15.3.13 // 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/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cloudflare/circl v1.3.3 // indirect
|
||||
github.com/couchbase/go-couchbase v0.1.1 // indirect
|
||||
github.com/couchbase/gomemcached v0.2.1 // 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/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // 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/dlclark/regexp2 v1.10.0 // indirect
|
||||
github.com/emersion/go-sasl v0.0.0-20220912192320-0145f2c60ead // indirect
|
||||
|
@ -246,25 +247,27 @@ require (
|
|||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/client_model v0.5.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.26 // indirect
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||
github.com/rs/xid v1.5.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/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // 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/jwalterweatherman v1.1.0 // 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/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/toqueteos/webbrowser v1.2.0 // indirect
|
||||
|
@ -286,11 +289,12 @@ require (
|
|||
go.uber.org/atomic v1.11.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.26.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||
golang.org/x/mod v0.13.0 // indirect
|
||||
golang.org/x/sync v0.4.0 // indirect
|
||||
golang.org/x/time v0.3.0 // 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/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
|
95
go.sum
95
go.sum
|
@ -24,8 +24,8 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf
|
|||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
|
||||
cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
|
||||
cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0=
|
||||
cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78=
|
||||
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
|
@ -42,11 +42,10 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
|
|||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
code.gitea.io/actions-proto-go v0.3.1 h1:PMyiQtBKb8dNnpEO2R5rcZdXSis+UQZVo/SciMtR1aU=
|
||||
code.gitea.io/actions-proto-go v0.3.1/go.mod h1:00ys5QDo1iHN1tHNvvddAcy2W/g+425hQya1cCSvq9A=
|
||||
code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
|
||||
code.gitea.io/gitea-vet v0.2.2 h1:TEOV/Glf38iGmKzKP0EB++Z5OSL4zGg3RrAvlwaMuvk=
|
||||
code.gitea.io/gitea-vet v0.2.2/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
|
||||
code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M=
|
||||
code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA=
|
||||
code.gitea.io/gitea-vet v0.2.3 h1:gdFmm6WOTM65rE8FUBTRzeQZYzXePKSSB1+r574hWwI=
|
||||
code.gitea.io/gitea-vet v0.2.3/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
|
||||
code.gitea.io/sdk/gitea v0.16.0 h1:gAfssETO1Hv9QbE+/nhWu7EjoFQYKt6kPoyDytQgw00=
|
||||
code.gitea.io/sdk/gitea v0.16.0/go.mod h1:ndkDk99BnfiUCCYEUhpNzi0lpmApXlwRFqClBlOlEBg=
|
||||
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570 h1:TXbikPqa7YRtfU9vS6QJBg77pUvbEb6StRdZO8t1bEY=
|
||||
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570/go.mod h1:IIAjsijsd8q1isWX8MACefDEgTQslQ4stk2AeeTt3kM=
|
||||
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
|
||||
|
@ -85,8 +84,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
|
|||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ClickHouse/ch-go v0.58.2 h1:jSm2szHbT9MCAB1rJ3WuCJqmGLi5UTjlNu+f530UTS0=
|
||||
github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTYWhsuQ99aw=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.14.2 h1:iYGP2bgPYJ33y6rCfZTQAPrnHt8wmsM3Ut4cLoYhWY0=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.14.2/go.mod h1:ZLn63wODwGxVdnGB0EIYmFL5tjtlLcLBuwQUH6B2sYk=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.14.3 h1:s9SuU3PfJrfJ4SDbVRo6XM2ZWlr7efvW9Z/ppUpE1vo=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.14.3/go.mod h1:qdw8IMGH4Y+PedKlf9QEhFO1ATTSFhh4exQRVIa3y2A=
|
||||
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
|
||||
github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
|
||||
|
@ -200,8 +199,8 @@ github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBW
|
|||
github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs=
|
||||
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20190329173943-551aad21a668/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285 h1:Dr+ezPI5ivhMn/3WOoB86XzMhie146DNaBbhaQWZHMY=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 h1:N7oVaKyGp8bttX0bfZGmcGkjz7DLQXhAn3DNd3T0ous=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
|
||||
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
||||
|
@ -251,16 +250,19 @@ github.com/couchbase/goutils v0.1.2 h1:gWr8B6XNWPIhfalHNog3qQKfGiYyh4K4VhO3P2o9B
|
|||
github.com/couchbase/goutils v0.1.2/go.mod h1:h89Ek/tiOxxqjz30nPPlwZdQbdB8BwgnuBxeoUe/ViE=
|
||||
github.com/couchbase/moss v0.1.0/go.mod h1:9MaHIaRuy9pvLPUJxB8sh8OrLfyDczECVL37grCIubs=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454WvHn0=
|
||||
github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE=
|
||||
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE=
|
||||
github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw=
|
||||
|
@ -355,6 +357,7 @@ github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
|
|||
github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=
|
||||
github.com/go-faster/errors v0.6.1 h1:nNIPOBkprlKzkThvS/0YaX8Zs9KewLCOSFQS5BU06FI=
|
||||
github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+Jpi2LAyY=
|
||||
github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
|
||||
github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e h1:oRq/fiirun5HqlEWMLIcDmLpIELlG4iGbd0s8iqgPi8=
|
||||
github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
|
||||
|
@ -592,8 +595,8 @@ github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/z
|
|||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
|
||||
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
|
||||
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
|
@ -789,8 +792,8 @@ github.com/mholt/acmez v1.2.0 h1:1hhLxSgY5FvH5HCnGUuwbKY2VQVo8IU7rxXKSnZ7F30=
|
|||
github.com/mholt/acmez v1.2.0/go.mod h1:VT9YwH1xgNX1kmYY89gY8xPJC84BFAisjo8Egigt4kE=
|
||||
github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo=
|
||||
github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4=
|
||||
github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg=
|
||||
github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE=
|
||||
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
|
||||
github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
|
||||
github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=
|
||||
github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
|
@ -880,19 +883,20 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
|||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg=
|
||||
github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
|
||||
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
|
||||
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
|
||||
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
|
||||
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
|
||||
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
|
||||
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
|
||||
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
|
||||
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
|
||||
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
|
||||
github.com/quasoft/websspi v1.1.2 h1:/mA4w0LxWlE3novvsoEL6BBA1WnjJATbjkh1kFrTidw=
|
||||
github.com/quasoft/websspi v1.1.2/go.mod h1:HmVdl939dQ0WIXZhyik+ARdI03M6bQzaSEKcgpFmewk=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
|
@ -924,6 +928,10 @@ github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThC
|
|||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ=
|
||||
github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
|
||||
github.com/sassoftware/go-rpmutils v0.2.0 h1:pKW0HDYMFWQ5b4JQPiI3WI12hGsVoW0V8+GMoZiI/JE=
|
||||
|
@ -958,9 +966,11 @@ github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYl
|
|||
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
|
||||
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
|
||||
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
|
||||
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
|
||||
|
@ -968,14 +978,12 @@ github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN
|
|||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||
github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
|
||||
github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg=
|
||||
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
|
||||
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
|
||||
github.com/stephens2424/writerset v1.0.2/go.mod h1:aS2JhsMn6eA7e82oNmW4rfsgAOp9COBTTl8mzkwADnc=
|
||||
|
@ -1028,8 +1036,8 @@ github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7Fw
|
|||
github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/xanzy/go-gitlab v0.93.0 h1:/Fy4akqKIQasZgQ2xj2xJBrEZ+iCW+iC+9qLEt19tgo=
|
||||
github.com/xanzy/go-gitlab v0.93.0/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
|
||||
github.com/xanzy/go-gitlab v0.93.1 h1:f7J33cw/P9b/8paIOoH0F3H+TFrswvWHs6yUgoTp9LY=
|
||||
github.com/xanzy/go-gitlab v0.93.1/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
|
||||
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
|
||||
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
|
@ -1130,10 +1138,12 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPh
|
|||
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
|
@ -1154,10 +1164,12 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
|
|||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo=
|
||||
golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
|
||||
golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg=
|
||||
golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
|
@ -1232,8 +1244,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
|||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
|
||||
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
|
@ -1364,7 +1376,6 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
|||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
|
@ -1513,8 +1524,8 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
|
|||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
|
@ -1532,8 +1543,8 @@ google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
|
|||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
|
||||
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
|
||||
google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
|
||||
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
|
@ -1637,5 +1648,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:
|
|||
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
|
||||
xorm.io/builder v0.3.13 h1:a3jmiVVL19psGeXx8GIurTp7p0IIgqeDmwhcR6BAOAo=
|
||||
xorm.io/builder v0.3.13/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
|
||||
xorm.io/xorm v1.3.3-0.20230725140238-59b727260d35 h1:qjhRBMFRr3IdT2YR8VByOMfko8vxINiOPeOc267zuPI=
|
||||
xorm.io/xorm v1.3.3-0.20230725140238-59b727260d35/go.mod h1:qFJGFoVYbbIdnz2vaL5OxSQ2raleMpyRRalnq3n9OJo=
|
||||
xorm.io/xorm v1.3.3 h1:L5/GOhvgMcwJYYRjzPf3lTTTf6JcaTd1Mb9A/Iqvccw=
|
||||
xorm.io/xorm v1.3.3/go.mod h1:qFJGFoVYbbIdnz2vaL5OxSQ2raleMpyRRalnq3n9OJo=
|
||||
|
|
|
@ -42,7 +42,7 @@ func (jobs ActionJobList) LoadRuns(ctx context.Context, withRepo bool) error {
|
|||
for _, r := range runs {
|
||||
runsList = append(runsList, r)
|
||||
}
|
||||
return runsList.LoadRepos()
|
||||
return runsList.LoadRepos(ctx)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -52,9 +52,9 @@ func (runs RunList) LoadTriggerUser(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (runs RunList) LoadRepos() error {
|
||||
func (runs RunList) LoadRepos(ctx context.Context) error {
|
||||
repoIDs := runs.GetRepoIDs()
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(repoIDs)
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -49,9 +49,9 @@ func (schedules ScheduleList) LoadTriggerUser(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (schedules ScheduleList) LoadRepos() error {
|
||||
func (schedules ScheduleList) LoadRepos(ctx context.Context) error {
|
||||
repoIDs := schedules.GetRepoIDs()
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(repoIDs)
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ func (specs SpecList) GetRepoIDs() []int64 {
|
|||
return ids.Values()
|
||||
}
|
||||
|
||||
func (specs SpecList) LoadRepos() error {
|
||||
func (specs SpecList) LoadRepos(ctx context.Context) error {
|
||||
repoIDs := specs.GetRepoIDs()
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(repoIDs)
|
||||
repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ func GetStatistic(ctx context.Context) (stats Statistic) {
|
|||
stats.Counter.Follow, _ = e.Count(new(user_model.Follow))
|
||||
stats.Counter.Mirror, _ = e.Count(new(repo_model.Mirror))
|
||||
stats.Counter.Release, _ = e.Count(new(repo_model.Release))
|
||||
stats.Counter.AuthSource = auth.CountSources()
|
||||
stats.Counter.AuthSource = auth.CountSources(ctx)
|
||||
stats.Counter.Webhook, _ = e.Count(new(webhook.Webhook))
|
||||
stats.Counter.Milestone, _ = e.Count(new(issues_model.Milestone))
|
||||
stats.Counter.Label, _ = e.Count(new(issues_model.Label))
|
||||
|
|
|
@ -111,8 +111,8 @@ func GetGPGKeysByKeyID(ctx context.Context, keyID string) ([]*GPGKey, error) {
|
|||
}
|
||||
|
||||
// GPGKeyToEntity retrieve the imported key and the traducted entity
|
||||
func GPGKeyToEntity(k *GPGKey) (*openpgp.Entity, error) {
|
||||
impKey, err := GetGPGImportByKeyID(k.KeyID)
|
||||
func GPGKeyToEntity(ctx context.Context, k *GPGKey) (*openpgp.Entity, error) {
|
||||
impKey, err := GetGPGImportByKeyID(ctx, k.KeyID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
|
||||
package asymkey
|
||||
|
||||
import "code.gitea.io/gitea/models/db"
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
)
|
||||
|
||||
// __________________ ________ ____ __.
|
||||
// / _____/\______ \/ _____/ | |/ _|____ ___.__.
|
||||
|
@ -31,9 +35,9 @@ func init() {
|
|||
}
|
||||
|
||||
// GetGPGImportByKeyID returns the import public armored key by given KeyID.
|
||||
func GetGPGImportByKeyID(keyID string) (*GPGKeyImport, error) {
|
||||
func GetGPGImportByKeyID(ctx context.Context, keyID string) (*GPGKeyImport, error) {
|
||||
key := new(GPGKeyImport)
|
||||
has, err := db.GetEngine(db.DefaultContext).ID(keyID).Get(key)
|
||||
has, err := db.GetEngine(ctx).ID(keyID).Get(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
package asymkey
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -29,8 +30,8 @@ import (
|
|||
// This file provides functions relating verifying gpg keys
|
||||
|
||||
// VerifyGPGKey marks a GPG key as verified
|
||||
func VerifyGPGKey(ownerID int64, keyID, token, signature string) (string, error) {
|
||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
||||
func VerifyGPGKey(ctx context.Context, ownerID int64, keyID, token, signature string) (string, error) {
|
||||
ctx, committer, err := db.TxContext(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ func addKey(ctx context.Context, key *PublicKey) (err error) {
|
|||
}
|
||||
|
||||
// AddPublicKey adds new public key to database and authorized_keys file.
|
||||
func AddPublicKey(ownerID int64, name, content string, authSourceID int64) (*PublicKey, error) {
|
||||
func AddPublicKey(ctx context.Context, ownerID int64, name, content string, authSourceID int64) (*PublicKey, error) {
|
||||
log.Trace(content)
|
||||
|
||||
fingerprint, err := CalcFingerprint(content)
|
||||
|
@ -99,7 +99,7 @@ func AddPublicKey(ownerID int64, name, content string, authSourceID int64) (*Pub
|
|||
return nil, err
|
||||
}
|
||||
|
||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
||||
ctx, committer, err := db.TxContext(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -136,9 +136,9 @@ func AddPublicKey(ownerID int64, name, content string, authSourceID int64) (*Pub
|
|||
}
|
||||
|
||||
// GetPublicKeyByID returns public key by given ID.
|
||||
func GetPublicKeyByID(keyID int64) (*PublicKey, error) {
|
||||
func GetPublicKeyByID(ctx context.Context, keyID int64) (*PublicKey, error) {
|
||||
key := new(PublicKey)
|
||||
has, err := db.GetEngine(db.DefaultContext).
|
||||
has, err := db.GetEngine(ctx).
|
||||
ID(keyID).
|
||||
Get(key)
|
||||
if err != nil {
|
||||
|
@ -180,7 +180,7 @@ func SearchPublicKeyByContentExact(ctx context.Context, content string) (*Public
|
|||
}
|
||||
|
||||
// SearchPublicKey returns a list of public keys matching the provided arguments.
|
||||
func SearchPublicKey(uid int64, fingerprint string) ([]*PublicKey, error) {
|
||||
func SearchPublicKey(ctx context.Context, uid int64, fingerprint string) ([]*PublicKey, error) {
|
||||
keys := make([]*PublicKey, 0, 5)
|
||||
cond := builder.NewCond()
|
||||
if uid != 0 {
|
||||
|
@ -189,12 +189,12 @@ func SearchPublicKey(uid int64, fingerprint string) ([]*PublicKey, error) {
|
|||
if fingerprint != "" {
|
||||
cond = cond.And(builder.Eq{"fingerprint": fingerprint})
|
||||
}
|
||||
return keys, db.GetEngine(db.DefaultContext).Where(cond).Find(&keys)
|
||||
return keys, db.GetEngine(ctx).Where(cond).Find(&keys)
|
||||
}
|
||||
|
||||
// ListPublicKeys returns a list of public keys belongs to given user.
|
||||
func ListPublicKeys(uid int64, listOptions db.ListOptions) ([]*PublicKey, error) {
|
||||
sess := db.GetEngine(db.DefaultContext).Where("owner_id = ? AND type != ?", uid, KeyTypePrincipal)
|
||||
func ListPublicKeys(ctx context.Context, uid int64, listOptions db.ListOptions) ([]*PublicKey, error) {
|
||||
sess := db.GetEngine(ctx).Where("owner_id = ? AND type != ?", uid, KeyTypePrincipal)
|
||||
if listOptions.Page != 0 {
|
||||
sess = db.SetSessionPagination(sess, &listOptions)
|
||||
|
||||
|
@ -207,30 +207,30 @@ func ListPublicKeys(uid int64, listOptions db.ListOptions) ([]*PublicKey, error)
|
|||
}
|
||||
|
||||
// CountPublicKeys count public keys a user has
|
||||
func CountPublicKeys(userID int64) (int64, error) {
|
||||
sess := db.GetEngine(db.DefaultContext).Where("owner_id = ? AND type != ?", userID, KeyTypePrincipal)
|
||||
func CountPublicKeys(ctx context.Context, userID int64) (int64, error) {
|
||||
sess := db.GetEngine(ctx).Where("owner_id = ? AND type != ?", userID, KeyTypePrincipal)
|
||||
return sess.Count(&PublicKey{})
|
||||
}
|
||||
|
||||
// ListPublicKeysBySource returns a list of synchronized public keys for a given user and login source.
|
||||
func ListPublicKeysBySource(uid, authSourceID int64) ([]*PublicKey, error) {
|
||||
func ListPublicKeysBySource(ctx context.Context, uid, authSourceID int64) ([]*PublicKey, error) {
|
||||
keys := make([]*PublicKey, 0, 5)
|
||||
return keys, db.GetEngine(db.DefaultContext).
|
||||
return keys, db.GetEngine(ctx).
|
||||
Where("owner_id = ? AND login_source_id = ?", uid, authSourceID).
|
||||
Find(&keys)
|
||||
}
|
||||
|
||||
// UpdatePublicKeyUpdated updates public key use time.
|
||||
func UpdatePublicKeyUpdated(id int64) error {
|
||||
func UpdatePublicKeyUpdated(ctx context.Context, id int64) error {
|
||||
// Check if key exists before update as affected rows count is unreliable
|
||||
// and will return 0 affected rows if two updates are made at the same time
|
||||
if cnt, err := db.GetEngine(db.DefaultContext).ID(id).Count(&PublicKey{}); err != nil {
|
||||
if cnt, err := db.GetEngine(ctx).ID(id).Count(&PublicKey{}); err != nil {
|
||||
return err
|
||||
} else if cnt != 1 {
|
||||
return ErrKeyNotExist{id}
|
||||
}
|
||||
|
||||
_, err := db.GetEngine(db.DefaultContext).ID(id).Cols("updated_unix").Update(&PublicKey{
|
||||
_, err := db.GetEngine(ctx).ID(id).Cols("updated_unix").Update(&PublicKey{
|
||||
UpdatedUnix: timeutil.TimeStampNow(),
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -250,7 +250,7 @@ func DeletePublicKeys(ctx context.Context, keyIDs ...int64) error {
|
|||
}
|
||||
|
||||
// PublicKeysAreExternallyManaged returns whether the provided KeyID represents an externally managed Key
|
||||
func PublicKeysAreExternallyManaged(keys []*PublicKey) ([]bool, error) {
|
||||
func PublicKeysAreExternallyManaged(ctx context.Context, keys []*PublicKey) ([]bool, error) {
|
||||
sources := make([]*auth.Source, 0, 5)
|
||||
externals := make([]bool, len(keys))
|
||||
keyloop:
|
||||
|
@ -272,7 +272,7 @@ keyloop:
|
|||
|
||||
if source == nil {
|
||||
var err error
|
||||
source, err = auth.GetSourceByID(key.LoginSourceID)
|
||||
source, err = auth.GetSourceByID(ctx, key.LoginSourceID)
|
||||
if err != nil {
|
||||
if auth.IsErrSourceNotExist(err) {
|
||||
externals[i] = false
|
||||
|
@ -295,15 +295,15 @@ keyloop:
|
|||
}
|
||||
|
||||
// PublicKeyIsExternallyManaged returns whether the provided KeyID represents an externally managed Key
|
||||
func PublicKeyIsExternallyManaged(id int64) (bool, error) {
|
||||
key, err := GetPublicKeyByID(id)
|
||||
func PublicKeyIsExternallyManaged(ctx context.Context, id int64) (bool, error) {
|
||||
key, err := GetPublicKeyByID(ctx, id)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if key.LoginSourceID == 0 {
|
||||
return false, nil
|
||||
}
|
||||
source, err := auth.GetSourceByID(key.LoginSourceID)
|
||||
source, err := auth.GetSourceByID(ctx, key.LoginSourceID)
|
||||
if err != nil {
|
||||
if auth.IsErrSourceNotExist(err) {
|
||||
return false, nil
|
||||
|
@ -318,9 +318,9 @@ func PublicKeyIsExternallyManaged(id int64) (bool, error) {
|
|||
}
|
||||
|
||||
// deleteKeysMarkedForDeletion returns true if ssh keys needs update
|
||||
func deleteKeysMarkedForDeletion(keys []string) (bool, error) {
|
||||
func deleteKeysMarkedForDeletion(ctx context.Context, keys []string) (bool, error) {
|
||||
// Start session
|
||||
ctx, committer, err := db.TxContext(db.DefaultContext)
|
||||
ctx, committer, err := db.TxContext(ctx)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ func deleteKeysMarkedForDeletion(keys []string) (bool, error) {
|
|||
}
|
||||
|
||||
// AddPublicKeysBySource add a users public keys. Returns true if there are changes.
|
||||
func AddPublicKeysBySource(usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool {
|
||||
func AddPublicKeysBySource(ctx context.Context, usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool {
|
||||
var sshKeysNeedUpdate bool
|
||||
for _, sshKey := range sshPublicKeys {
|
||||
var err error
|
||||
|
@ -368,7 +368,7 @@ func AddPublicKeysBySource(usr *user_model.User, s *auth.Source, sshPublicKeys [
|
|||
marshalled = marshalled[:len(marshalled)-1]
|
||||
sshKeyName := fmt.Sprintf("%s-%s", s.Name, ssh.FingerprintSHA256(out))
|
||||
|
||||
if _, err := AddPublicKey(usr.ID, sshKeyName, marshalled, s.ID); err != nil {
|
||||
if _, err := AddPublicKey(ctx, usr.ID, sshKeyName, marshalled, s.ID); err != nil {
|
||||
if IsErrKeyAlreadyExist(err) {
|
||||
log.Trace("AddPublicKeysBySource[%s]: Public SSH Key %s already exists for user", sshKeyName, usr.Name)
|
||||
} else {
|
||||
|
@ -387,14 +387,14 @@ func AddPublicKeysBySource(usr *user_model.User, s *auth.Source, sshPublicKeys [
|
|||
}
|
||||
|
||||
// SynchronizePublicKeys updates a users public keys. Returns true if there are changes.
|
||||
func SynchronizePublicKeys(usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool {
|
||||
func SynchronizePublicKeys(ctx context.Context, usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool {
|
||||
var sshKeysNeedUpdate bool
|
||||
|
||||
log.Trace("synchronizePublicKeys[%s]: Handling Public SSH Key synchronization for user %s", s.Name, usr.Name)
|
||||
|
||||
// Get Public Keys from DB with current LDAP source
|
||||
var giteaKeys []string
|
||||
keys, err := ListPublicKeysBySource(usr.ID, s.ID)
|
||||
keys, err := ListPublicKeysBySource(ctx, usr.ID, s.ID)
|
||||
if err != nil {
|
||||
log.Error("synchronizePublicKeys[%s]: Error listing Public SSH Keys for user %s: %v", s.Name, usr.Name, err)
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ func SynchronizePublicKeys(usr *user_model.User, s *auth.Source, sshPublicKeys [
|
|||
newKeys = append(newKeys, key)
|
||||
}
|
||||
}
|
||||
if AddPublicKeysBySource(usr, s, newKeys) {
|
||||
if AddPublicKeysBySource(ctx, usr, s, newKeys) {
|
||||
sshKeysNeedUpdate = true
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,7 @@ func SynchronizePublicKeys(usr *user_model.User, s *auth.Source, sshPublicKeys [
|
|||
}
|
||||
|
||||
// Delete keys from DB that no longer exist in the source
|
||||
needUpd, err := deleteKeysMarkedForDeletion(giteaKeysToDelete)
|
||||
needUpd, err := deleteKeysMarkedForDeletion(ctx, giteaKeysToDelete)
|
||||
if err != nil {
|
||||
log.Error("synchronizePublicKeys[%s]: Error deleting Public Keys marked for deletion for user %s: %v", s.Name, usr.Name, err)
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ func appendAuthorizedKeysToFile(keys ...*PublicKey) error {
|
|||
}
|
||||
|
||||
// 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(ctx).Iterate does not get latest data after insert/delete, so we have to call this function
|
||||
// outside any session scope independently.
|
||||
func RewriteAllPublicKeys(ctx context.Context) error {
|
||||
// Don't rewrite key if internal server
|
||||
|
|
|
@ -40,7 +40,7 @@ import (
|
|||
const authorizedPrincipalsFile = "authorized_principals"
|
||||
|
||||
// RewriteAllPrincipalKeys removes any authorized principal 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(ctx).Iterate does not get latest data after insert/delete, so we have to call this function
|
||||
// outside any session scope independently.
|
||||
func RewriteAllPrincipalKeys(ctx context.Context) error {
|
||||
// Don't rewrite key if internal server
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
func ParseCommitWithSSHSignature(ctx context.Context, c *git.Commit, committer *user_model.User) *CommitVerification {
|
||||
// Now try to associate the signature with the committer, if present
|
||||
if committer.ID != 0 {
|
||||
keys, err := ListPublicKeys(committer.ID, db.ListOptions{})
|
||||
keys, err := ListPublicKeys(ctx, committer.ID, db.ListOptions{})
|
||||
if err != nil { // Skipping failed to get ssh keys of user
|
||||
log.Error("ListPublicKeys: %v", err)
|
||||
return &CommitVerification{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue