mirror of https://github.com/go-gitea/gitea.git
Import docs into main repository (#2874)
* import docs into main repository Signed-off-by: Matti Ranta <matti@mdranta.net>pull/2978/head
parent
f148a4a1ed
commit
fb5c6b6444
@ -0,0 +1,34 @@
|
||||
# http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.go]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
[*.{tmpl,html}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.{less}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
@ -0,0 +1,2 @@
|
||||
public/
|
||||
themes/
|
@ -0,0 +1,22 @@
|
||||
# build stage
|
||||
FROM golang:alpine AS build-env
|
||||
|
||||
RUN apk add --no-cache git
|
||||
RUN go get -d -v github.com/mholt/caddy/caddy github.com/pedronasser/caddy-search github.com/simia-tech/caddy-locale
|
||||
WORKDIR /go/src/github.com/mholt/caddy/caddy
|
||||
|
||||
RUN sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/pedronasser/caddy-search"' caddymain/run.go \
|
||||
&& sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/simia-tech/caddy-locale"' caddymain/run.go \
|
||||
&& go install -v . \
|
||||
&& /go/bin/caddy -version
|
||||
|
||||
FROM alpine:edge
|
||||
EXPOSE 80
|
||||
|
||||
RUN apk add --no-cache wget mailcap ca-certificates
|
||||
COPY --from=build-env /go/bin/caddy /usr/sbin/caddy
|
||||
|
||||
COPY docker/caddy.conf /etc/caddy.conf
|
||||
COPY public /srv/www
|
||||
|
||||
CMD ["/usr/sbin/caddy", "-conf", "/etc/caddy.conf"]
|
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,29 @@
|
||||
THEME := themes/gitea
|
||||
PUBLIC := public
|
||||
ARCHIVE := https://dl.gitea.io/theme/master.tar.gz
|
||||
|
||||
.PHONY: all
|
||||
all: build
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(PUBLIC) $(THEME)
|
||||
|
||||
.PHONY: trans-copy
|
||||
trans-copy:
|
||||
@bash scripts/trans-copy
|
||||
|
||||
.PHONY: server
|
||||
server: $(THEME)
|
||||
hugo server
|
||||
|
||||
.PHONY: build
|
||||
build: $(THEME)
|
||||
hugo --cleanDestinationDir
|
||||
|
||||
.PHONY: update
|
||||
update: $(THEME)
|
||||
|
||||
$(THEME):
|
||||
mkdir -p $@
|
||||
curl -s $(ARCHIVE) | tar xz -C $@
|
@ -0,0 +1,55 @@
|
||||
# Gitea: Docs
|
||||
|
||||
[![Build Status](http://drone.gitea.io/api/badges/go-gitea/docs/status.svg)](http://drone.gitea.io/go-gitea/docs)
|
||||
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
|
||||
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
|
||||
|
||||
## Hosting
|
||||
|
||||
This page is hosted on our infrastructure within Docker containers, it gets
|
||||
automatically updated on every push to the `master` branch.
|
||||
|
||||
If you want to host this page on your own you can take our docker image
|
||||
[gitea/docs](https://hub.docker.com/r/gitea/docs/).
|
||||
|
||||
## Install
|
||||
|
||||
This pages uses the [Hugo](https://github.com/spf13/hugo) static site generator.
|
||||
If you are planning to contribute you'll want to download and install Hugo on
|
||||
your local machine.
|
||||
|
||||
The installation of Hugo is out of the scope of this document, so please take
|
||||
the [official install instructions](https://gohugo.io/overview/installing/) to
|
||||
get Hugo up and running.
|
||||
|
||||
## Development
|
||||
|
||||
To generate the website and serve it on [localhost:1313](http://localhost:1313)
|
||||
just execute this command and stop it with `Ctrl+C`:
|
||||
|
||||
```
|
||||
make server
|
||||
```
|
||||
|
||||
When you are done with your changes just create a pull request, after merging
|
||||
the pull request the website will be updated automatically.
|
||||
|
||||
## Contributing
|
||||
|
||||
Fork -> Patch -> Push -> Pull Request
|
||||
|
||||
## Authors
|
||||
|
||||
* [Maintainers](https://github.com/orgs/go-gitea/people)
|
||||
* [Contributors](https://github.com/go-gitea/docs/graphs/contributors)
|
||||
|
||||
## License
|
||||
|
||||
This project is under the Apache-2.0 License. See the [LICENSE](LICENSE) file
|
||||
for the full license text.
|
||||
|
||||
## Copyright
|
||||
|
||||
```
|
||||
Copyright (c) 2016 The Gitea Authors <https://gitea.io>
|
||||
```
|
@ -0,0 +1,237 @@
|
||||
baseurl: https://docs.gitea.io/
|
||||
languageCode: en-us
|
||||
title: Docs
|
||||
theme: gitea
|
||||
disqusShortname: gitea
|
||||
|
||||
defaultContentLanguage: en-us
|
||||
defaultContentLanguageInSubdir: true
|
||||
enableMissingTranslationPlaceholders: true
|
||||
|
||||
permalinks:
|
||||
post: /:year/:month/:title/
|
||||
doc: /:slug/
|
||||
page: /:slug/
|
||||
default: /:slug/
|
||||
|
||||
params:
|
||||
description: Git with a cup of tea
|
||||
author: The Gitea Authors
|
||||
website: https://docs.gitea.io
|
||||
|
||||
menu:
|
||||
page:
|
||||
- name: Website
|
||||
url: https://gitea.io/en-us/
|
||||
weight: 10
|
||||
pre: home
|
||||
- name: Docs
|
||||
url: /en-us/
|
||||
weight: 20
|
||||
pre: question
|
||||
post: active
|
||||
- name: API
|
||||
url: https://try.gitea.io/api/swagger
|
||||
weight: 25
|
||||
pre: plug
|
||||
- name: Blog
|
||||
url: https://blog.gitea.io/
|
||||
weight: 30
|
||||
pre: rss
|
||||
- name: Code
|
||||
url: https://code.gitea.io/
|
||||
weight: 40
|
||||
pre: code
|
||||
- name: Downloads
|
||||
url: https://dl.gitea.io/
|
||||
weight: 50
|
||||
pre: download
|
||||
- name: GitHub
|
||||
url: https://github.com/go-gitea/
|
||||
weight: 60
|
||||
pre: github
|
||||
- name: Discord Chat
|
||||
url: https://discord.gg/NsatcWJ
|
||||
weight: 70
|
||||
pre: comment
|
||||
- name: Forum
|
||||
url: https://discourse.gitea.io/
|
||||
weight: 80
|
||||
pre: group
|
||||
|
||||
languages:
|
||||
en-us:
|
||||
weight: 0
|
||||
languageName: English
|
||||
|
||||
zh-cn:
|
||||
weight: 1
|
||||
languageName: 中文(简体)
|
||||
menu:
|
||||
page:
|
||||
- name: 网站
|
||||
url: https://gitea.io/zh-cn/
|
||||
weight: 10
|
||||
pre: home
|
||||
- name: 文档
|
||||
url: /zh-cn/
|
||||
weight: 20
|
||||
pre: question
|
||||
post: active
|
||||
- name: API
|
||||
url: https://try.gitea.io/api/swagger
|
||||
weight: 25
|
||||
pre: plug
|
||||
- name: 博客
|
||||
url: https://blog.gitea.io/
|
||||
weight: 30
|
||||
pre: rss
|
||||
- name: 导入
|
||||
url: https://code.gitea.io/
|
||||
weight: 40
|
||||
pre: code
|
||||
- name: 下载
|
||||
url: https://dl.gitea.io/
|
||||
weight: 50
|
||||
pre: download
|
||||
- name: GitHub
|
||||
url: https://github.com/go-gitea/
|
||||
weight: 60
|
||||
pre: github
|
||||
- name: Discord Chat
|
||||
url: https://discord.gg/NsatcWJ
|
||||
weight: 70
|
||||
pre: comment
|
||||
- name: Forum
|
||||
url: https://discourse.gitea.io/
|
||||
weight: 80
|
||||
pre: group
|
||||
|
||||
zh-tw:
|
||||
weight: 2
|
||||
languageName: 中文(繁體)
|
||||
menu:
|
||||
page:
|
||||
- name: 網站
|
||||
url: https://gitea.io/zh-tw/
|
||||
weight: 10
|
||||
pre: home
|
||||
- name: 文件
|
||||
url: /zh-tw/
|
||||
weight: 20
|
||||
pre: question
|
||||
post: active
|
||||
- name: API
|
||||
url: https://try.gitea.io/api/swagger
|
||||
weight: 25
|
||||
pre: plug
|
||||
- name: 部落格
|
||||
url: https://blog.gitea.io/
|
||||
weight: 30
|
||||
pre: rss
|
||||
- name: 程式碼
|
||||
url: https://code.gitea.io/
|
||||
weight: 40
|
||||
pre: code
|
||||
- name: 下载
|
||||
url: https://dl.gitea.io/
|
||||
weight: 50
|
||||
pre: download
|
||||
- name: GitHub
|
||||
url: https://github.com/go-gitea/
|
||||
weight: 60
|
||||
pre: github
|
||||
- name: Discord Chat
|
||||
url: https://discord.gg/NsatcWJ
|
||||
weight: 70
|
||||
pre: comment
|
||||
- name: Forum
|
||||
url: https://discourse.gitea.io/
|
||||
weight: 80
|
||||
pre: group
|
||||
|
||||
pt-br:
|
||||
weight: 3
|
||||
languageName: Português Brasileiro
|
||||
menu:
|
||||
page:
|
||||
- name: Página inicial
|
||||
url: https://gitea.io/pt-br/
|
||||
weight: 10
|
||||
pre: home
|
||||
- name: Documentação
|
||||
url: /pt-br/
|
||||
weight: 20
|
||||
pre: question
|
||||
post: active
|
||||
- name: API
|
||||
url: https://try.gitea.io/api/swagger
|
||||
weight: 25
|
||||
pre: plug
|
||||
- name: Blog
|
||||
url: https://blog.gitea.io/
|
||||
weight: 30
|
||||
pre: rss
|
||||
- name: Código-fonte
|
||||
url: https://code.gitea.io/
|
||||
weight: 40
|
||||
pre: code
|
||||
- name: Downloads
|
||||
url: https://dl.gitea.io/
|
||||
weight: 50
|
||||
pre: download
|
||||
- name: GitHub
|
||||
url: https://github.com/go-gitea/
|
||||
weight: 60
|
||||
pre: github
|
||||
- name: Chat no Discord
|
||||
url: https://discord.gg/NsatcWJ
|
||||
weight: 70
|
||||
pre: comment
|
||||
- name: Forum
|
||||
url: https://discourse.gitea.io/
|
||||
weight: 80
|
||||
pre: group
|
||||
|
||||
nl-nl:
|
||||
weight: 4
|
||||
languageName: Nederlands
|
||||
menu:
|
||||
page:
|
||||
- name: Website
|
||||
url: https://gitea.io/nl-nl/
|
||||
weight: 10
|
||||
pre: home
|
||||
- name: Docs
|
||||
url: /nl-nl/
|
||||
weight: 20
|
||||
pre: question
|
||||
post: active
|
||||
- name: API
|
||||
url: https://try.gitea.io/api/swagger
|
||||
weight: 25
|
||||
pre: plug
|
||||
- name: Blog
|
||||
url: https://blog.gitea.io/
|
||||
weight: 30
|
||||
pre: rss
|
||||
- name: Code
|
||||
url: https://code.gitea.io/
|
||||
weight: 40
|
||||
pre: code
|
||||
- name: Downloads
|
||||
url: https://dl.gitea.io/
|
||||
weight: 50
|
||||
pre: download
|
||||
- name: GitHub
|
||||
url: https://github.com/go-gitea/
|
||||
weight: 60
|
||||
pre: github
|
||||
- name: Discord Chat
|
||||
url: https://discord.gg/NsatcWJ
|
||||
weight: 70
|
||||
pre: comment
|
||||
- name: Forum
|
||||
url: https://discourse.gitea.io/
|
||||
weight: 80
|
||||
pre: group
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Advanced"
|
||||
slug: "advanced"
|
||||
weight: 30
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Advanced"
|
||||
weight: 40
|
||||
identifier: "advanced"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "进阶"
|
||||
slug: "advanced"
|
||||
weight: 30
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "进阶"
|
||||
weight: 40
|
||||
identifier: "advanced"
|
||||
---
|
@ -0,0 +1,218 @@
|
||||
---
|
||||
date: "2016-12-26T16:00:00+02:00"
|
||||
title: "Config Cheat Sheet"
|
||||
slug: "config-cheat-sheet"
|
||||
weight: 20
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "advanced"
|
||||
name: "Config Cheat Sheet"
|
||||
weight: 20
|
||||
identifier: "config-cheat-sheet"
|
||||
---
|
||||
|
||||
# Configuration Cheat Sheet
|
||||
|
||||
This is a cheat sheet for the Gitea configuration file. It is helpful for more fully understanding how it powers Gitea.
|
||||
|
||||
Before getting started, make sure you know that any change to the configuration should be made in `custom/conf/app.ini` or any corresponding location.
|
||||
|
||||
All default settings can be found in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (replace master in URL with name of tag for released versions). If you see anything which looks like `%(X)s`, it is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values) for reading values recursively.
|
||||
|
||||
Any configuration option that is marked by :exclamation: means that you should keep the default value unless you fully understand what you are doing.
|
||||
|
||||
Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
|
||||
**Note** that you have to restart Gitea for changes to take effect.
|
||||
|
||||
## Overall (`DEFAULT`)
|
||||
|
||||
- `APP_NAME`: Application name, change to whatever you want.
|
||||
- `RUN_USER`: The user to run Gitea as, we recommend it be `git`; however, change this to whatever your username is if you run Gitea on your personal computer. Gitea may crash if this value is not set properly.
|
||||
- `RUN_MODE`: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically.
|
||||
|
||||
## Repository (`repository`)
|
||||
|
||||
- `ROOT`: Root path for storing all users' repository data. It must be an absolute path. The default is `~/<username>/gitea-repositories`.
|
||||
- `SCRIPT_TYPE`: The script type your server supports, usually this is `bash`, but some customers report that they only have `sh`.
|
||||
- `ANSI_CHARSET`: The default charset for an unrecognized charset.
|
||||
- `FORCE_PRIVATE`: Force every new repository to be private.
|
||||
- `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit.
|
||||
- `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible.
|
||||
|
||||
## UI (`ui`)
|
||||
|
||||
- `EXPLORE_PAGING_NUM`: Number of repositories that are shown in one explore page.
|
||||
- `ISSUE_PAGING_NUM`: Number of issues that are shown in one page (for all pages that list issues).
|
||||
- `FEED_MAX_COMMIT_NUM`: Number of maximum commits shown in one activity feed.
|
||||
|
||||
### UI - Admin (`ui.admin`)
|
||||
|
||||
- `USER_PAGING_NUM`: Number of users that are shown in one page.
|
||||
- `REPO_PAGING_NUM`: Number of repos that are shown in one page.
|
||||
- `NOTICE_PAGING_NUM`: Number of notices that are shown in one page.
|
||||
- `ORG_PAGING_NUM`: Number of organizations that are shown in one page.
|
||||
|
||||
## Markdown (`markdown`)
|
||||
|
||||
- `ENABLE_HARD_LINE_BREAK`: Whether or not to enable hard the line break extension.
|
||||
|
||||
## Server (`server`)
|
||||
|
||||
- `PROTOCOL`: Either `http`, `https`, `fcgi`, or `unix`.
|
||||
- `DOMAIN`: Domain name of your server.
|
||||
- `ROOT_URL`: Full public URL of Gitea server.
|
||||
- `HTTP_ADDR`: HTTP listen address. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use.
|
||||
- `HTTP_PORT`: HTTP listen port. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
|
||||
- `UNIX_SOCKET_PERMISSION`: Permisson mode for Unix socket, default is 666.
|
||||
- `DISABLE_SSH`: Disables SSH feature when it's not available.
|
||||
- `START_SSH_SERVER`: Starts built-in SSH server when enabled.
|
||||
- `SSH_DOMAIN`: Domain name of your ssh server.
|
||||
- `SSH_PORT`: SSH port displayed in clone URL, in case yours is not `22`.
|
||||
- `SSH_LISTEN_PORT`: Port for the built-in SSH server. Defaults to `SSH_PORT`.
|
||||
- `OFFLINE_MODE`: Disables use of CDN for static files and Gravatar for profile pictures.
|
||||
- `DISABLE_ROUTER_LOG`: Mutes printing of the router log.
|
||||
- `CERT_FILE`: Cert file path used for HTTPS.
|
||||
- `KEY_FILE`: Key file path used for HTTPS.
|
||||
- `STATIC_ROOT_PATH`: Upper level of template and static files path, default is the path where Gitea is located.
|
||||
- `ENABLE_GZIP`: Enables application-level GZIP support.
|
||||
- `LANDING_PAGE`: Non-logged-in users' landing page, either `home` or `explore`.
|
||||
- `LFS_START_SERVER`: Enables git-lfs support. `true` or `false`, default is `false`.
|
||||
- `LFS_CONTENT_PATH`: Where your lfs files put on, default is `data/lfs`.
|
||||
- `LFS_JWT_SECRET`: LFS authentication secret, changed this to yourself.
|
||||
|
||||
## Database (`database`)
|
||||
|
||||
- `DB_TYPE`: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`.
|
||||
- `HOST`: Database host address and port.
|
||||
- `NAME`: Database name.
|
||||
- `USER`: Database username.
|
||||
- `PASSWD`: Database user password.
|
||||
- `SSL_MODE`: For PostgreSQL only.
|
||||
- `PATH`: For SQLite3 only, the database file path.
|
||||
|
||||
## Security (`security`)
|
||||
|
||||
- `INSTALL_LOCK`: Indicates whether to allow the open install page (setting admin account is involved, so it's a very important value).
|
||||
- `SECRET_KEY`: Global secret key for your server security, **you'd better change it** (will generate a random string every time you install).
|
||||
- `LOGIN_REMEMBER_DAYS`: Cookie lifetime, in days.
|
||||
- `COOKIE_USERNAME`: Name of the cookie that saves username.
|
||||
- `COOKIE_REMEMBER_NAME`: Name of cookie that saves auto-login information.
|
||||
- `REVERSE_PROXY_AUTHENTICATION_USER`: Header name for reverse proxy authentication username.
|
||||
- `DISABLE_GIT_HOOKS`: Prevent all users (including admin) from creating custom git hooks (defaults to false)
|
||||
|
||||
## OpenID (`openid`)
|
||||
|
||||
- `ENABLE_OPENID_SIGNIN`: Whether to allow signin in via OpenID (defaults to false).
|
||||
- `ENABLE_OPENID_SIGNUP`: Whether to allow registering via OpenID (defaults to `!DISABLE_REGISTRATION`).
|
||||
- `WHITELISTED_URIS`: Space separated list of POSIX regexp patterns. If non empty OpenID URIs should match any of these to be granted access.
|
||||
- `BLACKLISTED_URIS`: Space separated list of POSIX regexp pattenrs. OpenID URI matching any of these is refused access.
|
||||
|
||||
## Service (`service`)
|
||||
|
||||
- `ACTIVE_CODE_LIVE_MINUTES`: The minutes of active code life time.
|
||||
- `RESET_PASSWD_CODE_LIVE_MINUTES`: The minutes of reset password code life time.
|
||||
- `REGISTER_EMAIL_CONFIRM`: Enable this to ask for mail confirmation of registration, requires `Mailer` to be enabled.
|
||||
- `DISABLE_REGISTRATION`: Disable registration, after which only admin can create accounts for users.
|
||||
- `SHOW_REGISTRATION_BUTTON`: Indicate whether to show registration button or not.
|
||||
- `REQUIRE_SIGNIN_VIEW`: Enable this to force users to log in to view any page.
|
||||
- `ENABLE_CACHE_AVATAR`: Enable this to cache avatar from Gravatar.
|
||||
- `ENABLE_NOTIFY_MAIL`: Enable this to send e-mail to watchers of repository when something happens like creating issues, requires `Mailer` to be enabled.
|
||||
- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: Enable this to allow reverse proxy authentication, more detail: https://github.com/gogits/gogs/issues/165
|
||||
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: Enable this to allow auto-registration for reverse authentication.
|
||||
- `DISABLE_MINIMUM_KEY_SIZE_CHECK`: Do not check minimum key size with corresponding type.
|
||||
- `ENABLE_CAPTCHA`: Enable this to use captcha validation for registration.
|
||||
|
||||
## Webhook (`webhook`)
|
||||
|
||||
- `QUEUE_LENGTH`:exclamation:: Hook task queue length.
|
||||
- `DELIVER_TIMEOUT`: Delivery timeout in seconds for shooting webhooks.
|
||||
- `SKIP_TLS_VERIFY`: Indicate whether to allow insecure certification or not.
|
||||
- `PAGING_NUM`: Number of webhook history that are shown in one page.
|
||||
|
||||
## Mailer (`mailer`)
|
||||
|
||||
- `ENABLED`: Enable this to use a mail service.
|
||||
- `DISABLE_HELO`: Disable HELO operation.
|
||||
- `HELO_HOSTNAME`: Custom hostname for HELO operation.
|
||||
- `HOST`: SMTP mail host address and port (example: smtp.gitea.io:587).
|
||||
- `FROM`: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format.
|
||||
- `USER`: Username of mailer (usually just your e-mail address).
|
||||
- `PASSWD`: Password of mailer.
|
||||
- `SKIP_VERIFY`: Do not verify the self-signed certificates.
|
||||
- `USE_SENDMAIL`: Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems. Valid values are `true` to use sendmail and `false` to use SMTP (default). Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`.
|
||||
- `SENDMAIL_PATH`: The location of sendmail on the operating system. This can be an absolute path (eg: `/usr/sbin/sendmail`) or just the name of the command (eg: `sendmail` - default) if it can be found in the `PATH` environment variable.
|
||||
|
||||
Note: Actually, Gitea supports only SMTP with STARTTLS.
|
||||
|
||||
## Cache (`cache`)
|
||||
|
||||
- `ADAPTER`: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`.
|
||||
- `INTERVAL`: for memory cache only, GC interval in seconds.
|
||||
- `HOST`: For redis and memcache, the host address and port number.
|
||||
- Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180`
|
||||
- Memache: `127.0.0.1:9090;127.0.0.1:9091`
|
||||
|
||||
## Session (`session`)
|
||||
|
||||
- `PROVIDER`: Session engine provider, either `memory`, `file`, `redis`, or `mysql`.
|
||||
- `PROVIDER_CONFIG`: For file, it's the root path; for others, it's the host address and port number.
|
||||
- `COOKIE_SECURE`: Enable this to force using HTTPS for all session access.
|
||||
- `COOKIE_NAME`: The name of the cookie used for the session ID, defaults to `i_like_gitea`.
|
||||
- `GC_INTERVAL_TIME`: GC interval in seconds.
|
||||
|
||||
## Picture (`picture`)
|
||||
|
||||
- `GRAVATAR_SOURCE`: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`.
|
||||
- `DISABLE_GRAVATAR`: Enable this to use local avatars only.
|
||||
- `ENABLE_FEDERATED_AVATAR`: Enable support for federated avatars (see http://www.libravatar.org)
|
||||
- `AVATAR_UPLOAD_PATH`: Path to store local and cached files.
|
||||
|
||||
## Attachment (`attachment`)
|
||||
|
||||
- `ENABLED`: Enable this to allow users upload attachments.
|
||||
- `PATH`: Path to store attachments.
|
||||
- `ALLOWED_TYPES`: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types.
|
||||
- `MAX_SIZE`: Maximum size in MB, e.g. `4`
|
||||
- `MAX_FILES`: Maximum number of attachments can be uploaded at once, e.g. `5`.
|
||||
|
||||
## Log (`log`)
|
||||
|
||||
- `ROOT_PATH`: Root path for log files.
|
||||
- `MODE`: Logging mode, default is `console`. For multiple modes, use comma to separate it.
|
||||
- `LEVEL`: General log level, default is `Trace`.
|
||||
|
||||
## Cron (`cron`)
|
||||
|
||||
- `ENABLED`: Enable this to run cron tasks periodically.
|
||||
- `RUN_AT_START`: Enable this to run cron tasks at start time.
|
||||
|
||||
### Cron - Update Mirrors (`cron.update_mirrors`)
|
||||
|
||||
- `SCHEDULE`: Cron syntax for scheduling update mirrors, e.g. `@every 1h`.
|
||||
|
||||
### Cron - Repository Health Check (`cron.repo_health_check`)
|
||||
|
||||
- `SCHEDULE`: Cron syntax for scheduling repository health check, e.g. `@every 24h`.
|
||||
- `TIMEOUT`: Time duration syntax for health check execution timeout, e.g. `60s`.
|
||||
- `ARGS`: Arguments for command `git fsck`, e.g. `--unreachable --tags`.
|
||||
|
||||
### Cron - Repository Statistics Check (`cron.check_repo_stats`)
|
||||
|
||||
- `RUN_AT_START`: Enable this to run repository statistics check at start time.
|
||||
- `SCHEDULE`: Cron syntax for scheduling repository statistics check, e.g. `@every 24h`.
|
||||
|
||||
## Git (`git`)
|
||||
|
||||
- `MAX_GIT_DIFF_LINES`: Max number of lines allowed of a single file in diff view.
|
||||
- `MAX_GIT_DIFF_LINE_CHARACTERS`: Max number of characters of a line allowed in diff view.
|
||||
- `MAX_GIT_DIFF_FILES`: Max number of files shown in diff view.
|
||||
- `GC_ARGS`: Arguments for command `git gc`, e.g. `--aggressive --auto`.
|
||||
|
||||
## Other (`other`)
|
||||
|
||||
- `SHOW_FOOTER_BRANDING`: Enable this to show Gitea branding in the footer.
|
||||
- `SHOW_FOOTER_VERSION`: Enable this to show Gitea version information in the footer.
|
||||
- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: Enable this to show time of template execution in the footer.
|
@ -0,0 +1,54 @@
|
||||
---
|
||||
date: "2017-04-15T14:56:00+02:00"
|
||||
title: "Customizing Gitea"
|
||||
slug: "customizing-gitea"
|
||||
weight: 9
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "advanced"
|
||||
name: "Customizing Gitea"
|
||||
weight: 9
|
||||
identifier: "customizing-gitea"
|
||||
---
|
||||
|
||||
# Customizing Gitea
|
||||
|
||||
The main way to customize Gitea is by using the `custom` folder. This is the central place to override and configure features.
|
||||
|
||||
If you install Gitea from binary, after the installation process ends, you can find the `custom` folder next to the binary.
|
||||
Gitea will create the folder for you and prepopulate it with a `conf` folder inside, where Gitea stores all the configuration settings provided through the installation steps (have a look [here](https://docs.gitea.io/en-us/config-cheat-sheet/) for a complete list).
|
||||
|
||||
If you can't find the `custom` folder next to the binary, please check the `GITEA_CUSTOM` environment variable, that can be used to override the default path to something else. `GITEA_CUSTOM` might be set for example in your launch script file. Please have a look [here](https://docs.gitea.io/en-us/specific-variables/) for a complete list of environment variables.
|
||||
|
||||
**Note** that you have to restart Gitea for it to notice the changes.
|
||||
|
||||
## Customizing /robots.txt
|
||||
|
||||
To make Gitea serve your own `/robots.txt` (by default, an empty 404 status is served), simply create a file called `robots.txt` in the `custom` folder with the [expected contents](http://www.robotstxt.org/).
|
||||
|
||||
## Serving custom public files
|
||||
|
||||
To make Gitea serve custom public files (like pages and images), use the folder `custom/public/` as the webroot. Symbolic links will be followed.
|
||||
|
||||
For example, a file `image.png` stored in `custom/public`, can be accessed with the url `http://your-gitea-url/image.png`.
|
||||
|
||||
## Changing the default avatar
|
||||
|
||||
Place the png image at the following path: `custom/public/img/avatar_default.png`
|
||||
|
||||
## Customizing Gitea pages
|
||||
|
||||
The `custom/templates` folder allows you to change every single page of Gitea.
|
||||
|
||||
You need to be aware of the template you want to change. All templates can be found in the `templates` folder of the Gitea sources.
|
||||
|
||||
When you find the correct .tmpl file, you need to copy it in the `custom/templates` folder of your installation, __respecting__ any subfolder you found in the source template.
|
||||
|
||||
You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax.
|
||||
Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing.
|
||||
|
||||
## Customizing gitignores, labels, licenses, locales, and readmes.
|
||||
|
||||
Place your own files in corresponding sub-folder under `custom/options`.
|
@ -0,0 +1,44 @@
|
||||
---
|
||||
date: "2017-01-14T11:00:00-02:00"
|
||||
title: "Make"
|
||||
slug: "make"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "advanced"
|
||||
name: "Make"
|
||||
weight: 30
|
||||
identifier: "make"
|
||||
---
|
||||
|
||||
# Make
|
||||
|
||||
Gitea makes heavy use of Make to automate tasks and have a faster development. This guide cover how to install Make.
|
||||
|
||||
### On Linux
|
||||
|
||||
You can install with your package manager.
|
||||
|
||||
On Ubuntu/Debian:
|
||||
|
||||
```bash
|
||||
sudo apt-get install build-essential
|
||||
```
|
||||
|
||||
On Fedora/RHEL/CentOS:
|
||||
|
||||
```bash
|
||||
sudo yum install make
|
||||
```
|
||||
|
||||
### On Windows
|
||||
|
||||
If you are using Windows, you can download and use one of these distributions of Make:
|
||||
|
||||
- [Single binary build](http://www.equation.com/servlet/equation.cmd?fa=make). Copy somewhere and add to `PATH`.
|
||||
- [32-bits version](ftp://ftp.equation.com/make/32/make.exe)
|
||||
- [64-bits version](ftp://ftp.equation.com/make/64/make.exe)
|
||||
- [MinGW](http://www.mingw.org/) includes a build. The binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to your `PATH`.
|
||||
- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make`
|
@ -0,0 +1,67 @@
|
||||
---
|
||||
date: "2017-04-08T11:34:00+02:00"
|
||||
title: "Specific variables"
|
||||
slug: "specific-variables"
|
||||
weight: 20
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "advanced"
|
||||
name: "Specific variables"
|
||||
weight: 20
|
||||
identifier: "specific-variables"
|
||||
---
|
||||
|
||||
# Specific variables
|
||||
|
||||
This is an inventory of Gitea environment variables. They change Gitea behaviour.
|
||||
|
||||
Initialize them before Gitea command to be effective, for example:
|
||||
|
||||
```
|
||||
GITEA_CUSTOM=/home/gitea/custom ./gitea web
|
||||
```
|
||||
|
||||
## From Go language
|
||||
|
||||
As Gitea is written in Go, it uses some Go variables as:
|
||||
|
||||
* `GOOS`
|
||||
* `GOARCH`
|
||||
* `GOPATH`
|
||||
|
||||
For `GOPATH`, check [official documentation about GOPATH environment variable](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable).
|
||||
|
||||
For others, check [official documentation about variables used when it runs the generator](https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source).
|
||||
|
||||
## Gitea files
|
||||
|
||||
* `GITEA_WORK_DIR`: Gitea absolute path of work directory.
|
||||
* `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable to change *custom* directory.
|
||||
* `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
|
||||
* `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
|
||||
|
||||
## Operating system specifics
|
||||
|
||||
* `USER`: system user that launch Gitea. Useful for repository URL address on Gitea interface
|
||||
* `USERNAME`: if no USER found, Gitea will try `USERNAME`
|
||||
* `HOME`: User home directory path (**except if** you're running on Windows, check the following `USERPROFILE` variable)
|
||||
|
||||
### Only on Windows
|
||||
|
||||
* `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
|
||||
* `HOMEDRIVE`: Main drive path you will use to get home directory
|
||||
* `HOMEPATH`: Home relative path in the given home drive path
|
||||
|
||||
## Macaron (framework used by Gitea)
|
||||
|
||||
* `HOST`: Host Macaron will listen on
|
||||
* `PORT`: Port Macaron will listen on
|
||||
* `MACARON_ENV`: global variable to provide special functionality for development environments vs production environments. If MACARON_ENV is set to "" or "development" then templates will be recompiled on every request. For more performance, set the MACARON_ENV environment variable to "production".
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
* `SKIP_MINWINSVC`: Do not run as a service on Windows if set to 1
|
||||
* `ZOOKEEPER_PATH`: [Zookeeper](http://zookeeper.apache.org/) jar file path
|
||||
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Features"
|
||||
slug: "features"
|
||||
weight: 20
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Features"
|
||||
weight: 30
|
||||
identifier: "features"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "特性"
|
||||
slug: "features"
|
||||
weight: 20
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "特性"
|
||||
weight: 30
|
||||
identifier: "features"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "功能"
|
||||
slug: "features"
|
||||
weight: 20
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "功能"
|
||||
weight: 30
|
||||
identifier: "features"
|
||||
---
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "认证"
|
||||
slug: "authentication"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "认证"
|
||||
weight: 10
|
||||
identifier: "authentication"
|
||||
---
|
||||
|
||||
# 认证
|
||||
|
||||
## TBD
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "認證"
|
||||
slug: "authentication"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "認證"
|
||||
weight: 10
|
||||
identifier: "authentication"
|
||||
---
|
||||
|
||||
# 認證
|
||||
|
||||
## TBD
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Localization"
|
||||
slug: "localization"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "Localization"
|
||||
weight: 20
|
||||
identifier: "localization"
|
||||
---
|
||||
|
||||
# Localization
|
||||
|
||||
## TBD
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "本地化"
|
||||
slug: "localization"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "本地化"
|
||||
weight: 20
|
||||
identifier: "localization"
|
||||
---
|
||||
|
||||
# 本地化
|
||||
|
||||
## TBD
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "在地化"
|
||||
slug: "localization"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "在地化"
|
||||
weight: 20
|
||||
identifier: "localization"
|
||||
---
|
||||
|
||||
# Localization
|
||||
|
||||
## TBD
|
@ -0,0 +1,103 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Webhooks"
|
||||
slug: "webhooks"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "Webhooks"
|
||||
weight: 30
|
||||
identifier: "webhooks"
|
||||
---
|
||||
|
||||
# Webhooks
|
||||
|
||||
Gitea supports web hooks for repository events, you can find it in settings page(`/:username/:reponame/settings/hooks`). All event pushes are POST requests, and we currently support two formats: Gitea and Slack.
|
||||
|
||||
### Event information
|
||||
|
||||
Following shows an example of event information that will be sent by Gitea to Payload URL:
|
||||
|
||||
|
||||
```
|
||||
X-Github-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
|
||||
X-Github-Event: push
|
||||
X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
|
||||
X-Gogs-Event: push
|
||||
X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
|
||||
X-Gitea-Event: push
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3",
|
||||
"ref": "refs/heads/develop",
|
||||
"before": "28e1879d029cb852e4844d9c718537df08844e03",
|
||||
"after": "bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"commits": [
|
||||
{
|
||||
"id": "bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"message": "Webhooks Yay!",
|
||||
"url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a",
|
||||
"author": {
|
||||
"name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"username": "gitea"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"username": "gitea"
|
||||
},
|
||||
"timestamp": "2017-03-13T13:52:11-04:00"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"id": 140,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"login": "gitea",
|
||||
"full_name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"avatar_url": "https://localhost:3000/avatars/1",
|
||||
"username": "gitea"
|
||||
},
|
||||
"name": "webhooks",
|
||||
"full_name": "gitea/webhooks",
|
||||
"description": "",
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"html_url": "http://localhost:3000/gitea/webhooks",
|
||||
"ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git",
|
||||
"clone_url": "http://localhost:3000/gitea/webhooks.git",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 1,
|
||||
"watchers_count": 1,
|
||||
"open_issues_count": 7,
|
||||
"default_branch": "master",
|
||||
"created_at": "2017-02-26T04:29:06-05:00",
|
||||
"updated_at": "2017-03-13T13:51:58-04:00"
|
||||
},
|
||||
"pusher": {
|
||||
"id": 1,
|
||||
"login": "gitea",
|
||||
"full_name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"avatar_url": "https://localhost:3000/avatars/1",
|
||||
"username": "gitea"
|
||||
},
|
||||
"sender": {
|
||||
"id": 1,
|
||||
"login": "gitea",
|
||||
"full_name": "Gitea",
|
||||
"email": "someone@gitea.io",
|
||||
"avatar_url": "https://localhost:3000/avatars/1",
|
||||
"username": "gitea"
|
||||
}
|
||||
}
|
||||
```
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Webhooks"
|
||||
slug: "webhooks"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "Webhooks"
|
||||
weight: 30
|
||||
identifier: "webhooks"
|
||||
---
|
||||
|
||||
# Webhooks
|
||||
|
||||
## TBD
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Webhooks"
|
||||
slug: "webhooks"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "features"
|
||||
name: "Webhooks"
|
||||
weight: 30
|
||||
identifier: "webhooks"
|
||||
---
|
||||
|
||||
# Webhooks
|
||||
|
||||
## TBD
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2017-01-20T15:00:00+08:00"
|
||||
title: "帮助"
|
||||
slug: "help"
|
||||
weight: 50
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "帮助"
|
||||
weight: 50
|
||||
identifier: "help"
|
||||
---
|
@ -0,0 +1,23 @@
|
||||
---
|
||||
date: "2017-01-20T15:00:00+08:00"
|
||||
title: "需要帮助"
|
||||
slug: "seek-help"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "help"
|
||||
name: "需要帮助"
|
||||
weight: 20
|
||||
identifier: "seek-help"
|
||||
---
|
||||
|
||||
## 需要帮助?
|
||||
|
||||
如果您在使用或者开发过程中遇到问题,请到以下渠道咨询:
|
||||
|
||||
- 到[Github issue](https://github.com/go-gitea/gitea/issues)提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问)
|
||||
- 中文问题到[gocn.io](https://gocn.io/topic/Gitea)提问
|
||||
- 访问 [Discord server - 英文](https://discord.gg/NsatcWJ)
|
||||
- 加入 QQ群 328432459 获得进一步的支持
|
@ -0,0 +1,69 @@
|
||||
---
|
||||
date: "2016-11-08T16:00:00+02:00"
|
||||
title: "Troubleshooting"
|
||||
slug: "troubleshooting"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "Help"
|
||||
name: "Troubleshooting"
|
||||
weight: 20
|
||||
identifier: "troubleshooting"
|
||||
---
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
This page contains some common issues you can run into and their solutions.
|
||||
|
||||
## SSH issues
|
||||
|
||||
If you are having issues with reaching your repositories over `ssh` while the
|
||||
Gitea web front-end and `https` based git operations work fine, consider
|
||||
looking at the following items.
|
||||
|
||||
```
|
||||
Permission denied (publickey).
|
||||
fatal: Could not read from remote repository.
|
||||
|
||||
Please make sure you have the correct access rights
|
||||
and the repository exists.
|
||||
```
|
||||
|
||||
This error signifies that the server rejected your log in attempt, check the
|
||||
following things:
|
||||
|
||||
* On the client:
|
||||
* Ensure the public and private ssh keys are added to the correct Gitea user.
|
||||
* Make sure there are no issues in your remote url, ensure the name of the
|
||||
git user (before the `@`) is spelled correctly.
|
||||
* Ensure the public and private ssh keys are available and reachable on the
|
||||
client machine.
|
||||
* Try to `ssh git@myremote.example` to ensure that everything is set up
|
||||
properly.
|
||||
* On the server:
|
||||
* Check the permissions of the `.ssh` directory in the home directory of your
|
||||
`git` user.
|
||||
* Verify that the correct public keys are added to `.ssh/authorized_keys`.
|
||||
Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the
|
||||
Gitea admin panel.
|
||||
|
||||
If you get a similar error without the public key part (shown below) then
|
||||
authentication succeeded, but some other setting is preventing ssh from
|
||||
reaching the correct repository.
|
||||
|
||||
```
|
||||
fatal: Could not read from remote repository.
|
||||
|
||||
Please make sure you have the correct access rights
|
||||
and the repository exists.
|
||||
```
|
||||
|
||||
In this case, look into the following settings:
|
||||
|
||||
* On the server:
|
||||
* Make sure that your `git` user has a usable shell set. You can verify this
|
||||
with `getent passwd git | cut -d: -f7`, `chsh` can be used to modify this.
|
||||
* Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the
|
||||
proper configuration file.
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Installation"
|
||||
slug: "installation"
|
||||
weight: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Installation"
|
||||
weight: 10
|
||||
identifier: "installation"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "安装"
|
||||
slug: "installation"
|
||||
weight: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "安装"
|
||||
weight: 10
|
||||
identifier: "installation"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "安裝"
|
||||
slug: "installation"
|
||||
weight: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "安裝"
|
||||
weight: 10
|
||||
identifier: "installation"
|
||||
---
|
@ -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.
|
@ -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.
|
@ -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.
|
@ -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),在那邊可以快速得到協助。
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -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
|
||||
```
|
@ -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.
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Upgrade"
|
||||
slug: "upgrade"
|
||||
weight: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Upgrade"
|
||||
weight: 20
|
||||
identifier: "upgrade"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "升级"
|
||||
slug: "upgrade"
|
||||
weight: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "升级"
|
||||
weight: 20
|
||||
identifier: "upgrade"
|
||||
---
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "升級"
|
||||
slug: "upgrade"
|
||||
weight: 10
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "升級"
|
||||
weight: 20
|
||||
identifier: "upgrade"
|
||||
---
|
@ -0,0 +1,82 @@
|
||||
---
|
||||
date: "2016-12-01T16:00:00+02:00"
|
||||
title: "Upgrade from Gogs"
|
||||
slug: "upgrade-from-gogs"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "upgrade"
|
||||
name: "From Gogs"
|
||||
weight: 10
|
||||
identifier: "upgrade-from-gogs"
|
||||
---
|
||||
|
||||
# Upgrade from Gogs
|
||||
|
||||
Gogs versions up to 0.9.146 (db schema version 15) can be smoothly upgraded to Gitea.
|
||||
|
||||
There are some steps to do so below. On Unix run as your Gogs user:
|
||||
|
||||
* Create a Gogs backup with `gogs dump`. This creates `gogs-dump-[timestamp].zip` file containing all your Gogs data.
|
||||
* Download the file matching your platform from the [downloads page](https://dl.gitea.io/gitea).
|
||||
* Put the binary at the desired install location.
|
||||
* Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`.
|
||||
* If you have custom `templates, public` in `gogs/custom/` copy them to `gitea/custom/`.
|
||||
* If you have any other custom folders like `gitignore, label, license, locale, readme` in `gogs/custom/conf` copy them to `gitea/custom/options`.
|
||||
* Copy `gogs/data/` to `gitea/data/`. It contains issue attachments and avatars.
|
||||
* Verify by starting Gitea with `gitea web`.
|
||||
* Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`, then run `Rewrite all update hook of repositories` (needed when custom config path is changed).
|
||||
|
||||
### Change gogs specific information:
|
||||
|
||||
* Rename `gogs-repositories/` to `gitea-repositories/`
|
||||
* Rename `gogs-data/` to `gitea-data/`
|
||||
* In your `gitea/custom/conf/app.ini` change:
|
||||
|
||||
FROM:
|
||||
```
|
||||
[database]
|
||||
PATH = /home/:USER/gogs/data/:DATABASE.db
|
||||
[attachment]
|
||||
PATH = /home/:USER/gogs-data/attachments
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
|
||||
[log]
|
||||
ROOT_PATH = /home/:USER/gogs/log
|
||||
```
|
||||
|
||||
TO:
|
||||
```
|
||||
[database]
|
||||
PATH = /home/:USER/gitea/data/:DATABASE.db
|
||||
[attachment]
|
||||
PATH = /home/:USER/gitea-data/attachments
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
|
||||
[log]
|
||||
ROOT_PATH = /home/:USER/gitea/log
|
||||
```
|
||||
|
||||
* Verify by starting Gitea with `gitea web`
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
* If you encounter errors relating to custom templates in the `gitea/custom/templates` folder, try moving the templates causing the errors away one by one. They may not be compatible with Gitea.
|
||||
|
||||
### Add Gitea to startup on Unix
|
||||
|
||||
Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) with the right environment variables.
|
||||
|
||||
For distro's with systemd:
|
||||
|
||||
* Copy the updated script to `/etc/systemd/system/gitea.service`
|
||||
* Add the service to the startup with: `sudo systemctl enable gitea`
|
||||
* Disable old gogs startup script: `sudo systemctl disable gogs`
|
||||
|
||||
For distro's with SysVinit:
|
||||
|
||||
* Copy the updated script to `/etc/init.d/gitea`
|
||||
* Add the service to the startup with: `sudo rc-update add gitea`
|
||||
* Disable old gogs startup script: `sudo rc-update del gogs`
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
date: "2016-12-27T16:00:00+02:00"
|
||||
title: "Usage"
|
||||
slug: "usage"
|
||||
weight: 35
|
||||
toc: false
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
name: "Usage"
|
||||
weight: 35
|
||||
identifier: "usage"
|
||||
---
|
@ -0,0 +1,46 @@
|
||||
---
|
||||
date: "2017-01-01T16:00:00+02:00"
|
||||
title: "Usage: Backup and Restore"
|
||||
slug: "backup-and-restore"
|
||||
weight: 11
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "Backup and Restore"
|
||||
weight: 11
|
||||
identifier: "backup-and-restore"
|
||||
---
|
||||
|
||||
# Backup and Restore
|
||||
|
||||
Gitea currently has a `dump` command that will save your installation to a zip file. There will be a `restore` command implemented at some point in the future. You will be able to use this to back up your installation, as well as make migrating servers easier.
|
||||
|
||||
## Backup Command (`dump`)
|
||||
|
||||
First, switch to the user running gitea: `su git` (or whatever user you are using). Run `./gitea dump` in the gitea installation directory. You should see some output similar to this:
|
||||
|
||||
```
|
||||
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
|
||||
2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
|
||||
2016/12/27 22:32:22 Dumping database...
|
||||
2016/12/27 22:32:22 Packing dump files...
|
||||
2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001
|
||||
2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
|
||||
```
|
||||
|
||||
Inside the `gitea-dump-1482906742.zip` file, you will find the following:
|
||||
|
||||
* `custom/conf/app.ini` - This is your server config.
|
||||
* `gitea-db.sql` - SQL dump of your database.
|
||||
* `gitea-repo.zip` - This zip will be a complete copy of your repo folder.
|
||||
See Config -> repository -> `ROOT` for the location.
|
||||
* `log/` - this will contain various logs. You don't need these if you are doing
|
||||
a migration.
|
||||
|
||||
Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable.
|
||||
|
||||
## Restore Command (`restore`)
|
||||
|
||||
WIP: Does not exist yet.
|
@ -0,0 +1,45 @@
|
||||
---
|
||||
date: "2017-01-01T16:00:00+02:00"
|
||||
title: "用法: 備份與還原"
|
||||
slug: "backup-and-restore"
|
||||
weight: 11
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "備份與還原"
|
||||
weight: 11
|
||||
identifier: "backup-and-restore"
|
||||
---
|
||||
|
||||
# 備份與還原
|
||||
|
||||
Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續會提供還原指令,讓你可以輕易的將備份資料及還原到另外一台機器。
|
||||
|
||||
## 備份指令 (`dump`)
|
||||
|
||||
首先,切換到執行 Gitea 的使用者: `su git` (請修改成您指定的使用者),並在安裝目錄內執行 `./gitea dump` 指令,你可以看到 console 畫面如下:
|
||||
|
||||
```
|
||||
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
|
||||
2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
|
||||
2016/12/27 22:32:22 Dumping database...
|
||||
2016/12/27 22:32:22 Packing dump files...
|
||||
2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001
|
||||
2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
|
||||
```
|
||||
|
||||
備份出來的 `gitea-dump-1482906742.zip` 檔案,檔案內會包含底下內容:
|
||||
|
||||
* `custom/conf/app.ini` - 伺服器設定檔。
|
||||
* `gitea-db.sql` - SQL 備份檔案。
|
||||
* `gitea-repo.zip` - 此 zip 檔案為全部的 repo 目錄。
|
||||
請參考 Config -> repository -> `ROOT` 所設定的路徑。
|
||||
* `log/` - 全部 logs 檔案,如果你要 migrate 到其他伺服器,此目錄不用保留。
|
||||
|
||||
你可以透過設定 `--tempdir` 指令參數來指定備份檔案目錄,或者是設定 `TMPDIR` 環境變數來達到此功能。
|
||||
|
||||
## 還原指令 (`restore`)
|
||||
|
||||
持續更新中: 此文件尚未完成.
|
@ -0,0 +1,80 @@
|
||||
---
|
||||
date: "2017-01-01T16:00:00+02:00"
|
||||
title: "Usage: Command Line"
|
||||
slug: "command-line"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
menu:
|
||||
sidebar:
|
||||
parent: "usage"
|
||||
name: "Command Line"
|
||||
weight: 10
|
||||
identifier: "command-line"
|
||||
---
|
||||
|
||||
## Command Line
|
||||
|
||||
### Usage
|
||||
|
||||
`gitea [global options] command [command options] [arguments...]`
|
||||
|
||||
### Global options
|
||||
- `--help`, `-h`: Show help text and exit. Optional. This can be used with any of the subcommands to see help text for it.
|
||||
- `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`).
|
||||
|
||||
### Commands
|
||||
|
||||
#### web
|
||||
Starts the server
|
||||
- Options:
|
||||
- `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file.
|
||||
- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
|
||||
- `--pid path`, `-P path`: Pidfile path. Optional.
|
||||
- Examples:
|
||||
- `gitea web`
|
||||
- `gitea web --port 80`
|
||||
- `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid`
|
||||
- Notes:
|
||||
- Gitea should not be run as root. To bind to a port below 1000, you can use setcap on Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be redone every time you update Gitea.
|
||||
|
||||
#### admin
|
||||
Admin operations
|
||||
- Commands:
|
||||
- `create-user`
|
||||
- Options:
|
||||
- `--name value`: Username. Required.
|
||||
- `--password value`: Password. Required.
|
||||
- `--email value`: Email. Required.
|
||||
- `--admin`: If provided, this makes the user an admin. Optional.
|
||||
- `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
|
||||
- Examples:
|
||||
- `gitea admin create-user --name myname --password asecurepassword --email me@example.com`
|
||||
- `change-password`
|
||||
- Arguments:
|
||||
- `--username value`, `-u value`: Username. Required.
|
||||
- `--password value`, `-p value`: New password. Required.
|
||||
- Examples:
|
||||
- `gitea admin change-password --username myname --password asecurepassword`
|
||||
|
||||
#### cert
|
||||
Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current directory and will overwrite any existing files.
|
||||
- Options:
|
||||
- `--host value`: Comma seperated hostnames and ips which this certificate is valid for. Wildcards are supported. Required.
|
||||
- `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options are P224, P256, P384, P521.
|
||||
- `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is set. (default: 2048).
|
||||
- `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`).
|
||||
- `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s)
|
||||
- `--ca`: If provided, this cert generates it's own certificate authority. Optional.
|
||||
- Examples:
|
||||
- `gitea cert --host git.example.com,example.com,www.example.com --ca`
|
||||
|
||||
#### dump
|
||||
Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip` in the current directory.
|
||||
- Options:
|
||||
- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
|
||||
- `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp).
|
||||
- `--verbose`, `-v`: If provided, shows additional details. Optional.
|
||||
- Examples:
|
||||
- `gitea dump`
|
||||
- `gitea dump --verbose`
|
@ -0,0 +1,279 @@
|
||||
---
|
||||
date: "2016-11-08T16:00:00+02:00"
|
||||
title: "Documentation"
|
||||
slug: "documentation"
|
||||
weight: 10
|
||||
toc: true
|
||||
draft: false
|
||||
---
|
||||
|
||||
# What is Gitea?
|
||||
|
||||
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on [Gogs](http://gogs.io) but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read [this](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post.
|
||||
|
||||
## Purpose
|
||||
|
||||
The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. With Go, this can be done with an independent binary distribution across ALL platforms that Go supports, including Linux, macOS and Windows, even on architectures like ARM or PowerPC.
|
||||
|
||||
## Features
|
||||
|
||||
- User Dashboard
|
||||
- Context switcher (organization or current user)
|
||||
- Activity timeline
|
||||
- Commits
|
||||
- Issues
|
||||
- Pull requests
|
||||
- Repository creation
|
||||
- Searchable repository list
|
||||
- List of your organizations
|
||||
- A list of mirror repositories
|
||||
- Issues dashboard
|
||||
- Context switcher (organization or current user)
|
||||
- Filter by
|
||||
- Open
|
||||
- Closed
|
||||
- Your repositories
|
||||
- Assigned issues
|
||||
- Your issues
|
||||
- Repository
|
||||
- Sort by
|
||||
- Oldest
|
||||
- Last updated
|
||||
- Number of comments
|
||||
- Pull request dashboard
|
||||
- Same as issue dashboard
|
||||
- Repository types
|
||||
- Mirror
|
||||
- Normal
|
||||
- Migrated
|
||||
- Notifications (email and web)
|
||||
- Read
|
||||
- Unread
|
||||
- Pin
|
||||
- Explore page
|
||||
- Users
|
||||
- Repos
|
||||
- Organizations
|
||||
- Search
|
||||
- Custom templates
|
||||
- Override public files (logo, css, etc)
|
||||
- CSRF and XSS protection
|
||||
- HTTPS support
|
||||
- Set allowed upload sizes and types
|
||||
- Logging
|
||||
- Configuration
|
||||
- Databases
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- SQLite3
|
||||
- MSSQL
|
||||
- [TiDB](https://github.com/pingcap/tidb) (experimental)
|
||||
- Configuration file
|
||||
- See [here](https://github.com/go-gitea/gitea/blob/master/conf/app.ini)
|
||||
- Admin panel
|
||||
- Statistics
|
||||
- Actions
|
||||
- Delete inactive accounts
|
||||
- Delete cached repository archives
|
||||
- Delete repositories records which are missing their files
|
||||
- Run garbage collection on repositories
|
||||
- Rewrite SSH keys
|
||||
- Resync hooks
|
||||
- Recreate repositories which are missing
|
||||
- Server status
|
||||
- Uptime
|
||||
- Memory
|
||||
- Current # of goroutines
|
||||
- And more
|
||||
- User management
|
||||
- Search
|
||||
- Sort
|
||||
- Last login
|
||||
- Authentication source
|
||||
- Maximum repositories
|
||||
- Disable account
|
||||
- Admin permissions
|
||||
- Permission to create git hooks
|
||||
- Permission to create organizations
|
||||
- Permission to import repositories
|
||||
- Organization management
|
||||
- People
|
||||
- Teams
|
||||
- Avatar
|
||||
- Hooks
|
||||
- Repository management
|
||||
- See all repository information and manage repositories
|
||||
- Authentication sources
|
||||
- OAuth
|
||||
- PAM
|
||||
- LDAP
|
||||
- SMTP
|
||||
- Configuration viewer
|
||||
- Everything in config file
|
||||
- System notices
|
||||
- When somthing unexpected happens
|
||||
- Monitoring
|
||||
- Current processes
|
||||
- Cron jobs
|
||||
- Update mirrors
|
||||
- Repository health check
|
||||
- Check repository statstics
|
||||
- Clean up old archives
|
||||
- Environment variables
|
||||
- Command line options
|
||||
- Multi-language support ([21 languages](https://github.com/go-gitea/gitea/tree/master/options/locale))
|
||||
- Mail service
|
||||
- Notifications
|
||||
- Registration confirmation
|
||||
- Password reset
|
||||
- Reverse proxy support
|
||||
- Includes subpaths
|
||||
- Users
|
||||
- Profile
|
||||
- Name
|
||||
- Username
|
||||
- Email
|
||||
- Website
|
||||
- Join date
|
||||
- Followers and following
|
||||
- Organizations
|
||||
- Repositories
|
||||
- Activity
|
||||
- Starred repositories
|
||||
- Settings
|
||||
- Same as profile and more below
|
||||
- Keep email private
|
||||
- Avatar
|
||||
- Gravatar
|
||||
- Libravatar
|
||||
- Custom
|
||||
- Password
|
||||
- Mutiple email addresses
|
||||
- SSH Keys
|
||||
- Connected applications
|
||||
- Two factor authentication
|
||||
- Linked OAuth2 sources
|
||||
- Delete account
|
||||
- Repositories
|
||||
- Clone with SSH/HTTP/HTTPS
|
||||
- Git LFS
|
||||
- Watch, Star, Fork
|
||||
- View watchers, stars, and forks
|
||||
- Code
|
||||
- Branch browser
|
||||
- Web based file upload and creation
|
||||
- Clone urls
|
||||
- Download
|
||||
- ZIP
|
||||
- TAR.GZ
|
||||
- Web based editor
|
||||
- Markdown editor
|
||||
- Plain text editor
|
||||
- Syntax highlighting
|
||||
- Diff preview
|
||||
- Preview
|
||||
- Choose where to commit to
|
||||
- View file history
|
||||
- Delete file
|
||||
- View raw
|
||||
- Issues
|
||||
- Issue templates
|
||||
- Milestones
|
||||
- Labels
|
||||
- Assign issues
|
||||
- Filter
|
||||
- Open
|
||||
- Closed
|
||||
- Assigned person
|
||||
- Created by you
|
||||
- Mentioning you
|
||||
- Sort
|
||||
- Oldest
|
||||
- Last updated
|
||||
- Number of comments
|
||||
- Search
|
||||
- Comments
|
||||
- Attachments
|
||||
- Pull requests
|
||||
- Same features as issues
|
||||
- Commits
|
||||
- Commit graph
|
||||
- Commits by branch
|
||||
- Search
|
||||
- Search in all branches
|
||||
- View diff
|
||||
- View SHA
|
||||
- View author
|
||||
- Browse files in commit
|
||||
- Releases
|
||||
- Attachments
|
||||
- Title
|
||||
- Content
|
||||
- Delete
|
||||
- Mark as pre-release
|
||||
- Choose branch
|
||||
- Wiki
|
||||
- Import
|
||||
- Markdown editor
|
||||
- Settings
|
||||
- Options
|
||||
- Name
|
||||
- Description
|
||||
- Private/Public
|
||||
- Website
|
||||
- Wiki
|
||||
- Enabled/disabled
|
||||
- Internal/external
|
||||
- Issues
|
||||
- Enabled/disabled
|
||||
- Internal/external
|
||||
- External supports url rewriting for better integration
|
||||
- Enable/disable pull requests
|
||||
- Transfer repository
|
||||
- Delete wiki
|
||||
- Delete repository
|
||||
- Collaboration
|
||||
- Read/write/admin
|
||||
- Branches
|
||||
- Default branch
|
||||
- Branch protection
|
||||
- Webhooks
|
||||
- Git hooks
|
||||
- Deploy keys
|
||||
|
||||
## System Requirements
|
||||
|
||||
- A cheap Raspberry Pi is powerful enough for basic functionality.
|
||||
- 2 CPU cores and 1GB RAM would be the baseline for teamwork.
|
||||
- Gitea is supposed to be run with a dedicated non-root user account on UNIX systems, no other mode of operation is supported. (**NOTE**: in case you run it with your own user account and the built-in SSH server disabled, Gitea modifies the `~/.ssh/authorized_keys` file so you will **not** be able to interactively log in.)
|
||||
|
||||
## Browser Support
|
||||
|
||||
- Please see [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) for specific versions of supported browsers.
|
||||
- The official support minimal size is **1024*768**, UI may still looks right in smaller size but no promises and fixes.
|
||||
|
||||
## Components
|
||||
|
||||
* Web framework: [Macaron](http://go-macaron.com/)
|
||||
* ORM: [XORM](https://github.com/go-xorm/xorm)
|
||||
* UI components:
|
||||
* [Semantic UI](http://semantic-ui.com/)
|
||||
* [GitHub Octicons](https://octicons.github.com/)
|
||||
* [Font Awesome](http://fontawesome.io/)
|
||||
* [DropzoneJS](http://www.dropzonejs.com/)
|
||||
* [Highlight](https://highlightjs.org/)
|
||||
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
||||
* [Emojify](https://github.com/Ranks/emojify.js)
|
||||
* [CodeMirror](https://codemirror.net/)
|
||||
* [jQuery Date Time Picker](https://github.com/xdan/datetimepicker)
|
||||
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
||||
* Database drivers:
|
||||
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||
* [github.com/lib/pq](https://github.com/lib/pq)
|
||||
* [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
|
||||
* [github.com/pingcap/tidb](https://github.com/pingcap/tidb)
|
||||
* [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb)
|
||||
|
||||
## Software and Service Support
|
||||
|
||||
- [Drone](https://github.com/drone/drone) (CI)
|
@ -0,0 +1,39 @@
|
||||
:80 {
|
||||
root /srv/www
|
||||
|
||||
locale en-US zh-CN zh-TW pt-BR nl-NL {
|
||||
detect header
|
||||
}
|
||||
|
||||
redir 301 {
|
||||
if {path} match ^/$
|
||||
/ /{>Detected-Locale}/
|
||||
}
|
||||
|
||||
rewrite /en-US/ {
|
||||
regexp (.*)
|
||||
to /en-us/{1}
|
||||
}
|
||||
|
||||
rewrite /zh-CN/ {
|
||||
regexp (.*)
|
||||
to /zh-cn/{1}
|
||||
}
|
||||
|
||||
rewrite /zh-TW/ {
|
||||
regexp (.*)
|
||||
to /zh-tw/{1}
|
||||
}
|
||||
|
||||
rewrite /pt-BR/ {
|
||||
regexp (.*)
|
||||
to /pt-br/{1}
|
||||
}
|
||||
|
||||
rewrite /nl-NL/ {
|
||||
regexp (.*)
|
||||
to /nl-nl/{1}
|
||||
}
|
||||
|
||||
header / Vary "Accept-Language"
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "navbar.html" . }}
|
||||
|
||||
<div class="container content">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{{ partial "menu" . }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ range where .Site.Pages "Type" "page" }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.DisqusShortname }}
|
||||
<div class="col-xs-12">
|
||||
{{ partial "disqus.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ partial "footer.html" . }}
|
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
#
|
||||
# This script is used to copy the en-US content to our available locales as a
|
||||
# fallback to always show all pages when displaying a specific locale that is
|
||||
# missing some documents to be translated.
|
||||
#
|
||||
# Just execute the script without any argument and you will get the missing
|
||||
# files copied into the content folder. We are calling this script within the CI
|
||||
# server simply by `make trans-copy`.
|
||||
#
|
||||
|
||||
declare -a LOCALES=(
|
||||
"nl-nl"
|
||||
"pt-br"
|
||||
"zh-cn"
|
||||
"zh-tw"
|
||||
)
|
||||
|
||||
ROOT=$(realpath $(dirname $0)/..)
|
||||
|
||||
for SOURCE in $(find ${ROOT}/content -type f -iname *.en-us.md); do
|
||||
for LOCALE in "${LOCALES[@]}"; do
|
||||
DEST="${SOURCE%.en-us.md}.${LOCALE}.md"
|
||||
|
||||
if [[ ! -f ${DEST} ]]; then
|
||||
echo "Creating fallback for ${DEST#${ROOT}/content/}"
|
||||
cp ${SOURCE} ${DEST}
|
||||
fi
|
||||
done
|
||||
done
|
Loading…
Reference in New Issue