Compare commits
90 Commits
Author | SHA1 | Date | |
---|---|---|---|
78cb09deda | |||
0f35cb5a2a | |||
0b3d6c399c | |||
f98a1b851c | |||
e75594f7a6 | |||
a1c0b3a02e | |||
6624f257d3 | |||
35db5a373b | |||
5043ad54c7 | |||
727435743a | |||
829b807a91 | |||
874cdcc974 | |||
e20023af58 | |||
4435d8a4b6 | |||
6ca8cb590d | |||
65e2811859 | |||
b78f5fc60f | |||
511298e452 | |||
7ea2ffaf16 | |||
fdb0d03083 | |||
ed5e0c8c27 | |||
0870e0bc9b | |||
c0b97d0485 | |||
f80ea95eb5 | |||
dcb9c38568 | |||
c4a86b20a4 | |||
f634982d23 | |||
9379352db6 | |||
e940443b27 | |||
2762921e73 | |||
78f41e4fc4 | |||
c01b266d86 | |||
e2eac7574f | |||
5b8b22bd75 | |||
f79530c50e | |||
39735c43a8 | |||
3604b7d8ad | |||
d41d367c35 | |||
7e0299b4fd | |||
933cc4da64 | |||
fea6bd130e | |||
906a722fca | |||
8cd83ff391 | |||
d823465d94 | |||
dd8bc1d61d | |||
0ac3186267 | |||
732d511e04 | |||
1aaeec6da7 | |||
315155fab0 | |||
9a4d283e9a | |||
fb7f28e9a7 | |||
c9b2aaed0e | |||
19a08c7fe2 | |||
f0d34cd3b9 | |||
7ed79b748f | |||
b9b2ae214d | |||
aadbbf4358 | |||
8e957e5f1d | |||
8def405047 | |||
5ac41026f9 | |||
333d02ddfd | |||
5d1abdce3e | |||
2588d73ebf | |||
a0b9bd2feb | |||
c398c25b18 | |||
2048363f9e | |||
b8e6cffd31 | |||
1ddcaedb88 | |||
7291fecab3 | |||
c33886b710 | |||
d6eb6c90f4 | |||
55c53080d1 | |||
8766f65add | |||
e95006848e | |||
9210ce4045 | |||
cebf55f6b1 | |||
b508813fe4 | |||
fd1edb9d9d | |||
633996db8e | |||
7f0ce2dfc7 | |||
b7c944b9e4 | |||
cf9a416d62 | |||
8c7bda8755 | |||
b7e32b2382 | |||
e3dfb512d6 | |||
0d50f27469 | |||
62f2d717b7 | |||
89960c3dfb | |||
8b5c9186a5 | |||
8b4abb1719 |
.eslintrc.yaml
.github/workflows
CHANGELOG.mdMakefilecmd
docs/content
administration.fr-fr.mdadministration.zh-tw.md
go.modgo.sumadministration
_index.zh-tw.mdbackup-and-restore.zh-tw.mdconfig-cheat-sheet.en-us.mdconfig-cheat-sheet.zh-cn.mdcustomizing-gitea.en-us.md
contributing.fr-fr.mdcontributing.zh-tw.mdcontributing
development.zh-tw.mddevelopment
_index.zh-tw.mdhacking-on-gitea.en-us.mdhacking-on-gitea.zh-cn.mdintegrations.zh-tw.mdmigrations.zh-tw.mdoauth2-provider.zh-tw.md
help.fr-fr.mdhelp.zh-tw.mdhelp
index.de-de.mdindex.fr-fr.mdindex.zh-tw.mdinstallation.fr-fr.mdinstallation.zh-tw.mdinstallation
_index.fr-fr.md_index.zh-tw.mdcomparison.zh-tw.mdfrom-binary.fr-fr.mdfrom-binary.zh-tw.mdfrom-package.fr-fr.mdfrom-package.zh-tw.mdfrom-source.en-us.mdfrom-source.fr-fr.mdfrom-source.zh-cn.mdfrom-source.zh-tw.mdon-kubernetes.zh-tw.mdrun-as-service-in-ubuntu.zh-tw.mdupgrade-from-gogs.fr-fr.mdwindows-service.fr-fr.mdwindows-service.zh-tw.mdwith-docker.fr-fr.mdwith-docker.zh-tw.md
search.de-de.mdsearch.fr-fr.mdsearch.zh-tw.mdusage.zh-tw.mdusage
models
activities
auth
fixtures
issues
perm/access
repo
unittest
modules
actions
base
charset
context
contexttest
generate
git
batch_reader.goblob_nogogit.gocommit_info_nogogit.gogit.gogit_test.go
pipeline
repo.gorepo_archive.gorepo_attribute.gorepo_base_gogit.gorepo_base_nogogit.gorepo_commit_nogogit.gorepo_commitgraph_gogit.gorepo_language_stats_nogogit.gorepo_tag.gorepo_tag_nogogit.gorepo_tag_test.gorepo_tree_nogogit.gosignature.gosignature_gogit.gosignature_nogogit.gosignature_test.gotag.gotree_nogogit.gotree_test.goindexer
markup
repository
setting
ssh
util
options/locale
package-lock.jsonpackage.jsonrouters
api
actions
packages
v1
install
web
auth
repo
actions
commit.gocompare.goeditor.goissue.gomiddlewares.gomilestone.gopull.gopull_review.gopull_review_test.gorender.gosetting
view.goshared/user
user/setting/security
services
actions
auth
convert
issue
mailer
migrations
packages
pull
release
repository
wiki
templates
admin/user
org
repo
branch_dropdown.tmplcommit_load_branches_and_tags.tmpl
diff
editor
issue/view_content
migrate
pulls
release
settings
unicode_escape_prompt.tmplview_file.tmplwiki
user/overview
tests
gitea-repositories-meta/user2/test_commit_revert.git
integration
web_src
@ -743,7 +743,7 @@ rules:
|
||||
wc/no-constructor-params: [2]
|
||||
wc/no-constructor: [2]
|
||||
wc/no-customized-built-in-elements: [2]
|
||||
wc/no-exports-with-element: [2]
|
||||
wc/no-exports-with-element: [0]
|
||||
wc/no-invalid-element-name: [2]
|
||||
wc/no-invalid-extends: [2]
|
||||
wc/no-method-prefixed-with-on: [2]
|
||||
|
12
.github/workflows/pull-compliance.yml
vendored
12
.github/workflows/pull-compliance.yml
vendored
@ -64,6 +64,18 @@ jobs:
|
||||
- run: make deps-frontend
|
||||
- run: make lint-swagger
|
||||
|
||||
lint-spell:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.templates == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
check-latest: true
|
||||
- run: make lint-spell
|
||||
|
||||
lint-go-windows:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
needs: files-changed
|
||||
|
109
CHANGELOG.md
109
CHANGELOG.md
@ -4,7 +4,108 @@ This changelog goes through all the changes that have been made in each release
|
||||
without substantial changes to our git log; to see the highlights of what has
|
||||
been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||
|
||||
## [1.21.4](https://github.com/go-gitea/gitea/releases/tag/1.21.4) - 2024-01-16
|
||||
## [1.21.7](https://github.com/go-gitea/gitea/releases/tag/1.21.7) - 2024-02-26
|
||||
|
||||
* ENHANCEMENTS
|
||||
* Users with `read` permission of pull requests can be assigned too (#27263) (#29372)
|
||||
* BUGFIXES
|
||||
* Do not double close reader (#29354) (#29370)
|
||||
* Display friendly error message (#29105) (#29363)
|
||||
* Fix project counter in organization/individual profile (#28068) (#29361)
|
||||
* Fix validity of the FROM email address not being checked (#29347) (#29360)
|
||||
* Fix tarball/zipball download bug (#29342) (#29352)
|
||||
* DOCS
|
||||
* Docker Tag Information in Docs (#29047) (#29362)
|
||||
* MISC
|
||||
* Enforce maxlength in frontend (#29389) (#29396)
|
||||
|
||||
## [1.21.6](https://github.com/go-gitea/gitea/releases/tag/v1.21.6) - 2024-02-22
|
||||
|
||||
* SECURITY
|
||||
* Fix XSS vulnerabilities (#29336)
|
||||
* Use general token signing secret (#29205) (#29325)
|
||||
* ENHANCEMENTS
|
||||
* Refactor git version functions and check compatibility (#29155) (#29157)
|
||||
* Improve user experience for outdated comments (#29050) (#29086)
|
||||
* Hide code links on release page if user cannot read code (#29064) (#29066)
|
||||
* Wrap contained tags and branches again (#29021) (#29026)
|
||||
* Fix incorrect button CSS usages (#29015) (#29023)
|
||||
* Strip trailing newline in markdown code copy (#29019) (#29022)
|
||||
* Implement some action notifier functions (#29173) (#29308)
|
||||
* Load outdated comments when (un)resolving conversation on PR timeline (#29203) (#29221)
|
||||
* BUGFIXES
|
||||
* Refactor issue template parsing and fix API endpoint (#29069) (#29140)
|
||||
* Fix swift packages not resolving (#29095) (#29102)
|
||||
* Remove SSH workaround (#27893) (#29332)
|
||||
* Only log error when tag sync fails (#29295) (#29327)
|
||||
* Fix SSPI user creation (#28948) (#29323)
|
||||
* Improve the `issue_comment` workflow trigger event (#29277) (#29322)
|
||||
* Discard unread data of `git cat-file` (#29297) (#29310)
|
||||
* Fix error display when merging PRs (#29288) (#29309)
|
||||
* Prevent double use of `git cat-file` session. (#29298) (#29301)
|
||||
* Fix missing link on outgoing new release notifications (#29079) (#29300)
|
||||
* Fix debian InRelease Acquire-By-Hash newline (#29204) (#29299)
|
||||
* Always write proc-receive hook for all git versions (#29287) (#29291)
|
||||
* Do not show delete button when time tracker is disabled (#29257) (#29279)
|
||||
* Workaround to clean up old reviews on creating a new one (#28554) (#29264)
|
||||
* Fix bug when the linked account was disactived and list the linked accounts (#29263)
|
||||
* Do not use lower tag names to find releases/tags (#29261) (#29262)
|
||||
* Fix missed edit issues event for actions (#29237) (#29251)
|
||||
* Only delete scheduled workflows when needed (#29091) (#29235)
|
||||
* Make submit event code work with both jQuery event and native event (#29223) (#29234)
|
||||
* Fix push to create with capitalize repo name (#29090) (#29206)
|
||||
* Use ghost user if user was not found (#29161) (#29169)
|
||||
* Dont load Review if Comment is CommentTypeReviewRequest (#28551) (#29160)
|
||||
* Refactor parseSignatureFromCommitLine (#29054) (#29108)
|
||||
* Avoid showing unnecessary JS errors when there are elements with different origin on the page (#29081) (#29089)
|
||||
* Fix gitea-origin-url with default ports (#29085) (#29088)
|
||||
* Fix orgmode link resolving (#29024) (#29076)
|
||||
* Fix Elasticsearh Request Entity Too Large #28117 (#29062) (#29075)
|
||||
* Do not render empty comments (#29039) (#29049)
|
||||
* Avoid sending update/delete release notice when it is draft (#29008) (#29025)
|
||||
* Fix gitea-action user avatar broken on edited menu (#29190) (#29307)
|
||||
* Disallow merge when required checked are missing (#29143) (#29268)
|
||||
* Fix incorrect link to swift doc and swift package-registry login command (#29096) (#29103)
|
||||
* Convert visibility to number (#29226) (#29244)
|
||||
* DOCS
|
||||
* Remove outdated docs from some languages (#27530) (#29208)
|
||||
* Fix typos in the documentation (#29048) (#29056)
|
||||
* Explained where create issue/PR template (#29035)
|
||||
|
||||
## [1.21.5](https://github.com/go-gitea/gitea/releases/tag/v1.21.5) - 2024-01-31
|
||||
|
||||
* SECURITY
|
||||
* Prevent anonymous container access if `RequireSignInView` is enabled (#28877) (#28882)
|
||||
* Update go dependencies and fix go-git (#28893) (#28934)
|
||||
* BUGFIXES
|
||||
* Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) (#29007)
|
||||
* Fix an actions schedule bug (#28942) (#28999)
|
||||
* Fix update enable_prune even if mirror_interval is not provided (#28905) (#28929)
|
||||
* Fix uploaded artifacts should be overwritten (#28726) backport v1.21 (#28832)
|
||||
* Preserve BOM in web editor (#28935) (#28959)
|
||||
* Strip `/` from relative links (#28932) (#28952)
|
||||
* Don't remove all mirror repository's releases when mirroring (#28817) (#28939)
|
||||
* Implement `MigrateRepository` for the actions notifier (#28920) (#28923)
|
||||
* Respect branch info for relative links (#28909) (#28922)
|
||||
* Don't reload timeline page when (un)resolving or replying conversation (#28654) (#28917)
|
||||
* Only migrate the first 255 chars of a Github issue title (#28902) (#28912)
|
||||
* Fix sort bug on repository issues list (#28897) (#28901)
|
||||
* Fix `DeleteCollaboration` transaction behaviour (#28886) (#28889)
|
||||
* Fix schedule not trigger bug because matching full ref name with short ref name (#28874) (#28888)
|
||||
* Fix migrate storage bug (#28830) (#28867)
|
||||
* Fix archive creating LFS hooks and breaking pull requests (#28848) (#28851)
|
||||
* Fix reverting a merge commit failing (#28794) (#28825)
|
||||
* Upgrade xorm to v1.3.7 to fix a resource leak problem caused by Iterate (#28891) (#28895)
|
||||
* Fix incorrect PostgreSQL connection string for Unix sockets (#28865) (#28870)
|
||||
* ENHANCEMENTS
|
||||
* Make loading animation less aggressive (#28955) (#28956)
|
||||
* Avoid duplicate JS error messages on UI (#28873) (#28881)
|
||||
* Bump `@github/relative-time-element` to 4.3.1 (#28819) (#28826)
|
||||
* MISC
|
||||
* Warn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (#28783) (#28868)
|
||||
* Remove duplicated checkinit on git module (#28824) (#28831)
|
||||
|
||||
## [1.21.4](https://github.com/go-gitea/gitea/releases/tag/v1.21.4) - 2024-01-16
|
||||
|
||||
* SECURITY
|
||||
* Update github.com/cloudflare/circl (#28789) (#28790)
|
||||
@ -58,7 +159,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||
* Concatenate error in `checkIfPRContentChanged` (#28731) (#28737)
|
||||
* Improve 1.21 document for Database Preparation (#28643) (#28644)
|
||||
|
||||
## [1.21.3](https://github.com/go-gitea/gitea/releases/tag/1.21.3) - 2023-12-21
|
||||
## [1.21.3](https://github.com/go-gitea/gitea/releases/tag/v1.21.3) - 2023-12-21
|
||||
|
||||
* SECURITY
|
||||
* Update golang.org/x/crypto (#28519)
|
||||
@ -86,7 +187,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||
* Fix Chinese translation of config cheat sheet[API] (#28472) (#28473)
|
||||
* Retry SSH key verification with additional CRLF if it failed (#28392) (#28464)
|
||||
|
||||
## [1.21.2](https://github.com/go-gitea/gitea/releases/tag/1.21.2) - 2023-12-12
|
||||
## [1.21.2](https://github.com/go-gitea/gitea/releases/tag/v1.21.2) - 2023-12-12
|
||||
|
||||
* SECURITY
|
||||
* Rebuild with recently released golang version
|
||||
@ -125,7 +226,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.com).
|
||||
* Use full width for project boards (#28225) (#28245)
|
||||
* Enable system users search via the API (#28013) (#28018)
|
||||
|
||||
## [1.21.1](https://github.com/go-gitea/gitea/releases/tag/1.21.1) - 2023-11-26
|
||||
## [1.21.1](https://github.com/go-gitea/gitea/releases/tag/v1.21.1) - 2023-11-26
|
||||
|
||||
* SECURITY
|
||||
* Fix comment permissions (#28213) (#28216)
|
||||
|
24
Makefile
24
Makefile
@ -30,7 +30,7 @@ EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-che
|
||||
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
|
||||
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.1
|
||||
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
|
||||
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
|
||||
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.4.1
|
||||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
|
||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
|
||||
@ -142,6 +142,8 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
|
||||
GO_DIRS := build cmd models modules routers services tests
|
||||
WEB_DIRS := web_src/js web_src/css
|
||||
|
||||
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github
|
||||
|
||||
GO_SOURCES := $(wildcard *.go)
|
||||
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
|
||||
GO_SOURCES += $(GENERATED_GO_DEST)
|
||||
@ -219,6 +221,8 @@ help:
|
||||
@echo " - lint-swagger lint swagger files"
|
||||
@echo " - lint-templates lint template files"
|
||||
@echo " - lint-yaml lint yaml files"
|
||||
@echo " - lint-spell lint spelling"
|
||||
@echo " - lint-spell-fix lint spelling and fix issues"
|
||||
@echo " - checks run various consistency checks"
|
||||
@echo " - checks-frontend check frontend files"
|
||||
@echo " - checks-backend check backend files"
|
||||
@ -309,10 +313,6 @@ fmt-check: fmt
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: misspell-check
|
||||
misspell-check:
|
||||
go run $(MISSPELL_PACKAGE) -error $(GO_DIRS) $(WEB_DIRS)
|
||||
|
||||
.PHONY: $(TAGS_EVIDENCE)
|
||||
$(TAGS_EVIDENCE):
|
||||
@mkdir -p $(MAKE_EVIDENCE_DIR)
|
||||
@ -352,13 +352,13 @@ checks: checks-frontend checks-backend
|
||||
checks-frontend: lockfile-check svg-check
|
||||
|
||||
.PHONY: checks-backend
|
||||
checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-validate security-check
|
||||
checks-backend: tidy-check swagger-check fmt-check swagger-validate security-check
|
||||
|
||||
.PHONY: lint
|
||||
lint: lint-frontend lint-backend
|
||||
lint: lint-frontend lint-backend lint-spell
|
||||
|
||||
.PHONY: lint-fix
|
||||
lint-fix: lint-frontend-fix lint-backend-fix
|
||||
lint-fix: lint-frontend-fix lint-backend-fix lint-spell-fix
|
||||
|
||||
.PHONY: lint-frontend
|
||||
lint-frontend: lint-js lint-css
|
||||
@ -396,6 +396,14 @@ lint-swagger: node_modules
|
||||
lint-md: node_modules
|
||||
npx markdownlint docs *.md
|
||||
|
||||
.PHONY: lint-spell
|
||||
lint-spell:
|
||||
@go run $(MISSPELL_PACKAGE) -error $(SPELLCHECK_FILES)
|
||||
|
||||
.PHONY: lint-spell-fix
|
||||
lint-spell-fix:
|
||||
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES)
|
||||
|
||||
.PHONY: lint-go
|
||||
lint-go:
|
||||
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
|
||||
|
@ -70,7 +70,7 @@ func runGenerateInternalToken(c *cli.Context) error {
|
||||
}
|
||||
|
||||
func runGenerateLfsJwtSecret(c *cli.Context) error {
|
||||
_, jwtSecretBase64, err := generate.NewJwtSecretBase64()
|
||||
_, jwtSecretBase64, err := generate.NewJwtSecretWithBase64()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -110,6 +110,9 @@ func migrateLFS(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
||||
|
||||
func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
||||
return db.Iterate(ctx, nil, func(ctx context.Context, user *user_model.User) error {
|
||||
if user.CustomAvatarRelativePath() == "" {
|
||||
return nil
|
||||
}
|
||||
_, err := storage.Copy(dstStorage, user.CustomAvatarRelativePath(), storage.Avatars, user.CustomAvatarRelativePath())
|
||||
return err
|
||||
})
|
||||
@ -117,6 +120,9 @@ func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error
|
||||
|
||||
func migrateRepoAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
|
||||
return db.Iterate(ctx, nil, func(ctx context.Context, repo *repo_model.Repository) error {
|
||||
if repo.CustomAvatarRelativePath() == "" {
|
||||
return nil
|
||||
}
|
||||
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
|
||||
return err
|
||||
})
|
||||
|
12
cmd/serv.go
12
cmd/serv.go
@ -216,16 +216,18 @@ func runServ(c *cli.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// LowerCase and trim the repoPath as that's how they are stored.
|
||||
repoPath = strings.ToLower(strings.TrimSpace(repoPath))
|
||||
|
||||
rr := strings.SplitN(repoPath, "/", 2)
|
||||
if len(rr) != 2 {
|
||||
return fail(ctx, "Invalid repository path", "Invalid repository path: %v", repoPath)
|
||||
}
|
||||
|
||||
username := strings.ToLower(rr[0])
|
||||
reponame := strings.ToLower(strings.TrimSuffix(rr[1], ".git"))
|
||||
username := rr[0]
|
||||
reponame := strings.TrimSuffix(rr[1], ".git")
|
||||
|
||||
// LowerCase and trim the repoPath as that's how they are stored.
|
||||
// This should be done after splitting the repoPath into username and reponame
|
||||
// so that username and reponame are not affected.
|
||||
repoPath = strings.ToLower(strings.TrimSpace(repoPath))
|
||||
|
||||
if alphaDashDotPattern.MatchString(reponame) {
|
||||
return fail(ctx, "Invalid repo name", "Invalid repo name: %s", reponame)
|
||||
|
@ -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
|
||||
```
|
@ -620,7 +620,7 @@ And the following unique queues:
|
||||
- `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page or to use API.
|
||||
- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when
|
||||
something happens, like creating issues. Requires `Mailer` to be enabled.
|
||||
- `ENABLE_BASIC_AUTHENTICATION`: **true**: Disable this to disallow authenticaton using HTTP
|
||||
- `ENABLE_BASIC_AUTHENTICATION`: **true**: Disable this to disallow authentication using HTTP
|
||||
BASIC and the user's password. Please note if you disable this you will not be able to access the
|
||||
tokens API endpoints using a password. Further, this only disables BASIC authentication using the
|
||||
password - not tokens or OAuth Basic.
|
||||
|
@ -29,7 +29,7 @@ menu:
|
||||
[ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。
|
||||
标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。
|
||||
|
||||
在下面的默认值中,`$XYZ`代表环境变量`XYZ`的值(详见:`enviroment-to-ini`)。 _`XxYyZz`_是指默认配置的一部分列出的值。这些在 app.ini 文件中不起作用,仅在此处列出作为文档说明。
|
||||
在下面的默认值中,`$XYZ`代表环境变量`XYZ`的值(详见:`environment-to-ini`)。 _`XxYyZz`_是指默认配置的一部分列出的值。这些在 app.ini 文件中不起作用,仅在此处列出作为文档说明。
|
||||
|
||||
包含`#`或者`;`的变量必须使用引号(`` ` ``或者`""""`)包裹,否则会被解析为注释。
|
||||
|
||||
|
@ -312,7 +312,7 @@ receive.certNonceSeed = <randomstring>
|
||||
|
||||
### Labels
|
||||
|
||||
Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) to `$GITEA_CUSTOM/options/label`:
|
||||
Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) in the directory `$GITEA_CUSTOM/options/label/`:
|
||||
|
||||
```yaml
|
||||
labels:
|
||||
@ -330,7 +330,7 @@ For more information, see the [labels documentation](usage/labels.md).
|
||||
|
||||
### Licenses
|
||||
|
||||
To add a custom license, add a file with the license text to `$GITEA_CUSTOM/options/license`
|
||||
To add a custom license, add a file with the license text in the directory `$GITEA_CUSTOM/options/license/`
|
||||
|
||||
### Locales
|
||||
|
||||
|
@ -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"
|
||||
---
|
@ -243,10 +243,10 @@ documentation using:
|
||||
make generate-swagger
|
||||
```
|
||||
|
||||
You should validate your generated Swagger file and spell-check it with:
|
||||
You should validate your generated Swagger file:
|
||||
|
||||
```bash
|
||||
make swagger-validate misspell-check
|
||||
make swagger-validate
|
||||
```
|
||||
|
||||
You should commit the changed swagger JSON file. The continuous integration
|
||||
|
@ -228,10 +228,10 @@ Gitea Logo的 PNG 和 SVG 版本是使用 `TAGS="gitea" make generate-images`
|
||||
make generate-swagger
|
||||
```
|
||||
|
||||
您应该验证生成的 Swagger 文件并使用以下命令对其进行拼写检查:
|
||||
您应该验证生成的 Swagger 文件:
|
||||
|
||||
```bash
|
||||
make swagger-validate misspell-check
|
||||
make swagger-validate
|
||||
```
|
||||
|
||||
您应该提交更改后的 swagger JSON 文件。持续集成服务器将使用以下方法检查是否已完成:
|
||||
|
@ -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 攻擊。
|
||||
|
||||

|
||||
|
||||
使用者將會被詢問是否授權給您的應用程式。如果它們同意了,使用者將被重新導向到 `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) 回報。
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user