将链接替换成文档
@@ -12,8 +12,11 @@ export default defineConfig({
|
||||
outline: [2, 6],
|
||||
logo: '/devstar-logo.png',
|
||||
nav: [
|
||||
{ text: '文档', link: '/document/decription/关于devstar' },
|
||||
{ text: 'Examples', link: '/markdown-examples' }
|
||||
{ text: '文档', link: '/document/index' },
|
||||
{ text: 'API', link: 'https://docs.gitea.com/zh-cn/api/1.24/' },
|
||||
{ text: 'Runner', link: 'https://docs.gitea.com/zh-cn/runner/0.2.11/' },
|
||||
{ text: 'Enterprise', link: 'https://docs.gitea.com/enterprise/' },
|
||||
// { text: 'Examples', link: '/markdown-examples' }
|
||||
],
|
||||
|
||||
// sidebar: [
|
||||
@@ -25,15 +28,179 @@ export default defineConfig({
|
||||
// ]
|
||||
// }
|
||||
// ],
|
||||
sidebar: {
|
||||
"/document/decription": set_sidebar("/document/decription"),
|
||||
},
|
||||
// sidebar: {
|
||||
// "/document/decription": set_sidebar("/document/decription"),
|
||||
// },
|
||||
sidebar: [
|
||||
{
|
||||
text: 'devstar是什么',
|
||||
link: '/document/index',
|
||||
} as any,
|
||||
{
|
||||
text: '安装',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
// link: 'https://docs.gitea.com/zh-cn/category/installation',
|
||||
items: [
|
||||
{ text: '对比Gitea与其它Git托管工具', link: '/document/installation/comparison.md' },
|
||||
{ text: '数据库准备', link: '/document/installation/database-preparation.md' },
|
||||
{ text: '使用二进制文件安装', link: '/document/installation/from-binary.md' },
|
||||
{ text: '包管理器安装', link: '/document/installation/from-package.md' },
|
||||
{ text: '使用源代码安装', link: '/document/installation/from-source.md' },
|
||||
{ text: '在Linux中以service方式运行', link: '/document/installation/run-as-service-in-ubuntu.md' },//
|
||||
{ text: '注册为Windows服务', link: '/document/installation/windows-service.md' },
|
||||
{ text: '使用Docker安装(rootless)', link: '/document/installation/with-docker-rootless.md' },
|
||||
{ text: '使用Docker安装', link: '/document/installation/with-docker.md' },
|
||||
{ text: '在Kubernetes中安装Gitea', link: '/document/installation/on-kubernetes.md' },
|
||||
{ text: '在云服务器上安装Gitea', link: '/document/installation/on-cloud-provider.md' },
|
||||
{ text: '从旧版Gitea升级', link: '/document/installation/upgrade-from-gitea.md' },
|
||||
]
|
||||
} as any,
|
||||
{
|
||||
text: '管理',
|
||||
link: 'https://docs.gitea.com/zh-cn/category/administration',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
items: [
|
||||
{ text: '命令行', link: 'https://docs.gitea.com/zh-cn/administration/command-line' },
|
||||
{ text: '认证', link: 'https://docs.gitea.com/zh-cn/administration/authentication' },
|
||||
{ text: '环境变量清单', link: 'https://docs.gitea.com/zh-cn/administration/environment-variables' },
|
||||
{ text: '备份与恢复', link: 'https://docs.gitea.com/zh-cn/administration/backup-and-restore' },
|
||||
{ text: 'Email 设置', link: 'https://docs.gitea.com/zh-cn/administration/email-setup' },
|
||||
{ text: 'Git LFS 设置', link: 'https://docs.gitea.com/zh-cn/administration/git-lfs-setup' },
|
||||
{ text: 'HTTPS配置', link: 'https://docs.gitea.com/zh-cn/administration/https-setup' },
|
||||
{ text: '设置 Fail2ban', link: 'https://docs.gitea.com/zh-cn/administration/fail2ban-setup' },
|
||||
{ text: '反向代理', link: 'https://docs.gitea.com/zh-cn/administration/reverse-proxies' },
|
||||
{ text: '嵌入资源提取工具', link: 'https://docs.gitea.com/zh-cn/administration/cmd-embedded' },
|
||||
{ text: '配置说明', link: 'https://docs.gitea.com/zh-cn/administration/config-cheat-sheet' },
|
||||
{ text: '日志配置', link: 'https://docs.gitea.com/zh-cn/administration/logging-config' },
|
||||
{ text: '邮件模板', link: 'https://docs.gitea.com/zh-cn/administration/mail-templates' },
|
||||
{ text: '仓库索引器', link: 'https://docs.gitea.com/zh-cn/administration/repo-indexer' },
|
||||
{ text: 'GPG 提交签名', link: 'https://docs.gitea.com/zh-cn/administration/signing' },
|
||||
{ text: '外部渲染器', link: 'https://docs.gitea.com/zh-cn/administration/external-renderers' },
|
||||
{ text: '搜索引擎索引', link: 'https://docs.gitea.com/zh-cn/administration/search-engines-indexation' },
|
||||
{ text: '自定义 Gitea 配置', link: 'https://docs.gitea.com/zh-cn/administration/customizing-gitea' },
|
||||
{ text: '添加法律页面', link: 'https://docs.gitea.com/zh-cn/administration/adding-legal-pages' }
|
||||
]
|
||||
} as any,
|
||||
{
|
||||
text: '使用',
|
||||
link: 'https://docs.gitea.com/zh-cn/category/usage',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
items: [
|
||||
{
|
||||
text: 'Actions',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: false, // 默认展开
|
||||
items: [
|
||||
{ text: 'Overview', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '快速入门', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '与GitHub Actions的对比', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Act Runner', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '变量', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Gitea Actions设计', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '密钥管理', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Gitea Actions常见问题解答', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Badge', link: 'https://docs.gitea.com/zh-cn/installation/comparison' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '软件包',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
items: [
|
||||
{ text: '软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Alpine 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Arch package registry', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Cargo 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Chef 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '存储', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Composer 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Conan 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Conda 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '容器注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'CRAN 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Go 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Helm Chart 注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Maven 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'NPM Package Registry', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'NuGet 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Pub 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'PyPI 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'RPM 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'RubyGems 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Swift 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Vagrant 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '通用软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Debian 软件包注册表', link: 'https://docs.gitea.com/zh-cn/installation/comparison' }
|
||||
]
|
||||
},
|
||||
{ text: 'AGit', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '个人资料 README', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Blame File View', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '邮件接收', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '标签', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '合并请求', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '权限', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '模板仓库', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '从模板创建工单与合并请求', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '自动链接引用', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '合并消息模板', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '推送', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Blocking a user', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '克隆过滤器 (部分克隆)', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Code Owners', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Webhooks', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Migration', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '受保护的标签', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '仓库镜像', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Markdown', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'Multi-factor Authentication (MFA)', link: 'https://docs.gitea.com/zh-cn/installation/comparison' }
|
||||
]
|
||||
} as any,
|
||||
{
|
||||
text: '开发',
|
||||
link: 'https://docs.gitea.com/zh-cn/category/development',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
items: [
|
||||
{ text: '玩转 Gitea', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'API 使用指南', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: 'OAuth2 提供者', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '迁移接口', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '集成', link: 'https://docs.gitea.com/zh-cn/installation/comparison' }
|
||||
]
|
||||
} as any,
|
||||
{
|
||||
text: '贡献',
|
||||
link: 'https://docs.gitea.com/zh-cn/category/contributing',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
items: [
|
||||
{ text: '后端开发指南', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '前端开发指南', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '重构指南', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '本地化', link: 'https://docs.gitea.com/zh-cn/installation/comparison' }
|
||||
]
|
||||
} as any,
|
||||
{
|
||||
text: '帮助',
|
||||
link: 'https://docs.gitea.com/zh-cn/category/help',
|
||||
collapsible: true, // 使整个组可折叠
|
||||
collapsed: true, // 默认展开
|
||||
items: [
|
||||
{ text: '常见问题', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
{ text: '支持选项', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
|
||||
]
|
||||
} as any,
|
||||
],
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: ' https://github.com/mengning/DevStar' }
|
||||
],
|
||||
footer: {
|
||||
copyright: 'Copyright © 2023-present devstar contributors',
|
||||
copyright: 'Copyright © 2025-present devstar contributors',
|
||||
},
|
||||
// 设置搜索框的样式
|
||||
search: {
|
||||
|
@@ -22,6 +22,8 @@ weight: 3
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ### 准备开发环境
|
||||
|
||||
#### Windows/MacOS/Linux
|
||||
|
@@ -9,9 +9,11 @@ DevStar Studio 是一个Gitea 发行版,在Git代码仓库托管的基础上
|
||||
|
||||
## 目标
|
||||
|
||||
DevStar Studio是一个通用的一站式软件研发平台,但它最初的目标是服务于汽车软件、消费电子、智能制造等嵌入式软件研发场景中的开发者
|
||||
DevStar Studio是一个通用的一站式软件研发平台,它最初的目标是服务于汽车软件、消费电子、智能制造等嵌入式软件研发场景中的开发者
|
||||
|
||||
## 功能特性
|
||||
## 在线演示
|
||||
|
||||
访问[devstar.cn](https://devstar.cn)或者在VS Code插件市场搜索devstar
|
||||
|
||||
|
||||
|
||||
|
16
docs/document/index.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
outline: deep
|
||||
weight: 1
|
||||
---
|
||||
|
||||
# 关于devstar
|
||||
|
||||
DevStar Studio 是一个Gitea 发行版,在Git代码仓库托管的基础上提供了开发环境DevEnv执行引擎,与VS Code插件或自定义IDE深度融合,形成灵活适配基础软件工具的生态平台,从而为开发者用户提供智能(代码大模型AI+)、安全(完全云原生)、一站式开箱即用的CI/CD全生命周期研发平台。
|
||||
|
||||
## 目标
|
||||
|
||||
DevStar Studio是一个通用的一站式软件研发平台,它最初的目标是服务于汽车软件、消费电子、智能制造等嵌入式软件研发场景中的开发者
|
||||
|
||||
## 在线演示
|
||||
|
||||
访问[devstar.cn](https://devstar.cn)或者在VS Code插件市场搜索devstar
|
12
docs/document/installation.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Installation"
|
||||
slug: "installation"
|
||||
sidebar_position: 10
|
||||
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Installation"
|
||||
sidebar_position: 10
|
||||
identifier: "installation"
|
||||
---
|
140
docs/document/installation/comparison.md
Normal file
@@ -0,0 +1,140 @@
|
||||
---
|
||||
date: "2019-02-14T11:51:04+08:00"
|
||||
slug: "comparison"
|
||||
sidebar_position: 5
|
||||
aliases:
|
||||
- /zh-cn/comparison
|
||||
---
|
||||
|
||||
# 对比 Gitea 与其它 Git 托管工具
|
||||
|
||||
这里列出了 Gitea 与其它一些 Git 托管工具之间的异同,以便确认 Gitea 是否能够满足您的需求。
|
||||
|
||||
请注意,此列表中的某些表项可能已经过时,因为我们并没有定期检查其它产品的功能是否有所更改。你可以前往 [Github issue](https://github.com/go-gitea/gitea/issues) 来帮助我们更新过时的内容,感谢!
|
||||
|
||||
_表格中的符号含义:_
|
||||
|
||||
- _✓ - 支持_
|
||||
|
||||
- _⁄ - 部分支持_
|
||||
|
||||
- _✘ - 不支持_
|
||||
|
||||
- _⚙️ - 由第三方服务或插件支持_
|
||||
|
||||
#### 主要特性
|
||||
|
||||
| 特性 | 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 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 组织里程碑 | [✘](https://github.com/go-gitea/gitea/issues/14622) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 细粒度用户角色 | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 提交人的身份验证 | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ |
|
||||
| GPG 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| SSH 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ? |
|
||||
| 拒绝未通过验证的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 外部仓库迁移 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 仓库活跃度页面 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 分支管理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 建立新分支 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 在线代码编辑 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 提交的统计图表 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 模板仓库 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ |
|
||||
| Git Blame | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 可视化镜像变化 | ✓ | ✘ | ✓ | ? | ? | ? | ? |
|
||||
|
||||
#### 工单管理
|
||||
|
||||
| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | ----------------------------------------------------------------------- | --------- | -------------- | ------------ |
|
||||
| 工单跟踪 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (cloud only) | ✘ |
|
||||
| 工单模板 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 标签 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 时间跟踪 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||
| 支持多个负责人 | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
|
||||
| 关联的工单 | ✘ | ✘ | ⁄ | [✓](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) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 工单依赖关系 | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||
| 通过 Email 创建工单 | [✘](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) | ✓ | ✘ | ✘ |
|
||||
|
||||
#### Pull/Merge requests
|
||||
|
||||
| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| ------------------------------------ | -------------------------------------------------- | ---- | --------- | --------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------ | ------------ |
|
||||
| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Squash merging | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ |
|
||||
| Rebase merging | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ |
|
||||
| 评论 Pull/Merge request 中的某行代码 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 指定 Pull/Merge request 的审核人 | ✓ | ✘ | ⁄ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 解决 Merge 冲突 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 限制某些用户的 push 和 merge 权限 | ✓ | ✘ | ✓ | ⁄ | ✓ | ✓ | ✓ |
|
||||
| 回退某些 commits 或 merge request | [✓](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||
| 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 | ✘ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
|
||||
|
||||
#### 第三方集成
|
||||
|
||||
| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||
| -------------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | --------- | --------- | --------- | ------------ |
|
||||
| 支持 Webhook | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 自定义 Git 钩子 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| 集成 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 连接 | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ |
|
||||
| 集成 OAuth 2.0(外部授权) | ✓ | ✘ | ⁄ | ✓ | ✓ | ? | ✓ |
|
||||
| 作为 OAuth 2.0 provider | [✓](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
|
300
docs/document/installation/database-preparation.md
Normal file
@@ -0,0 +1,300 @@
|
||||
---
|
||||
date: "2020-01-16"
|
||||
slug: "database-prep"
|
||||
sidebar_position: 10
|
||||
aliases:
|
||||
- /zh-cn/database-prep
|
||||
---
|
||||
|
||||
# 数据库准备
|
||||
|
||||
在使用 Gitea 前,您需要准备一个数据库。Gitea 支持 PostgreSQL(>= 12)、MySQL(>= 8.0)、MariaDB(>= 10.4)、SQLite(内置) 和 MSSQL(>= 2012 SP4)这几种数据库。本页将指导您准备数据库。由于 PostgreSQL 和 MySQL 在生产环境中被广泛使用,因此本文档将仅涵盖这两种数据库。如果您计划使用 SQLite,则可以忽略本章内容。
|
||||
|
||||
如果您使用不受支持的数据库版本,请通过 [联系我们](/help/support) 以获取有关我们的扩展支持的信息。我们可以为旧数据库提供测试和支持,并将这些修复集成到 Gitea 代码库中。
|
||||
|
||||
数据库实例可以与 Gitea 实例在相同机器上(本地数据库),也可以与 Gitea 实例在不同机器上(远程数据库)。
|
||||
|
||||
注意:以下所有步骤要求您的选择的数据库引擎已安装在您的系统上。对于远程数据库设置,请在数据库实例上安装服务器应用程序,在 Gitea 服务器上安装客户端程序。客户端程序用于测试 Gitea 服务器与数据库之间的连接,而 Gitea 本身使用 Go 提供的数据库驱动程序完成相同的任务。此外,请确保服务器和客户端使用相同的引擎版本,以使某些引擎功能正常工作。出于安全原因,请使用安全密码保护 `root`(MySQL)或 `postgres`(PostgreSQL)数据库超级用户。以下步骤假设您在数据库和 Gitea 服务器上都使用 Linux。
|
||||
|
||||
## MySQL/MariaDB
|
||||
|
||||
1. 对于远程数据库设置,您需要让 MySQL 监听您的 IP 地址。编辑数据库实例上的 `/etc/mysql/my.cnf` 文件中的 `bind-address` 选项为:
|
||||
|
||||
```ini
|
||||
bind-address = 203.0.113.3
|
||||
```
|
||||
|
||||
2. 在数据库实例上,使用 `root` 用户登录到数据库控制台:
|
||||
|
||||
```
|
||||
mysql -u root -p
|
||||
```
|
||||
|
||||
按提示输入密码。
|
||||
|
||||
3. 创建一个将被 Gitea 使用的数据库用户,并使用密码进行身份验证。以下示例中使用了 `'gitea'` 作为密码。请为您的实例使用一个安全密码。
|
||||
|
||||
对于本地数据库:
|
||||
|
||||
```sql
|
||||
SET old_passwords=0;
|
||||
CREATE USER 'gitea' IDENTIFIED BY 'gitea';
|
||||
```
|
||||
|
||||
对于远程数据库:
|
||||
|
||||
```sql
|
||||
SET old_passwords=0;
|
||||
CREATE USER 'gitea'@'192.0.2.10' IDENTIFIED BY 'gitea';
|
||||
```
|
||||
|
||||
其中 `192.0.2.10` 是您的 Gitea 实例的 IP 地址。
|
||||
|
||||
根据需要替换上述用户名和密码。
|
||||
|
||||
4. 使用 UTF-8 字符集和大小写敏感的排序规则创建数据库。
|
||||
|
||||
`utf8mb4_bin` 是 MySQL/MariaDB 的通用排序规则。
|
||||
Gitea 启动后会尝试把数据库修改为更合适的字符集 (`utf8mb4_0900_as_cs` 或者 `uca1400_as_cs`) 并在可能的情况下更改数据库。
|
||||
如果你想指定自己的字符集规则,可以在 `app.ini` 中设置 `[database].CHARSET_COLLATION`。
|
||||
|
||||
```sql
|
||||
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';
|
||||
```
|
||||
|
||||
根据需要替换数据库名称。
|
||||
|
||||
5. 将数据库上的所有权限授予上述创建的数据库用户。
|
||||
|
||||
对于本地数据库:
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
对于远程数据库:
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'192.0.2.10';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
6. 通过 `exit` 退出数据库控制台。
|
||||
|
||||
7. 在您的 Gitea 服务器上,测试与数据库的连接:
|
||||
|
||||
```
|
||||
mysql -u gitea -h 203.0.113.3 -p giteadb
|
||||
```
|
||||
|
||||
其中 `gitea` 是数据库用户名,`giteadb` 是数据库名称,`203.0.113.3` 是数据库实例的 IP 地址。对于本地数据库,省略 `-h` 选项。
|
||||
|
||||
到此您应该能够连接到数据库了。
|
||||
|
||||
## PostgreSQL
|
||||
|
||||
1. 对于远程数据库设置,通过编辑数据库实例上的 postgresql.conf 文件中的 `listen_addresses` 将 `PostgreSQL` 配置为监听您的 IP 地址:
|
||||
|
||||
```ini
|
||||
listen_addresses = 'localhost, 203.0.113.3'
|
||||
```
|
||||
|
||||
2. PostgreSQL 默认使用 `md5` 质询-响应加密方案进行密码身份验证。现在这个方案不再被认为是安全的。改用 SCRAM-SHA-256 方案,通过编辑数据库服务器上的` postgresql.conf` 配置文件:
|
||||
|
||||
```ini
|
||||
password_encryption = scram-sha-256
|
||||
```
|
||||
|
||||
重启 PostgreSQL 以应用该设置。
|
||||
|
||||
3. 在数据库服务器上,以超级用户身份登录到数据库控制台:
|
||||
|
||||
```
|
||||
su -c "psql" - postgres
|
||||
```
|
||||
|
||||
4. 创建具有登录权限和密码的数据库用户(在 PostgreSQL 术语中称为角色)。请使用安全的、强密码,而不是下面的 `'gitea'`:
|
||||
|
||||
```sql
|
||||
CREATE ROLE gitea WITH LOGIN PASSWORD 'gitea';
|
||||
```
|
||||
|
||||
根据需要替换用户名和密码。
|
||||
|
||||
5. 使用 UTF-8 字符集创建数据库,并由之前创建的数据库用户拥有。可以根据预期内容使用任何 `libc` 排序规则,使用 `LC_COLLATE` 和 `LC_CTYPE` 参数指定:
|
||||
|
||||
```sql
|
||||
CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
|
||||
```
|
||||
|
||||
根据需要替换数据库名称。
|
||||
|
||||
6. 通过将以下身份验证规则添加到 `pg_hba.conf`,允许数据库用户访问上面创建的数据库。
|
||||
|
||||
对于本地数据库:
|
||||
|
||||
```ini
|
||||
local giteadb gitea scram-sha-256
|
||||
```
|
||||
|
||||
对于远程数据库:
|
||||
|
||||
```ini
|
||||
host giteadb gitea 192.0.2.10/32 scram-sha-256
|
||||
```
|
||||
|
||||
根据您自己的数据库名称、用户和 Gitea 实例的 IP 地址进行替换。
|
||||
|
||||
注意:`pg_hba.conf` 上的规则按顺序评估,也就是第一个匹配的规则将用于身份验证。您的 PostgreSQL 安装可能附带了适用于所有用户和数据库的通用身份验证规则。如果是这种情况,您可能需要将此处提供的规则放置在此类通用规则之上。
|
||||
|
||||
重启 PostgreSQL 以应用新的身份验证规则。
|
||||
|
||||
7. 在您的 Gitea 服务器上,测试与数据库的连接。
|
||||
|
||||
对于本地数据库:
|
||||
|
||||
```
|
||||
psql -U gitea -d giteadb
|
||||
```
|
||||
|
||||
对于远程数据库:
|
||||
|
||||
```
|
||||
psql "postgres://gitea@203.0.113.3/giteadb"
|
||||
```
|
||||
|
||||
其中 `gitea` 是数据库用户,`giteadb` 是数据库名称,`203.0.113.3` 是您的数据库实例的 IP 地址。
|
||||
|
||||
您应该会被提示输入数据库用户的密码,并连接到数据库。
|
||||
|
||||
## 使用 TLS 进行数据库连接
|
||||
|
||||
如果 Gitea 和您的数据库实例之间的通信是通过私有网络进行的,或者如果 Gitea 和数据库运行在同一台服务器上,那么可以省略本节,因为 Gitea 和数据库实例之间的安全性不会受到严重威胁。但是,如果数据库实例位于公共网络上,请使用 TLS 对数据库连接进行加密,以防止第三方拦截流量数据。
|
||||
|
||||
### 先决条件
|
||||
|
||||
- 您需要两个有效的 TLS 证书,一个用于数据库实例(数据库服务器),一个用于 Gitea 实例(数据库客户端)。两个证书都必须由受信任的 CA 签名。
|
||||
- 数据库证书必须在 `X509v3 Extended Key Usage` 扩展属性中包含 `TLS Web Server Authentication`,而客户端证书则需要在相应的属性中包含 `TLS Web Client Authentication`。
|
||||
- 在数据库服务器证书中,`Subject Alternative Name` 或 `Common Name` 条目之一必须是数据库实例的完全限定域名(FQDN)(例如 `db.example.com`)。在数据库客户端证书中,上述提到的条目之一必须包含 Gitea 将用于连接的数据库用户名。
|
||||
- 您需要将 Gitea 和数据库服务器的域名映射到它们各自的 IP 地址。可以为它们设置 DNS 记录,也可以在每个系统上的 `/etc/hosts`(Windows 中的 `%WINDIR%\System32\drivers\etc\hosts`)中添加本地映射。这样可以通过域名而不是 IP 地址进行数据库连接。有关详细信息,请参阅您系统的文档。
|
||||
|
||||
### PostgreSQL TLS
|
||||
|
||||
Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中,数据库客户端和服务器通过将各自的证书发送给对方进行验证来相互认证。换句话说,服务器验证客户端证书,客户端验证服务器证书。
|
||||
|
||||
1. 在数据库实例所在的服务器上,放置以下凭据:
|
||||
|
||||
- `/path/to/postgresql.crt`: 数据库实例证书
|
||||
- `/path/to/postgresql.key`: 数据库实例私钥
|
||||
- `/path/to/root.crt`: 用于验证客户端证书的 CA 证书链
|
||||
|
||||
2. 在 `postgresql.conf` 中添加以下选项:
|
||||
|
||||
```ini
|
||||
ssl = on
|
||||
ssl_ca_file = '/path/to/root.crt'
|
||||
ssl_cert_file = '/path/to/postgresql.crt'
|
||||
ssl_key_file = '/path/to/postgresql.key'
|
||||
ssl_min_protocol_version = 'TLSv1.2'
|
||||
```
|
||||
|
||||
3. 根据 PostgreSQL 的要求,调整凭据的所有权和权限:
|
||||
|
||||
```
|
||||
chown postgres:postgres /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key
|
||||
chmod 0600 /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key
|
||||
```
|
||||
|
||||
4. 编辑 `pg_hba.conf` 规则,仅允许 Gitea 数据库用户通过 SSL 连接,并要求客户端证书验证。
|
||||
|
||||
对于 PostgreSQL 12:
|
||||
|
||||
```ini
|
||||
hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=verify-full
|
||||
```
|
||||
|
||||
对于 PostgreSQL 11 及更早版本:
|
||||
|
||||
```ini
|
||||
hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=1
|
||||
```
|
||||
|
||||
根据需要替换数据库名称、用户和 Gitea 实例的 IP 地址。
|
||||
|
||||
5. 重新启动 PostgreSQL 以应用上述配置。
|
||||
|
||||
6. 在运行 Gitea 实例的服务器上,将以下凭据放置在运行 Gitea 的用户的主目录下(例如 `git`):
|
||||
|
||||
- `~/.postgresql/postgresql.crt`: 数据库客户端证书
|
||||
- `~/.postgresql/postgresql.key`: 数据库客户端私钥
|
||||
- `~/.postgresql/root.crt`: 用于验证服务器证书的 CA 证书链
|
||||
|
||||
注意:上述文件名在 PostgreSQL 中是硬编码的,无法更改。
|
||||
|
||||
7. 根据需要调整凭据、所有权和权限:
|
||||
|
||||
```
|
||||
chown git:git ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt
|
||||
chown 0600 ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt
|
||||
```
|
||||
|
||||
8. 测试与数据库的连接:
|
||||
|
||||
```
|
||||
psql "postgres://gitea@example.db/giteadb?sslmode=verify-full"
|
||||
```
|
||||
|
||||
您将被提示输入数据库用户的密码,然后连接到数据库。
|
||||
|
||||
### MySQL/MariaDB TLS
|
||||
|
||||
虽然 Gitea 使用的 MySQL 驱动程序也支持双向 TLS,但目前 Gitea 仅支持单向 TLS。有关详细信息,请参见工单#10828。
|
||||
|
||||
在单向 TLS 中,数据库客户端在连接握手期间验证服务器发送的证书,而服务器则假定连接的客户端是合法的,因为不进行客户端证书验证。
|
||||
|
||||
1. 在数据库实例上放置以下凭据:
|
||||
|
||||
- `/path/to/mysql.crt`: 数据库实例证书
|
||||
- `/path/to/mysql.key`: 数据库实例密钥
|
||||
- `/path/to/ca.crt`: CA 证书链。在单向 TLS 中不使用此文件,但用于验证双向 TLS 中的客户端证书。
|
||||
|
||||
2. 将以下选项添加到 `my.cnf`:
|
||||
|
||||
```ini
|
||||
[mysqld]
|
||||
ssl-ca = /path/to/ca.crt
|
||||
ssl-cert = /path/to/mysql.crt
|
||||
ssl-key = /path/to/mysql.key
|
||||
tls-version = TLSv1.2,TLSv1.3
|
||||
```
|
||||
|
||||
3. 调整凭据的所有权和权限:
|
||||
|
||||
```
|
||||
chown mysql:mysql /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key
|
||||
chmod 0600 /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key
|
||||
```
|
||||
|
||||
4. 重新启动 MySQL 以应用设置。
|
||||
|
||||
5. Gitea 的数据库用户可能已经创建过,但只会对运行 Gitea 的服务器的 IP 地址进行身份验证。要对其域名进行身份验证,请重新创建用户,并设置其需要通过 TLS 连接到数据库:
|
||||
|
||||
```sql
|
||||
DROP USER 'gitea'@'192.0.2.10';
|
||||
CREATE USER 'gitea'@'example.gitea' IDENTIFIED BY 'gitea' REQUIRE SSL;
|
||||
GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'example.gitea';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
根据需要替换数据库用户名、密码和 Gitea 实例域名。
|
||||
|
||||
6. 确保用于验证数据库服务器证书的 CA 证书链位于数据库和 Gitea 服务器的系统证书存储中。请参考系统文档中有关将 CA 证书添加到证书存储的说明。
|
||||
|
||||
7. 在运行 Gitea 的服务器上,测试与数据库的连接:
|
||||
|
||||
```
|
||||
mysql -u gitea -h example.db -p --ssl
|
||||
```
|
||||
|
||||
至此应该成功连接到数据库了。
|
205
docs/document/installation/from-binary.md
Normal file
@@ -0,0 +1,205 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
slug: "install-from-binary"
|
||||
sidebar_position: 15
|
||||
aliases:
|
||||
- /zh-cn/install-from-binary
|
||||
---
|
||||
|
||||
# 使用二进制文件安装
|
||||
|
||||
所有打包的二进制程序均包含 SQLite,MySQL 和 PostgreSQL 的数据库连接支持,同时网站的静态资源均已嵌入到可执行程序中,这一点和曾经的 Gogs 有所不同。
|
||||
|
||||
## 下载
|
||||
|
||||
你可以从 [下载页面](https://dl.gitea.com/gitea/) 选择对应平台的二进制文件。
|
||||
|
||||
### 选择架构
|
||||
|
||||
- **对于 Linux**,`linux-amd64` 适用于 64-bit 的 Intel/AMD 平台。更多架构包含 `arm64` (Raspberry PI 4),`386` (32-bit),`arm-5` 以及 `arm-6`。
|
||||
|
||||
- **对于 Windows**,`windows-4.0-amd64` 适用于 64-bit 的 Intel/AMD 平台,`386` 适用于 32-bit 的 Intel/AMD 平台。(提示:`gogit-windows` 版本内建了 gogit 可能缓解在旧的 Windows 平台上 Go 程序调用 git 子程序时面临的 [性能问题](https://github.com/go-gitea/gitea/pull/15482))
|
||||
|
||||
- **对于 macOS**,`darwin-arm64` 适用于 Apple Silicon 架构,`darwin-amd64` 适用于 Intel 架构.
|
||||
|
||||
- **对于 FreeBSD**,`freebsd12-amd64` 适用于 64-bit 的 Intel/AMD 平台。
|
||||
|
||||
### 使用 wget 下载
|
||||
|
||||
使用以下命令下载适用于 64-bit Linux 平台的二进制文件。
|
||||
|
||||
```sh
|
||||
wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64
|
||||
chmod +x gitea
|
||||
```
|
||||
|
||||
## 验证 GPG 签名
|
||||
|
||||
Gitea 对打包的二进制文件使用 [GPG 密钥](https://keys.openpgp.org/search?q=teabot%40gitea.io) 签名以防止篡改。
|
||||
请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。
|
||||
|
||||
```sh
|
||||
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
|
||||
gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64
|
||||
```
|
||||
|
||||
校验正确时的信息为 `Good signature from "Teabot <teabot@gitea.io>"`。
|
||||
校验错误时的信息为 `This key is not certified with a trusted signature!`。
|
||||
|
||||
## 服务器设置
|
||||
|
||||
**提示:** `GITEA_WORK_DIR` 表示 Gitea 工作的路径。以下路径可以通过 [环境变量](../administration/environment-variables.md) 初始化。
|
||||
|
||||
### 准备环境
|
||||
|
||||
检查是否安装 Git。要求 Git 版本 >= 2.0。
|
||||
|
||||
```sh
|
||||
git --version
|
||||
```
|
||||
|
||||
创建用户(推荐使用名称 `git`)
|
||||
|
||||
```sh
|
||||
# On Ubuntu/Debian:
|
||||
adduser \
|
||||
--system \
|
||||
--shell /bin/bash \
|
||||
--gecos 'Git Version Control' \
|
||||
--group \
|
||||
--disabled-password \
|
||||
--home /home/git \
|
||||
git
|
||||
|
||||
# On Fedora/RHEL/CentOS:
|
||||
groupadd --system git
|
||||
adduser \
|
||||
--system \
|
||||
--shell /bin/bash \
|
||||
--comment 'Git Version Control' \
|
||||
--gid git \
|
||||
--home-dir /home/git \
|
||||
--create-home \
|
||||
git
|
||||
```
|
||||
|
||||
### 创建工作路径
|
||||
|
||||
```sh
|
||||
mkdir -p /var/lib/gitea/{custom,data,log}
|
||||
chown -R git:git /var/lib/gitea/
|
||||
chmod -R 750 /var/lib/gitea/
|
||||
mkdir /etc/gitea
|
||||
chown root:git /etc/gitea
|
||||
chmod 770 /etc/gitea
|
||||
```
|
||||
|
||||
> **注意:** 为了让 Web 安装程序可以写入配置文件,我们临时为 `/etc/gitea` 路径授予了组外用户 `git` 写入权限。建议在安装结束后将配置文件的权限设置为只读。
|
||||
>
|
||||
> ```sh
|
||||
> chmod 750 /etc/gitea
|
||||
> chmod 640 /etc/gitea/app.ini
|
||||
> ```
|
||||
|
||||
如果您不希望通过 Web 安装程序创建配置文件,可以将配置文件设置为仅供 Gitea 用户只读(owner/group `root:git`, mode `0640`)并手工创建配置文件:
|
||||
|
||||
- 设置 `INSTALL_LOCK=true` 关闭安装界面
|
||||
- 手动配置数据库连接参数
|
||||
- 使用 `gitea generate secret` 创建 `SECRET_KEY` 和 `INTERNAL_TOKEN`
|
||||
- 提供所有必要的密钥
|
||||
|
||||
详情参考 [命令行文档](../administration/command-line.md) 中有关 `gitea generate secret` 的内容。
|
||||
|
||||
### 配置 Gitea 工作路径
|
||||
|
||||
**提示:** 如果使用 Systemd 管理 Gitea 的 Linux 服务,你可以采用 `WorkingDirectory` 参数来配置工作路径。 否则,使用环境变量 `GITEA_WORK_DIR` 来明确指出程序工作和数据存放路径。
|
||||
|
||||
```sh
|
||||
export GITEA_WORK_DIR=/var/lib/gitea/
|
||||
```
|
||||
|
||||
### 复制二进制文件到全局位置
|
||||
|
||||
```sh
|
||||
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:
|
||||
|
||||
### 1. 创建服务自动启动 Gitea(推荐)
|
||||
|
||||
学习创建 [Linux 服务](installation/run-as-service-in-ubuntu.md)
|
||||
|
||||
### 2. 通过命令行终端运行
|
||||
|
||||
```sh
|
||||
GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini
|
||||
```
|
||||
|
||||
## 升级到最新版本
|
||||
|
||||
您可以通过停止程序,替换 `/usr/local/bin/gitea` 并重启来更新到新版本。直接替换可执行程序时不要更改或使用新的文件名称,以避免数据出错。
|
||||
|
||||
建议您在更新之前进行[备份](../administration/backup-and-restore.md)。
|
||||
|
||||
如果您按照上述描述执行了安装步骤,二进制文件的通用名称应为 gitea。请勿更改此名称,即不要包含版本号。
|
||||
|
||||
### 1. 使用 systemd 重新启动 Gitea(推荐)
|
||||
|
||||
我们建议使用 systemd 作为服务管理器,使用 `systemctl restart gitea` 安全地重启程序。
|
||||
|
||||
### 2. 非 systemd 重启方法
|
||||
|
||||
使用 SIGHUP 信号关闭程序:查询到 Gitea 程序的 PID,使用 `kill -1 $GITEA_PID`,或者 `killall -1 gitea`。
|
||||
|
||||
更优雅的停止指令可能包括 `kill $GITEA_PID` 或者 `killall gitea`。
|
||||
|
||||
**提示:** 我们不建议使用 SIGKILL 信号(`-9`),这会强制停止 Gitea 程序,但不会正确关闭队列、索引器等任务。
|
||||
|
||||
请参阅下面的疑难解答说明,以在 Gitea 版本更新后修复损坏的仓库。
|
||||
|
||||
## 排查故障
|
||||
|
||||
### 旧版 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](https://docs.gitea.com/installation/install-from-binary#troubleshooting)
|
||||
|
||||
如果从本页中没有找到你需要的内容,请访问 [帮助页面](help/support.md)
|
104
docs/document/installation/from-package.md
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
slug: "install-from-package"
|
||||
sidebar_position: 20
|
||||
aliases:
|
||||
- /zh-cn/install-from-package
|
||||
---
|
||||
|
||||
# 包管理器安装
|
||||
|
||||
## 官方包管理器
|
||||
|
||||
### macOS
|
||||
|
||||
macOS 平台下当前我们仅支持通过 `brew` 来安装。如果你没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装](installation/from-binary.md)。在你安装了 `brew` 之后, 你可以执行以下命令:
|
||||
|
||||
```
|
||||
brew install gitea
|
||||
```
|
||||
|
||||
## 非官方包管理器
|
||||
|
||||
### Alpine Linux
|
||||
|
||||
Gitea 已经包含在 Alpine Linux 的[社区存储库](https://pkgs.alpinelinux.org/packages?name=gitea&branch=edge)中,版本与 Gitea 官方保持同步。
|
||||
|
||||
```sh
|
||||
apk add gitea
|
||||
```
|
||||
|
||||
### Arch Linux
|
||||
|
||||
Gitea 已经在滚动发布发行版的官方[社区存储库](https://www.archlinux.org/packages/community/x86_64/gitea/)中,版本与 Gitea 官方保持同步。
|
||||
|
||||
```sh
|
||||
pacman -S gitea
|
||||
```
|
||||
|
||||
### Arch Linux ARM
|
||||
|
||||
官方支持 [aarch64](https://archlinuxarm.org/packages/aarch64/gitea), [armv7h](https://archlinuxarm.org/packages/armv7h/gitea) 和 [armv6h](https://archlinuxarm.org/packages/armv6h/gitea) 架构。
|
||||
|
||||
```sh
|
||||
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)。
|
||||
|
||||
```sh
|
||||
snap install gitea
|
||||
```
|
||||
|
||||
### SUSE/openSUSE
|
||||
|
||||
OpenSUSE 构建服务为 [openSUSE 和 SLE](https://software.opensuse.org/download/package?package=gitea&project=devel%3Atools%3Ascm)
|
||||
提供包,你可以在开发软件配置管理存储库中找到它们。
|
||||
|
||||
### Windows
|
||||
|
||||
目前你可以通过 [Chocolatey](https://chocolatey.org/) 来安装 [Gitea](https://chocolatey.org/packages/gitea)。
|
||||
|
||||
```sh
|
||||
choco install gitea
|
||||
```
|
||||
|
||||
你也可以 [从二进制安装](installation/from-binary.md) 。
|
||||
|
||||
### FreeBSD
|
||||
|
||||
可以使用 Gitea 的 FreeBSD port `www/gitea`。 请安装预构建的二进制包:
|
||||
|
||||
```
|
||||
pkg install gitea
|
||||
```
|
||||
|
||||
对于最新版本,或使用自定义选项构建 port,请
|
||||
[从 port 安装](https://www.freebsd.org/doc/handbook/ports-using.html):
|
||||
|
||||
```
|
||||
su -
|
||||
cd /usr/ports/www/gitea
|
||||
make install clean
|
||||
```
|
||||
|
||||
该 port 使用标准的 FreeBSD 文件系统布局:配置文件在 `/usr/local/etc/gitea` 目录中,
|
||||
模板、选项、插件和主题在 `/usr/local/share/gitea` 目录中,启动脚本在 `/usr/local/etc/rc.d/gitea` 目录中。
|
||||
|
||||
要使 Gitea 作为服务运行,请运行 `sysrc gitea_enable=YES` 并使用 `service gitea start` 命令启动它。
|
||||
|
||||
### 其它
|
||||
|
||||
如果这里没有找到你喜欢的包管理器,可以使用 Gitea 第三方软件包。这里有一个完整的列表: [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/branch/master/README.md#user-content-packages)。
|
||||
|
||||
如果你知道其他 Gitea 第三方软件包,请发送 PR 来添加它。
|
218
docs/document/installation/from-source.md
Normal file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
slug: "install-from-source"
|
||||
sidebar_position: 30
|
||||
aliases:
|
||||
- /zh-cn/install-from-source
|
||||
---
|
||||
|
||||
# 使用源代码安装
|
||||
|
||||
你需要 [安装 Go](https://golang.google.cn/doc/install) 并正确设置 Go 环境。特别的,建议设置`$GOPATH`环境变量,并将 Go 的二进制目录或目录`${GOPATH//://bin:}/bin`添加到`$PATH`中。请参阅 Go 百科上关于 [GOPATH](https://github.com/golang/go/wiki/GOPATH) 的词条。
|
||||
|
||||
接下来,[安装 Node.js 和 npm](https://nodejs.org/zh-cn/download/), 这是构建 JavaScript 和 CSS 文件所需的。最低支持的 Node.js 版本是 @minNodeVersion@,建议使用最新的 LTS 版本。
|
||||
|
||||
**注意**:需要 Go 版本 @minGoVersion@ 或更高版本。不过,建议获取与我们的持续集成(continuous integration, CI)相同的版本,请参阅在 [Hacking on Gitea](development/hacking-on-gitea.md) 中给出的建议。
|
||||
|
||||
## 下载
|
||||
|
||||
首先,我们需要获取源码。由于引入了 Go 模块,最简单的方法是直接使用 Git,因为我们不再需要在 GOPATH 内构建 Gitea。
|
||||
|
||||
```bash
|
||||
git clone https://github.com/go-gitea/gitea
|
||||
```
|
||||
|
||||
(之前的版本中建议使用 `go get`,但现在不再需要。)
|
||||
|
||||
你可以选择编译和安装的版本,当前有多个选择。`main` 分支代表当前的开发版本。如果你想编译 `main` 版本,你可以直接跳到 [构建](#构建) 部分。
|
||||
|
||||
如果你想编译带有标签的发行版本,可以使用以下命令签出:
|
||||
|
||||
```bash
|
||||
git branch -a
|
||||
git checkout @sourceBranch@
|
||||
```
|
||||
|
||||
要验证一个拉取请求(Pull Request, PR),要先启用新的分支(其中 `xyz` 是 PR 的 ID;例如,对于 [#2663](https://github.com/go-gitea/gitea/pull/2663),ID 是 `2663 `):
|
||||
|
||||
```bash
|
||||
git fetch origin pull/xyz/head:pr-xyz
|
||||
```
|
||||
|
||||
要以指定发行版本(如 @sourceVersion@ )的源代码来构建 Gitea,可执行以下命令列出可用的版本并选择某个版本签出。
|
||||
使用以下命令列出可用的版本:
|
||||
|
||||
```bash
|
||||
git tag -l
|
||||
git checkout @sourceVersion@ # or git checkout pr-xyz
|
||||
```
|
||||
|
||||
## 构建
|
||||
|
||||
要从源代码进行构建,系统必须预先安装以下程序:
|
||||
|
||||
- `go` @minGoVersion@ 或更高版本,请参阅 [这里](https://go.dev/dl/)
|
||||
- `node` @minNodeVersion@ 或更高版本,并且安装 `npm`, 请参阅 [这里](https://nodejs.org/zh-cn/download/)
|
||||
- `make`, 请参阅 [这里](development/hacking-on-gitea.md)
|
||||
|
||||
为了尽可能简化编译过程,提供了各种 [make 任务](https://github.com/go-gitea/gitea/blob/main/Makefile)。
|
||||
|
||||
根据你的构建需求,以下 tags 可以使用:
|
||||
|
||||
- `bindata`: 构建一个单一的整体二进制文件,包含所有资源。适用于构建生产环境版本。
|
||||
- `sqlite sqlite_unlock_notify`: 启用对 [SQLite3](https://sqlite.org/) 数据库的支持。仅建议在少数人使用时使用这个模式。
|
||||
- `pam`: 启用对 PAM( Linux 可插拔认证模块)的支持。可用于对本地用户进行身份验证或扩展身份验证到 PAM 可用的方法。
|
||||
- `gogit`:(实验性功能)使用 go-git 变体的 Git 命令。
|
||||
|
||||
将所有资源(JS/CSS/模板等)打包到二进制文件中。在生产环境部署时,使用`bindata`构建标签是必需的。在开发/测试 Gitea 或能够明确分离资源时,可以不用`bindata`。
|
||||
|
||||
要包含所有资源,请使用 `bindata` 标签:
|
||||
|
||||
```bash
|
||||
TAGS="bindata" make build
|
||||
```
|
||||
|
||||
在我们的持续集成系统的默认发行版中,构建标签为:`TAGS="bindata sqlite sqlite_unlock_notify"`。因此,从源码构建的最简单、推荐方式是:
|
||||
|
||||
```bash
|
||||
TAGS="bindata sqlite sqlite_unlock_notify" make build
|
||||
```
|
||||
|
||||
`build`目标分为两个子目标:
|
||||
|
||||
- `make backend` 需要 [Go @minGoVersion@](https://golang.google.cn/doc/install) 或更高版本。
|
||||
- `make frontend` 需要 [Node.js @minNodeVersion@](https://nodejs.org/zh-cn/download/) 或更高版本。
|
||||
|
||||
如果存在预构建的前端文件,可以仅构建后端:
|
||||
|
||||
```bash
|
||||
TAGS="bindata" make backend
|
||||
```
|
||||
|
||||
## 测试
|
||||
|
||||
按照上述步骤完成后,工作目录中将会有一个`gitea`二进制文件。可以从该目录进行测试,或将其移动到带有测试数据的目录中。当手动从命令行启动 Gitea 时,可以通过按下`Ctrl + C`来停止程序。
|
||||
|
||||
```bash
|
||||
./gitea web
|
||||
```
|
||||
|
||||
## 更改默认路径
|
||||
|
||||
Gitea 将从`CustomPath`中查找许多信息。默认的,这会在运行 Gitea 时当前工作目录下的`custom/`目录中(译者案:即`$PATH_TO_YOUR_GITEA$/custom/`)。它还将在`$(CustomPath)/conf/app.ini`中查找其配置文件`CustomConf`,并将当前工作目录用作一些可配置值的相对基本路径`AppWorkPath`。最后,静态文件将从默认为 `AppWorkPath`的`StaticRootPath`提供。
|
||||
|
||||
尽管在开发时这些值很有用,但可能与下游用户的偏好冲突。
|
||||
|
||||
一种选择是使用脚本文件来隐藏`gitea`二进制文件,并在运行 Gitea 之前创建适当的环境。然而,在构建时,可以使用`make`的`LDFLAGS`环境变量来更改这些默认值。适当的设置如下:
|
||||
|
||||
- 要设置`CustomPath`,请使用`LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""`
|
||||
- 对于`CustomConf`,应该使用`-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
|
||||
- 对于`AppWorkPath`,应该使用`-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
|
||||
- 对于`StaticRootPath`,应该使用`-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"`
|
||||
- 要更改默认的 PID 文件位置,请使用`-X \"code.gitea.io/gitea/cmd.PIDFile=/run/gitea.pid\"`
|
||||
|
||||
将这些字符串与其前导的`-X`添加到`LDFLAGS`变量中,并像上面那样使用适当的`TAGS`运行`make build`。
|
||||
|
||||
运行`gitea help`将允许您查看配置的`gitea`设置。
|
||||
|
||||
## 交叉编译
|
||||
|
||||
`go`编译器工具链支持将代码交叉编译到不同的目标架构上。请参考[`GOOS`和`GOARCH`环境变量](https://go.dev/doc/install/source#environment) 以获取支持的目标列表。如果您想为性能较弱的系统(如树莓派)构建 Gitea,交叉编译非常有用。
|
||||
|
||||
要使用构建标签(`TAGS`)进行交叉编译 Gitea,您还需要一个 C 交叉编译器,该编译器的目标架构与`GOOS`和`GOARCH`变量选择的架构相同。例如,要为 Linux ARM64(`GOOS=linux`和`GOARCH=arm64`)进行交叉编译,您需要`aarch64-unknown-linux-gnu-gcc`交叉编译器。这是因为 Gitea 构建标签使用了`cgo`的外部函数接口(FFI)。
|
||||
|
||||
在没有任何标签的情况下,交叉编译的 Gitea 为 Linux ARM64 版本:
|
||||
|
||||
```
|
||||
GOOS=linux GOARCH=arm64 make build
|
||||
```
|
||||
|
||||
要交叉编译 Linux ARM64 下的 Gitea,这是推荐的构建标签:
|
||||
|
||||
```
|
||||
CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sqlite_unlock_notify" make build
|
||||
```
|
||||
|
||||
根据您的目标架构,适当替换`CC`、`GOOS`和`GOARCH`。
|
||||
|
||||
有时您需要构建一个静态编译的镜像。为此,您需要添加以下内容:
|
||||
|
||||
```
|
||||
LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="netgo osusergo $TAGS" make build
|
||||
```
|
||||
|
||||
这可以与上述的`CC`、`GOOS`和`GOARCH`结合使用。
|
||||
|
||||
### 添加 bash/zsh 自动补全(从 1.19 版本起)
|
||||
|
||||
在[`contrib/autocompletion/bash_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete)中可以找到一个启用 bash 自动补全的脚本。您可以根据需要进行修改,并在您的 `.bashrc` 中使用 `source` 命令加载该脚本,或者将其复制到 `/usr/share/bash-completion/completions/gitea`。
|
||||
|
||||
类似地,可以在[`contrib/autocompletion/zsh_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/zsh_autocomplete)中找到一个用于 zsh 自动补全的脚本。您可以将其复制到 `/usr/share/zsh/_gitea`,或者在您的 `.zshrc` 中使用 `source` 命令加载该脚本。
|
||||
|
||||
可能需要你根据具体情况进一步改进这些脚本。
|
||||
|
||||
## 在 Linux 上使用 Zig 进行编译或交叉编译
|
||||
|
||||
请按照 [Zig 的入门指南](https://ziglang.org/learn/getting-started/#installing-zig) 安装 Zig。
|
||||
|
||||
- 编译 (Linux ➝ Linux)
|
||||
|
||||
```sh
|
||||
CC="zig cc -target x86_64-linux-gnu" \
|
||||
CGO_ENABLED=1 \
|
||||
CGO_CFLAGS="-O2 -g -pthread" \
|
||||
CGO_LDFLAGS="-linkmode=external -v"
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
TAGS="bindata sqlite sqlite_unlock_notify" \
|
||||
make build
|
||||
```
|
||||
|
||||
- 交叉编译 (Linux ➝ Windows)
|
||||
|
||||
```sh
|
||||
CC="zig cc -target x86_64-windows-gnu" \
|
||||
CGO_ENABLED=1 \
|
||||
CGO_CFLAGS="-O2 -g -pthread" \
|
||||
GOOS=windows \
|
||||
GOARCH=amd64 \
|
||||
TAGS="bindata sqlite sqlite_unlock_notify" \
|
||||
make build
|
||||
```
|
||||
|
||||
## 在 Windows 上使用 Zig 进行编译或交叉编译
|
||||
|
||||
使用`GIT BASH`编译。
|
||||
|
||||
- 编译 (Windows ➝ Windows)
|
||||
|
||||
```sh
|
||||
CC="zig cc -target x86_64-windows-gnu" \
|
||||
CGO_ENABLED=1 \
|
||||
CGO_CFLAGS="-O2 -g -pthread" \
|
||||
GOOS=windows \
|
||||
GOARCH=amd64 \
|
||||
TAGS="bindata sqlite sqlite_unlock_notify" \
|
||||
make build
|
||||
```
|
||||
|
||||
- 交叉编译 (Windows ➝ Linux)
|
||||
|
||||
```sh
|
||||
CC="zig cc -target x86_64-linux-gnu" \
|
||||
CGO_ENABLED=1 \
|
||||
CGO_CFLAGS="-O2 -g -pthread" \
|
||||
CGO_LDFLAGS="-linkmode=external -v"
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
TAGS="bindata sqlite sqlite_unlock_notify" \
|
||||
make build
|
||||
```
|
||||
|
||||
## Source Map
|
||||
|
||||
默认情况下,gitea 会为前端文件生成精简的 Source Map 以节省空间。 这可以通过“ENABLE_SOURCEMAP”环境变量进行控制:
|
||||
|
||||
- `ENABLE_SOURCEMAP=true` 生成所有 Source Map,这是开发版本的默认设置
|
||||
- `ENABLE_SOURCEMAP=reduced` 生成有限的 Source Map,这是生产版本的默认设置
|
||||
- `ENABLE_SOURCEMAP=false` 不生成 Source Map
|
42
docs/document/installation/on-cloud-provider.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
slug: "install-on-cloud-provider"
|
||||
sidebar_position: 90
|
||||
aliases:
|
||||
- /zh-cn/install-on-cloud-provider
|
||||
---
|
||||
|
||||
# 在云服务器上安装 Gitea
|
||||
|
||||
## Cloudron
|
||||
|
||||
Gitea 可以在 [Cloudron](https://cloudron.io) 上进行一键安装。
|
||||
Cloudron 使得在您的服务器上运行 Gitea,并保持其更新和安全变得简单。
|
||||
|
||||
[](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
|
||||
|
||||
Gitea 软件包的维护地址在[这里](https://git.cloudron.io/cloudron/gitea-app).
|
||||
|
||||
这里有一个[demo 实例](https://my.demo.cloudron.io) (用户名: cloudron 密码: cloudron) 您可以在其中尝试运行 Gitea。
|
||||
|
||||
## Linode
|
||||
|
||||
[Linode](https://www.linode.com/) 将 Gitea 作为其市场中的一个应用程序.
|
||||
|
||||
要将 Gitea 部署到 Linode, 请参考 [Linode Marketplace](https://www.linode.com/marketplace/apps/linode/gitea/).
|
||||
|
||||
## alwaysdata
|
||||
|
||||
[alwaysdata](https://www.alwaysdata.com/) 将 Gitea 作为其市场中的一个 droplet.
|
||||
|
||||
要将 Gitea 部署到 alwaysdata, 请参考 [alwaysdata Marketplace](https://www.alwaysdata.com/en/marketplace/gitea/).
|
||||
|
||||
## Exoscale
|
||||
|
||||
[Exoscale](https://www.exoscale.com/) 在其市场中提供由 [Glasskube](https://glasskube.eu/) 管理的 Gitea。
|
||||
|
||||
Exoscale 是一家欧洲的云服务提供商。
|
||||
|
||||
该软件包通过开源的 [Glasskube Kubernetes Operator](https://github.com/glasskube/operator) 进行维护和更新。
|
||||
|
||||
要在 Exoscale 上部署 Gitea,请参考 [Exoscale Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/)。
|
74
docs/document/installation/on-kubernetes.md
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
date: "2020-03-19T19:27:00+02:00"
|
||||
slug: "install-on-kubernetes"
|
||||
sidebar_position: 80
|
||||
aliases:
|
||||
- /zh-cn/install-on-kubernetes
|
||||
---
|
||||
|
||||
# 在 Kubernetes 中安装 Gitea
|
||||
|
||||
Gitea 已经提供了便于在 Kubernetes 云原生环境中安装所需的 Helm Chart
|
||||
|
||||
默认安装指令为:
|
||||
|
||||
```bash
|
||||
helm repo add gitea https://dl.gitea.com/charts
|
||||
helm repo update
|
||||
helm install gitea gitea/gitea
|
||||
```
|
||||
|
||||
如果采用默认安装指令,Helm 会部署单实例的 Gitea, PostgreSQL, Memcached。若您想实现自定义安装(包括配置 Gitea 集群、NGINX Ingress、MySQL、MariaDB、持久存储等),请前往阅读:[Gitea Helm Chart](https://gitea.com/gitea/helm-chart/)
|
||||
|
||||
您也可以通过 `helm show` 命令导出 `README.md` 和配置文件 `values.yaml` 进行学习和编辑,例如:
|
||||
|
||||
```bash
|
||||
helm show values gitea/gitea > values.yaml
|
||||
helm show readme gitea/gitea > README.md
|
||||
|
||||
# 使用自定义的配置文件 values.yaml
|
||||
helm install gitea -f values.yaml gitea/gitea
|
||||
```
|
||||
|
||||
## 运行状况检查接口
|
||||
|
||||
Gitea 附带了一个运行状况检查接口 `/api/healthz`,你可以像这样在 Kubernetes 中配置它:
|
||||
|
||||
```yaml
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/healthz
|
||||
port: http
|
||||
initialDelaySeconds: 200
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 10
|
||||
```
|
||||
|
||||
成功的运行状况检查响应代码为 HTTP `200`,下面是示例:
|
||||
|
||||
```json
|
||||
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 文档 [配置存活、就绪和启动探测器](https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
63
docs/document/installation/run-as-service-in-ubuntu.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
date: "2017-07-21T12:00:00+02:00"
|
||||
slug: "linux-service"
|
||||
sidebar_position: 40
|
||||
aliases:
|
||||
- /zh-cn/linux-service
|
||||
---
|
||||
|
||||
# 在 Linux 中以 service 方式运行
|
||||
|
||||
## 在 Ubuntu 16.04 LTS 中以 service 方式运行
|
||||
|
||||
### systemd 方式
|
||||
|
||||
在 terminal 中执行以下命令:
|
||||
|
||||
```
|
||||
sudo vim /etc/systemd/system/gitea.service
|
||||
```
|
||||
|
||||
接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。
|
||||
|
||||
修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||
|
||||
激活 gitea 并将它作为系统自启动服务:
|
||||
|
||||
```
|
||||
sudo systemctl enable gitea
|
||||
sudo systemctl start gitea
|
||||
```
|
||||
|
||||
### 使用 supervisor
|
||||
|
||||
在 terminal 中执行以下命令安装 supervisor:
|
||||
|
||||
```
|
||||
sudo apt install supervisor
|
||||
```
|
||||
|
||||
为 supervisor 配置日志路径:
|
||||
|
||||
```
|
||||
# assuming gitea is installed in /home/git/gitea/
|
||||
mkdir /home/git/gitea/log/supervisor
|
||||
```
|
||||
|
||||
在文件编辑器中打开 supervisor 的配置文件:
|
||||
|
||||
```
|
||||
sudo vim /etc/supervisor/supervisord.conf
|
||||
```
|
||||
|
||||
增加如下示例配置
|
||||
[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。
|
||||
|
||||
将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。
|
||||
|
||||
最后激活 supervisor 并将它作为系统自启动服务:
|
||||
|
||||
```
|
||||
sudo systemctl enable supervisor
|
||||
sudo systemctl start supervisor
|
||||
```
|
86
docs/document/installation/upgrade-from-gitea.md
Normal file
@@ -0,0 +1,86 @@
|
||||
---
|
||||
date: "2021-09-02T16:00:00+08:00"
|
||||
slug: "upgrade-from-gitea"
|
||||
sidebar_position: 100
|
||||
---
|
||||
|
||||
# 从旧版 Gitea 升级
|
||||
|
||||
在升级之前,您需要做如下的准备工作。
|
||||
|
||||
## 为重大变更检查更新日志
|
||||
|
||||
为了让 Gitea 变得更好,进行重大变更是不可避免的,尤其是一些里程碑更新的发布。
|
||||
在更新前,请 [在 Gitea 博客上阅读更新日志](https://blog.gitea.com/)
|
||||
并检查重大变更是否会影响你的 Gitea 实例。
|
||||
|
||||
## 在控制面板中检查过期的配置项
|
||||
|
||||
一些配置项可能会在后续版本中过期,你需要在控制面板中检查他们。如果不解决过期的配置项,
|
||||
Gitea也许会在升级后无法重启。你可以访问 https://docs.gitea.com 获得要升级的版本
|
||||
对应的文档来修改你的配置文件。
|
||||
|
||||
## 降级前的备份
|
||||
|
||||
Gitea 会保留首二位版本号相同的版本的兼容性 (`a.b.x` -> `a.b.y`),
|
||||
这些版本拥有相同的数据库结构,可以自由升级或降级。
|
||||
其他情况 (`a.b.?` -> `a.c.?`)下,
|
||||
新版 Gitea 可能将会将数据库升级到与旧版数据库不同的结构。
|
||||
|
||||
举个例子:
|
||||
|
||||
| 当前 | 目标 | 结果 |
|
||||
| --- | --- | --- |
|
||||
| 1.4.0 | 1.4.1 | ✅ |
|
||||
| 1.4.1 | 1.4.0 | ⚠️ 不建议,后果自负!尽管数据库结构可能不会变更,让它可以正常工作。我们强烈建议降级前进行完全的备份。 |
|
||||
| 1.4.x | 1.5.y | ✅ 数据库会被自动升级。你可以直接从 1.4.x 升级到最新的 1.5.y。 |
|
||||
| 1.5.y | 1.4.x | ❌ 数据库已被升级且无法用于旧版本Gitea,使用备份来进行降级。 |
|
||||
|
||||
**因为你不能基于升级后的数据库运行旧版 Gitea,所以你应该在数据库升级前完成数据备份。**
|
||||
|
||||
如果你在生产环境下使用 Gitea,你应该在升级前做好备份,哪怕只是小版本的补丁更新。
|
||||
|
||||
备份步骤:
|
||||
|
||||
* 停止 Gitea 实例
|
||||
* 备份数据库
|
||||
* 备份 Gitea 配置文件
|
||||
* 备份 Gitea 在 `APP_DATA_PATH` 中的数据文件
|
||||
* 备份 Gitea 的外部存储 (例如: S3/MinIO 或被使用的其他存储)
|
||||
|
||||
如果你在使用云服务或拥有快照功能的文件系统,
|
||||
最好对 Gitea 的数据盘及相关资料存储进行一次快照。
|
||||
|
||||
在所有上述步骤准备妥当之后,要升级 Gitea,只需要下载新版,停止运行旧版,进行数据备份,然后运行新版就好。
|
||||
每次 Gitea 实例启动时,它都会检查是否要进行数据库迁移。
|
||||
如果需要进行数据库迁移,Gitea 会花一些时间完成升级然后继续服务。
|
||||
|
||||
## 从 Docker 升级
|
||||
|
||||
* `docker pull` 拉取 Gitea 的最新发布版。
|
||||
* 停止运行中的实例,备份数据。
|
||||
* 使用 `docker` 或 `docker-compose` 启动较新的 Gitea Docker 容器.
|
||||
|
||||
## 从包升级
|
||||
|
||||
* 停止运行中的实例,备份数据。
|
||||
* 使用你的包管理器更新 Gitea 到最新版本。
|
||||
* 启动 Gitea 实例。
|
||||
|
||||
## 从二进制升级
|
||||
|
||||
* 下载最新的 Gitea 二进制文件到临时文件夹中。
|
||||
* 停止运行中的实例,备份数据。
|
||||
* 将旧的 Gitea 二进制文件覆盖成新的。
|
||||
* 启动 Gitea 实例。
|
||||
|
||||
在 Linux 系统上自动执行以上步骤的脚本可在 [Gitea 的 source tree 中找到 `contrib/upgrade.sh` 来获取](https://github.com/go-gitea/gitea/blob/main/contrib/upgrade.sh).
|
||||
|
||||
## 小心你的自定义模板
|
||||
|
||||
Gitea 的模板结构与变量可能会随着各个版本的发布发生变化,如果你使用了自定义模板,
|
||||
你得注意你的模板与你使用的 Gitea 版本的兼容性。
|
||||
|
||||
如果自定义模板与 Gitea 版本不兼容,你可能会遇到:
|
||||
`50x` 服务器错误,页面元素丢失或故障,莫名其妙的页面布局,等等…
|
||||
移除或更新不兼容的模板,Gitea Web 才可以正常工作。
|
69
docs/document/installation/windows-service.md
Normal file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
date: "2016-12-21T15:00:00-02:00"
|
||||
slug: "windows-service"
|
||||
sidebar_position: 50
|
||||
aliases:
|
||||
- /zh-cn/windows-service
|
||||
---
|
||||
|
||||
# 注册为 Windows 服务
|
||||
|
||||
## 准备工作
|
||||
|
||||
在 C:\gitea\custom\conf\app.ini 中进行了以下更改:
|
||||
|
||||
```ini title="app.ini"
|
||||
RUN_USER = COMPUTERNAME$
|
||||
```
|
||||
|
||||
将 Gitea 设置为以本地系统用户运行。
|
||||
|
||||
COMPUTERNAME 是从命令行中运行 `echo %COMPUTERNAME%` 后得到的响应。如果响应是 `USER-PC`,那么 `RUN_USER = USER-PC$`。
|
||||
|
||||
### 使用绝对路径
|
||||
|
||||
如果您使用 SQLite3,请将 `PATH` 更改为包含完整路径:
|
||||
|
||||
```ini title="app.ini"
|
||||
[database]
|
||||
PATH = c:/gitea/data/gitea.db
|
||||
```
|
||||
|
||||
## 注册为 Windows 服务
|
||||
|
||||
要注册为 Windows 服务,首先以 Administrator 身份运行 `cmd`,然后执行以下命令:
|
||||
|
||||
```
|
||||
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 事件日志中记录超时。
|
||||
在这种情况下,将启动类型更改为`Automatic-Delayed`。这可以在服务创建期间完成,或者通过运行配置命令来完成。
|
||||
|
||||
```
|
||||
sc.exe config gitea start= delayed-auto
|
||||
```
|
||||
|
||||
### 添加启动依赖项
|
||||
|
||||
要将启动依赖项添加到 Gitea Windows 服务(例如 Mysql、Mariadb),作为管理员,然后运行以下命令:
|
||||
|
||||
```
|
||||
sc.exe config gitea depend= mariadb
|
||||
```
|
||||
|
||||
这将确保在 Windows 计算机重新启动时,将延迟自动启动 Gitea,直到数据库准备就绪,从而减少启动失败的情况。
|
||||
|
||||
## 从 Windows 服务中删除
|
||||
|
||||
以 Administrator 身份运行 `cmd`,然后执行以下命令:
|
||||
|
||||
```
|
||||
sc.exe delete gitea
|
||||
```
|
325
docs/document/installation/with-docker-rootless.md
Normal file
@@ -0,0 +1,325 @@
|
||||
---
|
||||
date: "2020-02-09T20:00:00+02:00"
|
||||
slug: "install-with-docker-rootless"
|
||||
sidebar_position: 60
|
||||
aliases:
|
||||
- /zh-cn/install-with-docker-rootless
|
||||
---
|
||||
|
||||
# 使用 Docker 安装 (rootless)
|
||||
|
||||
Gitea 在其 Docker Hub 组织中提供自动更新的 Docker 镜像。您可以始终使用最新的稳定标签,或使用其他处理 Docker 镜像更新的服务。
|
||||
|
||||
rootless 镜像使用 Gitea 内部 SSH 功能来提供 Git 协议,但不支持 OpenSSH。
|
||||
|
||||
本参考设置指南将用户引导通过基于 `docker-compose` 的设置。但是,`docker-compose` 的安装超出了本文档的范围。要安装`docker-compose` 本身, 请按照官方的 [安装说明](https://docs.docker.com/compose/install/)进行操作。
|
||||
|
||||
## 基础设置
|
||||
|
||||
最简单的设置只需创建一个卷和一个网络,并将 `docker.gitea.com/gitea:latest-rootless` 镜像作为服务启动。由于没有可用的数据库,可以使用 SQLite3 来初始化一个。
|
||||
|
||||
创建一个名为 `data` 和 `config`:
|
||||
|
||||
```sh
|
||||
mkdir -p gitea/{data,config}
|
||||
cd gitea
|
||||
touch docker-compose.yml
|
||||
```
|
||||
|
||||
然后将以下内容粘贴到名为 `docker-compose.yml` 的文件中:
|
||||
|
||||
```yaml
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@-rootless
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2222:2222"
|
||||
```
|
||||
|
||||
请注意,卷应由在配置文件中指定的 UID/GID 的用户/组所有。默认情况下,Docker 中的 Gitea 将使用 uid:1000 gid:1000。如果需要,您可以使用以下命令设置这些文件夹的所有权:
|
||||
|
||||
```sh
|
||||
sudo chown 1000:1000 config/ data/
|
||||
```
|
||||
|
||||
> 如果未为卷设置正确的权限,容器可能无法启动。
|
||||
|
||||
对于稳定版本,您可以使用 `:latest-rootless`、`:1-rootless`,或指定特定的版本,如: `@dockerVersion@-rootless`。如果您想使用最新的开发版本,则可以使用 `:dev-rootless` 标签。如果您想运行发布分支的最新提交,可以使用 `:1.x-dev-rootless` 标签,其中 x 是 Gitea 的次要版本号(例如:`1.16-dev-rootless`)。
|
||||
|
||||
## 自定义端口
|
||||
|
||||
要将集成的 SSH 和 Web 服务器绑定到不同的端口,请调整端口部分。通常只需更改主机端口并保持容器内的端口不变。
|
||||
|
||||
```diff
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@-rootless
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- - "3000:3000"
|
||||
- - "2222:2222"
|
||||
+ - "80:3000"
|
||||
+ - "22:2222"
|
||||
```
|
||||
|
||||
## MySQL 数据库
|
||||
|
||||
要将 Gitea 与 MySQL 数据库结合使用,请对上面创建的 `docker-compose.yml` 文件进行以下更改。
|
||||
|
||||
```diff
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@-rootless
|
||||
+ environment:
|
||||
+ - GITEA__database__DB_TYPE=mysql
|
||||
+ - GITEA__database__HOST=db:3306
|
||||
+ - GITEA__database__NAME=gitea
|
||||
+ - GITEA__database__USER=gitea
|
||||
+ - GITEA__database__PASSWD=gitea
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
+ depends_on:
|
||||
+ - db
|
||||
+
|
||||
+ db:
|
||||
+ image: docker.io/library/mysql:8
|
||||
+ restart: always
|
||||
+ environment:
|
||||
+ - MYSQL_ROOT_PASSWORD=gitea
|
||||
+ - MYSQL_USER=gitea
|
||||
+ - MYSQL_PASSWORD=gitea
|
||||
+ - MYSQL_DATABASE=gitea
|
||||
+ volumes:
|
||||
+ - ./mysql:/var/lib/mysql
|
||||
```
|
||||
|
||||
## PostgreSQL 数据库
|
||||
|
||||
要将 Gitea 与 PostgreSQL 数据库结合使用,请对上面创建的 `docker-compose.yml` 文件进行以下更改。
|
||||
|
||||
```diff
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@-rootless
|
||||
environment:
|
||||
+ - GITEA__database__DB_TYPE=postgres
|
||||
+ - GITEA__database__HOST=db:5432
|
||||
+ - GITEA__database__NAME=gitea
|
||||
+ - GITEA__database__USER=gitea
|
||||
+ - GITEA__database__PASSWD=gitea
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2222:2222"
|
||||
+ depends_on:
|
||||
+ - db
|
||||
+
|
||||
+ db:
|
||||
+ image: docker.io/library/postgres:14
|
||||
+ restart: always
|
||||
+ environment:
|
||||
+ - POSTGRES_USER=gitea
|
||||
+ - POSTGRES_PASSWORD=gitea
|
||||
+ - POSTGRES_DB=gitea
|
||||
+ volumes:
|
||||
+ - ./postgres:/var/lib/postgresql/data
|
||||
```
|
||||
|
||||
## 命名卷 (Named Volumes)
|
||||
|
||||
要使用命名卷 (Named Volumes) 而不是主机卷 (Host Volumes),请在 `docker-compose.yml` 配置中定义和使用命名卷。这样的更改将自动创建所需的卷。您不需要担心权限问题,Docker 会自动处理。
|
||||
|
||||
```diff
|
||||
version: "2"
|
||||
|
||||
+volumes:
|
||||
+ gitea-data:
|
||||
+ driver: local
|
||||
+ gitea-config:
|
||||
+ driver: local
|
||||
+
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@-rootless
|
||||
restart: always
|
||||
volumes:
|
||||
- - ./data:/var/lib/gitea
|
||||
+ - gitea-data:/var/lib/gitea
|
||||
- - ./config:/etc/gitea
|
||||
+ - gitea-config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2222:2222"
|
||||
```
|
||||
|
||||
MySQL 或 PostgreSQL 容器需要单独创建。
|
||||
|
||||
## 自定义用户
|
||||
|
||||
你可以选择使用自定义用户 (遵循 --user 标志定义 https://docs.docker.com/engine/reference/run/#user)。
|
||||
例如,要克隆主机用户 `git` 的定义,请使用命令 `id -u git` 并将其添加到 `docker-compose.yml` 文件中:
|
||||
请确用户对保挂载的文件夹具有写权限。
|
||||
|
||||
```diff
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@-rootless
|
||||
restart: always
|
||||
+ user: 1001
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2222:2222"
|
||||
```
|
||||
|
||||
## 启动
|
||||
|
||||
要启动基于 `docker-compose` 的这个设置,请执行 `docker-compose up -d`,以在后台启动 Gitea。使用 `docker-compose ps` 命令可以查看 Gitea 是否正确启动。可以使用 `docker-compose logs` 命令查看日志。
|
||||
|
||||
要关闭设置,请执行 `docker-compose down` 命令。这将停止和终止容器,但卷仍将存在。
|
||||
|
||||
注意:如果在 HTTP 上使用的是非 3000 端口,请将 app.ini 更改为匹配 `LOCAL_ROOT_URL = http://localhost:3000/`。
|
||||
|
||||
## 安装
|
||||
|
||||
在通过 `docker-compose` 启动 Docker 设置后,可以使用喜爱的浏览器访问 Gitea,完成安装过程。访问 `http://<服务器-IP>:3000` 并按照安装向导进行操作。如果数据库是使用上述文档中的 `docker-compose` 设置启动的,请注意必须使用 `db` 作为数据库主机名。
|
||||
|
||||
## 自定义
|
||||
|
||||
自定义文件的位置位于 `/var/lib/gitea/custom` 目录中,可以在这里找到有关自定义的文件说明。如果使用主机卷(host volumes),很容易访问这些文件;如果使用命名卷(named volumes),则可以通过另一个容器或直接访问 `/var/lib/docker/volumes/gitea_gitea/_/var_lib_gitea` 来进行访问。在安装后,配置文件将保存在 `/etc/gitea/app.ini` 中。
|
||||
|
||||
## 升级
|
||||
|
||||
:::warning
|
||||
:exclamation::exclamation: **确保您已将数据卷迁移到 Docker 容器之外的其他位置** :exclamation::exclamation:
|
||||
:::
|
||||
|
||||
要将安装升级到最新版本,请按照以下步骤操作:
|
||||
|
||||
```bash
|
||||
# 如果在 docker-compose.yml 中指定了版本,请编辑该文件以更新版本
|
||||
# 拉取新的镜像
|
||||
docker-compose pull
|
||||
# 启动一个新的容器,自动移除旧的容器
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 从标准镜像升级
|
||||
|
||||
- 备份您的设置
|
||||
- 将卷挂载点从 `/data` 更改为 `/var/lib/gitea`
|
||||
- 如果使用了自定义的 `app.ini`,请将其移动到新的挂载到 `/etc/gitea` 的卷中
|
||||
- 将卷中的文件夹(gitea)重命名为 custom
|
||||
- 如果需要,编辑 `app.ini`
|
||||
- 设置 `START_SSH_SERVER = true`
|
||||
- 使用镜像 ` docker.gitea.com/gitea:@dockerVersion@-rootless`
|
||||
|
||||
## 使用环境变量管理部署
|
||||
|
||||
除了上述的环境变量外,`app.ini` 中的任何设置都可以通过形式为 `GITEA__SECTION_NAME__KEY_NAME` 的环境变量进行设置或覆盖。这些设置在每次 Docker 容器启动时都会生效。完整信息请参考[这里](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini).
|
||||
|
||||
这些环境变量可以在 `docker-compose.yml` 中传递给 Docker 容器。以下示例将启用 SMTP 邮件服务器,如果主机上设置了所需的环境变量 GITEA**mailer**FROM、GITEA**mailer**HOST、GITEA**mailer**PASSWD,或者在与 `docker-compose.yml` 相同目录中的 `.env` 文件中设置了这些环境变量:
|
||||
|
||||
```bash
|
||||
...
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||
- GITEA__mailer__PROTOCOL=smtp
|
||||
- GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set}
|
||||
- GITEA__mailer__IS_TLS_ENABLED=true
|
||||
- GITEA__mailer__USER=${GITEA__mailer__USER:-apikey}
|
||||
- GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}"""
|
||||
```
|
||||
|
||||
要设置所需的 TOKEN 和 SECRET 值,可以使用 Gitea 的内置[生成使用函数](../administration/command-line.md#generate).
|
||||
|
||||
# SSH 容器透传
|
||||
|
||||
由于 SSH 在容器内运行,如果需要 SSH 支持,需要将 SSH 从主机透传到容器。一种选择是在容器内运行 SSH,并使用非标准端口(或将主机端口移动到非标准端口)。另一种可能更直接的选择是将主机上的 SSH 命令转发到容器。下面解释了这种设置。
|
||||
|
||||
本指南假设您已在主机上创建了一个名为 `git` 的用户,并具有运行 `docker exec` 的权限,并且 Gitea 容器的名称为 `gitea`。您需要修改该用户的 shell,以将命令转发到容器内的 `sh` 可执行文件,使用 `docker exec`。
|
||||
|
||||
首先,在主机上创建文件 `/usr/local/bin/gitea-shell`,并填入以下内容:
|
||||
|
||||
```bash
|
||||
#!/bin/sh
|
||||
/usr/bin/docker exec -i --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@"
|
||||
```
|
||||
|
||||
注意上述 docker 命令中的 `gitea` 是容器的名称。如果您的容器名称不同,请记得更改。
|
||||
|
||||
还应确保正确设置了 shell 包装器的权限:
|
||||
|
||||
```bash
|
||||
sudo chmod +x /usr/local/bin/gitea-shell
|
||||
```
|
||||
|
||||
一旦包装器就位,您可以将其设置为 `git` 用户的 shell:
|
||||
|
||||
```bash
|
||||
sudo usermod -s /usr/local/bin/gitea-shell git
|
||||
```
|
||||
|
||||
现在,所有的 SSH 命令都会被转发到容器,您需要在主机上设置 SSH 认证。这可以通过利用 [SSH AuthorizedKeysCommand](../administration/command-line.md#keys) 来匹配 Gitea 接受的密钥。在主机的 `/etc/ssh/sshd_config` 文件中添加以下代码块:
|
||||
|
||||
```bash
|
||||
Match User git
|
||||
AuthorizedKeysCommandUser git
|
||||
AuthorizedKeysCommand /usr/bin/docker exec -i gitea /usr/local/bin/gitea keys -c /etc/gitea/app.ini -e git -u %u -t %t -k %k
|
||||
```
|
||||
|
||||
(从 1.16.0 开始,您将不需要设置 `-c /etc/gitea/app.ini` 选项。)
|
||||
|
||||
剩下的就是重新启动 SSH 服务器:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart sshd
|
||||
```
|
||||
|
||||
**注意**
|
||||
|
||||
这实际上并没有使用 Docker 的 SSH,而是仅仅使用了围绕它的命令。
|
||||
从理论上讲,您可以不运行内部的 SSH 服务器。
|
373
docs/document/installation/with-docker.md
Normal file
@@ -0,0 +1,373 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
slug: "install-with-docker"
|
||||
sidebar_position: 70
|
||||
aliases:
|
||||
- /zh-cn/install-with-docker
|
||||
---
|
||||
|
||||
# 使用 Docker 安装
|
||||
|
||||
Gitea 在其 Docker Hub 组织内提供自动更新的 Docker 镜像。可以始终使用最新的稳定标签或使用其他服务来更新 Docker 镜像。
|
||||
|
||||
该参考设置指导用户完成基于 `docker-compose` 的设置,但是 `docker-compose` 的安装不在本文档的范围之内。要安装 `docker-compose` 本身,请遵循官方[安装说明](https://docs.docker.com/compose/install/)。
|
||||
|
||||
## 基本
|
||||
|
||||
最简单的设置只是创建一个卷和一个网络,然后将 `docker.gitea.com/gitea:latest` 镜像作为服务启动。由于没有可用的数据库,因此可以使用 SQLite3 初始化数据库。创建一个类似 `gitea` 的目录,并将以下内容粘贴到名为 `docker-compose.yml` 的文件中。请注意,该卷应由配置文件中指定的 UID/GID 的用户/组拥有。如果您不授予卷正确的权限,则容器可能无法启动。另请注意,标签 `:latest` 将安装当前的开发版本。对于稳定的发行版,您可以使用 `:1` 或指定某个发行版,例如 `@dockerVersion@`。
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
```
|
||||
|
||||
## 端口
|
||||
|
||||
要将集成的 openSSH 守护进程和 Web 服务器绑定到其他端口,请调整端口部分。通常,只需更改主机端口,容器内的端口保持原样即可。
|
||||
|
||||
```diff
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- - "3000:3000"
|
||||
- - "222:22"
|
||||
+ - "8080:3000"
|
||||
+ - "2221:22"
|
||||
```
|
||||
|
||||
## 数据库
|
||||
|
||||
### MySQL 数据库
|
||||
|
||||
要将 Gitea 与 MySQL 数据库结合使用,请将这些更改应用于上面创建的 `docker-compose.yml` 文件。
|
||||
|
||||
```diff
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
+ - GITEA__database__DB_TYPE=mysql
|
||||
+ - GITEA__database__HOST=db:3306
|
||||
+ - GITEA__database__NAME=gitea
|
||||
+ - GITEA__database__USER=gitea
|
||||
+ - GITEA__database__PASSWD=gitea
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
+ depends_on:
|
||||
+ - db
|
||||
+
|
||||
+ db:
|
||||
+ image: docker.io/library/mysql:8
|
||||
+ restart: always
|
||||
+ environment:
|
||||
+ - MYSQL_ROOT_PASSWORD=gitea
|
||||
+ - MYSQL_USER=gitea
|
||||
+ - MYSQL_PASSWORD=gitea
|
||||
+ - MYSQL_DATABASE=gitea
|
||||
+ networks:
|
||||
+ - gitea
|
||||
+ volumes:
|
||||
+ - ./mysql:/var/lib/mysql
|
||||
```
|
||||
|
||||
### PostgreSQL 数据库
|
||||
|
||||
要将 Gitea 与 PostgreSQL 数据库结合使用,请将这些更改应用于上面创建的 `docker-compose.yml` 文件。
|
||||
|
||||
```diff
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
+ - GITEA__database__DB_TYPE=postgres
|
||||
+ - GITEA__database__HOST=db:5432
|
||||
+ - GITEA__database__NAME=gitea
|
||||
+ - GITEA__database__USER=gitea
|
||||
+ - GITEA__database__PASSWD=gitea
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
+ depends_on:
|
||||
+ - db
|
||||
+
|
||||
+ db:
|
||||
+ image: docker.io/library/postgres:14
|
||||
+ restart: always
|
||||
+ environment:
|
||||
+ - POSTGRES_USER=gitea
|
||||
+ - POSTGRES_PASSWORD=gitea
|
||||
+ - POSTGRES_DB=gitea
|
||||
+ networks:
|
||||
+ - gitea
|
||||
+ volumes:
|
||||
+ - ./postgres:/var/lib/postgresql/data
|
||||
```
|
||||
|
||||
## 命名卷
|
||||
|
||||
要使用命名卷而不是主机卷,请在 `docker-compose.yml` 配置中定义并使用命名卷。此更改将自动创建所需的卷。您无需担心命名卷的权限;Docker 将自动处理该问题。
|
||||
|
||||
```diff
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
+volumes:
|
||||
+ gitea:
|
||||
+ driver: local
|
||||
+
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:@dockerVersion@
|
||||
container_name: gitea
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- - ./gitea:/data
|
||||
+ - gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
```
|
||||
|
||||
MySQL 或 PostgreSQL 容器将需要分别创建。
|
||||
|
||||
## 启动
|
||||
|
||||
要基于 `docker-compose` 启动此设置,请执行 `docker-compose up -d`,以在后台启动 Gitea。使用 `docker-compose ps` 将显示 Gitea 是否正确启动。可以使用 `docker-compose logs` 查看日志。
|
||||
|
||||
要关闭设置,请执行 `docker-compose down`。这将停止并杀死容器。这些卷将仍然存在。
|
||||
|
||||
注意:如果在 http 上使用非 3000 端口,请更改 app.ini 以匹配 `LOCAL_ROOT_URL = http://localhost:3000/`。
|
||||
|
||||
## 安装
|
||||
|
||||
通过 `docker-compose` 启动 Docker 安装后,应该可以使用喜欢的浏览器访问 Gitea,以完成安装。访问 http://server-ip:3000 并遵循安装向导。如果数据库是通过上述 `docker-compose` 设置启动的,请注意,必须将 `db` 用作数据库主机名。
|
||||
|
||||
## 环境变量
|
||||
|
||||
您可以通过环境变量配置 Gitea 的一些设置:
|
||||
|
||||
(默认值以**粗体**显示)
|
||||
|
||||
- `APP_NAME`:**“Gitea: Git with a cup of tea”**:应用程序名称,在页面标题中使用。
|
||||
- `RUN_MODE`:**prod**:应用程序运行模式,会影响性能和调试。"dev","prod"或"test"。
|
||||
- `DOMAIN`:**localhost**:此服务器的域名,用于 Gitea UI 中显示的 http 克隆 URL。
|
||||
- `SSH_DOMAIN`:**localhost**:该服务器的域名,用于 Gitea UI 中显示的 ssh 克隆 URL。如果启用了安装页面,则 SSH 域服务器将采用以下形式的 DOMAIN 值(保存时将覆盖此设置)。
|
||||
- `SSH_PORT`:**22**:克隆 URL 中显示的 SSH 端口。
|
||||
- `SSH_LISTEN_PORT`:**%(SSH_PORT)s**:内置 SSH 服务器的端口。
|
||||
- `DISABLE_SSH`:**false**:如果不可用,请禁用 SSH 功能。如果要禁用 SSH 功能,则在安装 Gitea 时应将 SSH 端口设置为 `0`。
|
||||
- `HTTP_PORT`:**3000**:HTTP 监听端口。
|
||||
- `ROOT_URL`:**""**:覆盖自动生成的公共 URL。如果内部 URL 和外部 URL 不匹配(例如在 Docker 中),这很有用。
|
||||
- `LFS_START_SERVER`:**false**:启用 git-lfs 支持。
|
||||
- `DB_TYPE`:**sqlite3**:正在使用的数据库类型[mysql,postgres,mssql,sqlite3]。
|
||||
- `DB_HOST`:**localhost:3306**:数据库主机地址和端口。
|
||||
- `DB_NAME`:**gitea**:数据库名称。
|
||||
- `DB_USER`:**root**:数据库用户名。
|
||||
- `DB_PASSWD`:**"_empty_"** :数据库用户密码。如果您在密码中使用特殊字符,请使用“您的密码”进行引用。
|
||||
- `INSTALL_LOCK`:**false**:禁止访问安装页面。
|
||||
- `SECRET_KEY`:**""** :全局密钥。这应该更改。如果它具有一个值并且 `INSTALL_LOCK` 为空,则 `INSTALL_LOCK` 将自动设置为 `true`。
|
||||
- `DISABLE_REGISTRATION`:**false**:禁用注册,之后只有管理员才能为用户创建帐户。
|
||||
- `REQUIRE_SIGNIN_VIEW`:**false**:启用此选项可强制用户登录以查看任何页面。
|
||||
- `USER_UID`:**1000**:在容器内运行 Gitea 的用户的 UID(Unix 用户 ID)。如果使用主机卷,则将其与 `/data` 卷的所有者的 UID 匹配(对于命名卷,则不需要这样做)。
|
||||
- `USER_GID`:**1000**:在容器内运行 Gitea 的用户的 GID(Unix 组 ID)。如果使用主机卷,则将其与 `/data` 卷的所有者的 GID 匹配(对于命名卷,则不需要这样做)。
|
||||
|
||||
## 自定义
|
||||
|
||||
[此处](../administration/customizing-gitea.md)描述的定制文件应放在 `/data/gitea` 目录中。如果使用主机卷,则访问这些文件非常容易;对于命名卷,可以通过另一个容器或通过直接访问 `/var/lib/docker/volumes/gitea_gitea/_data` 来完成。安装后,配置文件将保存在 `/data/gitea/conf/app.ini` 中。
|
||||
|
||||
## 升级
|
||||
|
||||
:::warning
|
||||
:exclamation::exclamation: **确保已将数据卷到 Docker 容器外部的某个位置** :exclamation::exclamation:
|
||||
:::
|
||||
|
||||
要将安装升级到最新版本:
|
||||
|
||||
```bash
|
||||
# Edit `docker-compose.yml` to update the version, if you have one specified
|
||||
# Pull new images
|
||||
docker-compose pull
|
||||
# Start a new container, automatically removes old one
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 使用环境变量管理部署
|
||||
|
||||
除了上面的环境变量之外,`app.ini` 中的任何设置都可以使用以下形式的环境变量进行设置或覆盖:`GITEA__SECTION_NAME__KEY_NAME`。 每次 docker 容器启动时都会应用这些设置。 完整信息在[这里](https://github.com/go-gitea/gitea/tree/master/contrib/environment-to-ini)。
|
||||
|
||||
```bash
|
||||
...
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||
- GITEA__mailer__PROTOCOL=smtps
|
||||
- GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set}
|
||||
- GITEA__mailer__USER=${GITEA__mailer__USER:-apikey}
|
||||
- GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}"""
|
||||
```
|
||||
|
||||
Gitea 将为每次新安装自动生成新的 `SECRET_KEY` 并将它们写入 `app.ini`。 如果您想手动设置 `SECRET_KEY`,您可以使用以下 docker 命令来使用 Gitea 内置的[方法](../administration/command-line.md#generate)生成 `SECRET_KEY`。 安装后请妥善保管您的 `SECRET_KEY`,如若丢失则无法解密已加密的数据。
|
||||
|
||||
以下命令将向 `stdout` 输出一个新的 `SECRET_KEY` 和 `INTERNAL_TOKEN`,然后您可以将其放入环境变量中。
|
||||
|
||||
```bash
|
||||
docker run -it --rm docker.gitea.com/gitea:1 gitea generate secret SECRET_KEY
|
||||
docker run -it --rm docker.gitea.com/gitea:1 gitea generate secret INTERNAL_TOKEN
|
||||
```
|
||||
|
||||
```yaml
|
||||
---
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- GITEA__security__SECRET_KEY=[value returned by generate secret SECRET_KEY]
|
||||
- GITEA__security__INTERNAL_TOKEN=[value returned by generate secret INTERNAL_TOKEN]
|
||||
```
|
||||
|
||||
## SSH 容器直通
|
||||
|
||||
由于 SSH 在容器内运行,因此,如果需要 SSH 支持,则需要将 SSH 从主机传递到容器。一种选择是在非标准端口上运行容器 SSH(或将主机端口移至非标准端口)。另一个可能更直接的选择是将 SSH 连接从主机转发到容器。下面将说明此设置。
|
||||
|
||||
本指南假定您已经在名为 `git` 的主机上创建了一个用户,该用户与容器值 `USER_UID`/`USER_GID` 共享相同的 `UID`/`GID`。这些值可以在 `docker-compose.yml` 中设置为环境变量:
|
||||
|
||||
```bash
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
```
|
||||
|
||||
接下来将主机的 `/home/git/.ssh` 装入容器。否则,SSH 身份验证将无法在容器内运行。
|
||||
|
||||
```bash
|
||||
volumes:
|
||||
- /home/git/.ssh/:/data/git/.ssh
|
||||
```
|
||||
|
||||
现在,需要在主机上创建 SSH 密钥对。该密钥对将用于向主机验证主机上的 `git` 用户。
|
||||
|
||||
```bash
|
||||
sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key"
|
||||
```
|
||||
|
||||
在下一步中,需要在主机上创建一个名为 `/usr/local/bin/gitea` 的文件(具有可执行权限)。该文件将发出从主机到容器的 SSH 转发。将以下内容添加到 `/usr/local/bin/gitea`:
|
||||
|
||||
```bash
|
||||
ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"
|
||||
```
|
||||
|
||||
为了使转发正常工作,需要将容器(22)的 SSH 端口映射到 `docker-compose.yml` 中的主机端口 2222。由于此端口不需要暴露给外界,因此可以将其映射到主机的 `localhost`:
|
||||
|
||||
```bash
|
||||
ports:
|
||||
# [...]
|
||||
- "127.0.0.1:2222:22"
|
||||
```
|
||||
|
||||
另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。
|
||||
|
||||
该文件应该看起来像:
|
||||
|
||||
```bash
|
||||
# SSH pubkey from git user
|
||||
ssh-rsa <Gitea Host Key>
|
||||
|
||||
# other keys from users
|
||||
command="/usr/local/bin/gitea --config=/data/gitea/conf/app.ini serv key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty <user pubkey>
|
||||
```
|
||||
|
||||
这是详细的说明,当发出 SSH 请求时会发生什么:
|
||||
|
||||
1. 使用 `git` 用户向主机发出 SSH 请求,例如 `git clone git@domain:user/repo.git`。
|
||||
2. 在 `/home/git/.ssh/authorized_keys` 中,该命令执行 `/usr/local/bin/gitea` 脚本。
|
||||
3. `/usr/local/bin/gitea` 将 SSH 请求转发到端口 2222,该端口已映射到容器的 SSH 端口(22)。
|
||||
4. 由于 `/home/git/.ssh/authorized_keys` 中存在 `git` 用户的公钥,因此身份验证主机 → 容器成功,并且 SSH 请求转发到在 docker 容器中运行的 Gitea。
|
||||
|
||||
如果在 Gitea Web 界面中添加了新的 SSH 密钥,它将以与现有密钥相同的方式附加到 `.ssh/authorized_keys` 中。
|
||||
|
||||
**注意**
|
||||
|
||||
SSH 容器直通仅在以下情况下有效
|
||||
|
||||
- 在容器中使用 `opensshd`
|
||||
- 如果未将 `AuthorizedKeysCommand` 与 `SSH_CREATE_AUTHORIZED_KEYS_FILE = false` 结合使用以禁用授权文件密钥生成
|
||||
- `LOCAL_ROOT_URL` 不变
|
BIN
docs/static/authorize.png
vendored
Normal file
After Width: | Height: | Size: 18 KiB |
53
docs/static/cloudron.svg
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="155" height="37" id="svg4152" version="1.1" inkscape:version="0.91 r13725" viewBox="0 0 155 37" sodipodi:docname="button.svg" inkscape:export-filename="/home/nebulon/Cloudron/Assets/button_64.png" inkscape:export-xdpi="155.6129" inkscape:export-ydpi="155.6129">
|
||||
<defs id="defs4154"/>
|
||||
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="1" inkscape:pageshadow="2" inkscape:zoom="3.6203867" inkscape:cx="121.3823" inkscape:cy="1.1988893" inkscape:current-layer="g4481" showgrid="true" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:window-width="1280" inkscape:window-height="736" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" showguides="false"/>
|
||||
<metadata id="metadata4157">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer" transform="translate(0,-27)">
|
||||
<g id="g5138">
|
||||
<rect inkscape:export-ydpi="67.349998" inkscape:export-xdpi="67.349998" ry="3.2883968" y="27.493248" x="0.49324799" height="36.013504" width="154.0135" id="rect4424" style="opacity:1;fill:none;fill-opacity:1;stroke:#03a9f4;stroke-width:0.98649561;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
|
||||
<g transform="translate(-17.67767,3.2702403)" id="g4467">
|
||||
<g id="g4382" transform="matrix(0.59473169,0,0,0.59473169,31.04719,102.48374)" inkscape:export-xdpi="67.349998" inkscape:export-ydpi="67.349998">
|
||||
<g id="g4496">
|
||||
<path inkscape:export-ydpi="67.349998" inkscape:export-xdpi="67.349998" transform="matrix(0.8660254,-0.49999999,0.49999999,0.8660254,51.102849,-7.8015133)" d="m 29.166669,-109.50348 c 1.200386,2.08567 1.17988,17.183595 -0.02617,19.265993 -1.206046,2.082397 -14.291486,9.613601 -16.697919,9.610333 -2.406432,-0.0033 -15.4713664,-7.56999 -16.671752,-9.655655 -1.2003857,-2.085666 -1.1798799,-17.183591 0.026167,-19.265991 1.2060467,-2.0824 14.2914862,-9.6136 16.6979192,-9.61033 2.406432,0.003 15.471366,7.56999 16.671752,9.65565 z" inkscape:randomized="0" inkscape:rounded="0.12490573" inkscape:flatsided="true" sodipodi:arg2="0.0013581913" sodipodi:arg1="-0.52224059" sodipodi:r2="16.307295" sodipodi:r1="19.266006" sodipodi:cy="-99.893143" sodipodi:cx="12.46875" sodipodi:sides="6" id="path4162" style="opacity:1;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1.10000002;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" sodipodi:type="star"/>
|
||||
<rect style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4168-1-1" width="8.7434387" height="8.7434387" x="2.2207832" y="-104.9176" ry="2.4183984" inkscape:transform-center-x="0.40624986"/>
|
||||
<g id="g4491" transform="translate(0,0.14463441)">
|
||||
<rect ry="2.4183986" y="-98.734459" x="9.0890703" height="8.7434387" width="8.7434387" id="rect4168-1-1-7" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
|
||||
<rect ry="2.4183986" y="-111.39002" x="9.0890703" height="8.7434387" width="8.7434387" id="rect4168-1-1-7-2" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g style="fill:#03a9f4;fill-opacity:1" transform="translate(0,-12.132814)" id="g4481">
|
||||
<g style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="text4135">
|
||||
<path d="m 41.656508,62.625017 c -2.555847,0 -3.639656,-1.261747 -3.639656,-4.173473 0,-2.927901 1.083809,-4.173472 3.639656,-4.173472 1.16469,0 2.216146,0.274996 3.122016,0.679402 l 0,-1.391157 c -0.970575,-0.38823 -2.07056,-0.64705 -3.299955,-0.64705 -2.280851,0 -5.014637,0.954399 -5.014637,5.532277 0,4.577879 2.733786,5.532278 5.014637,5.532278 1.229395,0 2.32938,-0.25882 3.299955,-0.64705 l 0,-1.391157 c -0.90587,0.404406 -1.957326,0.679402 -3.122016,0.679402 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4149"/>
|
||||
<path d="m 47.031573,52.708976 0,11.145436 1.488215,0 0,-11.145436 -1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4151"/>
|
||||
<path d="m 54.478208,55.669229 c -1.730858,0 -3.801418,0.727932 -3.801418,4.157297 0,3.429365 2.07056,4.157296 3.801418,4.157296 1.730859,0 3.801419,-0.727931 3.801419,-4.157296 0,-3.429365 -2.07056,-4.157297 -3.801419,-4.157297 z m 0,7.004317 c -1.213218,0 -2.313203,-0.339701 -2.313203,-2.84702 0,-2.507319 1.099985,-2.84702 2.313203,-2.84702 1.213219,0 2.313204,0.339701 2.313204,2.84702 0,2.507319 -1.099985,2.84702 -2.313204,2.84702 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4153"/>
|
||||
<path d="m 65.458345,55.782463 0,4.78817 c 0,1.472039 -0.598521,2.119089 -1.924974,2.119089 -1.342629,0 -1.94115,-0.64705 -1.94115,-2.119089 l 0,-4.78817 -1.472039,0 0,4.674936 c 0,2.248499 1.245572,3.542599 3.413189,3.542599 2.167618,0 3.413189,-1.2941 3.413189,-3.542599 l 0,-4.674936 -1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4155"/>
|
||||
<path d="m 69.133133,59.713292 c 0,3.720538 2.232322,4.27053 3.574951,4.27053 3.089664,0 3.332308,-2.005855 3.332308,-2.620552 l 0,-8.654294 -1.472039,0 0,3.186721 c -0.566169,-0.161763 -1.132338,-0.242644 -1.730859,-0.242644 -1.68233,0 -3.704361,0.711755 -3.704361,4.060239 z m 1.472039,0 c 0,-2.410261 1.083808,-2.749963 2.232322,-2.749963 0.598521,0 1.180866,0.113234 1.730859,0.339702 l 0,4.157296 c 0,0.808813 -0.630874,1.213219 -1.860269,1.213219 -0.986751,0 -2.102912,-0.339701 -2.102912,-2.960254 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4157"/>
|
||||
<path d="m 79.727313,57.351559 c 0.630874,-0.161762 1.488215,-0.323525 2.442614,-0.339701 l 0,-1.358805 c -2.167618,0 -3.849948,0.77646 -3.930829,0.808813 l 0,7.392546 1.488215,0 0,-6.502853 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4159"/>
|
||||
<path d="m 86.957085,55.669229 c -1.730859,0 -3.801419,0.727932 -3.801419,4.157297 0,3.429365 2.07056,4.157296 3.801419,4.157296 1.730858,0 3.801418,-0.727931 3.801418,-4.157296 0,-3.429365 -2.07056,-4.157297 -3.801418,-4.157297 z m 0,7.004317 c -1.213219,0 -2.313204,-0.339701 -2.313204,-2.84702 0,-2.507319 1.099985,-2.84702 2.313204,-2.84702 1.213218,0 2.313203,0.339701 2.313203,2.84702 0,2.507319 -1.099985,2.84702 -2.313203,2.84702 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4161"/>
|
||||
<path d="m 94.118867,63.854412 0,-6.551381 c 0.501464,-0.161763 1.16469,-0.291173 1.892621,-0.291173 1.617625,0 1.827916,0.77646 1.827916,1.536744 l 0,5.30581 1.488215,0 0,-5.208753 c 0,-1.876445 -1.213218,-3.008782 -3.251426,-3.008782 -1.892621,0 -3.380836,0.808812 -3.445541,0.841165 l 0,7.37637 1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4163"/>
|
||||
</g>
|
||||
<g style="font-style:normal;font-weight:normal;font-size:32.19625854px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="text4477">
|
||||
<path d="m 105.24414,53.529928 0,-1.351991 1.41487,0 0,1.351991 -1.41487,0 z m 0,10.312865 0,-8.504969 1.41487,0 0,8.504969 -1.41487,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4156"/>
|
||||
<path d="m 114.23645,63.842793 0,-5.392245 q 0,-0.841064 -0.16507,-1.304829 -0.16507,-0.463764 -0.52665,-0.668135 -0.36158,-0.204371 -1.06115,-0.204371 -1.02186,0 -1.61139,0.699577 -0.58953,0.699577 -0.58953,1.941523 l 0,4.92848 -1.41487,0 0,-6.689213 q 0,-1.485619 -0.0472,-1.815756 l 1.33628,0 q 0.008,0.0393 0.0157,0.212231 0.008,0.172929 0.0157,0.400881 0.0157,0.220092 0.0314,0.841065 l 0.0236,0 q 0.48735,-0.880367 1.12404,-1.241946 0.64455,-0.369439 1.59566,-0.369439 1.39916,0 2.04371,0.699576 0.65242,0.691717 0.65242,2.295242 l 0,5.667359 -1.42274,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4158"/>
|
||||
<path d="m 124.17987,61.492529 q 0,1.202643 -0.9118,1.855057 -0.90395,0.652415 -2.53892,0.652415 -1.5878,0 -2.45245,-0.518788 -0.85678,-0.526647 -1.11618,-1.634966 l 1.24981,-0.243673 q 0.18079,0.683856 0.74674,1.006133 0.56595,0.314417 1.57208,0.314417 1.07688,0 1.57209,-0.330137 0.50306,-0.330138 0.50306,-0.990413 0,-0.503066 -0.34586,-0.817483 -0.34585,-0.314416 -1.11618,-0.518787 l -1.01399,-0.267254 q -1.21836,-0.314417 -1.73715,-0.613113 -0.51093,-0.306556 -0.80176,-0.738879 -0.29084,-0.432322 -0.29084,-1.061156 0,-1.163341 0.82535,-1.768593 0.8332,-0.613112 2.421,-0.613112 1.40702,0 2.23236,0.495206 0.83321,0.495206 1.0533,1.587804 l -1.27339,0.157208 q -0.11791,-0.56595 -0.63669,-0.864646 -0.51093,-0.306556 -1.37558,-0.306556 -0.95897,0 -1.41487,0.290836 -0.45591,0.290835 -0.45591,0.880366 0,0.361579 0.18865,0.597391 0.18865,0.235813 0.55809,0.400882 0.36944,0.165068 1.55637,0.455904 1.12404,0.282975 1.61924,0.526647 0.49521,0.235813 0.77818,0.526648 0.29084,0.290836 0.44805,0.675996 0.1572,0.3773 0.1572,0.864646 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4160"/>
|
||||
<path d="m 129.11621,63.779909 q -0.69957,0.18865 -1.43059,0.18865 -1.69785,0 -1.69785,-1.925801 l 0,-5.67522 -0.98255,0 0,-1.029714 1.03757,0 0.4166,-1.902221 0.94325,0 0,1.902221 1.57209,0 0,1.029714 -1.57209,0 0,5.368663 q 0,0.613113 0.19651,0.864646 0.20438,0.243673 0.69958,0.243673 0.28298,0 0.81748,-0.110046 l 0,1.045435 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4164"/>
|
||||
<path d="m 132.48047,64.000001 q -1.28124,0 -1.9258,-0.675996 -0.64455,-0.675996 -0.64455,-1.855058 0,-1.320549 0.86464,-2.027987 0.87251,-0.707437 2.80617,-0.7546 l 1.91008,-0.03144 0,-0.463765 q 0,-1.037574 -0.44018,-1.485618 -0.44018,-0.448044 -1.38343,-0.448044 -0.95111,0 -1.38344,0.322277 -0.43232,0.322277 -0.51878,1.029715 l -1.47776,-0.133627 q 0.36158,-2.295241 3.41142,-2.295241 1.60352,0 2.41314,0.738879 0.80963,0.731018 0.80963,2.122311 l 0,3.662954 q 0,0.628833 0.16507,0.95111 0.16506,0.314416 0.62883,0.314416 0.20437,0 0.46376,-0.05502 l 0,0.880366 q -0.5345,0.125767 -1.09259,0.125767 -0.78605,0 -1.14762,-0.408742 -0.35372,-0.416602 -0.40089,-1.296968 l -0.0472,0 q -0.54237,0.974691 -1.26553,1.383433 -0.71529,0.400881 -1.74501,0.400881 z m 0.32228,-1.061156 q 0.77818,0 1.38343,-0.353719 0.60525,-0.353718 0.95111,-0.966831 0.35372,-0.620973 0.35372,-1.273387 l 0,-0.699577 -1.5485,0.03144 q -0.99827,0.01572 -1.51706,0.204371 -0.51093,0.188649 -0.78604,0.58167 -0.27512,0.393021 -0.27512,1.029715 0,0.691716 0.36944,1.069016 0.3773,0.3773 1.06902,0.3773 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4166"/>
|
||||
<path d="m 139.27187,63.842793 0,-11.664856 1.41488,0 0,11.664856 -1.41488,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4168"/>
|
||||
<path d="m 142.85622,63.842793 0,-11.664856 1.41488,0 0,11.664856 -1.41488,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4170"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/static/development/gitea_approval.png
vendored
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/static/development/gitea_oauth2_step1.png
vendored
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
docs/static/development/gitea_oauth2_step2.png
vendored
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
docs/static/development/minio_login.png
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
docs/static/development/minio_oauth2.png
vendored
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
docs/static/gitea-push-hint.png
vendored
Normal file
After Width: | Height: | Size: 412 KiB |
BIN
docs/static/images/usage/actions/enable-actions.png
vendored
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
docs/static/images/usage/actions/labels.png
vendored
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
docs/static/images/usage/actions/network.png
vendored
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
docs/static/images/usage/actions/register-runner.png
vendored
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
docs/static/images/usage/actions/view-job.png
vendored
Normal file
After Width: | Height: | Size: 522 KiB |
BIN
docs/static/images/usage/actions/view-runner.png
vendored
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
docs/static/images/usage/profile-readme.png
vendored
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/static/img/favicon.png
vendored
Normal file
After Width: | Height: | Size: 4.2 KiB |
31
docs/static/img/gitea.svg
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
||||
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
|
||||
<g>
|
||||
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
|
||||
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
|
||||
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
|
||||
<g>
|
||||
<g>
|
||||
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
|
||||
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
|
||||
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
|
||||
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
|
||||
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
|
||||
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
|
||||
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
|
||||
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
|
||||
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
|
||||
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
|
||||
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
|
||||
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
|
||||
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
|
||||
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
|
||||
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
|
||||
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
|
||||
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
|
||||
C343.2,346.5,335,363.3,326.8,380.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
1
docs/static/img/logo.svg
vendored
Normal file
After Width: | Height: | Size: 6.3 KiB |
1
docs/static/octicon-versions.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M7.75 14A1.75 1.75 0 0 1 6 12.25v-8.5C6 2.784 6.784 2 7.75 2h6.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14Zm-.25-1.75c0 .138.112.25.25.25h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25h-6.5a.25.25 0 0 0-.25.25ZM4.9 3.508a.75.75 0 0 1-.274 1.025.249.249 0 0 0-.126.217v6.5c0 .09.048.173.126.217a.75.75 0 0 1-.752 1.298A1.75 1.75 0 0 1 3 11.25v-6.5c0-.649.353-1.214.874-1.516a.75.75 0 0 1 1.025.274ZM1.625 5.533h.001a.249.249 0 0 0-.126.217v4.5c0 .09.048.173.126.217a.75.75 0 0 1-.752 1.298A1.748 1.748 0 0 1 0 10.25v-4.5a1.748 1.748 0 0 1 .873-1.516.75.75 0 1 1 .752 1.299Z"></path></svg>
|
After Width: | Height: | Size: 696 B |
23
docs/static/open-in-gitpod.svg
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<svg width="160" height="45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_d)">
|
||||
<rect x="2" y="2" width="156" height="40" rx="16" fill="#F9F9F9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.425 11.174c.604 1.114.233 2.53-.83 3.164l-6.986 4.166a.378.378 0 00-.18.325v6.748c0 .134.069.258.18.325l5.714 3.407c.11.066.244.066.354 0l5.714-3.407a.378.378 0 00.18-.325V21.29l-4.986 2.936c-1.067.628-2.416.231-3.015-.886-.6-1.118-.22-2.532.846-3.16l7.008-4.127c2.048-1.206 4.576.345 4.576 2.806v6.718c0 1.803-.924 3.467-2.42 4.36l-5.713 3.407a4.596 4.596 0 01-4.734 0l-5.714-3.408C18.924 29.044 18 27.38 18 25.576V18.83c0-1.803.924-3.467 2.42-4.36l6.985-4.165c1.063-.634 2.415-.245 3.02.87z" fill="url(#paint0_linear)"/>
|
||||
<path fill="#F9F9F9" d="M47 12.5h95v-1H47z"/>
|
||||
<path d="M52.538 27.752c2.744 0 4.844-1.876 4.844-5.152 0-3.108-2.1-5.152-4.844-5.152s-4.802 2.002-4.802 5.152c0 3.29 2.058 5.152 4.802 5.152zm0-1.554c-1.736 0-2.912-1.316-2.912-3.598 0-2.226 1.162-3.598 2.912-3.598s2.954 1.4 2.954 3.598c0 2.31-1.218 3.598-2.954 3.598zm7.89 4.158V27.22c0-.196-.013-.378-.055-.658.434.7 1.022 1.19 2.17 1.19 1.736 0 3.066-1.414 3.066-3.626 0-2.17-1.19-3.682-2.996-3.682-1.078 0-1.806.476-2.24 1.204.042-.28.056-.462.056-.672v-.308H58.72v9.688h1.708zm1.695-3.948c-1.036 0-1.764-.938-1.764-2.31 0-1.414.742-2.296 1.764-2.296 1.092 0 1.75.952 1.75 2.296 0 1.372-.7 2.31-1.75 2.31zm7.866 1.344c1.848 0 3.052-1.078 3.192-2.478h-1.736c-.112.714-.714 1.134-1.456 1.134-1.036 0-1.722-.826-1.736-1.904h4.97v-.378c0-2.226-1.204-3.682-3.29-3.682-1.988 0-3.43 1.47-3.43 3.626 0 2.366 1.442 3.682 3.486 3.682zm-1.75-4.48c.098-.896.756-1.554 1.68-1.554.924 0 1.526.63 1.554 1.554H68.24zm8.006 4.228v-4.004c0-.952.616-1.694 1.456-1.694.798 0 1.288.63 1.288 1.638v4.06h1.708v-4.312c0-1.68-.896-2.744-2.408-2.744-1.078 0-1.722.518-2.1 1.204.042-.266.056-.476.056-.672v-.308h-1.708V27.5h1.708zm8.911-7.868h1.792V17.84h-1.792v1.792zm.042 1.036V27.5h1.708v-6.832h-1.708zm5.097 6.832v-4.004c0-.952.616-1.694 1.456-1.694.798 0 1.288.63 1.288 1.638v4.06h1.708v-4.312c0-1.68-.896-2.744-2.408-2.744-1.078 0-1.722.518-2.1 1.204.042-.266.056-.476.056-.672v-.308h-1.708V27.5h1.708zm13.238.252c1.526 0 2.52-.658 2.982-1.54-.07.322-.098.644-.098.98v.308h1.68v-5.222h-4.34v1.554h2.66v.07c0 1.4-1.134 2.296-2.59 2.296-1.792 0-3.024-1.372-3.024-3.598s1.26-3.598 3.066-3.598c1.302 0 2.17.756 2.296 1.736h1.89c-.182-1.904-1.764-3.29-4.214-3.29-2.954 0-4.928 2.128-4.928 5.152 0 3.136 1.848 5.152 4.62 5.152zm6.063-8.12h1.792V17.84h-1.792v1.792zm.042 1.036V27.5h1.708v-6.832h-1.708zm6.413 6.958c.434 0 .84-.07 1.008-.126v-1.288c-.168.028-.35.042-.518.042-.728 0-1.008-.42-1.008-1.134v-3.094h1.68v-1.358h-1.68v-2.464h-1.708v2.464h-1.554v1.358h1.554v3.346c0 1.526.77 2.254 2.226 2.254zm3.961 2.73V27.22c0-.196-.014-.378-.056-.658.434.7 1.022 1.19 2.17 1.19 1.736 0 3.066-1.414 3.066-3.626 0-2.17-1.19-3.682-2.996-3.682-1.078 0-1.806.476-2.24 1.204.042-.28.056-.462.056-.672v-.308h-1.708v9.688h1.708zm1.694-3.948c-1.036 0-1.764-.938-1.764-2.31 0-1.414.742-2.296 1.764-2.296 1.092 0 1.75.952 1.75 2.296 0 1.372-.7 2.31-1.75 2.31zm7.88 1.344c2.058 0 3.514-1.372 3.514-3.64 0-2.24-1.456-3.668-3.514-3.668-2.044 0-3.5 1.428-3.5 3.668 0 2.268 1.442 3.64 3.5 3.64zm0-1.344c-1.064 0-1.764-.84-1.764-2.296 0-1.484.728-2.31 1.764-2.31 1.05 0 1.778.826 1.778 2.31 0 1.456-.714 2.296-1.778 2.296zm7.551 1.344c1.26 0 1.876-.686 2.142-1.19-.056.238-.056.42-.056.658v.28h1.708v-9.8h-1.708v3.276c0 .21 0 .42.056.672-.392-.658-1.05-1.204-2.114-1.204-1.596 0-3.15 1.218-3.15 3.668 0 2.408 1.316 3.64 3.122 3.64zm.406-1.344c-1.022 0-1.792-.896-1.792-2.31 0-1.358.77-2.296 1.792-2.296s1.778.896 1.778 2.296c0 1.372-.756 2.31-1.778 2.31z" fill="#12100C"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="33.806" y1="13.629" x2="22.389" y2="30.86" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFB45B"/>
|
||||
<stop offset="1" stop-color="#FF8A00"/>
|
||||
</linearGradient>
|
||||
<filter id="filter0_d" x="0" y=".5" width="160" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset dy=".5"/>
|
||||
<feGaussianBlur stdDeviation="1"/>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
||||
<feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 4.5 KiB |