mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-20 14:31:19 +02:00
Merge remote-tracking branch 'upstream/main' into limit-repo-size
This commit is contained in:
@@ -403,7 +403,7 @@ Sometimes when there are migrations the old columns and default values may be le
|
||||
unchanged in the database schema. This may lead to warning such as:
|
||||
|
||||
```
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
```
|
||||
|
||||
You can cause Gitea to recreate these tables and copy the old data into the new table
|
||||
|
||||
@@ -375,7 +375,7 @@ AuthorizedKeysCommand /path/to/gitea keys -e git -u %u -t %t -k %k
|
||||
有时,在迁移时,旧的列和默认值可能会在数据库模式中保持不变。这可能会导致警告,如下所示:
|
||||
|
||||
```
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
```
|
||||
|
||||
您可以通过以下方式让 Gitea 重新创建这些表,并将旧数据复制到新表中,并适当设置默认值:
|
||||
|
||||
@@ -562,7 +562,7 @@ And the following unique queues:
|
||||
- `scrypt`: `scrypt$65536$16$2$50`
|
||||
- Adjusting the algorithm parameters using this functionality is done at your own risk.
|
||||
- `CSRF_COOKIE_HTTP_ONLY`: **true**: Set false to allow JavaScript to read CSRF cookie.
|
||||
- `MIN_PASSWORD_LENGTH`: **6**: Minimum password length for new users.
|
||||
- `MIN_PASSWORD_LENGTH`: **8**: Minimum password length for new users.
|
||||
- `PASSWORD_COMPLEXITY`: **off**: Comma separated list of character classes required to pass minimum complexity. If left empty or no valid values are specified, checking is disabled (off):
|
||||
- lower - use one or more lower latin characters
|
||||
- upper - use one or more upper latin characters
|
||||
@@ -651,6 +651,7 @@ And the following unique queues:
|
||||
- `DEFAULT_USER_IS_RESTRICTED`: **false**: Give new users restricted permissions by default
|
||||
- `DEFAULT_ENABLE_DEPENDENCIES`: **true**: Enable this to have dependencies enabled by default.
|
||||
- `ALLOW_CROSS_REPOSITORY_DEPENDENCIES` : **true** Enable this to allow dependencies on issues from any repository where the user is granted access.
|
||||
- `USER_LOCATION_MAP_URL`: **""**: A map service URL to show user's location on a map. The location will be appended to the URL as escaped query parameter.
|
||||
- `ENABLE_USER_HEATMAP`: **true**: Enable this to display the heatmap on users profiles.
|
||||
- `ENABLE_TIMETRACKING`: **true**: Enable Timetracking feature.
|
||||
- `DEFAULT_ENABLE_TIMETRACKING`: **true**: Allow repositories to use timetracking by default.
|
||||
@@ -1102,6 +1103,7 @@ This section only does "set" config, a removed config key from this section won'
|
||||
- `JWT_SECRET_URI`: **_empty_**: Instead of defining JWT_SECRET in the configuration, this configuration option can be used to give Gitea a path to a file that contains the secret (example value: `file:/etc/gitea/oauth2_jwt_secret`)
|
||||
- `JWT_SIGNING_PRIVATE_KEY_FILE`: **jwt/private.pem**: Private key file path used to sign OAuth2 tokens. The path is relative to `APP_DATA_PATH`. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `RS256`, `RS384`, `RS512`, `ES256`, `ES384` or `ES512`. The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you.
|
||||
- `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider
|
||||
- `DEFAULT_APPLICATIONS`: **git-credential-oauth, git-credential-manager**: Pre-register OAuth applications for some services on startup. See the [OAuth2 documentation](/development/oauth2-provider.md) for the list of available options.
|
||||
|
||||
## i18n (`i18n`)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -126,7 +126,17 @@ Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful temp
|
||||
- `body_outer_post.tmpl`, before the bottom `<footer>` element.
|
||||
- `footer.tmpl`, right before the end of the `<body>` tag, a good place for additional JavaScript.
|
||||
|
||||
#### Example: PlantUML
|
||||
### Using Gitea variables
|
||||
|
||||
It's possible to use various Gitea variables in your custom templates.
|
||||
|
||||
First, _temporarily_ enable development mode: in your `app.ini` change from `RUN_MODE = prod` to `RUN_MODE = dev`. Then add `{{ $ | DumpVar }}` to any of your templates, restart Gitea and refresh that page; that will dump all available variables.
|
||||
|
||||
Find the data that you need, and use the corresponding variable; for example, if you need the name of the repository then you'd use `{{.Repository.Name}}`.
|
||||
|
||||
If you need to transform that data somehow, and aren't familiar with Go, an easy workaround is to add the data to the DOM and add a small JavaScript script block to manipulate the data.
|
||||
|
||||
### Example: PlantUML
|
||||
|
||||
You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server.
|
||||
The data is encoded and sent to the PlantUML server which generates the picture. There is an online
|
||||
@@ -162,7 +172,7 @@ Alice <-- Bob: Another authentication Response
|
||||
|
||||
The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`.
|
||||
|
||||
#### Example: STL Preview
|
||||
### Example: STL Preview
|
||||
|
||||
You can display STL file directly in Gitea by adding:
|
||||
|
||||
|
||||
@@ -79,8 +79,7 @@ SMTP_PORT = 465
|
||||
FROM = example.user@gmail.com
|
||||
USER = example.user
|
||||
PASSWD = `***`
|
||||
PROTOCOL = smtp
|
||||
IS_TLS_ENABLED = true
|
||||
PROTOCOL = smtps
|
||||
```
|
||||
|
||||
Note that you'll need to create and use an [App password](https://support.google.com/accounts/answer/185833?hl=en) by enabling 2FA on your Google
|
||||
|
||||
@@ -102,8 +102,11 @@ MODE = file, file-error
|
||||
|
||||
; by default, the "file" mode will record logs to %(log.ROOT_PATH)/gitea.log, so we don't need to set it
|
||||
; [log.file]
|
||||
; by default, the MODE (actually it's the output writer of this logger) is taken from the section name, so we don't need to set it either
|
||||
; MODE = file
|
||||
|
||||
[log.file-error]
|
||||
MODE = file
|
||||
LEVEL = Error
|
||||
FILE_NAME = file-error.log
|
||||
```
|
||||
|
||||
@@ -133,3 +133,7 @@ A lot of legacy code already existed before this document's written. It's recomm
|
||||
### Vue3 and JSX
|
||||
|
||||
Gitea is using Vue3 now. We decided not to introduce JSX to keep the HTML and the JavaScript code separated.
|
||||
|
||||
### UI Examples
|
||||
|
||||
Gitea uses some self-made UI elements and customizes others to integrate them better into the general UI approach. When running Gitea in development mode (`RUN_MODE=dev`), a page with some standardized UI examples is available under `http(s)://your-gitea-url:port/devtest`.
|
||||
|
||||
@@ -78,6 +78,17 @@ Gitea token scopes are as follows:
|
||||
| **read:user** | Grants read access to user operations, such as getting user repo subscriptions and user settings. |
|
||||
| **write:user** | Grants read/write/delete access to user operations, such as updating user repo subscriptions, followed users, and user settings. |
|
||||
|
||||
## Pre-configured Applications
|
||||
|
||||
Gitea creates OAuth applications for the following services by default on startup, as we assume that these are universally useful.
|
||||
|
||||
|Application|Description|Client ID|
|
||||
|-----------|-----------|---------|
|
||||
|[git-credential-oauth](https://github.com/hickford/git-credential-oauth)|Git credential helper|`a4792ccc-144e-407e-86c9-5e7d8d9c3269`|
|
||||
|[Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager)|Git credential helper|`e90ee53c-94e2-48ac-9358-a874fb9e0662`|
|
||||
|
||||
To prevent unexpected behavior, they are being displayed as locked in the UI and their creation can instead be controlled by the `DEFAULT_APPLICATIONS` parameter in `app.ini`.
|
||||
|
||||
## Client types
|
||||
|
||||
Gitea supports both confidential and public client types, [as defined by RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1).
|
||||
|
||||
@@ -410,7 +410,7 @@ Sometimes when there are migrations the old columns and default values may be le
|
||||
unchanged in the database schema. This may lead to warning such as:
|
||||
|
||||
```
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
```
|
||||
|
||||
These can safely be ignored, but you are able to stop these warnings by getting Gitea to recreate these tables using:
|
||||
|
||||
@@ -424,7 +424,7 @@ SystemD 上的标准输出默认会写入日志记录中。您可以尝试使用
|
||||
这可能会导致警告,例如:
|
||||
|
||||
```
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||
```
|
||||
|
||||
可以安全地忽略这些警告,但您可以通过让 Gitea 重新创建这些表来停止这些警告,使用以下命令:
|
||||
|
||||
@@ -20,6 +20,8 @@ menu:
|
||||
- [Paid Commercial Support](https://about.gitea.com/)
|
||||
- [Discord](https://discord.gg/Gitea)
|
||||
- [Discourse Forum](https://discourse.gitea.io/)
|
||||
- [Matrix](https://matrix.to/#/#gitea-space:matrix.org)
|
||||
- NOTE: Most of the Matrix channels are bridged with their counterpart in Discord and may experience some degree of flakiness with the bridge process.
|
||||
|
||||
**NOTE:** When asking for support, it may be a good idea to have the following available so that the person helping has all the info they need:
|
||||
|
||||
|
||||
+21
-240
@@ -25,246 +25,27 @@ You can try it out using [the online demo](https://try.gitea.io/).
|
||||
|
||||
## Features
|
||||
|
||||
- User Dashboard
|
||||
- Context switcher (organization or current user)
|
||||
- Activity timeline
|
||||
- Commits
|
||||
- Issues
|
||||
- Pull requests
|
||||
- Repository creation
|
||||
- Searchable repository list
|
||||
- List of organizations
|
||||
- A list of mirror repositories
|
||||
- Issues dashboard
|
||||
- Context switcher (organization or current user)
|
||||
- Filter by
|
||||
- Open
|
||||
- Closed
|
||||
- Your repositories
|
||||
- Assigned issues
|
||||
- Your issues
|
||||
- Repository
|
||||
- Sort by
|
||||
- Oldest
|
||||
- Last updated
|
||||
- Number of comments
|
||||
- Pull request dashboard
|
||||
- Same as issue dashboard
|
||||
- Repository types
|
||||
- Mirror
|
||||
- Normal
|
||||
- Migrated
|
||||
- Notifications (email and web)
|
||||
- Read
|
||||
- Unread
|
||||
- Pin
|
||||
- Explore page
|
||||
- Users
|
||||
- Repos
|
||||
- Organizations
|
||||
- Search
|
||||
- Custom templates
|
||||
- Override public files (logo, css, etc)
|
||||
- CSRF and XSS protection
|
||||
- HTTPS support
|
||||
- Set allowed upload sizes and types
|
||||
- Logging
|
||||
- Configuration
|
||||
- Databases
|
||||
- MySQL (>=5.7)
|
||||
- PostgreSQL (>=10)
|
||||
- SQLite3
|
||||
- MSSQL (>=2008R2 SP3)
|
||||
- TiDB (MySQL protocol)
|
||||
- Configuration file
|
||||
- [app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
|
||||
- Admin panel
|
||||
- Statistics
|
||||
- Actions
|
||||
- Delete inactive accounts
|
||||
- Delete cached repository archives
|
||||
- Delete repositories records which are missing their files
|
||||
- Run garbage collection on repositories
|
||||
- Rewrite SSH keys
|
||||
- Resync hooks
|
||||
- Recreate repositories which are missing
|
||||
- Server status
|
||||
- Uptime
|
||||
- Memory
|
||||
- Current # of goroutines
|
||||
- And more
|
||||
- User management
|
||||
- Search
|
||||
- Sort
|
||||
- Last login
|
||||
- Authentication source
|
||||
- Maximum repositories
|
||||
- Disable account
|
||||
- Admin permissions
|
||||
- Permission to create Git Hooks
|
||||
- Permission to create organizations
|
||||
- Permission to import repositories
|
||||
- Organization management
|
||||
- Members
|
||||
- Teams
|
||||
- Avatar
|
||||
- Hooks
|
||||
- Repository management
|
||||
- See all repository information and manage repositories
|
||||
- Set per repository global size limit, disable/enable the repository limit (runtime only), permanent should be done via Configuration file
|
||||
- Authentication sources
|
||||
- OAuth
|
||||
- PAM
|
||||
- LDAP
|
||||
- SMTP
|
||||
- Configuration viewer
|
||||
- Everything in config file
|
||||
- System notices
|
||||
- When something unexpected happens
|
||||
- Monitoring
|
||||
- Current processes
|
||||
- Cron jobs
|
||||
- Update mirrors
|
||||
- Repository health check
|
||||
- Check repository statistics
|
||||
- Clean up old archives
|
||||
- Environment variables
|
||||
- Command line options
|
||||
- Multi-language support ([21 languages](https://github.com/go-gitea/gitea/tree/main/options/locale))
|
||||
- [Mermaid](https://mermaidjs.github.io/) diagrams in Markdown
|
||||
- Math syntax in Markdown
|
||||
- Mail service
|
||||
- Notifications
|
||||
- Registration confirmation
|
||||
- Password reset
|
||||
- Reverse proxy support
|
||||
- Includes subpaths
|
||||
- Users
|
||||
- Profile
|
||||
- Name
|
||||
- Username
|
||||
- Email
|
||||
- Website
|
||||
- Join date
|
||||
- Followers and following
|
||||
- Organizations
|
||||
- Repositories
|
||||
- Activity
|
||||
- Starred repositories
|
||||
- Settings
|
||||
- Same as profile and more below
|
||||
- Keep email private
|
||||
- Avatar
|
||||
- Gravatar
|
||||
- Libravatar
|
||||
- Custom
|
||||
- Password
|
||||
- Multiple email addresses
|
||||
- SSH Keys
|
||||
- Connected applications
|
||||
- Two factor authentication
|
||||
- Linked OAuth2 sources
|
||||
- Delete account
|
||||
- Repositories
|
||||
- Clone with SSH/HTTP/HTTPS
|
||||
- Git LFS
|
||||
- Watch, Star, Fork
|
||||
- View watchers, stars, and forks
|
||||
- Size limit (excl. LFS)
|
||||
- Code
|
||||
- Branch browser
|
||||
- Web based file upload and creation
|
||||
- Clone urls
|
||||
- Download
|
||||
- ZIP
|
||||
- TAR.GZ
|
||||
- Web based editor
|
||||
- Markdown editor
|
||||
- Plain text editor
|
||||
- Syntax highlighting
|
||||
- Diff preview
|
||||
- Preview
|
||||
- Choose where to commit to
|
||||
- View file history
|
||||
- Delete file
|
||||
- View raw
|
||||
- Issues
|
||||
- Issue templates
|
||||
- Milestones
|
||||
- Labels
|
||||
- Assign issues
|
||||
- Track time
|
||||
- Reactions
|
||||
- Filter
|
||||
- Open
|
||||
- Closed
|
||||
- Assigned person
|
||||
- Created by you
|
||||
- Mentioning you
|
||||
- Sort
|
||||
- Oldest
|
||||
- Last updated
|
||||
- Number of comments
|
||||
- Search
|
||||
- Comments
|
||||
- Attachments
|
||||
- Pull requests
|
||||
- Same features as issues
|
||||
- Commits
|
||||
- Commit graph
|
||||
- Commits by branch
|
||||
- Search
|
||||
- Search in all branches
|
||||
- View diff
|
||||
- View SHA
|
||||
- View author
|
||||
- Browse files in commit
|
||||
- Releases
|
||||
- Attachments
|
||||
- Title
|
||||
- Content
|
||||
- Delete
|
||||
- Mark as pre-release
|
||||
- Choose branch
|
||||
- Wiki
|
||||
- Import
|
||||
- Markdown editor
|
||||
- Settings
|
||||
- Options
|
||||
- Name
|
||||
- Description
|
||||
- Private/Public
|
||||
- Website
|
||||
- Wiki
|
||||
- Enabled/disabled
|
||||
- Internal/external
|
||||
- Issues
|
||||
- Enabled/disabled
|
||||
- Internal/external
|
||||
- External supports url rewriting for better integration
|
||||
- Enable/disable pull requests
|
||||
- Transfer repository
|
||||
- Delete wiki
|
||||
- Delete repository
|
||||
- Collaboration
|
||||
- Read/write/admin
|
||||
- Branches
|
||||
- Default branch
|
||||
- Branch protection
|
||||
- Webhooks
|
||||
- Git Hooks
|
||||
- Deploy keys
|
||||
- Package Registries
|
||||
- Composer
|
||||
- Conan
|
||||
- Container
|
||||
- Generic
|
||||
- Helm
|
||||
- Maven
|
||||
- NPM
|
||||
- Nuget
|
||||
- PyPI
|
||||
- RubyGems
|
||||
- Code Hosting: Gitea supports creating and managing repositories, browsing commit history and code files, reviewing and merging code submissions, managing collaborators, handling branches, and more. It also supports many common Git features such as tags, Cherry-pick, hooks, integrated collaboration tools, and more.
|
||||
|
||||
- Lightweight and Fast: One of Gitea's design goals is to be lightweight and fast in response. Unlike some large code hosting platforms, it remains lean, performing well in terms of speed, and is suitable for resource-limited server environments. Due to its lightweight design, Gitea has relatively low resource consumption and performs well in resource-constrained environments.
|
||||
|
||||
- Easy Deployment and Maintenance: It can be easily deployed on various servers without complex configurations or dependencies. This makes it convenient for individual developers or small teams to set up and manage their own Git services.
|
||||
|
||||
- Security: Gitea places a strong emphasis on security, offering features such as user permission management, access control lists, and more to ensure the security of code and data.
|
||||
|
||||
- Code Review: Code review supports both the Pull Request workflow and AGit workflow. Reviewers can browse code online and provide review comments or feedback. Submitters can receive review comments and respond or modify code online. Code reviews can help individuals and organizations enhance code quality.
|
||||
|
||||
- CI/CD: Gitea Actions supports CI/CD functionality, compatible with GitHub Actions. Users can write workflows in familiar YAML format and reuse a variety of existing Actions plugins. Actions plugins support downloading from any Git website.
|
||||
|
||||
- Project Management: Gitea tracks project requirements, features, and bugs through boards and issues. Issues support features like branches, tags, milestones, assignments, time tracking, due dates, dependencies, and more.
|
||||
|
||||
- Artifact Repository: Gitea supports over 20 different types of public or private software package management, including Cargo, Chef, Composer, Conan, Conda, Container, Helm, Maven, npm, NuGet, Pub, PyPI, RubyGems, Vagrant, and more.
|
||||
|
||||
- Open Source Community Support: Gitea is an open-source project based on the MIT license. It has an active open-source community that continuously develops and improves the platform. The project also actively welcomes community contributions, ensuring updates and innovation.
|
||||
|
||||
- Multilingual Support: Gitea provides interfaces in multiple languages, catering to users globally and promoting internationalization and localization.
|
||||
|
||||
Additional Features: For more detailed information, please refer to: https://docs.gitea.com/installation/comparison#general-features
|
||||
|
||||
## System Requirements
|
||||
|
||||
|
||||
+32
-23
@@ -9,42 +9,51 @@ draft: false
|
||||
|
||||
# 关于Gitea
|
||||
|
||||
Gitea 是一个自己托管的Git服务程序。他和GitHub, Bitbucket or Gitlab等比较类似。他是从 [Gogs](http://gogs.io) 发展而来,不过我们已经Fork并且命名为Gitea。对于我们Fork的原因可以看 [这里](https://blog.gitea.com/welcome-to-gitea/)。
|
||||
Gitea 是一个轻量级的 DevOps 平台软件。从开发计划到产品成型的整个软件生命周期,他都能够高效而轻松的帮助团队和开发者。包括 Git 托管、代码审查、团队协作、软件包注册和 CI/CD。它与 GitHub、Bitbucket 和 GitLab 等比较类似。
|
||||
Gitea 最初是从 [Gogs](http://gogs.io) 分支而来,几乎所有代码都已更改。对于我们Fork的原因可以看
|
||||
[这里](https://blog.gitea.com/welcome-to-gitea/)。
|
||||
|
||||
## 目标
|
||||
|
||||
Gitea的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用Go作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了x86,amd64,还包括 ARM 和 PowerPC。
|
||||
Gitea的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好
|
||||
的自建 Git 服务。
|
||||
|
||||
采用Go作为后端语言,只需生成一个可执行程序即可。
|
||||
支持 Linux, macOS 和 Windows等多平台,
|
||||
支持主流的x86,amd64、
|
||||
ARM 和 PowerPC等架构。
|
||||
|
||||
## 功能特性
|
||||
|
||||
- 支持活动时间线
|
||||
- 支持 SSH 以及 HTTP/HTTPS 协议
|
||||
- 支持 SMTP、LDAP 和反向代理的用户认证
|
||||
- 支持反向代理子路径
|
||||
- 支持用户、组织和仓库管理系统
|
||||
- 支持添加和删除仓库协作者
|
||||
- 支持仓库和组织级别 Web 钩子(包括 Slack 集成)
|
||||
- 支持仓库 Git 钩子和部署密钥
|
||||
- 支持仓库工单(Issue)、合并请求(Pull Request)以及 Wiki
|
||||
- 支持迁移和镜像仓库以及它的 Wiki
|
||||
- 支持在线编辑仓库文件和 Wiki
|
||||
- 支持自定义源的 Gravatar 和 Federated Avatar
|
||||
- 支持邮件服务
|
||||
- 支持后台管理面板
|
||||
- 支持 MySQL、PostgreSQL、SQLite3、MSSQL 和 TiDB(MySQL) 数据库
|
||||
- 支持多语言本地化(21 种语言)
|
||||
- 支持软件包注册中心(Composer/Conan/Container/Generic/Helm/Maven/NPM/Nuget/PyPI/RubyGems)
|
||||
- 代码托管:Gitea⽀持创建和管理仓库、浏览提交历史和代码⽂件、审查和合并代码提交、管理协作者、管理分⽀等。它还⽀持许多常见的Git特性,⽐如标签、Cherry-pick、hook、集成协作⼯具等。
|
||||
- 轻量级和快速: Gitea 的设计目标之一就是轻量级和快速响应。它不像一些大型的代码托管平台那样臃肿,因此在性能方面表现出色,适用于资源有限的服务器环境。由于其轻量级设计,Gitea 在资源消耗方面相对较低,可以在资源有限的环境下运行良好。
|
||||
- 易于部署和维护: 轻松地部署在各种服务器上,不需要复杂的配置和依赖。这使得个人开发者或小团队可以方便地设置和管理自己的 Git 服务。
|
||||
- 安全性: Gitea 注重安全性,提供了用户权限管理、访问控制列表等功能,可以确保代码和数据的安全性。
|
||||
- 代码评审:代码评审同时支持 Pull Request workflow 和 AGit workflow。评审⼈可以在线浏览代码,并提交评审意见或问题。 提交者可以接收到评审意见,并在线回 复或修改代码。代码评审可以帮助用户和企业提⾼代码质量。
|
||||
- CI/CD: Gitea Actions⽀持 CI/CD 功能,该功能兼容 GitHub Actions,⽤⼾可以采用熟悉的YAML格式编写workflows,也可以重⽤⼤量的已有的 Actions 插件。Actions 插件支持从任意的 Git 网站中下载。
|
||||
- 项目管理:Gitea 通过看板和⼯单来跟踪⼀个项⽬的需求,功能和bug。⼯单⽀持分支,标签、⾥程碑、 指派、时间跟踪、到期时间、依赖关系等功能。
|
||||
- 制品库: Gitea支持超过 20 种不同种类的公有或私有软件包管理,包括:Cargo, Chef, Composer, Conan, Conda, Container, Helm, Maven, npm, NuGet, Pub, PyPI, RubyGems, Vagrant等
|
||||
- 开源社区支持: Gitea 是一个基于 MIT 许可证的开源项目,Gitea 拥有一个活跃的开源社区,能够持续地进行开发和改进,同时也积极接受社区贡献,保持了平台的更新和创新。
|
||||
- 多语言支持: Gitea 提供多种语言界面,适应全球范围内的用户,促进了国际化和本地化。
|
||||
|
||||
更多功能特性:详见:https://docs.gitea.com/installation/comparison#general-features
|
||||
|
||||
## 系统要求
|
||||
|
||||
- 最低的系统硬件要求为一个廉价的树莓派
|
||||
- 如果用于团队项目,建议使用 2 核 CPU 及 1GB 内存
|
||||
- 树莓派Pi3功能强大,足以运行 Gitea 来处理小型工作负载。
|
||||
- 对于小型团队/项目而言,2 个 CPU 内核和 1GB 内存通常就足够了。
|
||||
- 在 UNIX 系统上,Gitea 应使用专用的非 root 系统账户运行。
|
||||
- 注意:Gitea 管理 `~/.ssh/authorized_keys` 文件。以普通用户身份运行 Gitea 可能会破坏该用户的登录能力。
|
||||
- [Git](https://git-scm.com/) 需要 2.0.0 或更高版本。
|
||||
- [Git Large File Storage](https://git-lfs.github.com/) 如果启用,且 Git 版本大于等于 2.1.2,则该选项可用
|
||||
- 如果 Git 版本大于等于 2.18,将自动启用 Git 提交历史图形化展示功能
|
||||
|
||||
## 浏览器支持
|
||||
|
||||
- Chrome, Firefox, Safari, Edge
|
||||
- Last 2 versions of Chrome, Firefox, Safari and Edge
|
||||
- Firefox ESR
|
||||
|
||||
## 组件
|
||||
## 技术栈
|
||||
|
||||
- Web框架: [Chi](http://github.com/go-chi/chi)
|
||||
- ORM: [XORM](https://xorm.io)
|
||||
|
||||
+19
-226
@@ -18,234 +18,27 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G
|
||||
|
||||
## 功能
|
||||
|
||||
- 使用者面板
|
||||
- 內容切換(組織或目前使用者)
|
||||
- 動態時間軸
|
||||
- 提交
|
||||
- 問題
|
||||
- 合併請求
|
||||
- 儲存庫的建立
|
||||
- 可搜尋的儲存庫清單
|
||||
- 組織清單
|
||||
- 鏡像儲存庫清單
|
||||
- 問題面板
|
||||
- 內容切換(組織或目前使用者)
|
||||
- 篩選器
|
||||
- 開放中
|
||||
- 已關閉
|
||||
- 您的儲存庫
|
||||
- 被指派的問題
|
||||
- 您的問題
|
||||
- 儲存庫
|
||||
- 排序
|
||||
- 最舊
|
||||
- 最近更新
|
||||
- 留言數量
|
||||
- 合併請求面板
|
||||
- 和問題面板相同
|
||||
- 儲存庫類型
|
||||
- 鏡像
|
||||
- 一般
|
||||
- 已遷移
|
||||
- 通知(email 和網頁)
|
||||
- 已讀
|
||||
- 未讀
|
||||
- 釘選
|
||||
- 探索頁面
|
||||
- 使用者
|
||||
- 儲存庫
|
||||
- 組織
|
||||
- 搜尋
|
||||
- 自訂範本
|
||||
- 複寫 public 檔案(logo, css 等)
|
||||
- CSRF 與 XSS 保護
|
||||
- 支援 HTTPS
|
||||
- 設定允許上傳的檔案大小和類型
|
||||
- 日誌
|
||||
- 組態
|
||||
- 資料庫
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- SQLite3
|
||||
- MSSQL
|
||||
- TiDB(MySQL 協議)
|
||||
- 設定檔
|
||||
- [app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
|
||||
- 管理員面板
|
||||
- 系統摘要
|
||||
- 維護操作
|
||||
- 刪除未啟用帳戶
|
||||
- 刪除快取的儲存庫存檔
|
||||
- 刪除遺失 Git 檔案的儲存庫
|
||||
- 對儲存庫進行垃圾回收
|
||||
- 重寫 SSH 金鑰
|
||||
- 重新同步 hooks
|
||||
- 重新建立遺失的儲存庫
|
||||
- 伺服器狀態
|
||||
- 執行時間
|
||||
- 記憶體
|
||||
- 目前的 Goroutines 數量
|
||||
- 還有更多……
|
||||
- 使用者管理
|
||||
- 搜尋
|
||||
- 排序
|
||||
- 最後登入時間
|
||||
- 認證來源
|
||||
- 儲存庫上限
|
||||
- 停用帳戶
|
||||
- 管理員權限
|
||||
- 建立 Git Hook 的權限
|
||||
- 建立組織的權限
|
||||
- 匯入儲存庫的權限
|
||||
- 組織管理
|
||||
- 成員
|
||||
- 團隊
|
||||
- 大頭貼
|
||||
- Hook
|
||||
- 儲存庫管理
|
||||
- 查看所有儲存庫資訊和管理儲存庫
|
||||
- 認證來源
|
||||
- OAuth
|
||||
- PAM
|
||||
- LDAP
|
||||
- SMTP
|
||||
- 組態檢視器
|
||||
- 所有設定檔中的值
|
||||
- 系統提示
|
||||
- 當有未預期的事情發生時
|
||||
- 應用監控面板
|
||||
- 目前的處理程序
|
||||
- Cron 任務
|
||||
- 更新鏡像
|
||||
- 儲存庫健康檢查
|
||||
- 檢查儲存庫的統計資料
|
||||
- 刪除舊的儲存庫存檔
|
||||
- 環境變數
|
||||
- 命令列選項
|
||||
- 支援多國語言 ([21 種語言](https://github.com/go-gitea/gitea/tree/master/options/locale))
|
||||
- 支援 [Mermaid](https://mermaidjs.github.io/) 圖表
|
||||
- 郵件服務
|
||||
- 通知
|
||||
- 確認註冊
|
||||
- 重設密碼
|
||||
- 支援反向代理(Reverse Proxy)
|
||||
- 包含子路徑
|
||||
- 使用者
|
||||
- 代碼託管:Gitea 支援建立和管理存儲庫、瀏覽提交歷史和程式碼檔案、審查和合併程式碼提交、管理協作者、處理分支等。它還支援許多常見的 Git 功能,如標籤、Cherry-pick、鉤子、集成協作工具等。
|
||||
|
||||
- 個人資料
|
||||
- 姓名
|
||||
- 帳號
|
||||
- 電子信箱
|
||||
- 網站
|
||||
- 加入日期
|
||||
- 追蹤者和追蹤中
|
||||
- 組織
|
||||
- 儲存庫
|
||||
- 動態
|
||||
- 已加星號的儲存庫
|
||||
- 設定
|
||||
- 和個人資料相同並包含下列功能
|
||||
- 隱藏電子信箱
|
||||
- 大頭貼
|
||||
- Gravatar
|
||||
- Libravatar
|
||||
- 自訂
|
||||
- 密碼
|
||||
- 多個電子信箱
|
||||
- SSH 金鑰
|
||||
- 已連結的應用程式
|
||||
- 兩步驟驗證
|
||||
- 已連結 OAuth2 來源
|
||||
- 刪除帳戶
|
||||
- 輕量級和快速:Gitea 的設計目標之一就是輕量級和快速響應。與某些大型代碼託管平台不同,它保持了精簡,在速度方面表現出色,適用於資源有限的伺服器環境。由於其輕量級設計,Gitea 的資源消耗相對較低,在資源受限的環境中表現出色。
|
||||
|
||||
- 儲存庫
|
||||
- 以 SSH/HTTP/HTTPS Clone
|
||||
- Git LFS
|
||||
- 關注、星號、Fork
|
||||
- 檢視關注、已加星號、Fork 的使用者
|
||||
- 程式碼
|
||||
- 瀏覽分支
|
||||
- 從網頁上傳和建立檔案
|
||||
- Clone url
|
||||
- 下載
|
||||
- ZIP
|
||||
- TAR.GZ
|
||||
- 網頁程式碼編輯器
|
||||
- Markdown 編輯器
|
||||
- 文本編輯器
|
||||
- 語法高亮
|
||||
- 預覽差異
|
||||
- 預覽
|
||||
- 選擇提交目標分支
|
||||
- 檢視檔案歷史
|
||||
- 刪除檔案
|
||||
- 檢視 raw
|
||||
- 問題
|
||||
- 問題範本
|
||||
- 里程碑
|
||||
- 標籤
|
||||
- 指派問題
|
||||
- 時間追蹤
|
||||
- 表情反應
|
||||
- 篩選器
|
||||
- 開放中
|
||||
- 已關閉
|
||||
- 被指派的人
|
||||
- 您的問題
|
||||
- 提及您
|
||||
- 排序
|
||||
- 最舊
|
||||
- 最近更新
|
||||
- 留言數量
|
||||
- 搜尋
|
||||
- 留言
|
||||
- 附件
|
||||
- 合併請求
|
||||
- 功能和問題相同
|
||||
- 提交
|
||||
- 提交線圖
|
||||
- 不同分支的提交
|
||||
- 搜尋
|
||||
- 在所有分支中搜尋
|
||||
- 檢視差異(diff)
|
||||
- 檢視 SHA
|
||||
- 檢視作者(author)
|
||||
- 瀏覽提交中的檔案
|
||||
- 版本發佈
|
||||
- 附件
|
||||
- 標題
|
||||
- 內容
|
||||
- 刪除
|
||||
- 標記為 pre-release
|
||||
- 選擇分支
|
||||
- Wiki
|
||||
- 匯入
|
||||
- Markdown 編輯器
|
||||
- 設定
|
||||
- 選項
|
||||
- 名稱
|
||||
- 描述
|
||||
- 私有/公開
|
||||
- 網站
|
||||
- Wiki
|
||||
- 開啟/關閉
|
||||
- 內部/外部
|
||||
- 問題
|
||||
- 開啟/關閉
|
||||
- 內部/外部
|
||||
- 外部問題追蹤器支援 URL 重寫(URL Rewrite)以獲得更好的整合性
|
||||
- 開啟/關閉合併請求
|
||||
- 轉移儲存庫所有權
|
||||
- 刪除 wiki
|
||||
- 刪除儲存庫
|
||||
- 協作者
|
||||
- 讀取/寫入/管理員
|
||||
- 分支
|
||||
- 預設分支
|
||||
- 分支保護
|
||||
- Webhook
|
||||
- Git hook
|
||||
- 部署金鑰
|
||||
- 易於部署和維護:它可以輕鬆地部署在各種伺服器上,無需複雜的配置或依賴。這使得個人開發者或小團隊可以方便地設置和管理自己的 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
|
||||
|
||||
## 系統需求
|
||||
|
||||
|
||||
@@ -29,53 +29,62 @@ _表格中的符号含义:_
|
||||
|
||||
* _✘ - 不支持_
|
||||
|
||||
* _? - 不确定_
|
||||
|
||||
* _⚙️ - 由第三方服务或插件支持_
|
||||
|
||||
#### 主要特性
|
||||
|
||||
| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| --------------------- | -------------------------------------------------- | ---- | --------- | --------- | --------- | -------------- | ------------ |
|
||||
| 开源免费 | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ |
|
||||
| 低资源开销 (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
| 支持多种数据库 | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ |
|
||||
| 支持多种操作系统 | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ |
|
||||
| 升级简便 | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 支持 Markdown | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 支持 Orgmode | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ? |
|
||||
| 支持 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? |
|
||||
| 支持第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? |
|
||||
| Git 驱动的静态 pages | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| Git 驱动的集成化 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (cloud only) | ✘ |
|
||||
| 部署令牌 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 仓库写权限令牌 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 内置容器 Registry | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 外部 Git 镜像 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ |
|
||||
| WebAuthn (2FA) | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ? |
|
||||
| 内置 CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 子组织:组织内的组织 | [✘](https://github.com/go-gitea/gitea/issues/1872) | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ------------------------------- | -------------------------------------------------- | ---- | --------- | --------- | --------- | -------------- | ------------ |
|
||||
| 开源免费 | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ |
|
||||
| 低资源开销 (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
| 支持多种数据库 | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ |
|
||||
| 支持多种操作系统 | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ |
|
||||
| 升级简便 | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 可观测性 | **✘** | ✘ | ✓ | ✓ | ✓ | ✓ | ? |
|
||||
| 支持第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? |
|
||||
| WebAuthn (2FA) | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ? |
|
||||
| 扩展 API | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 内置软件包/容器注册中心 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 同步提交到外部仓库 (push mirror) | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 同步外部仓库的提交 (pull mirror) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ? |
|
||||
| 浅色和深色主题 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ? |
|
||||
| 自定义主题支持 | ✓ | ✓ | ✘ | ✘ | ✘ | ✓ | ✘ |
|
||||
| 支持 Markdown | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 支持 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? |
|
||||
| Git 驱动的静态 pages | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| Git 驱动的集成化 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (cloud only) | ✘ |
|
||||
| 部署令牌 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 仓库写权限令牌 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| RSS Feeds | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ✘ |
|
||||
| 内置 CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 子组织:组织内的组织 | [✘](https://github.com/go-gitea/gitea/issues/1872) | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||
| 多实例交互 | [/](https://github.com/go-gitea/gitea/issues/18240) | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
| Markdown绘图 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| Markdown数学公式 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
|
||||
#### 代码管理
|
||||
|
||||
| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ---------------------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||
| 仓库主题描述 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 仓库内代码搜索 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 全局代码搜索 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
|
||||
| Git LFS 2.0 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 组织里程碑 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 细粒度用户角色 (例如 Code, Issues, Wiki) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 提交人的身份验证 | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ |
|
||||
| GPG 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| SSH 签名的提交 | ✓ | ✘ | ✘ | ✘ | ✘ | ? | ? |
|
||||
| 拒绝未用通过验证的提交 | [✓](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 |
|
||||
| ------------------------------------ | --------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||
| 仓库主题描述 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 仓库内代码搜索 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 全局代码搜索 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
|
||||
| Git LFS 2.0 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 组织里程碑 | [✘](https://github.com/go-gitea/gitea/issues/14622) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 细粒度用户角色 | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 提交人的身份验证 | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ |
|
||||
| GPG 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| SSH 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ? |
|
||||
| 拒绝未通过验证的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 外部仓库迁移 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 仓库活跃度页面 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 分支管理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 建立新分支 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 在线代码编辑 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 提交的统计图表 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 模板仓库 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ |
|
||||
| Git Blame | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 可视化镜像变化 | ✓ | ✘ | ✓ | ? | ? | ? | ? |
|
||||
|
||||
#### 工单管理
|
||||
|
||||
@@ -93,6 +102,7 @@ _表格中的符号含义:_
|
||||
| 工单批处理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 工单看板 | [✓](https://github.com/go-gitea/gitea/pull/8346) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 从工单创建分支 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 从评论创建工单 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 工单搜索 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 工单全局搜索 | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 工单依赖关系 | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
@@ -114,6 +124,7 @@ _表格中的符号含义:_
|
||||
| Pull/Merge requests 模板 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 查看 Cherry-picking 的更改 | [✓](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 下载 Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ |
|
||||
| Merge queues | ✘ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
|
||||
|
||||
#### 第三方集成
|
||||
|
||||
|
||||
@@ -133,6 +133,14 @@ export GITEA_WORK_DIR=/var/lib/gitea/
|
||||
cp gitea /usr/local/bin/gitea
|
||||
```
|
||||
|
||||
### 添加 bash/zsh 自动补全(从 1.19 版本开始)
|
||||
|
||||
可以在 [`contrib/autocompletion/bash_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete) 找到启用 bash 自动补全的脚本。可以将其复制到 `/usr/share/bash-completion/completions/gitea`,或在 `.bashrc` 中引用。
|
||||
|
||||
同样地,zsh 自动补全的脚本可以在 [`contrib/autocompletion/zsh_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/zsh_autocomplete) 找到。您可以将其复制到 `/usr/share/zsh/_gitea`,或在您的 `.zshrc` 中引用。
|
||||
|
||||
具体情况可能会有所不同,这些脚本可能需要进一步的改进。
|
||||
|
||||
## 运行 Gitea
|
||||
|
||||
完成以上步骤后,可以通过两种方式运行 Gitea:
|
||||
@@ -153,6 +161,8 @@ GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini
|
||||
|
||||
建议您在更新之前进行[备份](administration/backup-and-restore.md)。
|
||||
|
||||
如果您按照上述描述执行了安装步骤,二进制文件的通用名称应为 gitea。请勿更改此名称,即不要包含版本号。
|
||||
|
||||
### 1. 使用 systemd 重新启动 Gitea(推荐)
|
||||
|
||||
我们建议使用 systemd 作为服务管理器,使用 `systemctl restart gitea` 安全地重启程序。
|
||||
@@ -169,6 +179,36 @@ GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini
|
||||
|
||||
## 排查故障
|
||||
|
||||
### 旧版 glibc
|
||||
|
||||
旧版 Linux 发行版(例如 Debian 7 和 CentOS 6)可能无法加载 Gitea 二进制文件,通常会产生类似于 `./gitea: /lib/x86_64-linux-gnu/libc.so.6:
|
||||
version 'GLIBC\_2.14' not found (required by ./gitea)` 的错误。这是由于 dl.gitea.com 提供的二进制文件中集成了 SQLite 支持。在这种情况下,通常可以选择[从源代码安装](installation/from-source.md),而不包括 SQLite 支持。
|
||||
|
||||
### 在另一个端口上运行 Gitea
|
||||
|
||||
对于出现类似于 `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000:
|
||||
bind: address already in use` 的错误,需要将 Gitea 启动在另一个空闲端口上。您可以使用 `./gitea web -p $PORT` 来实现。可能已经有另一个 Gitea 实例在运行。
|
||||
|
||||
### 在 Raspbian 上运行 Gitea
|
||||
|
||||
从 v1.8 版本开始,arm7 版本的 Gitea 存在问题,无法在树莓派和类似设备上运行。
|
||||
|
||||
建议切换到 arm6 版本,该版本经过测试并已被证明可以在树莓派和类似设备上运行。
|
||||
|
||||
### 更新到新版本的 Gitea 后出现的 Git 错误
|
||||
|
||||
如果在更新过程中,二进制文件的名称已更改为新版本的 Gitea,则现有仓库中的 Git 钩子将不再起作用。在这种情况下,当推送到仓库时,会显示 Git 错误。
|
||||
|
||||
```
|
||||
remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory
|
||||
```
|
||||
|
||||
错误信息中的 `[...]` 部分将包含您先前 Gitea 二进制文件的路径。
|
||||
|
||||
要解决此问题,请转到管理选项,并运行任务 `Resynchronize pre-receive, update and post-receive hooks of all repositories`,以将所有钩子更新为包含新的二进制文件路径。请注意,这将覆盖所有 Git 钩子,包括自定义的钩子。
|
||||
|
||||
如果您没有使用 Gitea 内置的 SSH 服务器,您还需要通过在管理选项中运行任务 `Update the '.ssh/authorized_keys' file with Gitea SSH keys.` 来重新编写授权密钥文件。
|
||||
|
||||
> 更多经验总结,请参考英文版 [Troubleshooting](/en-us/install-from-binary/#troubleshooting)
|
||||
|
||||
如果从本页中没有找到你需要的内容,请访问 [帮助页面](help/support.md)
|
||||
|
||||
@@ -40,7 +40,7 @@ apk add gitea
|
||||
|
||||
## Arch Linux
|
||||
|
||||
The rolling release distribution has [Gitea](https://www.archlinux.org/packages/community/x86_64/gitea/) in their official community repository and package updates are provided with new Gitea releases.
|
||||
The rolling release distribution has [Gitea](https://www.archlinux.org/packages/extra/x86_64/gitea/) in their official extra repository and package updates are provided with new Gitea releases.
|
||||
|
||||
```sh
|
||||
pacman -S gitea
|
||||
|
||||
@@ -52,6 +52,14 @@ pacman -S gitea
|
||||
pacman -S gitea
|
||||
```
|
||||
|
||||
## Gentoo Linux
|
||||
|
||||
滚动发布的发行版在其官方社区软件仓库中提供了 [Gitea](https://packages.gentoo.org/packages/www-apps/gitea),并且会随着新的 Gitea 发布提供软件包更新。
|
||||
|
||||
```sh
|
||||
emerge gitea -va
|
||||
```
|
||||
|
||||
## Canonical Snap
|
||||
|
||||
目前 Gitea 已在 Snap Store 中发布,名称为 [gitea](https://snapcraft.io/gitea)。
|
||||
|
||||
@@ -17,16 +17,20 @@ menu:
|
||||
|
||||
# Upgrade from an old Gitea
|
||||
|
||||
To update Gitea, download a newer version, stop the old one, perform a backup, and run the new one.
|
||||
Every time a Gitea instance starts up, it checks whether a database migration should be run.
|
||||
If a database migration is required, Gitea will take some time to complete the upgrade and then serve.
|
||||
Follow below steps to ensure a smooth upgrade to a new Gitea version.
|
||||
|
||||
## Check the Changelog for breaking changes
|
||||
|
||||
To make Gitea better, some breaking changes are unavoidable, especially for big milestone releases.
|
||||
Before upgrade, please read the [Changelog on Gitea blog](https://blog.gitea.io/)
|
||||
Before upgrading, please read the [Changelog on Gitea blog](https://blog.gitea.com/)
|
||||
and check whether the breaking changes affect your Gitea instance.
|
||||
|
||||
## Verify there are no deprecated configuration options
|
||||
|
||||
New versions of Gitea often come with changed configuration syntax or options which are usually displayed for
|
||||
at least one release cycle inside at the top of the Site Administration panel. If these warnings are not
|
||||
resolved, Gitea may refuse to start in the following version.
|
||||
|
||||
## Backup for downgrade
|
||||
|
||||
Gitea keeps compatibility for patch versions whose first two fields are the same (`a.b.x` -> `a.b.y`),
|
||||
@@ -60,6 +64,11 @@ Backup steps:
|
||||
If you are using cloud services or filesystems with snapshot feature,
|
||||
a snapshot for the Gitea data volume and related object storage is more convenient.
|
||||
|
||||
After all of steps have been prepared, download the new version, stop the application, perform a backup and
|
||||
then start the new application. On each startup, Gitea verifies that the database is up to date and will automtically
|
||||
perform any necessary migrations. Depending on the size of the database, this can take some additional time on the
|
||||
first launch during which the application will be unavailable.
|
||||
|
||||
## Upgrade with Docker
|
||||
|
||||
* `docker pull` the latest Gitea release.
|
||||
|
||||
@@ -15,16 +15,20 @@ menu:
|
||||
|
||||
# 从旧版 Gitea 升级
|
||||
|
||||
想要升级 Gitea,只需要下载新版,停止运行旧版,进行数据备份,然后运行新版就好。
|
||||
每次 Gitea 实例启动时,它都会检查是否要进行数据库迁移。
|
||||
如果需要进行数据库迁移,Gitea 会花一些时间完成升级然后继续服务。
|
||||
在升级之前,您需要做如下的准备工作。
|
||||
|
||||
## 为重大变更检查更新日志
|
||||
|
||||
为了让 Gitea 变得更好,进行重大变更是不可避免的,尤其是一些里程碑更新的发布。
|
||||
在更新前,请 [在 Gitea 博客上阅读更新日志](https://blog.gitea.io/)
|
||||
在更新前,请 [在 Gitea 博客上阅读更新日志](https://blog.gitea.com/)
|
||||
并检查重大变更是否会影响你的 Gitea 实例。
|
||||
|
||||
## 在控制面板中检查过期的配置项
|
||||
|
||||
一些配置项可能会在后续版本中过期,你需要在控制面板中检查他们。如果不解决过期的配置项,
|
||||
Gitea也许会在升级后无法重启。你可以访问 https://docs.gitea.com 获得要升级的版本
|
||||
对应的文档来修改你的配置文件。
|
||||
|
||||
## 降级前的备份
|
||||
|
||||
Gitea 会保留首二位版本号相同的版本的兼容性 (`a.b.x` -> `a.b.y`),
|
||||
@@ -56,6 +60,10 @@ Gitea 会保留首二位版本号相同的版本的兼容性 (`a.b.x` -> `a.b.y`
|
||||
如果你在使用云服务或拥有快照功能的文件系统,
|
||||
最好对 Gitea 的数据盘及相关资料存储进行一次快照。
|
||||
|
||||
在所有上述步骤准备妥当之后,要升级 Gitea,只需要下载新版,停止运行旧版,进行数据备份,然后运行新版就好。
|
||||
每次 Gitea 实例启动时,它都会检查是否要进行数据库迁移。
|
||||
如果需要进行数据库迁移,Gitea 会花一些时间完成升级然后继续服务。
|
||||
|
||||
## 从 Docker 升级
|
||||
|
||||
* `docker pull` 拉取 Gitea 的最新发布版。
|
||||
|
||||
@@ -19,10 +19,83 @@ menu:
|
||||
|
||||
如果你正在运行Gogs 0.9.146以下版本,你可以平滑的升级到Gitea。该升级需要如下的步骤:
|
||||
|
||||
* 停止 Gogs 的运行
|
||||
* 拷贝 Gogs 的配置文件 `custom/conf/app.ini` 到 Gitea 的相应位置。
|
||||
* 拷贝 Gitea 的 `options/` 到 Home 目录下。
|
||||
* 如果你还有更多的自定义内容,比如templates和localization文件,你需要手工合并你的修改到 Gitea 的 Options 下对应目录。
|
||||
* 拷贝 Gogs 的数据目录 `data/` 到 Gitea 相应位置。这个目录包含附件和头像文件。
|
||||
* 运行 Gitea
|
||||
* 登录 Gitea 并进入 管理面板, 运行 `重新生成 '.ssh/authorized_keys' 文件(警告:不是 Gitea 的密钥也会被删除)` 和 `重新生成所有仓库的 Update 钩子(用于自定义配置文件被修改)`。
|
||||
* 使用 `gogs backup` 创建 Gogs 备份。这会创建一个名为 `gogs-backup-[时间戳].zip` 的文件,其中包含所有重要的 Gogs 数据。如果您将来想要返回到 `gogs`,您会需要这个备份文件。
|
||||
* 从 [下载页面](https://dl.gitea.com/gitea/) 下载适用于目标平台的文件。应该选择 `1.0.x` 版本。从 `gogs` 迁移到其他任何版本是不可能的。
|
||||
* 将二进制文件放置在所需的安装位置。
|
||||
* 将 `gogs/custom/conf/app.ini` 复制到 `gitea/custom/conf/app.ini`。
|
||||
* 将 `gogs/custom/` 中的自定义 `templates, public` 复制到 `gitea/custom/`。
|
||||
* 对于其他自定义文件夹,例如 `gogs/custom/conf` 中的 `gitignore, label, license, locale, readme`,将它们复制到 `gitea/custom/options`。
|
||||
* 将 `gogs/data/` 复制到 `gitea/data/`。其中包含问题附件和头像。
|
||||
* 使用 `gitea web` 启动 Gitea 进行验证。
|
||||
* 在 UI 上进入 Gitea 管理面板,运行 `Rewrite '.ssh/authorized_keys' file`。
|
||||
* 启动每个主要版本的二进制文件(例如 `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → 等)以迁移数据库。
|
||||
* 如果自定义或配置路径已更改,请运行 `Rewrite all update hook of repositories`。
|
||||
|
||||
## 更改特定于 Gogs 的信息
|
||||
|
||||
* 将 `gogs-repositories/` 重命名为 `gitea-repositories/`
|
||||
* 将 `gogs-data/` 重命名为 `gitea-data/`
|
||||
* 在 `gitea/custom/conf/app.ini` 中进行更改:
|
||||
从:
|
||||
|
||||
```ini
|
||||
[database]
|
||||
PATH = /home/:USER/gogs/data/:DATABASE.db
|
||||
[attachment]
|
||||
PATH = /home/:USER/gogs-data/attachments
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
|
||||
[log]
|
||||
ROOT_PATH = /home/:USER/gogs/log
|
||||
```
|
||||
|
||||
到:
|
||||
|
||||
```ini
|
||||
[database]
|
||||
PATH = /home/:USER/gitea/data/:DATABASE.db
|
||||
[attachment]
|
||||
PATH = /home/:USER/gitea-data/attachments
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
|
||||
[log]
|
||||
ROOT_PATH = /home/:USER/gitea/log
|
||||
```
|
||||
|
||||
* 使用 `gitea web` 启动 Gitea 进行验证
|
||||
|
||||
## 升级到最新版本的 `gitea`
|
||||
|
||||
在成功从 `gogs` 迁移到 `gitea 1.0.x` 之后,可以通过两步过程将 `gitea` 升级到现代版本。
|
||||
|
||||
首先升级到 [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/)。从 [下载页面](https://dl.gitea.com/gitea/1.6.4/) 下载适用于目标平台的文件,并替换二进制文件。至少运行一次 Gitea 并检查是否一切正常。
|
||||
|
||||
然后重复这个过程,但这次使用 [最新版本](https://dl.gitea.com/gitea/@version@/)。
|
||||
|
||||
## 从较新的 Gogs 版本升级
|
||||
|
||||
从较新的 Gogs 版本(最高到 `0.11.x`)可能也是可能的,但需要更多的工作。
|
||||
请参见 [#4286](https://github.com/go-gitea/gitea/issues/4286),其中包括各种 Gogs `0.11.x` 版本。
|
||||
|
||||
从 Gogs `0.12.x` 及更高版本升级将变得越来越困难,因为项目在配置和架构上逐渐分歧。
|
||||
|
||||
## 故障排除
|
||||
|
||||
* 如果在 `gitea/custom/templates` 文件夹中遇到与自定义模板相关的错误,请尝试逐个移除引发错误的模板。
|
||||
它们可能与 Gitea 或更新不兼容。
|
||||
|
||||
## 将 Gitea 添加到 Unix 的启动项
|
||||
|
||||
从 [gitea/contrib](https://github.com/go-gitea/gitea/tree/main/contrib) 更新适当的文件,确保正确的环境变量。
|
||||
|
||||
对于使用 systemd 的发行版:
|
||||
|
||||
* 将更新后的脚本复制到 `/etc/systemd/system/gitea.service`
|
||||
* 使用以下命令将服务添加到启动项:`sudo systemctl enable gitea`
|
||||
* 禁用旧的 gogs 启动脚本:`sudo systemctl disable gogs`
|
||||
|
||||
对于使用 SysVinit 的发行版:
|
||||
|
||||
* 将更新后的脚本复制到 `/etc/init.d/gitea`
|
||||
* 使用以下命令将服务添加到启动项:`sudo rc-update add gitea`
|
||||
* 禁用旧的 gogs 启动脚本:`sudo rc-update del gogs`
|
||||
|
||||
@@ -15,22 +15,53 @@ menu:
|
||||
identifier: "windows-service"
|
||||
---
|
||||
|
||||
# 准备工作
|
||||
|
||||
在 C:\gitea\custom\conf\app.ini 中进行了以下更改:
|
||||
|
||||
```
|
||||
RUN_USER = COMPUTERNAME$
|
||||
```
|
||||
|
||||
将 Gitea 设置为以本地系统用户运行。
|
||||
|
||||
COMPUTERNAME 是从命令行中运行 `echo %COMPUTERNAME%` 后得到的响应。如果响应是 `USER-PC`,那么 `RUN_USER = USER-PC$`。
|
||||
|
||||
## 使用绝对路径
|
||||
|
||||
如果您使用 SQLite3,请将 `PATH` 更改为包含完整路径:
|
||||
|
||||
```
|
||||
[database]
|
||||
PATH = c:/gitea/data/gitea.db
|
||||
```
|
||||
|
||||
# 注册为Windows服务
|
||||
|
||||
要注册为Windows服务,首先以Administrator身份运行 `cmd`,然后执行以下命令:
|
||||
|
||||
```
|
||||
sc create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\""
|
||||
sc.exe create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\""
|
||||
```
|
||||
|
||||
别忘了将 `C:\gitea` 替换成你的 Gitea 安装目录。
|
||||
|
||||
之后在控制面板打开 "Windows Services",搜索 "gitea",右键选择 "Run"。在浏览器打开 `http://localhost:3000` 就可以访问了。(如果你修改了端口,请访问对应的端口,3000是默认端口)。
|
||||
|
||||
## 添加启动依赖项
|
||||
|
||||
要将启动依赖项添加到 Gitea Windows 服务(例如 Mysql、Mariadb),作为管理员,然后运行以下命令:
|
||||
|
||||
```
|
||||
sc.exe config gitea depend= mariadb
|
||||
```
|
||||
|
||||
这将确保在 Windows 计算机重新启动时,将延迟自动启动 Gitea,直到数据库准备就绪,从而减少启动失败的情况。
|
||||
|
||||
## 从Windows服务中删除
|
||||
|
||||
以Administrator身份运行 `cmd`,然后执行以下命令:
|
||||
|
||||
```
|
||||
sc delete gitea
|
||||
sc.exe delete gitea
|
||||
```
|
||||
|
||||
@@ -245,8 +245,8 @@ You can find more useful images on [act images](https://github.com/nektos/act/bl
|
||||
If you want to run jobs in the host directly, you can change it to `ubuntu-22.04:host` or just `ubuntu-22.04`, the `:host` is optional.
|
||||
However, we suggest you to use a special name like `linux_amd64:host` or `windows:host` to avoid misusing it.
|
||||
|
||||
One more thing is that it is recommended to register the runner if you want to change the labels.
|
||||
It may be annoying to do this, so we may provide a better way to do it in the future.
|
||||
Starting with Gitea 1.21, you can change labels by modifying `container.labels` in the runner configuration file (if you don't have a configuration file, please refer to [configuration tutorials](#configuration)).
|
||||
The runner will use these new labels as soon as you restart it, i.e., by calling `./act_runner daemon --config config.yaml`.
|
||||
|
||||
## Running
|
||||
|
||||
@@ -261,3 +261,34 @@ After you have registered the runner, you can run it by running the following co
|
||||
The runner will fetch jobs from the Gitea instance and run them automatically.
|
||||
|
||||
Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly.
|
||||
|
||||
## Configuration variable
|
||||
|
||||
You can create configuration variables on the user, organization and repository level.
|
||||
The level of the variable depends on where you created it.
|
||||
|
||||
### Naming conventions
|
||||
|
||||
The following rules apply to variable names:
|
||||
|
||||
- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.
|
||||
|
||||
- Variable names must not start with the `GITHUB_` and `GITEA_` prefix.
|
||||
|
||||
- Variable names must not start with a number.
|
||||
|
||||
- Variable names are case-insensitive.
|
||||
|
||||
- Variable names must be unique at the level they are created at.
|
||||
|
||||
- Variable names must not be `CI`.
|
||||
|
||||
### Using variable
|
||||
|
||||
After creating configuration variables, they will be automatically filled in the `vars` context.
|
||||
They can be accessed through expressions like `{{ vars.VARIABLE_NAME }}` in the workflow.
|
||||
|
||||
### Precedence
|
||||
|
||||
If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence:
|
||||
A repository variable will always be chosen over an organization/user variable.
|
||||
|
||||
@@ -241,8 +241,7 @@ Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们
|
||||
如果您想直接在主机上运行Job,您可以将其更改为`ubuntu-22.04:host`或仅`ubuntu-22.04`,`:host`是可选的。
|
||||
然而,我们建议您使用类似`linux_amd64:host`或`windows:host`的特殊名称,以避免误用。
|
||||
|
||||
还有一点需要注意的是,建议在更改标签时注册Runner。
|
||||
这可能会有些麻烦,所以我们可能会在将来提供更好的方法来处理。
|
||||
从 Gitea 1.21 开始,您可以通过修改 runner 的配置文件中的 `container.labels` 来更改标签(如果没有配置文件,请参考 [配置教程](#配置)),通过执行 `./act_runner daemon --config config.yaml` 命令重启 runner 之后,这些新定义的标签就会生效。
|
||||
|
||||
## 运行
|
||||
|
||||
@@ -257,3 +256,32 @@ Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们
|
||||
Runner将从Gitea实例获取Job并自动运行它们。
|
||||
|
||||
由于Act Runner仍处于开发中,建议定期检查最新版本并进行升级。
|
||||
|
||||
## 变量
|
||||
|
||||
您可以创建用户、组织和仓库级别的变量。变量的级别取决于创建它的位置。
|
||||
|
||||
### 命名规则
|
||||
|
||||
以下规则适用于变量名:
|
||||
|
||||
- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。
|
||||
|
||||
- 变量名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。
|
||||
|
||||
- 变量名称不能以数字开头。
|
||||
|
||||
- 变量名称不区分大小写。
|
||||
|
||||
- 变量名称在创建它们的级别上必须是唯一的。
|
||||
|
||||
- 变量名称不能为 “CI”。
|
||||
|
||||
### 使用
|
||||
|
||||
创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `{{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。
|
||||
|
||||
### 优先级
|
||||
|
||||
如果同名变量存在于多个级别,则级别最低的变量优先。
|
||||
仓库级别的变量总是比组织或者用户级别的变量优先被选中。
|
||||
|
||||
@@ -127,7 +127,7 @@ jobs:
|
||||
|
||||
请注意,演示文件中包含一些表情符号。
|
||||
请确保您的数据库支持它们,特别是在使用MySQL时。
|
||||
如果字符集不是`utf8mb4,将出现错误,例如`Error 1366 (HY000): Incorrect string value: '\\xF0\\x9F\\x8E\\x89 T...' for column 'name' at row 1`。
|
||||
如果字符集不是`utf8mb4`,将出现错误,例如`Error 1366 (HY000): Incorrect string value: '\\xF0\\x9F\\x8E\\x89 T...' for column 'name' at row 1`。
|
||||
有关更多信息,请参阅[数据库准备工作](installation/database-preparation.md#mysql)。
|
||||
|
||||
或者,您可以从演示文件中删除所有表情符号,然后再尝试一次。
|
||||
|
||||
@@ -21,8 +21,8 @@ In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-a
|
||||
|
||||
## Creating PRs with Agit
|
||||
|
||||
Agit allows to create PRs while pushing code to the remote repo. \
|
||||
This can be done by pushing to the branch followed by a specific refspec (a location identifier known to git). \
|
||||
Agit allows to create PRs while pushing code to the remote repo.
|
||||
This can be done by pushing to the branch followed by a specific refspec (a location identifier known to git).
|
||||
The following example illustrates this:
|
||||
|
||||
```shell
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
date: "2023-08-22T14:21:00+08:00"
|
||||
title: "Usage: Multi-factor Authentication (MFA)"
|
||||
slug: "multi-factor-authentication"
|
||||
weight: 15
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "Multi-factor Authentication (MFA)"
|
||||
weight: 15
|
||||
identifier: "multi-factor-authentication"
|
||||
---
|
||||
|
||||
# Multi-factor Authentication (MFA)
|
||||
|
||||
Multi-factor Authentication (also referred to as MFA or 2FA) enhances security by requiring a time-sensitive set of credentials in addition to a password.
|
||||
If a password were later to be compromised, logging into Gitea will not be possible without the additional credentials and the account would remain secure.
|
||||
Gitea supports both TOTP (Time-based One-Time Password) tokens and FIDO-based hardware keys using the Webauthn API.
|
||||
|
||||
MFA can be configured within the "Security" tab of the user settings page.
|
||||
|
||||
## MFA Considerations
|
||||
|
||||
Enabling MFA on a user does affect how the Git HTTP protocol can be used with the Git CLI.
|
||||
This interface does not support MFA, and trying to use a password normally will no longer be possible whilst MFA is enabled.
|
||||
If SSH is not an option for Git operations, an access token can be generated within the "Applications" tab of the user settings page.
|
||||
This access token can be used as if it were a password in order to allow the Git CLI to function over HTTP.
|
||||
|
||||
> **Warning** - By its very nature, an access token sidesteps the security benefits of MFA.
|
||||
> It must be kept secure and should only be used as a last resort.
|
||||
|
||||
The Gitea API supports providing the relevant TOTP password in the `X-Gitea-OTP` header, as described in [API Usage](development/api-usage.md).
|
||||
This should be used instead of an access token where possible.
|
||||
@@ -29,10 +29,12 @@ Gitea 支持对仓库进行权限管理,这样您就可以为不同的人员
|
||||
| 工单 | 组织缺陷报告、任务和里程碑。 | 读取 写入 |
|
||||
| 合并请求 | 启用合并请求和代码审核。 | 读取 写入 |
|
||||
| 发布 | 跟踪项目版本和下载。 | 读取 写入 |
|
||||
| 维基 | 与协作者编写和共享文档。 | 读取 写入 |
|
||||
| 外部维基 | 链接到外部维基。 | 读取 |
|
||||
| 百科 | 与协作者编写和共享文档。 | 读取 写入 |
|
||||
| 外部百科 | 链接到外部维基。 | 读取 |
|
||||
| 外部工单跟踪器 | 链接到外部工单跟踪器。 | 读取 |
|
||||
| 项目 | 模板仓库的 URL。 | 读取 写入 |
|
||||
| 包 | 链接到仓库 | 读取 写入 |
|
||||
| Actions | 审查Actions日志或重启/取消工作流 | 读取 写入 |
|
||||
| 设置 | 管理仓库。 | 管理员 |
|
||||
|
||||
通过不同的权限,用户可以在这些单元上执行不同的操作。
|
||||
@@ -43,25 +45,42 @@ Gitea 支持对仓库进行权限管理,这样您就可以为不同的人员
|
||||
| 工单 | 查看工单并创建新工单。 | 添加标签、分配、关闭工单。 | - |
|
||||
| 合并请求 | 查看合并请求并创建新合并请求。 | 添加标签、分配、关闭合并请求。 | - |
|
||||
| 发布 | 查看发布和下载文件。 | 创建/编辑发布。 | - |
|
||||
| 维基 | 查看维基页面。克隆维基仓库。 | 创建/编辑维基页面,推送更改。 | - |
|
||||
| 外部维基 | 链接到外部维基。 | - | - |
|
||||
| 百科 | 查看百科页面。克隆百科仓库。 | 创建/编辑百科页面,推送更改。 | - |
|
||||
| 外部百科 | 链接到外部百科。 | - | - |
|
||||
| 外部工单跟踪器 | 链接到外部工单跟踪器。 | - | - |
|
||||
| 项目 | 查看面板。 | 在面板之间移动工单。 | - |
|
||||
| 包 | 查看包 | 上传/删除包 | - |
|
||||
| Actions | 查看 Actions日志 | 同意 / 取消 / 重启 | - |
|
||||
| 设置 | - | - | 管理仓库 |
|
||||
|
||||
个人仓库和组织仓库之间的权限存在一些差异。
|
||||
|
||||
## 个人仓库
|
||||
|
||||
对于个人仓库,创建者是仓库的唯一所有者,对于该仓库的任何更改或删除没有限制。仓库所有者可以添加协作者来帮助维护仓库。协作者可以拥有 `读取(Read)`、`写入(Write)` 和 `管理员(Admin)` 权限。
|
||||
对于个人仓库,创建者是仓库的唯一所有者,对于该仓库的任何更改或删除没有限制。
|
||||
仓库所有者可以添加协作者来帮助维护仓库。协作者可以拥有 `读取(Read)`、`写入(Write)` 和 `管理员(Admin)` 权限。
|
||||
|
||||
访问私有仓库的体验与访问匿名公共仓库类似。您可以访问仓库中的所有可用内容,包括克隆代码、创建工单、回复工单评论、提交拉取请求等。如果你有 "写"权限,只要分支保护规则允许,你就可以向仓库的特定分支推送代码。此外,你还可以修改百科页面。有了 "管理"权限,你就可以修改仓库的设置。
|
||||
|
||||
但如果你不是该仓库的所有者,就不能删除或转移该仓库。
|
||||
|
||||
## 组织仓库
|
||||
|
||||
与个人仓库不同,组织仓库的所有者是组织的所有者团队。
|
||||
对于个人仓库,所有者是创建它的用户。而对于组织仓库,所有者是该组织中的所有者团队成员。对该组织仓库的所有权限都取决于团队权限设置。
|
||||
|
||||
### 团队
|
||||
### 所有者团队
|
||||
|
||||
组织中的一个团队具有单元权限设置。它可以拥有成员和仓库的范围。团队可以访问组织中的所有仓库或者由所有者团队授权访问的特定仓库。团队也可以被允许创建新的仓库。
|
||||
创建组织时将自动创建所有者团队,创建者将成为所有者团队的第一名成员。所有者团队不可删除,且至少有一名成员。
|
||||
|
||||
所有者团队(Owners)将在创建组织时自动创建,并且创建者将成为所有者团队的第一个成员。
|
||||
组织的每个成员必须至少属于一个团队。所有者团队不能被删除,只有所有者团队的成员可以创建新的团队。可以创建一个管理员团队来管理某些仓库,该团队的成员可以对这些仓库进行任何操作。可以由所有者团队创建一个生成团队来执行其权限允许的操作。
|
||||
### 管理员团队
|
||||
|
||||
创建团队时,有两种类型的团队。一种是管理员团队,另一种是普通团队。可以创建一个管理员团队来管理某些版本库,其成员可以对这些版本库做任何事情。只有所有者或管理员团队的成员才能创建新团队。
|
||||
|
||||
### 普通团队
|
||||
|
||||
组织中的普通团队具有可以根据`单元(Unit)`进行权限设置。它可以有成员和存储库范围。
|
||||
|
||||
- 一个团队可以访问所属组织的所有仓库或特殊仓库。
|
||||
- 也可以设置该团队是否有创建新仓库的权限。
|
||||
|
||||
可以通过创建 "普通团队",并通过权限控制对其行为进行限制。一名成员可以加入多个团队。
|
||||
|
||||
@@ -17,9 +17,45 @@ menu:
|
||||
|
||||
# 合并请求
|
||||
|
||||
## 在`合并请求`中使用“Work In Progress”标记
|
||||
合并请求(PR)是一种提出对仓库进行更改的方式。
|
||||
它是一种将一个分支合并到另一个分支的请求,附带有对所做更改的描述。
|
||||
合并请求通常用作贡献者对仓库贡献代码的方式,仓库的维护者可以通过对合并请求进行审查来决定是否接受这些更改。
|
||||
|
||||
您可以通过在一个进行中的 pull request 的标题上添加前缀 `WIP:` 或者 `[WIP]`(此处大小写敏感)来防止它被意外合并,具体的前缀设置可以在配置文件 `app.ini` 中找到:
|
||||
## 创建合并请求
|
||||
|
||||
要创建合并请求,您需要遵循以下步骤:
|
||||
|
||||
1. **Fork 仓库** - 如果您没有直接对仓库进行更改的权限,您需要将仓库 fork 到您自己的账户中。
|
||||
这将创建一个您可以对其进行更改的仓库副本。
|
||||
|
||||
2. **创建分支(可选)** - 在 fork 的仓库中创建一个新分支,该分支包含您要提出的更改。
|
||||
给分支取一个描述性的名称,以指示更改的内容。
|
||||
|
||||
3. **进行更改** - 进行您想要的更改,提交并将其推送到 fork 的仓库中。
|
||||
|
||||
4. **创建合并请求** - 转到原始仓库并转到“合并请求”选项卡。单击“新建合并请求”按钮,并将您的新分支选择为源分支。
|
||||
为您的合并请求输入描述性标题和描述,然后单击“创建合并请求”。
|
||||
|
||||
## 评审合并请求
|
||||
|
||||
创建合并请求后,将触发评审流程。仓库的维护者将收到合并请求的通知,并可以审查所做的更改。
|
||||
他们可以留下评论、请求更改或批准更改。
|
||||
|
||||
如果维护者请求更改,您需要在分支中进行这些更改,并将更改推送到 fork 的仓库中。
|
||||
合并请求将自动使用新更改进行更新。
|
||||
|
||||
如果维护者批准更改,他们可以将合并请求合并到仓库中。
|
||||
|
||||
## 关闭合并请求
|
||||
|
||||
如果您不接受该合并请求,您可以关闭它。
|
||||
要关闭合并请求,请转到打开的合并请求并单击“关闭合并请求”按钮。这将关闭合并请求并且不会将其合并。
|
||||
|
||||
## 使用“Work In Progress”标记
|
||||
|
||||
在合并请求中使用“Work In Progress”标记可以防止合并请求被意外合并。
|
||||
要将合并请求标记为“Work In Progress”,您必须在其标题中添加前缀`WIP:`或`[WIP]`(不区分大小写)。
|
||||
标记前缀可以在您的`app.ini`文件中进行配置:
|
||||
|
||||
```
|
||||
[repository.pull-request]
|
||||
|
||||
@@ -88,3 +88,16 @@ menu:
|
||||
4. 选择**添加推送镜像**以保存配置。
|
||||
|
||||
仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。
|
||||
|
||||
### 镜像现有的 ssh 仓库
|
||||
|
||||
当前,Gitea 不支持从 ssh 仓库进行镜像。如果您想要镜像一个 ssh 仓库,您需要将其转换为 http 仓库。您可以使用以下命令将现有的 ssh 仓库转换为 http 仓库:
|
||||
|
||||
1. 确保运行 gitea 的用户有权限访问您试图从 shell 镜像到的 git 仓库。
|
||||
2. 在 Web 界面的版本库设置 > git 钩子中为镜像添加一个接收后钩子。
|
||||
|
||||
```
|
||||
#!/usr/bin/env bash
|
||||
git push --mirror --quiet git@github.com:username/repository.git &>/dev/null &
|
||||
echo "GitHub mirror initiated .."
|
||||
```
|
||||
|
||||
@@ -47,6 +47,8 @@ a/b/c/d.json
|
||||
|
||||
在与上述通配符匹配的任何文件中,将会扩展某些变量。
|
||||
|
||||
文件名和路径的匹配也可以被扩展,并且会经过谨慎的清理处理,以支持跨平台的文件系统。
|
||||
|
||||
所有变量都必须采用`$VAR`或`${VAR}`的形式。要转义扩展,使用双重`$$`,例如`$$VAR`或`$${VAR}`。
|
||||
|
||||
| 变量 | 扩展为 | 可转换 |
|
||||
|
||||
Reference in New Issue
Block a user