diff options
author | techknowlogick <techknowlogick@users.noreply.github.com> | 2017-11-26 16:44:32 -0500 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-11-26 23:44:32 +0200 |
commit | fb5c6b644460f94acb8976ad35165230b9d47fb2 (patch) | |
tree | 3811cb3807a9f666e77743cc0fc8bcea4276f421 /docs/content/doc/installation | |
parent | f148a4a1ed55c75d391930865185fb7bfbee03ba (diff) | |
download | gitea-fb5c6b644460f94acb8976ad35165230b9d47fb2.tar.gz gitea-fb5c6b644460f94acb8976ad35165230b9d47fb2.zip |
Import docs into main repository (#2874)
* import docs into main repository
Signed-off-by: Matti Ranta <matti@mdranta.net>
Diffstat (limited to 'docs/content/doc/installation')
16 files changed, 946 insertions, 0 deletions
diff --git a/docs/content/doc/installation/from-binary.en-us.md b/docs/content/doc/installation/from-binary.en-us.md new file mode 100644 index 0000000000..9503ac823a --- /dev/null +++ b/docs/content/doc/installation/from-binary.en-us.md @@ -0,0 +1,45 @@ +--- +date: "2017-06-19T12:00:00+02:00" +title: "Installation from binary" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "From binary" + weight: 20 + identifier: "install-from-binary" +--- + +# Installation from binary + +All downloads come with SQLite, MySQL and PostgreSQL support, and are built with embedded assets. Keep in mind that this can be different for older releases. The installation based on our binaries is quite simple, just choose the file matching your platform from the [downloads page](https://dl.gitea.io/gitea), copy the URL and replace the URL within the commands below: + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.1/gitea-1.0.1-linux-amd64 +chmod +x gitea +``` + +## Test + +After following the steps above you will have a `gitea` binary within your working directory, first you can test it if it works like expected and afterwards you can copy it to the destination where you want to store it. When you launch Gitea manually from your CLI you can always kill it by hitting `Ctrl + C`. + +``` +./gitea web +``` + +## Troubleshooting + +### Old glibc versions + +Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the Gitea binary, usually resulting an error like ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. This is due to the integrated SQLite support in the binaries we provide. In the future, we will provide binaries without the requirement for glibc. As a workaround, you can upgrade your distribution or [install from source]({{< relref "from-source.en-us.md" >}}). + +### Running gitea on another port + +If getting an error like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use` gitea needs to be started on another free port. This is possible using `./gitea web -p $PORT`. + +## Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/docs/content/doc/installation/from-binary.zh-cn.md b/docs/content/doc/installation/from-binary.zh-cn.md new file mode 100644 index 0000000000..c8ceb7c681 --- /dev/null +++ b/docs/content/doc/installation/from-binary.zh-cn.md @@ -0,0 +1,35 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从二进制安装" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "从二进制安装" + weight: 20 + identifier: "install-from-binary" +--- + +# 从二进制安装 + +所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例): + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 +chmod +x gitea +``` + +## 测试 + +在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。 + +``` +./gitea web +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/docs/content/doc/installation/from-binary.zh-tw.md b/docs/content/doc/installation/from-binary.zh-tw.md new file mode 100644 index 0000000000..e6b4637bb6 --- /dev/null +++ b/docs/content/doc/installation/from-binary.zh-tw.md @@ -0,0 +1,35 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "執行檔安裝" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "執行檔" + weight: 20 + identifier: "install-from-binary" +--- + +# 從執行檔安裝 + +所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了: + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 +chmod +x gitea +``` + +## 測試 + +執行完上述步驟,您將會得到 `gita` 執行檔,在複製到遠端伺服器前,您可以先測試看看,在命令列執行完成後,可以透過 `Ctrl + C` 關閉程式。 + +``` +./gitea web +``` + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 diff --git a/docs/content/doc/installation/from-package.en-us.md b/docs/content/doc/installation/from-package.en-us.md new file mode 100644 index 0000000000..94f0815d3e --- /dev/null +++ b/docs/content/doc/installation/from-package.en-us.md @@ -0,0 +1,57 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation from package" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "From package" + weight: 20 + identifier: "install-from-package" +--- + +# Installation from package + +## Linux + +We have not published any real package yet, we will update this page directly when we start to publish packages for any Linux distribution, in the meantime you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. + +## Windows + +We have not published any package for Windows yet, we will update this page directly when we start to publish packages in the form of `MSI` installers or via [Chocolatey](https://chocolatey.org/), in the meantime you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. + +## macOS + +Currently we only support the installation via `brew` for macOS. If you are not using [Homebrew](http://brew.sh/) you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. To install Gitea via `brew` you just need to execute the following commands: + +``` +brew tap go-gitea/gitea +brew install gitea +``` + +## FreeBSD + +A FreeBSD port `www/gitea` is available. You can install a pre-built binary package: + +``` +pkg install gitea +``` + +For the most up to date version, or to build the port with custom options, [install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html): + +``` +su - +cd /usr/ports/www/gitea +make install clean +``` + +The port uses the standard FreeBSD file system layout: config files are in `/usr/local/etc/gitea`, bundled templates, options, plugins and themes are in `/usr/local/share/gitea`, and a start script is in `/usr/local/etc/rc.d/gitea`. + +To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`. + +## Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/docs/content/doc/installation/from-package.zh-cn.md b/docs/content/doc/installation/from-package.zh-cn.md new file mode 100644 index 0000000000..c56a54fe0d --- /dev/null +++ b/docs/content/doc/installation/from-package.zh-cn.md @@ -0,0 +1,37 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "选择包安装" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "选择包安装" + weight: 20 + identifier: "install-from-package" +--- + +# 使用包安装 + +## 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 +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/docs/content/doc/installation/from-package.zh-tw.md b/docs/content/doc/installation/from-package.zh-tw.md new file mode 100644 index 0000000000..f37579d6fd --- /dev/null +++ b/docs/content/doc/installation/from-package.zh-tw.md @@ -0,0 +1,53 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "套件安裝" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "套件安裝" + weight: 20 + identifier: "install-from-package" +--- + +# 從套件安裝 + +## Linux + +目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。 + +## Windows + +目前尚未發佈任何 Windows 套件,如果我們發佈了,會直接更新此網頁。我們計畫使用 `MSI`,或 [Chocolatey](https://chocolatey.org/) 來製作套件。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。 + +## macOS + +目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令: + +``` +brew tap go-gitea/gitea +brew install gitea +``` + +## FreeBSD + +下載 FreeBSD port `www/gitea` 套件。你可以安裝 pre-built 執行檔: + +``` +pkg install gitea +``` + +對於最新版本或想要自行編譯特定選項,請使用 [port 安裝](https://www.freebsd.org/doc/handbook/ports-using.html): + +``` +su - +cd /usr/ports/www/gitea +make install clean +``` + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md new file mode 100644 index 0000000000..a6686d8bd8 --- /dev/null +++ b/docs/content/doc/installation/from-source.en-us.md @@ -0,0 +1,79 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation from source" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "From source" + weight: 30 + identifier: "install-from-source" +--- + +# Installation from source + +We won't cover the basics of a Golang setup within this guide. If you don't know how to get the environment up and running you should follow the official [install instructions](https://golang.org/doc/install). + +**Note**: Go version 1.7 or higher is required + +## Download + +First of all you have to retrieve the source code, the easiest way is to simply use directly Go for that. Just call the following commands to fetch the source and to switch into the working directory. + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +Now it's time to decide which version of Gitea you want to build and install. Currently there are multiple options you can choose from. If you want to build our `master` branch you can directly go ahead to the [build section](#build), this branch represents our current development version and this is not intended for production use. + +If you want to build the latest stable version that acts as a development branch for the tagged releases you can see the available branches and how to checkout this branch with these commands: + +``` +git branch -a +git checkout v1.0 +``` + +If you would validate a Pull Request, first your must enable this new branch : (`xyz` is the PR id, for example `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)) + +``` +git fetch origin pull/xyz/head:pr-xyz +``` + +Last but not least you can also directly build our tagged versions like `v1.0.0`, if you want to build Gitea from the source this is the suggested way for that. To use the tags you need to list the available tags and checkout a specific tag with the following commands: + +``` +git tag -l +git checkout v1.0.0 +git checkout pr-xyz +``` + +## Build + +Since we already bundle all required libraries to build Gitea you can continue with the build process itself. We provide various [make tasks](https://github.com/go-gitea/gitea/blob/master/Makefile) to keep the build process as simple as possible. <a href='{{< relref "doc/advanced/make.en-us.md" >}}'>See here how to get Make</a>. Depending on your requirements you possibly want to add various build tags, you can choose between these tags: + +* `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](https://sqlite.org/) database, this is only suggested for tiny Gitea installations. +* `tidb`: With this tag you can enable support for a [TiDB](https://github.com/pingcap/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. + +Now it's time to build the binary, we suggest to embed the assets with the `bindata` build tag, to include the assets you also have to execute the `generate` make task, otherwise the assets are not prepared to get embedded: + +``` +TAGS="bindata" make generate build +``` + +## Test + +After following the steps above you will have a `gitea` binary within your working directory, first you can test it if it works like expected and afterwards you can copy it to the destination where you want to store it. When you launch Gitea manually from your CLI you can always kill it by hitting `Ctrl + C`. + +``` +./gitea web +``` + +## Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/docs/content/doc/installation/from-source.zh-cn.md b/docs/content/doc/installation/from-source.zh-cn.md new file mode 100644 index 0000000000..78cae35bf2 --- /dev/null +++ b/docs/content/doc/installation/from-source.zh-cn.md @@ -0,0 +1,84 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从源代码安装" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "从源代码安装" + weight: 30 + identifier: "install-from-source" +--- + +# 从源代码安装 + +首先你需要安装Golang,关于Golang的安装,参见官方文档 [install instructions](https://golang.org/doc/install)。 + +## 下载 + +你需要获取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`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。 +* `sqlite`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。 +* `tidb`: 这个编译选项启用tidb嵌入式数据库的支持,他跟SQLite类似但是是用纯Go编写的。 +* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。 + +我们支持两种方式进行编译,Make 工具 和 Go 工具。不过我们推荐使用 Make工具,因为他将会给出更多的编译选项。 + +**Note**: We recommend the Go version 1.6 or higher because we are using vendoring and we don't set the required env variable for 1.5 anywhere. + +* Make 工具 + +这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate: + +``` +TAGS="bindata" make generate build +``` + +* Go 工具 + +使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下: + +``` +go build +``` + +## 测试 + +在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。 + +``` +./gitea web +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/docs/content/doc/installation/from-source.zh-tw.md b/docs/content/doc/installation/from-source.zh-tw.md new file mode 100644 index 0000000000..9fdb9ccfef --- /dev/null +++ b/docs/content/doc/installation/from-source.zh-tw.md @@ -0,0 +1,73 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "原始碼安裝" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "原始碼安裝" + weight: 30 + identifier: "install-from-source" +--- + +# 從原始碼安裝 + +我們不會在本文教大家如何安裝 Golang 環境。假如您不知道如何設定環境,請直接參考[官方安裝文件](https://golang.org/doc/install)。 + +## 下載 + +首先您必須先下載原始碼,最簡單的方式就是透過 Go 指令下載,請透過底下指令下載原始碼並且切換到工作目錄。 + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +現在該決定您要編譯或安裝的 Gitea 版本,您有很多可以選擇。如果您想編譯 `master` 版本,你可以直接跳到[編譯章節](#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`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。 +* `sqlite`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。 +* `tidb`: 使用此標籤來啟用 [TiDB](https://github.com/pingcap/tidb) 資料庫,它是檔案形式的資料庫,跟 SQLite 類似。 +* `pam`: 使用此標籤來啟用 PAM (Linux Pluggable Authentication Modules) 認證,對於系統使用者來說,此方式最方便了。 + +現在您可以開始編譯執行檔了,我們建議使用 `bindata` 編譯選項,使用 `bindata` 選項前,您必須執行 `generate` 任務將所有資源都一起編譯進去,否則相關資源都不會被編譯進執行檔: + +``` +TAGS="bindata" make generate build +``` + +**注意**: 因為使用了套件管理工具,我們建議 Go 環境版本為 1.6 或者是更高,這樣不用在 Go 1.5 版本設定全域變數 `GO15VENDOREXPERIMENT`。 + +## 測試 + +完成上述步驟後,您可以在當下目錄發現 `gitea` 執行檔,在複製執行檔到遠端環境之前,您必須透過底下指令執行測試,使用 `Ctrl + C` 則可以關閉當下 gitea 程序。 + +``` +./gitea web +``` + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 + diff --git a/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md b/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md new file mode 100644 index 0000000000..3d58167bf2 --- /dev/null +++ b/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md @@ -0,0 +1,68 @@ +--- +date: "2017-07-21T12:00:00+02:00" +title: "Run as service in Linux" +slug: "linux-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Linux service" + weight: 20 + identifier: "linux-service" +--- + +### Run as service in Ubuntu 16.04 LTS + +#### Using systemd + +Run below command in terminal: +``` +sudo vim /etc/systemd/system/gitea.service +``` + +Add code to the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service). + +Uncomment any service need to be enabled like mysql in this case in Unit section. + +Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. + +Lastly start and enable gitea at boot: +``` +sudo systemctl start gitea +``` +``` +sudo systemctl enable gitea +``` + + +#### Using supervisor + +Install supervisor by running below command in terminal: +``` +sudo apt install supervisor +``` + +Create a log dir for the supervisor logs(assuming gitea is installed in /home/git/gitea/): +``` +mkdir /home/git/gitea/log/supervisor +``` + +Open supervisor config file in vi/vim/nano etc. +``` +sudo vim /etc/supervisor/supervisord.conf +``` + +And append the code at the end of the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea). + +Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. + +Lastly start and enable supervisor at boot: +``` +sudo systemctl start supervisor +``` +``` +sudo systemctl enable supervisor +``` + diff --git a/docs/content/doc/installation/windows-service.en-us.md b/docs/content/doc/installation/windows-service.en-us.md new file mode 100644 index 0000000000..0092c261c7 --- /dev/null +++ b/docs/content/doc/installation/windows-service.en-us.md @@ -0,0 +1,34 @@ +--- +date: "2016-12-21T15:00:00-02:00" +title: "Register as a Windows Service" +slug: "windows-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Windows Service" + weight: 30 + identifier: "windows-service" +--- + +# Register as a Windows Service + +To register Gitea as a Windows service, first run `cmd` as an Administrator, and then run the following command: + +``` +sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini"" +``` + +Do not forget to replace `C:\gitea` with your real Gitea folder. + +After, open "Windows Services", search for the service named "gitea", right-click it and click on "Run". If everything is OK you should be able to reach Gitea on `http://localhost:3000` (or the port is was configured, if different than 3000). + +## Unregister as a service + +To unregister Gitea as a service, open `cmd` as an Administrator and run: + +``` +sc delete gitea +``` diff --git a/docs/content/doc/installation/windows-service.zh-cn.md b/docs/content/doc/installation/windows-service.zh-cn.md new file mode 100644 index 0000000000..6f03f38b8e --- /dev/null +++ b/docs/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 delete gitea +``` diff --git a/docs/content/doc/installation/windows-service.zh-tw.md b/docs/content/doc/installation/windows-service.zh-tw.md new file mode 100644 index 0000000000..23dba7f8c9 --- /dev/null +++ b/docs/content/doc/installation/windows-service.zh-tw.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 服務,首先要以管理者身份執行 `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 是預設值)。 + +## 刪除服務 + +要刪除 Gitea 服務,請用管理者身份執行 `cmd` 並且執行底下指令: + +``` +sc delete gitea +``` diff --git a/docs/content/doc/installation/with-docker.en-us.md b/docs/content/doc/installation/with-docker.en-us.md new file mode 100644 index 0000000000..74460778c1 --- /dev/null +++ b/docs/content/doc/installation/with-docker.en-us.md @@ -0,0 +1,196 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation with Docker" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "With Docker" + weight: 10 + identifier: "install-with-docker" +--- + +# Installation with Docker + +We provide automatically updated Docker images within our Docker Hub organization. It is up to you and your deployment to always use the latest stable tag or to use another service that updates the Docker image for you. + +This reference setup guides you through the setup based on `docker-compose`, the installation of `docker-compose` is out of scope of this documentation. To install `docker-compose` follow the official [install instructions](https://docs.docker.com/compose/install/). + +## Basics + +The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest` image as a service. Since there is no database available you can start it only with SQLite3. Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. + +```yaml +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: + - 3000:3000 + - 222:22 +``` + +## Custom port + +To bind the integrated openSSH daemon and the webserver on a different port, you just need to adjust the port section. It's common to just change the host port and keep the ports within the container like they are. + +```diff +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: +- - 3000:3000 +- - 222:22 ++ - 8080:3000 ++ - 2221:22 +``` + +## MySQL database + +To start Gitea in combination with a MySQL database you should apply these changes to the `docker-compose.yml` file created above. + +```diff +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: + - 3000:3000 + - 222:22 ++ depends_on: ++ - db ++ ++ db: ++ image: mysql:5.7 ++ restart: always ++ environment: ++ - MYSQL_ROOT_PASSWORD=gitea ++ - MYSQL_USER=gitea ++ - MYSQL_PASSWORD=gitea ++ - MYSQL_DATABASE=gitea ++ networks: ++ - gitea ++ volumes: ++ - ./mysql:/var/lib/mysql +``` + +## PostgreSQL database + +To start Gitea in combination with a PostgreSQL database you should apply these changes to the `docker-compose.yml` file created above. + +```diff +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: + - 3000:3000 + - 222:22 ++ depends_on: ++ - db ++ ++ db: ++ image: postgres:9.6 ++ restart: always ++ environment: ++ - POSTGRES_USER=gitea ++ - POSTGRES_PASSWORD=gitea ++ - POSTGRES_DB=gitea ++ networks: ++ - gitea ++ volumes: ++ - ./postgres:/var/lib/postgresql/data +``` + +## Named volumes + +To use named volumes instead of host volumes you just have to define and use the named volume within the `docker-compose.yml` configuration. This change will automatically create the required volume. + +```diff +version: "2" + +networks: + gitea: + external: false + ++volumes: ++ gitea: ++ driver: local ++ +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: +- - ./gitea:/data ++ - gitea:/data + ports: + - 3000:3000 + - 222:22 +``` + +If you are using MySQL or PostgreSQL it's up to you to create named volumes for these containers as well. + +## Start + +To start this setup based on `docker-compose` you just have to execute `docker-compose up -d` to launch Gitea in the background. You can see if it started properly via `docker-compose ps`, and you can tail the log output via `docker-compose logs`. + +If you want to shutdown the setup again just execute `docker-compose down`, this will stop and kill the containers, the volumes will still exist. + +## Install + +After starting the Docker setup via `docker-compose` you should access Gitea with your favorite browser to finalize the installation. Please visit http://server-ip:3000 and follow the installation wizard. If you have started a database with the `docker-compose` setup as documented above please note that you have to use `db` as the database hostname. + +# Customization + +Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should be placed in `/data/gitea` directory. If you are using host volumes it's quite easy to access these files, for named volumes you have to do it through another container or you should directly access `/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at `/data/gitea/conf/app.ini` after the installation. + +# Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/docs/content/doc/installation/with-docker.zh-cn.md b/docs/content/doc/installation/with-docker.zh-cn.md new file mode 100644 index 0000000000..983a0d1f88 --- /dev/null +++ b/docs/content/doc/installation/with-docker.zh-cn.md @@ -0,0 +1,42 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从Docker安装" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "从Docker安装" + weight: 10 + identifier: "install-with-docker" +--- + +# 从Docker安装 + +阅读本章之前我们已经假设您对docker已经有了解并能够正常使用docker。 + +我们在 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`. + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/docs/content/doc/installation/with-docker.zh-tw.md b/docs/content/doc/installation/with-docker.zh-tw.md new file mode 100644 index 0000000000..960c23187e --- /dev/null +++ b/docs/content/doc/installation/with-docker.zh-tw.md @@ -0,0 +1,40 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Docker 安裝" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Docker 安裝" + weight: 10 + identifier: "install-with-docker" +--- + +# 用 Docker 安裝 + +我們在 Docker Hub 提供了自動更新的映像檔,它會保持最新穩定版。根據您的部屬環境來使用最新版本或用其他服務來更新 Docker 映像檔。首先您需要下載映像檔: + +``` +docker pull gitea/gitea:latest +``` + +為了儲存您的所有 Git 儲存庫資料,您應該建立一個目錄,用來存放資料的地方。 + +``` +sudo mkdir -p /var/lib/gitea +``` + +現在就可以直接啟動 Docker 容器,這是一個非常簡單的過程,您必須定義啟動連接埠,並且提供上面所建立的資料儲存路徑: + +``` +docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest +``` + +然後 Gitea 容器已經開始運行,您可以透過個人喜愛的瀏覽器來訪問 http://hostname:10080,假如您想要開始 Clone 儲存庫,可以直接執行 `git clone ssh://git@hostname:10022/username/repo.git` 指令。 + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 |