From 07579a83b765db84f6efc375c9dc078c7fb17bf8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 22 Dec 2016 14:17:02 +0800 Subject: [PATCH 1/4] translate Chinese to follow the English's changes --- content/doc/installation/from-binary.zh-cn.md | 19 +++++- .../doc/installation/from-package.zh-cn.md | 16 ++++- content/doc/installation/from-source.zh-cn.md | 66 ++++++++++++++++++- .../doc/installation/windows-service.zh-cn.md | 34 ++++++++++ content/doc/installation/with-docker.zh-cn.md | 26 +++++++- 5 files changed, 154 insertions(+), 7 deletions(-) create mode 100644 content/doc/installation/windows-service.zh-cn.md diff --git a/content/doc/installation/from-binary.zh-cn.md b/content/doc/installation/from-binary.zh-cn.md index 26f5e05..1aa8c9e 100644 --- a/content/doc/installation/from-binary.zh-cn.md +++ b/content/doc/installation/from-binary.zh-cn.md @@ -15,6 +15,21 @@ menu: # 从二进制安装 -所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 +所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例): -## TBD +``` +wget -O gitea https://dl.gitea.io/gitea/v1.0.0/gitea-v1.0.0-linux-amd64 +chmod +x gitea +``` + +## 测试 + +在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。 + +``` +./gitea web +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [Gitter channel - 英文](https://gitter.im/go-gitea/gitea/) 或加入 QQ群 328432459 获得进一步的支持。 \ No newline at end of file diff --git a/content/doc/installation/from-package.zh-cn.md b/content/doc/installation/from-package.zh-cn.md index 1f4fbff..65470c9 100644 --- a/content/doc/installation/from-package.zh-cn.md +++ b/content/doc/installation/from-package.zh-cn.md @@ -15,11 +15,23 @@ menu: # 使用包安装 -当前我们仅支持 macOS 平台下的 `brew` 安装 +## Linux + +目前还没有对应的Linux安装包发布,如果我们发布了,我们将更新本页面。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。 + +## Windows + +目前还没有对应的Windows安装包发布,如果我们发布了,我们将更新本页面。我们计划使用 `MSI` 安装器或者 [Chocolatey](https://chocolatey.org/)来制作安装包。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。 + +## macOS + +macOS 平台下当前我们仅支持通过 `brew` 来安装。如果您没有安装 [Homebrew](http://brew.sh/),你冶可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令: ``` brew tap go-gitea/gitea brew install gitea ``` -## TBD +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [Gitter channel - 英文](https://gitter.im/go-gitea/gitea/) 或加入 QQ群 328432459 获得进一步的支持。 diff --git a/content/doc/installation/from-source.zh-cn.md b/content/doc/installation/from-source.zh-cn.md index f486a7f..62bf6b0 100644 --- a/content/doc/installation/from-source.zh-cn.md +++ b/content/doc/installation/from-source.zh-cn.md @@ -17,4 +17,68 @@ menu: 首先你需要安装Golang,关于Golang的安装,参见官方文档 [install instructions](https://golang.org/doc/install)。 -## TBD +## 下载 + +你需要获取Gitea的源码,最方便的方式是使用 go 命令。执行以下命令: + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +然后你可以选择编译和安装的版本,当前你有多个选择。如果你想编译 `master` 版本,你可以直接跳到 [编译](#build) 部分,这是我们的开发分支,虽然也很稳定但不建议您在正式产品中使用。 + +如果你想编译最新稳定分支,你可以执行以下命令签出源码: + +``` +git branch -a +git checkout v1.0 +``` + +最后,你也可以直接使用标签版本如 `v1.0.0`。你可以执行以下命令列出可用的版本并选择某个版本签出: + +``` +git tag -l +git checkout v1.0.0 +``` + +## 编译 + +我们已经将所有的依赖项拷贝到本工程,我们提供了一些 [编译选项](https://github.com/go-gitea/gitea/blob/master/Makefile) 来让编译更简单。你可以按照你的需求来设置编译开关,可用编译选项如下: + +* `bindata`: With this tag you can embed all assets required to run an instance of Gitea, this makes a deployment quite easy because you don't need to care about any additional file. +* `sqlite`: With this tag you can enable support for a SQLite3 database, this is only suggested for tiny Gitea installations. +* `tidb`: With this tag you can enable support for a TiDB database, it's a quite simple file-based database comparable with SQLite. +* `pam`: With this tag you can enable support for PAM (Linux Pluggable Authentication Modules), this is useful if your users should be authenticated via your available system users. + +我们支持两种方式进行编译,Go 工具和 Make 工具。使用 Make工具 编译将会自动生成版本号,这是和 Go工具编译的唯一区别。 + +* Go 工具 + +使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下: + +``` +go build -tags="bindata" +``` + +如果要使用bindata选项,你可能需要先执行go generate + +* Make 工具 + +这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate: + +``` +TAGS="bindata" make generate build +``` + +## 测试 + +在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。 + +``` +./gitea web +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [Gitter channel - 英文](https://gitter.im/go-gitea/gitea/) 或加入 QQ群 328432459 获得进一步的支持。 diff --git a/content/doc/installation/windows-service.zh-cn.md b/content/doc/installation/windows-service.zh-cn.md new file mode 100644 index 0000000..8307223 --- /dev/null +++ b/content/doc/installation/windows-service.zh-cn.md @@ -0,0 +1,34 @@ +--- +date: "2016-12-21T15:00:00-02:00" +title: "注册为Windows服务" +slug: "windows-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Windows服务" + weight: 30 + identifier: "windows-service" +--- + +# 注册为Windows服务 + +要注册为Windows服务,首先以Administrator身份运行 `cmd`,然后执行以下命令: + +``` +sc 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是默认端口)。 + +## 从Windows服务中删除 + +以Administrator身份运行 `cmd`,然后执行以下命令: + +``` +sc remove gitea +``` diff --git a/content/doc/installation/with-docker.zh-cn.md b/content/doc/installation/with-docker.zh-cn.md index fd19845..02e9e66 100644 --- a/content/doc/installation/with-docker.zh-cn.md +++ b/content/doc/installation/with-docker.zh-cn.md @@ -15,6 +15,28 @@ menu: # 从Docker安装 -我们在 Docker Hub 的 Gitea 组织中提供了自动更新的 Docker 镜像,它会保持最新的稳定版。 +阅读本章之前我们已经假设您对docker已经有了解并能够正常使用docker。 -## TBD +我们在 Docker Hub 的 Gitea 组织中提供了自动更新的 Docker 镜像,它会保持最新的稳定版。你也可以用其它 Docker 服务来更新。首先你需要pull镜像: + +``` +docker pull gitea/gitea:latest +``` + +如果要将git和其它数据持久化,你需要创建一个目录来作为数据存储的地方: + +``` +sudo mkdir -p /var/lib/gitea +``` + +然后就可以运行 docker 容器了,这很简单。 当然你需要定义端口数数据目录: + +``` +docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest +``` + +然后 容器已经运行成功,在浏览器中访问 http://hostname:10080 就可以看到界面了。你可以尝试在上面创建项目,clone操作 `git clone ssh://git@hostname:10022/username/repo.git`. + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [Gitter channel - 英文](https://gitter.im/go-gitea/gitea/) 或加入 QQ群 328432459 获得进一步的支持。 \ No newline at end of file From ff3876f6b7fa6698696bbee3c0c17100624bc588 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 22 Dec 2016 14:23:37 +0800 Subject: [PATCH 2/4] add upgrade docs change --- content/doc/upgrade/from-gogs.zh-cn.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/doc/upgrade/from-gogs.zh-cn.md b/content/doc/upgrade/from-gogs.zh-cn.md index 25506bc..05eb119 100644 --- a/content/doc/upgrade/from-gogs.zh-cn.md +++ b/content/doc/upgrade/from-gogs.zh-cn.md @@ -19,7 +19,8 @@ menu: * 停止 Gogs 的运行 * 拷贝 Gogs 的配置文件 `custom/conf/app.ini` 到 Gitea 的相应位置。 -* 拷贝 Gogs 的 `conf/` 目录到 `options/` 目录。 -* 如果你自己修改过templates目录,你需要手工合并你的修改到Gitea的templates目录下。 +* 拷贝 Gitea 的 `options/` 到 Home 目录下。 +* 如果你还有更多的自定义内容,比如templates和localization文件,你需要手工合并你的修改到 Gitea 的 Options 下对应目录。 +* 拷贝 Gogs 的数据目录 `data/` 到 Gitea 相应位置。这个目录包含附件和头像文件。 * 运行 Gitea * 登陆 Gitea 并进入 管理面板, 运行 `重新生成 '.ssh/authorized_keys' 文件(警告:不是 Gitea 的密钥也会被删除)` 和 `重新生成所有仓库的 Update 钩子(用于自定义配置文件被修改)`。 \ No newline at end of file From 0bcd1c6377327c337d51de43dfaa2efd3946999e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 24 Dec 2016 20:37:52 +0800 Subject: [PATCH 3/4] update missing and fix download link --- content/doc/installation/from-binary.zh-cn.md | 2 +- content/doc/installation/from-source.zh-cn.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/doc/installation/from-binary.zh-cn.md b/content/doc/installation/from-binary.zh-cn.md index 1aa8c9e..c73f86a 100644 --- a/content/doc/installation/from-binary.zh-cn.md +++ b/content/doc/installation/from-binary.zh-cn.md @@ -18,7 +18,7 @@ menu: 所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例): ``` -wget -O gitea https://dl.gitea.io/gitea/v1.0.0/gitea-v1.0.0-linux-amd64 +wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 chmod +x gitea ``` diff --git a/content/doc/installation/from-source.zh-cn.md b/content/doc/installation/from-source.zh-cn.md index 62bf6b0..7e49161 100644 --- a/content/doc/installation/from-source.zh-cn.md +++ b/content/doc/installation/from-source.zh-cn.md @@ -46,10 +46,10 @@ git checkout v1.0.0 我们已经将所有的依赖项拷贝到本工程,我们提供了一些 [编译选项](https://github.com/go-gitea/gitea/blob/master/Makefile) 来让编译更简单。你可以按照你的需求来设置编译开关,可用编译选项如下: -* `bindata`: With this tag you can embed all assets required to run an instance of Gitea, this makes a deployment quite easy because you don't need to care about any additional file. -* `sqlite`: With this tag you can enable support for a SQLite3 database, this is only suggested for tiny Gitea installations. -* `tidb`: With this tag you can enable support for a TiDB database, it's a quite simple file-based database comparable with SQLite. -* `pam`: With this tag you can enable support for PAM (Linux Pluggable Authentication Modules), this is useful if your users should be authenticated via your available system users. +* `bindata`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。 +* `sqlite`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。 +* `tidb`: 这个编译选项启用tidb嵌入式数据库的支持,他跟SQLite类似但是是用纯Go编写的。 +* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。 我们支持两种方式进行编译,Go 工具和 Make 工具。使用 Make工具 编译将会自动生成版本号,这是和 Go工具编译的唯一区别。 From 1f532adbab6542054dfa7111d654ed1dbcb21c66 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 25 Dec 2016 23:04:34 +0800 Subject: [PATCH 4/4] fix go build and recommend make build --- content/doc/installation/from-source.zh-cn.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/content/doc/installation/from-source.zh-cn.md b/content/doc/installation/from-source.zh-cn.md index 7e49161..f2c4d9d 100644 --- a/content/doc/installation/from-source.zh-cn.md +++ b/content/doc/installation/from-source.zh-cn.md @@ -51,24 +51,22 @@ git checkout v1.0.0 * `tidb`: 这个编译选项启用tidb嵌入式数据库的支持,他跟SQLite类似但是是用纯Go编写的。 * `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。 -我们支持两种方式进行编译,Go 工具和 Make 工具。使用 Make工具 编译将会自动生成版本号,这是和 Go工具编译的唯一区别。 +我们支持两种方式进行编译,Make 工具 和 Go 工具。不过我们推荐使用 Make工具,因为他将会给出更多的编译选项。 -* Go 工具 +* Make 工具 -使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下: +这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate: ``` -go build -tags="bindata" +TAGS="bindata" make generate build ``` -如果要使用bindata选项,你可能需要先执行go generate - -* Make 工具 +* Go 工具 -这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate: +使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下: ``` -TAGS="bindata" make generate build +go build ``` ## 测试