Browse Source

Import docs into main repository (#2874)

* import docs into main repository

Signed-off-by: Matti Ranta <matti@mdranta.net>
techknowlogick 2 years ago
parent
commit
fb5c6b6444
68 changed files with 3720 additions and 0 deletions
  1. 31 0
      .drone.yml
  2. 34 0
      docs/.editorconfig
  3. 2 0
      docs/.gitignore
  4. 22 0
      docs/Dockerfile
  5. 202 0
      docs/LICENSE
  6. 29 0
      docs/Makefile
  7. 55 0
      docs/README.md
  8. 237 0
      docs/config.yaml
  9. 13 0
      docs/content/doc/advanced.en-us.md
  10. 13 0
      docs/content/doc/advanced.zh-cn.md
  11. 218 0
      docs/content/doc/advanced/config-cheat-sheet.en-us.md
  12. 191 0
      docs/content/doc/advanced/config-cheat-sheet.zh-cn.md
  13. 54 0
      docs/content/doc/advanced/customizing-gitea.en-us.md
  14. 42 0
      docs/content/doc/advanced/hacking-on-gitea.en-us.md
  15. 42 0
      docs/content/doc/advanced/hacking-on-gitea.zh-cn.md
  16. 44 0
      docs/content/doc/advanced/make.en-us.md
  17. 67 0
      docs/content/doc/advanced/specific-variables.en-us.md
  18. 13 0
      docs/content/doc/features.en-us.md
  19. 13 0
      docs/content/doc/features.zh-cn.md
  20. 13 0
      docs/content/doc/features.zh-tw.md
  21. 194 0
      docs/content/doc/features/authentication.en-us.md
  22. 18 0
      docs/content/doc/features/authentication.zh-cn.md
  23. 18 0
      docs/content/doc/features/authentication.zh-tw.md
  24. 18 0
      docs/content/doc/features/localization.en-us.md
  25. 18 0
      docs/content/doc/features/localization.zh-cn.md
  26. 18 0
      docs/content/doc/features/localization.zh-tw.md
  27. 103 0
      docs/content/doc/features/webhooks.en-us.md
  28. 18 0
      docs/content/doc/features/webhooks.zh-cn.md
  29. 18 0
      docs/content/doc/features/webhooks.zh-tw.md
  30. 13 0
      docs/content/doc/help.zh-cn.md
  31. 23 0
      docs/content/doc/help/seek-help.zh-cn.md
  32. 69 0
      docs/content/doc/help/troubleshooting.en-us.md
  33. 13 0
      docs/content/doc/installation.en-us.md
  34. 13 0
      docs/content/doc/installation.zh-cn.md
  35. 13 0
      docs/content/doc/installation.zh-tw.md
  36. 45 0
      docs/content/doc/installation/from-binary.en-us.md
  37. 35 0
      docs/content/doc/installation/from-binary.zh-cn.md
  38. 35 0
      docs/content/doc/installation/from-binary.zh-tw.md
  39. 57 0
      docs/content/doc/installation/from-package.en-us.md
  40. 37 0
      docs/content/doc/installation/from-package.zh-cn.md
  41. 53 0
      docs/content/doc/installation/from-package.zh-tw.md
  42. 79 0
      docs/content/doc/installation/from-source.en-us.md
  43. 84 0
      docs/content/doc/installation/from-source.zh-cn.md
  44. 73 0
      docs/content/doc/installation/from-source.zh-tw.md
  45. 68 0
      docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md
  46. 34 0
      docs/content/doc/installation/windows-service.en-us.md
  47. 34 0
      docs/content/doc/installation/windows-service.zh-cn.md
  48. 34 0
      docs/content/doc/installation/windows-service.zh-tw.md
  49. 196 0
      docs/content/doc/installation/with-docker.en-us.md
  50. 42 0
      docs/content/doc/installation/with-docker.zh-cn.md
  51. 40 0
      docs/content/doc/installation/with-docker.zh-tw.md
  52. 13 0
      docs/content/doc/upgrade.en-us.md
  53. 13 0
      docs/content/doc/upgrade.zh-cn.md
  54. 13 0
      docs/content/doc/upgrade.zh-tw.md
  55. 82 0
      docs/content/doc/upgrade/from-gogs.en-us.md
  56. 26 0
      docs/content/doc/upgrade/from-gogs.zh-cn.md
  57. 26 0
      docs/content/doc/upgrade/from-gogs.zh-tw.md
  58. 13 0
      docs/content/doc/usage.en-us.md
  59. 46 0
      docs/content/doc/usage/backup-and-restore.en-us.md
  60. 45 0
      docs/content/doc/usage/backup-and-restore.zh-tw.md
  61. 80 0
      docs/content/doc/usage/command-line.md
  62. 279 0
      docs/content/page/index.en-us.md
  63. 75 0
      docs/content/page/index.zh-cn.md
  64. 67 0
      docs/content/page/index.zh-tw.md
  65. 39 0
      docs/docker/caddy.conf
  66. 23 0
      docs/layouts/index.html
  67. 32 0
      docs/scripts/trans-copy
  68. 0 0
      docs/static/.gitkeep

+ 31 - 0
.drone.yml

@@ -180,6 +180,37 @@ pipeline:
180 180
     when:
181 181
       event: [ push, tag ]
182 182
 
183
+  build_docs:
184
+    image: webhippie/hugo:latest
185
+    pull: true
186
+    commands:
187
+      - cd docs
188
+      - make trans-copy
189
+      - make clean
190
+      - make build
191
+
192
+  docker:
193
+    image: plugins/docker:17.05
194
+    pull: true
195
+    secrets: [ docker_username, docker_password ]
196
+    repo: gitea/docs
197
+    dockerfile: docs/Dockerfile
198
+    tags: [ '${DRONE_BRANCH##release/v}' ]
199
+    when:
200
+      event: [ push ]
201
+      branch: [ release/* ]
202
+
203
+  docker:
204
+    image: plugins/docker:17.05
205
+    pull: true
206
+    secrets: [ docker_username, docker_password ]
207
+    repo: gitea/docs
208
+    dockerfile: docs/Dockerfile
209
+    tags: [ 'latest' ]
210
+    when:
211
+      event: [ push ]
212
+      branch: [ master ]
213
+
183 214
   docker:
184 215
     image: plugins/docker:17.05
185 216
     pull: true

+ 34 - 0
docs/.editorconfig

@@ -0,0 +1,34 @@
1
+# http://editorconfig.org
2
+
3
+root = true
4
+
5
+[*]
6
+charset = utf-8
7
+insert_final_newline = true
8
+trim_trailing_whitespace = true
9
+
10
+[*.go]
11
+indent_style = tab
12
+indent_size = 8
13
+
14
+[*.{tmpl,html}]
15
+indent_style = tab
16
+indent_size = 4
17
+
18
+[*.{less}]
19
+indent_style = space
20
+indent_size = 4
21
+
22
+[*.{yml}]
23
+indent_style = space
24
+indent_size = 2
25
+
26
+[*.js]
27
+indent_style = space
28
+indent_size = 4
29
+
30
+[Makefile]
31
+indent_style = tab
32
+
33
+[*.md]
34
+trim_trailing_whitespace = false

+ 2 - 0
docs/.gitignore

@@ -0,0 +1,2 @@
1
+public/
2
+themes/

+ 22 - 0
docs/Dockerfile

@@ -0,0 +1,22 @@
1
+# build stage
2
+FROM golang:alpine AS build-env
3
+
4
+RUN apk add --no-cache git 
5
+RUN go get -d -v github.com/mholt/caddy/caddy github.com/pedronasser/caddy-search github.com/simia-tech/caddy-locale
6
+WORKDIR /go/src/github.com/mholt/caddy/caddy
7
+
8
+RUN sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/pedronasser/caddy-search"' caddymain/run.go \
9
+ && sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/simia-tech/caddy-locale"' caddymain/run.go \
10
+ && go install -v . \
11
+ && /go/bin/caddy -version
12
+
13
+FROM alpine:edge
14
+EXPOSE 80
15
+
16
+RUN apk add --no-cache wget mailcap ca-certificates
17
+COPY --from=build-env /go/bin/caddy /usr/sbin/caddy
18
+
19
+COPY docker/caddy.conf /etc/caddy.conf
20
+COPY public /srv/www
21
+
22
+CMD ["/usr/sbin/caddy", "-conf", "/etc/caddy.conf"]

+ 202 - 0
docs/LICENSE

@@ -0,0 +1,202 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+
177
+   END OF TERMS AND CONDITIONS
178
+
179
+   APPENDIX: How to apply the Apache License to your work.
180
+
181
+      To apply the Apache License to your work, attach the following
182
+      boilerplate notice, with the fields enclosed by brackets "[]"
183
+      replaced with your own identifying information. (Don't include
184
+      the brackets!)  The text should be enclosed in the appropriate
185
+      comment syntax for the file format. We also recommend that a
186
+      file or class name and description of purpose be included on the
187
+      same "printed page" as the copyright notice for easier
188
+      identification within third-party archives.
189
+
190
+   Copyright [yyyy] [name of copyright owner]
191
+
192
+   Licensed under the Apache License, Version 2.0 (the "License");
193
+   you may not use this file except in compliance with the License.
194
+   You may obtain a copy of the License at
195
+
196
+       http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+   Unless required by applicable law or agreed to in writing, software
199
+   distributed under the License is distributed on an "AS IS" BASIS,
200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+   See the License for the specific language governing permissions and
202
+   limitations under the License.

+ 29 - 0
docs/Makefile

@@ -0,0 +1,29 @@
1
+THEME := themes/gitea
2
+PUBLIC := public
3
+ARCHIVE := https://dl.gitea.io/theme/master.tar.gz
4
+
5
+.PHONY: all
6
+all: build
7
+
8
+.PHONY: clean
9
+clean:
10
+	rm -rf $(PUBLIC) $(THEME)
11
+
12
+.PHONY: trans-copy
13
+trans-copy:
14
+	@bash scripts/trans-copy
15
+
16
+.PHONY: server
17
+server: $(THEME)
18
+	hugo server
19
+
20
+.PHONY: build
21
+build: $(THEME)
22
+	hugo --cleanDestinationDir
23
+
24
+.PHONY: update
25
+update: $(THEME)
26
+
27
+$(THEME):
28
+	mkdir -p $@
29
+	curl -s $(ARCHIVE) | tar xz -C $@

+ 55 - 0
docs/README.md

@@ -0,0 +1,55 @@
1
+# Gitea: Docs
2
+
3
+[![Build Status](http://drone.gitea.io/api/badges/go-gitea/docs/status.svg)](http://drone.gitea.io/go-gitea/docs)
4
+[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
5
+[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
6
+
7
+## Hosting
8
+
9
+This page is hosted on our infrastructure within Docker containers, it gets
10
+automatically updated on every push to the `master` branch.
11
+
12
+If you want to host this page on your own you can take our docker image
13
+[gitea/docs](https://hub.docker.com/r/gitea/docs/).
14
+
15
+## Install
16
+
17
+This pages uses the [Hugo](https://github.com/spf13/hugo) static site generator.
18
+If you are planning to contribute you'll want to download and install Hugo on
19
+your local machine.
20
+
21
+The installation of Hugo is out of the scope of this document, so please take
22
+the [official install instructions](https://gohugo.io/overview/installing/) to
23
+get Hugo up and running.
24
+
25
+## Development
26
+
27
+To generate the website and serve it on [localhost:1313](http://localhost:1313)
28
+just execute this command and stop it with `Ctrl+C`:
29
+
30
+```
31
+make server
32
+```
33
+
34
+When you are done with your changes just create a pull request, after merging
35
+the pull request the website will be updated automatically.
36
+
37
+## Contributing
38
+
39
+Fork -> Patch -> Push -> Pull Request
40
+
41
+## Authors
42
+
43
+* [Maintainers](https://github.com/orgs/go-gitea/people)
44
+* [Contributors](https://github.com/go-gitea/docs/graphs/contributors)
45
+
46
+## License
47
+
48
+This project is under the Apache-2.0 License. See the [LICENSE](LICENSE) file
49
+for the full license text.
50
+
51
+## Copyright
52
+
53
+```
54
+Copyright (c) 2016 The Gitea Authors <https://gitea.io>
55
+```

+ 237 - 0
docs/config.yaml

@@ -0,0 +1,237 @@
1
+baseurl: https://docs.gitea.io/
2
+languageCode: en-us
3
+title: Docs
4
+theme: gitea
5
+disqusShortname: gitea
6
+
7
+defaultContentLanguage: en-us
8
+defaultContentLanguageInSubdir: true
9
+enableMissingTranslationPlaceholders: true
10
+
11
+permalinks:
12
+  post: /:year/:month/:title/
13
+  doc: /:slug/
14
+  page: /:slug/
15
+  default: /:slug/
16
+
17
+params:
18
+  description: Git with a cup of tea
19
+  author: The Gitea Authors
20
+  website: https://docs.gitea.io
21
+
22
+menu:
23
+  page:
24
+    - name: Website
25
+      url: https://gitea.io/en-us/
26
+      weight: 10
27
+      pre: home
28
+    - name: Docs
29
+      url: /en-us/
30
+      weight: 20
31
+      pre: question
32
+      post: active
33
+    - name: API
34
+      url: https://try.gitea.io/api/swagger
35
+      weight: 25
36
+      pre: plug
37
+    - name: Blog
38
+      url: https://blog.gitea.io/
39
+      weight: 30
40
+      pre: rss
41
+    - name: Code
42
+      url: https://code.gitea.io/
43
+      weight: 40
44
+      pre: code
45
+    - name: Downloads
46
+      url: https://dl.gitea.io/
47
+      weight: 50
48
+      pre: download
49
+    - name: GitHub
50
+      url: https://github.com/go-gitea/
51
+      weight: 60
52
+      pre: github
53
+    - name: Discord Chat
54
+      url: https://discord.gg/NsatcWJ
55
+      weight: 70
56
+      pre: comment
57
+    - name: Forum
58
+      url: https://discourse.gitea.io/
59
+      weight: 80
60
+      pre: group
61
+
62
+languages:
63
+  en-us:
64
+    weight: 0
65
+    languageName: English
66
+
67
+  zh-cn:
68
+    weight: 1
69
+    languageName: 中文(简体)
70
+    menu:
71
+      page:
72
+        - name: 网站
73
+          url: https://gitea.io/zh-cn/
74
+          weight: 10
75
+          pre: home
76
+        - name: 文档
77
+          url: /zh-cn/
78
+          weight: 20
79
+          pre: question
80
+          post: active
81
+        - name: API
82
+          url: https://try.gitea.io/api/swagger
83
+          weight: 25
84
+          pre: plug
85
+        - name: 博客
86
+          url: https://blog.gitea.io/
87
+          weight: 30
88
+          pre: rss
89
+        - name: 导入
90
+          url: https://code.gitea.io/
91
+          weight: 40
92
+          pre: code
93
+        - name: 下载
94
+          url: https://dl.gitea.io/
95
+          weight: 50
96
+          pre: download
97
+        - name: GitHub
98
+          url: https://github.com/go-gitea/
99
+          weight: 60
100
+          pre: github
101
+        - name: Discord Chat
102
+          url: https://discord.gg/NsatcWJ
103
+          weight: 70
104
+          pre: comment
105
+        - name: Forum
106
+          url: https://discourse.gitea.io/
107
+          weight: 80
108
+          pre: group
109
+
110
+  zh-tw:
111
+    weight: 2
112
+    languageName: 中文(繁體)
113
+    menu:
114
+      page:
115
+        - name: 網站
116
+          url: https://gitea.io/zh-tw/
117
+          weight: 10
118
+          pre: home
119
+        - name: 文件
120
+          url: /zh-tw/
121
+          weight: 20
122
+          pre: question
123
+          post: active
124
+        - name: API
125
+          url: https://try.gitea.io/api/swagger
126
+          weight: 25
127
+          pre: plug
128
+        - name: 部落格
129
+          url: https://blog.gitea.io/
130
+          weight: 30
131
+          pre: rss
132
+        - name: 程式碼
133
+          url: https://code.gitea.io/
134
+          weight: 40
135
+          pre: code
136
+        - name: 下载
137
+          url: https://dl.gitea.io/
138
+          weight: 50
139
+          pre: download
140
+        - name: GitHub
141
+          url: https://github.com/go-gitea/
142
+          weight: 60
143
+          pre: github
144
+        - name: Discord Chat
145
+          url: https://discord.gg/NsatcWJ
146
+          weight: 70
147
+          pre: comment
148
+        - name: Forum
149
+          url: https://discourse.gitea.io/
150
+          weight: 80
151
+          pre: group
152
+
153
+  pt-br:
154
+    weight: 3
155
+    languageName: Português Brasileiro
156
+    menu:
157
+      page:
158
+        - name: Página inicial
159
+          url: https://gitea.io/pt-br/
160
+          weight: 10
161
+          pre: home
162
+        - name: Documentação
163
+          url: /pt-br/
164
+          weight: 20
165
+          pre: question
166
+          post: active
167
+        - name: API
168
+          url: https://try.gitea.io/api/swagger
169
+          weight: 25
170
+          pre: plug
171
+        - name: Blog
172
+          url: https://blog.gitea.io/
173
+          weight: 30
174
+          pre: rss
175
+        - name: Código-fonte
176
+          url: https://code.gitea.io/
177
+          weight: 40
178
+          pre: code
179
+        - name: Downloads
180
+          url: https://dl.gitea.io/
181
+          weight: 50
182
+          pre: download
183
+        - name: GitHub
184
+          url: https://github.com/go-gitea/
185
+          weight: 60
186
+          pre: github
187
+        - name: Chat no Discord
188
+          url: https://discord.gg/NsatcWJ
189
+          weight: 70
190
+          pre: comment
191
+        - name: Forum
192
+          url: https://discourse.gitea.io/
193
+          weight: 80
194
+          pre: group
195
+
196
+  nl-nl:
197
+    weight: 4
198
+    languageName: Nederlands
199
+    menu:
200
+      page:
201
+        - name: Website
202
+          url: https://gitea.io/nl-nl/
203
+          weight: 10
204
+          pre: home
205
+        - name: Docs
206
+          url: /nl-nl/
207
+          weight: 20
208
+          pre: question
209
+          post: active
210
+        - name: API
211
+          url: https://try.gitea.io/api/swagger
212
+          weight: 25
213
+          pre: plug
214
+        - name: Blog
215
+          url: https://blog.gitea.io/
216
+          weight: 30
217
+          pre: rss
218
+        - name: Code
219
+          url: https://code.gitea.io/
220
+          weight: 40
221
+          pre: code
222
+        - name: Downloads
223
+          url: https://dl.gitea.io/
224
+          weight: 50
225
+          pre: download
226
+        - name: GitHub
227
+          url: https://github.com/go-gitea/
228
+          weight: 60
229
+          pre: github
230
+        - name: Discord Chat
231
+          url: https://discord.gg/NsatcWJ
232
+          weight: 70
233
+          pre: comment
234
+        - name: Forum
235
+          url: https://discourse.gitea.io/
236
+          weight: 80
237
+          pre: group

+ 13 - 0
docs/content/doc/advanced.en-us.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Advanced"
4
+slug: "advanced"
5
+weight: 30
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "Advanced"
11
+    weight: 40
12
+    identifier: "advanced"
13
+---

+ 13 - 0
docs/content/doc/advanced.zh-cn.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "进阶"
4
+slug: "advanced"
5
+weight: 30
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "进阶"
11
+    weight: 40
12
+    identifier: "advanced"
13
+---

+ 218 - 0
docs/content/doc/advanced/config-cheat-sheet.en-us.md

@@ -0,0 +1,218 @@
1
+---
2
+date: "2016-12-26T16:00:00+02:00"
3
+title: "Config Cheat Sheet"
4
+slug: "config-cheat-sheet"
5
+weight: 20
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "advanced"
11
+    name: "Config Cheat Sheet"
12
+    weight: 20
13
+    identifier: "config-cheat-sheet"
14
+---
15
+
16
+# Configuration Cheat Sheet
17
+
18
+This is a cheat sheet for the Gitea configuration file. It is helpful for more fully understanding how it powers Gitea.
19
+
20
+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.
21
+
22
+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.
23
+
24
+Any configuration option that is marked by :exclamation: means that you should keep the default value unless you fully understand what you are doing.
25
+
26
+Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
27
+
28
+**Note** that you have to restart Gitea for changes to take effect.
29
+
30
+## Overall (`DEFAULT`)
31
+
32
+- `APP_NAME`: Application name, change to whatever you want.
33
+- `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.
34
+- `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.
35
+
36
+## Repository (`repository`)
37
+
38
+- `ROOT`: Root path for storing all users' repository data. It must be an absolute path. The default is `~/<username>/gitea-repositories`.
39
+- `SCRIPT_TYPE`: The script type your server supports, usually this is `bash`, but some customers report that they only have `sh`.
40
+- `ANSI_CHARSET`: The default charset for an unrecognized charset.
41
+- `FORCE_PRIVATE`: Force every new repository to be private.
42
+- `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit.
43
+- `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible.
44
+
45
+## UI (`ui`)
46
+
47
+- `EXPLORE_PAGING_NUM`: Number of repositories that are shown in one explore page.
48
+- `ISSUE_PAGING_NUM`: Number of issues that are shown in one page (for all pages that list issues).
49
+- `FEED_MAX_COMMIT_NUM`: Number of maximum commits shown in one activity feed.
50
+
51
+### UI - Admin (`ui.admin`)
52
+
53
+- `USER_PAGING_NUM`: Number of users that are shown in one page.
54
+- `REPO_PAGING_NUM`: Number of repos that are shown in one page.
55
+- `NOTICE_PAGING_NUM`: Number of notices that are shown in one page.
56
+- `ORG_PAGING_NUM`: Number of organizations that are shown in one page.
57
+
58
+## Markdown (`markdown`)
59
+
60
+- `ENABLE_HARD_LINE_BREAK`: Whether or not to enable hard the line break extension.
61
+
62
+## Server (`server`)
63
+
64
+- `PROTOCOL`: Either `http`, `https`, `fcgi`, or `unix`.
65
+- `DOMAIN`: Domain name of your server.
66
+- `ROOT_URL`: Full public URL of Gitea server.
67
+- `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.
68
+- `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.
69
+- `UNIX_SOCKET_PERMISSION`: Permisson mode for Unix socket, default is 666.
70
+- `DISABLE_SSH`: Disables SSH feature when it's not available.
71
+- `START_SSH_SERVER`: Starts built-in SSH server when enabled.
72
+- `SSH_DOMAIN`: Domain name of your ssh server.
73
+- `SSH_PORT`: SSH port displayed in clone URL, in case yours is not `22`.
74
+- `SSH_LISTEN_PORT`: Port for the built-in SSH server. Defaults to `SSH_PORT`.
75
+- `OFFLINE_MODE`: Disables use of CDN for static files and Gravatar for profile pictures.
76
+- `DISABLE_ROUTER_LOG`: Mutes printing of the router log.
77
+- `CERT_FILE`: Cert file path used for HTTPS.
78
+- `KEY_FILE`: Key file path used for HTTPS.
79
+- `STATIC_ROOT_PATH`: Upper level of template and static files path, default is the path where Gitea is located.
80
+- `ENABLE_GZIP`: Enables application-level GZIP support.
81
+- `LANDING_PAGE`: Non-logged-in users' landing page, either `home` or `explore`.
82
+- `LFS_START_SERVER`: Enables git-lfs support. `true` or `false`, default is `false`.
83
+- `LFS_CONTENT_PATH`: Where your lfs files put on, default is `data/lfs`.
84
+- `LFS_JWT_SECRET`: LFS authentication secret, changed this to yourself.
85
+
86
+## Database (`database`)
87
+
88
+- `DB_TYPE`: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`.
89
+- `HOST`: Database host address and port.
90
+- `NAME`: Database name.
91
+- `USER`: Database username.
92
+- `PASSWD`: Database user password.
93
+- `SSL_MODE`: For PostgreSQL only.
94
+- `PATH`: For SQLite3 only, the database file path.
95
+
96
+## Security (`security`)
97
+
98
+- `INSTALL_LOCK`: Indicates whether to allow the open install page (setting admin account is involved, so it's a very important value).
99
+- `SECRET_KEY`: Global secret key for your server security, **you'd better change it** (will generate a random string every time you install).
100
+- `LOGIN_REMEMBER_DAYS`: Cookie lifetime, in days.
101
+- `COOKIE_USERNAME`: Name of the cookie that saves username.
102
+- `COOKIE_REMEMBER_NAME`: Name of cookie that saves auto-login information.
103
+- `REVERSE_PROXY_AUTHENTICATION_USER`: Header name for reverse proxy authentication username.
104
+- `DISABLE_GIT_HOOKS`: Prevent all users (including admin) from creating custom git hooks (defaults to false)
105
+
106
+## OpenID (`openid`)
107
+
108
+- `ENABLE_OPENID_SIGNIN`: Whether to allow signin in via OpenID (defaults to false).
109
+- `ENABLE_OPENID_SIGNUP`: Whether to allow registering via OpenID (defaults to `!DISABLE_REGISTRATION`).
110
+- `WHITELISTED_URIS`: Space separated list of POSIX regexp patterns. If non empty OpenID URIs should match any of these to be granted access.
111
+- `BLACKLISTED_URIS`: Space separated list of POSIX regexp pattenrs. OpenID URI matching any of these is refused access.
112
+
113
+## Service (`service`)
114
+
115
+- `ACTIVE_CODE_LIVE_MINUTES`: The minutes of active code life time.
116
+- `RESET_PASSWD_CODE_LIVE_MINUTES`: The minutes of reset password code life time.
117
+- `REGISTER_EMAIL_CONFIRM`: Enable this to ask for mail confirmation of registration, requires `Mailer` to be enabled.
118
+- `DISABLE_REGISTRATION`: Disable registration, after which only admin can create accounts for users.
119
+- `SHOW_REGISTRATION_BUTTON`: Indicate whether to show registration button or not.
120
+- `REQUIRE_SIGNIN_VIEW`: Enable this to force users to log in to view any page.
121
+- `ENABLE_CACHE_AVATAR`: Enable this to cache avatar from Gravatar.
122
+- `ENABLE_NOTIFY_MAIL`: Enable this to send e-mail to watchers of repository when something happens like creating issues, requires `Mailer` to be enabled.
123
+- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: Enable this to allow reverse proxy authentication, more detail: https://github.com/gogits/gogs/issues/165
124
+- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: Enable this to allow auto-registration for reverse authentication.
125
+- `DISABLE_MINIMUM_KEY_SIZE_CHECK`: Do not check minimum key size with corresponding type.
126
+- `ENABLE_CAPTCHA`: Enable this to use captcha validation for registration.
127
+
128
+## Webhook (`webhook`)
129
+
130
+- `QUEUE_LENGTH`:exclamation:: Hook task queue length.
131
+- `DELIVER_TIMEOUT`: Delivery timeout in seconds for shooting webhooks.
132
+- `SKIP_TLS_VERIFY`: Indicate whether to allow insecure certification or not.
133
+- `PAGING_NUM`: Number of webhook history that are shown in one page.
134
+
135
+## Mailer (`mailer`)
136
+
137
+- `ENABLED`: Enable this to use a mail service.
138
+- `DISABLE_HELO`: Disable HELO operation.
139
+- `HELO_HOSTNAME`: Custom hostname for HELO operation.
140
+- `HOST`: SMTP mail host address and port (example: smtp.gitea.io:587).
141
+- `FROM`: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format.
142
+- `USER`: Username of mailer (usually just your e-mail address).
143
+- `PASSWD`: Password of mailer.
144
+- `SKIP_VERIFY`: Do not verify the self-signed certificates.
145
+- `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`.
146
+- `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.
147
+
148
+Note: Actually, Gitea supports only SMTP with STARTTLS.
149
+
150
+## Cache (`cache`)
151
+
152
+- `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'`.
153
+- `INTERVAL`: for memory cache only, GC interval in seconds.
154
+- `HOST`: For redis and memcache, the host address and port number.
155
+    - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180`
156
+    - Memache: `127.0.0.1:9090;127.0.0.1:9091`
157
+
158
+## Session (`session`)
159
+
160
+- `PROVIDER`: Session engine provider, either `memory`, `file`, `redis`, or `mysql`.
161
+- `PROVIDER_CONFIG`: For file, it's the root path; for others, it's the host address and port number.
162
+- `COOKIE_SECURE`: Enable this to force using HTTPS for all session access.
163
+- `COOKIE_NAME`: The name of the cookie used for the session ID, defaults to `i_like_gitea`.
164
+- `GC_INTERVAL_TIME`: GC interval in seconds.
165
+
166
+## Picture (`picture`)
167
+
168
+- `GRAVATAR_SOURCE`: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`.
169
+- `DISABLE_GRAVATAR`: Enable this to use local avatars only.
170
+- `ENABLE_FEDERATED_AVATAR`: Enable support for federated avatars (see http://www.libravatar.org)
171
+- `AVATAR_UPLOAD_PATH`: Path to store local and cached files.
172
+
173
+## Attachment (`attachment`)
174
+
175
+- `ENABLED`: Enable this to allow users upload attachments.
176
+- `PATH`: Path to store attachments.
177
+- `ALLOWED_TYPES`: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types.
178
+- `MAX_SIZE`: Maximum size in MB, e.g. `4`
179
+- `MAX_FILES`: Maximum number of attachments can be uploaded at once, e.g. `5`.
180
+
181
+## Log (`log`)
182
+
183
+- `ROOT_PATH`: Root path for log files.
184
+- `MODE`: Logging mode, default is `console`. For multiple modes, use comma to separate it.
185
+- `LEVEL`: General log level, default is `Trace`.
186
+
187
+## Cron (`cron`)
188
+
189
+- `ENABLED`: Enable this to run cron tasks periodically.
190
+- `RUN_AT_START`: Enable this to run cron tasks at start time.
191
+
192
+### Cron - Update Mirrors (`cron.update_mirrors`)
193
+
194
+- `SCHEDULE`: Cron syntax for scheduling update mirrors, e.g. `@every 1h`.
195
+
196
+### Cron - Repository Health Check (`cron.repo_health_check`)
197
+
198
+- `SCHEDULE`: Cron syntax for scheduling repository health check, e.g. `@every 24h`.
199
+- `TIMEOUT`: Time duration syntax for health check execution timeout, e.g. `60s`.
200
+- `ARGS`: Arguments for command `git fsck`, e.g. `--unreachable --tags`.
201
+
202
+### Cron - Repository Statistics Check (`cron.check_repo_stats`)
203
+
204
+- `RUN_AT_START`: Enable this to run repository statistics check at start time.
205
+- `SCHEDULE`: Cron syntax for scheduling repository statistics check, e.g. `@every 24h`.
206
+
207
+## Git (`git`)
208
+
209
+- `MAX_GIT_DIFF_LINES`: Max number of lines allowed of a single file in diff view.
210
+- `MAX_GIT_DIFF_LINE_CHARACTERS`: Max number of characters of a line allowed in diff view.
211
+- `MAX_GIT_DIFF_FILES`: Max number of files shown in diff view.
212
+- `GC_ARGS`: Arguments for command `git gc`, e.g. `--aggressive --auto`.
213
+
214
+## Other (`other`)
215
+
216
+- `SHOW_FOOTER_BRANDING`: Enable this to show Gitea branding in the footer.
217
+- `SHOW_FOOTER_VERSION`: Enable this to show Gitea version information in the footer.
218
+- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: Enable this to show time of template execution in the footer.

File diff suppressed because it is too large
+ 191 - 0
docs/content/doc/advanced/config-cheat-sheet.zh-cn.md


+ 54 - 0
docs/content/doc/advanced/customizing-gitea.en-us.md

@@ -0,0 +1,54 @@
1
+---
2
+date: "2017-04-15T14:56:00+02:00"
3
+title: "Customizing Gitea"
4
+slug: "customizing-gitea"
5
+weight: 9
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "advanced"
11
+    name: "Customizing Gitea"
12
+    weight: 9
13
+    identifier: "customizing-gitea"
14
+---
15
+
16
+# Customizing Gitea
17
+
18
+The main way to customize Gitea is by using the `custom` folder. This is the central place to override and configure features.
19
+
20
+If you install Gitea from binary, after the installation process ends, you can find the `custom` folder next to the binary.
21
+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).
22
+
23
+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.
24
+
25
+**Note** that you have to restart Gitea for it to notice the changes.
26
+
27
+## Customizing /robots.txt
28
+
29
+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/).
30
+
31
+## Serving custom public files
32
+
33
+To make Gitea serve custom public files (like pages and images), use the folder `custom/public/` as the webroot. Symbolic links will be followed.
34
+
35
+For example, a file `image.png` stored in `custom/public`, can be accessed with the url `http://your-gitea-url/image.png`.
36
+
37
+## Changing the default avatar
38
+
39
+Place the png image at the following path: `custom/public/img/avatar_default.png`
40
+
41
+## Customizing Gitea pages
42
+
43
+The `custom/templates` folder allows you to change every single page of Gitea.
44
+
45
+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.
46
+
47
+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.
48
+
49
+You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax.
50
+Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing.
51
+
52
+## Customizing gitignores, labels, licenses, locales, and readmes.
53
+
54
+Place your own files in corresponding sub-folder under `custom/options`.

+ 42 - 0
docs/content/doc/advanced/hacking-on-gitea.en-us.md

@@ -0,0 +1,42 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Hacking on Gitea"
4
+slug: "hacking-on-gitea"
5
+weight: 10
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "advanced"
11
+    name: "Hacking on Gitea"
12
+    weight: 10
13
+    identifier: "hacking-on-gitea"
14
+---
15
+
16
+# Hacking on Gitea
17
+
18
+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).
19
+
20
+If you want to contribute to Gitea you should fork the project and work on the `master` branch. There is a catch though, some internal packages are referenced by their GitHub URL. So you have to trick the Go tool to think that you work on a clone of the official repository. Start by downloading the source code as you normally would:
21
+
22
+```
23
+go get -d code.gitea.io/gitea
24
+```
25
+
26
+Now it's time to fork the [Gitea repository](https://github.com/go-gitea/gitea) on GitHub, after that you should have to switch to the source directory on the command line:
27
+
28
+```
29
+cd $GOPATH/src/code.gitea.io/gitea
30
+```
31
+
32
+To be able to create pull requests you should add your forked repository as a remote to the Gitea sources, otherwise you can not apply the changes to our repository because of lacking write permissions:
33
+
34
+```
35
+git remote rename origin upstream
36
+git remote add origin git@github.com:<USERNAME>/gitea.git
37
+git fetch --all --prune
38
+```
39
+
40
+You've got a working development environment for Gitea now. Take a look at the `Makefile` to get an overview about the available tasks. The most common tasks should be `make test` which will start our test environment and `make build` which will build a `gitea` binary into your working directory. Writing test cases is not mandatory to contribute, but we will be happy if you do.
41
+
42
+That’s it! You are ready to hack on Gitea. Test your changes, push them to your repository and open a pull request.

+ 42 - 0
docs/content/doc/advanced/hacking-on-gitea.zh-cn.md

@@ -0,0 +1,42 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "加入 Gitea 开源"
4
+slug: "hacking-on-gitea"
5
+weight: 10
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "advanced"
11
+    name: "加入 Gitea 开源"
12
+    weight: 10
13
+    identifier: "hacking-on-gitea"
14
+---
15
+
16
+# Hacking on Gitea
17
+
18
+首先你需要一些运行环境,这和 [从源代码安装]({{< relref "from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。
19
+
20
+如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea使用Govendor来管理依赖,因此所有依赖项都被工具自动copy在vendor子目录下。用下面的命令来下载源码:
21
+
22
+```
23
+go get -d code.gitea.io/gitea
24
+```
25
+
26
+然后你可以在 Github 上 fork [Gitea 项目](https://github.com/go-gitea/gitea),之后可以通过下面的命令进入源码目录:
27
+
28
+```
29
+cd $GOPATH/src/code.gitea.io/gitea
30
+```
31
+
32
+要创建 pull requests 你还需要在源码中新增一个 remote 指向你 Fork 的地址,直接推送到 origin 的话会告诉你没有写权限:
33
+
34
+```
35
+git remote rename origin upstream
36
+git remote add origin git@github.com:<USERNAME>/gitea.git
37
+git fetch --all --prune
38
+```
39
+
40
+然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。
41
+
42
+好了,到这里你已经设置好了所有的开发Gitea所需的环境。欢迎成为 Gitea 的 Contributor。

+ 44 - 0
docs/content/doc/advanced/make.en-us.md

@@ -0,0 +1,44 @@
1
+---
2
+date: "2017-01-14T11:00:00-02:00"
3
+title: "Make"
4
+slug: "make"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "advanced"
11
+    name: "Make"
12
+    weight: 30
13
+    identifier: "make"
14
+---
15
+
16
+# Make
17
+
18
+Gitea makes heavy use of Make to automate tasks and have a faster development. This guide cover how to install Make.
19
+
20
+### On Linux
21
+
22
+You can install with your package manager. 
23
+
24
+On Ubuntu/Debian:
25
+
26
+```bash
27
+sudo apt-get install build-essential
28
+```
29
+
30
+On Fedora/RHEL/CentOS:
31
+
32
+```bash
33
+sudo yum install make
34
+```
35
+
36
+### On Windows
37
+
38
+If you are using Windows, you can download and use one of these distributions of Make:
39
+
40
+- [Single binary build](http://www.equation.com/servlet/equation.cmd?fa=make). Copy somewhere and add to `PATH`.
41
+  - [32-bits version](ftp://ftp.equation.com/make/32/make.exe)
42
+  - [64-bits version](ftp://ftp.equation.com/make/64/make.exe)
43
+- [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`.
44
+- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make`

+ 67 - 0
docs/content/doc/advanced/specific-variables.en-us.md

@@ -0,0 +1,67 @@
1
+---
2
+date: "2017-04-08T11:34:00+02:00"
3
+title: "Specific variables"
4
+slug: "specific-variables"
5
+weight: 20
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "advanced"
11
+    name: "Specific variables"
12
+    weight: 20
13
+    identifier: "specific-variables"
14
+---
15
+
16
+# Specific variables
17
+
18
+This is an inventory of Gitea environment variables. They change Gitea behaviour.
19
+
20
+Initialize them before Gitea command to be effective, for example:
21
+
22
+```
23
+GITEA_CUSTOM=/home/gitea/custom ./gitea web
24
+```
25
+
26
+## From Go language
27
+
28
+As Gitea is written in Go, it uses some Go variables as:
29
+
30
+  * `GOOS`
31
+  * `GOARCH`
32
+  * `GOPATH`
33
+
34
+For `GOPATH`, check [official documentation about GOPATH environment variable](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable).
35
+
36
+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).
37
+
38
+## Gitea files
39
+
40
+  * `GITEA_WORK_DIR`: Gitea absolute path of work directory.
41
+  * `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable to change *custom* directory.
42
+  * `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
43
+  * `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
44
+
45
+## Operating system specifics
46
+
47
+  * `USER`: system user that launch Gitea. Useful for repository URL address on Gitea interface
48
+  * `USERNAME`: if no USER found, Gitea will try `USERNAME`
49
+  * `HOME`: User home directory path (**except if** you're running on Windows, check  the following `USERPROFILE` variable)
50
+
51
+### Only on Windows
52
+
53
+  * `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
54
+  * `HOMEDRIVE`: Main drive path you will use to get home directory
55
+  * `HOMEPATH`: Home relative path in the given home drive path
56
+
57
+## Macaron (framework used by Gitea)
58
+
59
+  * `HOST`: Host Macaron will listen on
60
+  * `PORT`: Port Macaron will listen on
61
+  * `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".
62
+
63
+## Miscellaneous
64
+
65
+  * `SKIP_MINWINSVC`: Do not run as a service on Windows if set to 1
66
+  * `ZOOKEEPER_PATH`: [Zookeeper](http://zookeeper.apache.org/) jar file path
67
+

+ 13 - 0
docs/content/doc/features.en-us.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Features"
4
+slug: "features"
5
+weight: 20
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "Features"
11
+    weight: 30
12
+    identifier: "features"
13
+---

+ 13 - 0
docs/content/doc/features.zh-cn.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "特性"
4
+slug: "features"
5
+weight: 20
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "特性"
11
+    weight: 30
12
+    identifier: "features"
13
+---

+ 13 - 0
docs/content/doc/features.zh-tw.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "功能"
4
+slug: "features"
5
+weight: 20
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "功能"
11
+    weight: 30
12
+    identifier: "features"
13
+---

+ 194 - 0
docs/content/doc/features/authentication.en-us.md

@@ -0,0 +1,194 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Authentication"
4
+slug: "authentication"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "Authentication"
12
+    weight: 10
13
+    identifier: "authentication"
14
+---
15
+
16
+---
17
+name: Authentication
18
+---
19
+
20
+# Authentication
21
+
22
+## LDAP (Lightweight Directory Access Protocol)
23
+
24
+Both the LDAP via BindDN and the simple auth LDAP share the following fields:
25
+
26
+- Authorization Name **(required)**
27
+  - A name to assign to the new method of authorization.
28
+
29
+- Host **(required)**
30
+  - The address where the LDAP server can be reached.
31
+  - Example: `mydomain.com`
32
+
33
+- Port **(required)**
34
+  - The port to use when connecting to the server.
35
+  - Example: `389` for LDAP or `636` for LDAP SSL
36
+
37
+- Enable TLS Encryption (optional)
38
+  - Whether to use TLS when connecting to the LDAP server.
39
+
40
+- Admin Filter (optional)
41
+  - An LDAP filter specifying if a user should be given administrator
42
+    privileges. If a user account passes the filter, the user will be
43
+    privileged as an administrator.
44
+  - Example: `(objectClass=adminAccount)`
45
+  - Example for Microsoft Active Directory (AD): `(memberOf=CN=admin-group,OU=example,DC=example,DC=org)`
46
+
47
+- Username attribute (optional)
48
+  - The attribute of the user's LDAP record containing the user name. Given
49
+    attribute value will be used for new Gitea account user name after first
50
+    successful sign-in. Leave empty to use login name given on sign-in form.
51
+  - This is useful when supplied login name is matched against multiple
52
+    attributes, but only single specific attribute should be used for Gitea
53
+    account name, see "User Filter".
54
+  - Example: `uid`
55
+  - Example for Microsoft Active Directory (AD): `sAMAccountName`
56
+
57
+- First name attribute (optional)
58
+  - The attribute of the user's LDAP record containing the user's first name.
59
+    This will be used to populate their account information.
60
+  - Example: `givenName`
61
+
62
+- Surname attribute (optional)
63
+  - The attribute of the user's LDAP record containing the user's surname.
64
+    This will be used to populate their account information.
65
+  - Example: `sn`
66
+
67
+- E-mail attribute **(required)**
68
+  - The attribute of the user's LDAP record containing the user's email
69
+    address. This will be used to populate their account information.
70
+  - Example: `mail`
71
+
72
+**LDAP via BindDN** adds the following fields:
73
+
74
+- Bind DN (optional)
75
+  - The DN to bind to the LDAP server with when searching for the user. This
76
+    may be left blank to perform an anonymous search.
77
+  - Example: `cn=Search,dc=mydomain,dc=com`
78
+
79
+- Bind Password (optional)
80
+  - The password for the Bind DN specified above, if any. _Note: The password
81
+    is stored in plaintext at the server. As such, ensure that your Bind DN
82
+    has as few privileges as possible._
83
+
84
+- User Search Base **(required)**
85
+  - The LDAP base at which user accounts will be searched for.
86
+  - Example: `ou=Users,dc=mydomain,dc=com`
87
+
88
+- User Filter **(required)**
89
+  - An LDAP filter declaring how to find the user record that is attempting to
90
+    authenticate. The `%s` matching parameter will be substituted with login
91
+    name given on sign-in form.
92
+  - Example: `(&(objectClass=posixAccount)(uid=%s))`
93
+  - Example for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))`
94
+  - To substitute more than once `%[1]s` should be used instead, e.g. when
95
+    matching supplied login name against multiple attributes such as user
96
+    identifier, email or even phone number.
97
+  - Example: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))`
98
+
99
+**LDAP using simple auth** adds the following fields:
100
+
101
+- User DN **(required)**
102
+  - A template to use as the user's DN. The `%s` matching parameter will be substituted with login name given on sign-in form.
103
+  - Example: `cn=%s,ou=Users,dc=mydomain,dc=com`
104
+  - Example: `uid=%s,ou=Users,dc=mydomain,dc=com`
105
+
106
+- User Filter **(required)**
107
+  - An LDAP filter declaring when a user should be allowed to log in. The `%s`
108
+    matching parameter will be substituted with login name given on sign-in
109
+    form.
110
+  - Example: `(&(objectClass=posixAccount)(cn=%s))`
111
+  - Example: `(&(objectClass=posixAccount)(uid=%s))`
112
+
113
+**Verify group membership in LDAP** uses the following fields:
114
+
115
+* Group Search Base (optional)
116
+    * The LDAP DN used for groups.
117
+    * Example: `ou=group,dc=mydomain,dc=com`
118
+
119
+* Group Name Filter (optional)
120
+    * An LDAP filter declaring how to find valid groups in the above DN.
121
+    * Example: `(|(cn=gitea_users)(cn=admins))`
122
+
123
+* User Attribute in Group (optional)
124
+    * Which user LDAP attribute is listed in the group.
125
+    * Example: `uid`
126
+
127
+* Group Attribute for User (optional)
128
+    * Which group LDAP attribute contains an array above user attribute names.
129
+    * Example: `memberUid`
130
+
131
+## PAM (Pluggable Authentication Module)
132
+
133
+To configure this you just need to set the 'PAM Service Name' to a filename in `/etc/pam.d/`.
134
+If you want it to work with normal Linux passwords, the user running Gitea must have read access to `/etc/shadow`.
135
+
136
+## SMTP (Simple Mail Transfer Protocol)
137
+
138
+This option allows Gitea to log in to your SMTP host as a Gitea user. To configure this, simply set the fields below:
139
+
140
+- Authentication Name **(required)**
141
+  - A name to assign to the new method of authorization.
142
+
143
+- SMTP Authentication Type **(required)**
144
+  - Type of authentication for use on your SMTP host, PLAIN or LOGIN.
145
+
146
+- Host **(required)**
147
+  - The address where the SMTP host can be reached.
148
+  - Example: `smtp.mydomain.com`
149
+
150
+- Port **(required)**
151
+  - The port to use when connecting to the server.
152
+  - Example: `587`
153
+
154
+- Allowed Domains
155
+  - Restrict what domains can log in if you're using public SMTP host or SMTP host with multiple domains.
156
+  - Example: `gitea.io,mydomain.com,mydomain2.com`
157
+
158
+- Enable TLS Encryption
159
+  - Enable TLS encryption on authentication.
160
+
161
+- Skip TLS Verify
162
+  - Disable TLS verify on authentication.
163
+  
164
+- This authentication is activate
165
+  - Enable or disable this auth.
166
+
167
+## FreeIPA
168
+
169
+- In order to log in to Gitea using FreeIPA credentials, you need to create a bind account for Gitea to use:
170
+
171
+-  On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com` with your DN, and providing an appropriately secure password:
172
+```
173
+  dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com
174
+  changetype: add
175
+  objectclass: account
176
+  objectclass: simplesecurityobject
177
+  uid: gitea
178
+  userPassword: secure password
179
+  passwordExpirationTime: 20380119031407Z
180
+  nsIdleTimeout: 0
181
+```
182
+
183
+- Import the LDIF (change localhost to an IPA server if needed), you’ll be prompted for your Directory Manager password:
184
+```
185
+  ldapmodify -h localhost -p 389 -x -D \
186
+  "cn=Directory Manager" -W -f gitea.ldif
187
+```
188
+-  Add an IPA group for gitea_users :
189
+```
190
+  ipa group-add --desc="Gitea Users" gitea_users
191
+```
192
+-  Note: If you get an error about IPA credentials, please run `kinit admin` and give your admin account password.
193
+
194
+-  Now login to the Gitea as an Administrator, click on "Authentication" under Admin Panel. Then click `Add New Source` and fill in the details, changing all where appropriate to your own domain.

+ 18 - 0
docs/content/doc/features/authentication.zh-cn.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "认证"
4
+slug: "authentication"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "认证"
12
+    weight: 10
13
+    identifier: "authentication"
14
+---
15
+
16
+# 认证
17
+
18
+## TBD

+ 18 - 0
docs/content/doc/features/authentication.zh-tw.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "認證"
4
+slug: "authentication"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "認證"
12
+    weight: 10
13
+    identifier: "authentication"
14
+---
15
+
16
+# 認證
17
+
18
+## TBD

+ 18 - 0
docs/content/doc/features/localization.en-us.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Localization"
4
+slug: "localization"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "Localization"
12
+    weight: 20
13
+    identifier: "localization"
14
+---
15
+
16
+# Localization
17
+
18
+## TBD

+ 18 - 0
docs/content/doc/features/localization.zh-cn.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "本地化"
4
+slug: "localization"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "本地化"
12
+    weight: 20
13
+    identifier: "localization"
14
+---
15
+
16
+# 本地化
17
+
18
+## TBD

+ 18 - 0
docs/content/doc/features/localization.zh-tw.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "在地化"
4
+slug: "localization"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "在地化"
12
+    weight: 20
13
+    identifier: "localization"
14
+---
15
+
16
+# Localization
17
+
18
+## TBD

+ 103 - 0
docs/content/doc/features/webhooks.en-us.md

@@ -0,0 +1,103 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Webhooks"
4
+slug: "webhooks"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "Webhooks"
12
+    weight: 30
13
+    identifier: "webhooks"
14
+---
15
+
16
+# Webhooks
17
+
18
+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.
19
+
20
+### Event information
21
+
22
+Following shows an example of event information that will be sent by Gitea to Payload URL:
23
+
24
+
25
+```
26
+X-Github-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
27
+X-Github-Event: push
28
+X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
29
+X-Gogs-Event: push
30
+X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
31
+X-Gitea-Event: push
32
+```
33
+
34
+```json
35
+{
36
+  "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3",
37
+  "ref": "refs/heads/develop",
38
+  "before": "28e1879d029cb852e4844d9c718537df08844e03",
39
+  "after": "bffeb74224043ba2feb48d137756c8a9331c449a",
40
+  "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a",
41
+  "commits": [
42
+    {
43
+      "id": "bffeb74224043ba2feb48d137756c8a9331c449a",
44
+      "message": "Webhooks Yay!",
45
+      "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a",
46
+      "author": {
47
+        "name": "Gitea",
48
+        "email": "someone@gitea.io",
49
+        "username": "gitea"
50
+      },
51
+      "committer": {
52
+        "name": "Gitea",
53
+        "email": "someone@gitea.io",
54
+        "username": "gitea"
55
+      },
56
+      "timestamp": "2017-03-13T13:52:11-04:00"
57
+    }
58
+  ],
59
+  "repository": {
60
+    "id": 140,
61
+    "owner": {
62
+      "id": 1,
63
+      "login": "gitea",
64
+      "full_name": "Gitea",
65
+      "email": "someone@gitea.io",
66
+      "avatar_url": "https://localhost:3000/avatars/1",
67
+      "username": "gitea"
68
+    },
69
+    "name": "webhooks",
70
+    "full_name": "gitea/webhooks",
71
+    "description": "",
72
+    "private": false,
73
+    "fork": false,
74
+    "html_url": "http://localhost:3000/gitea/webhooks",
75
+    "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git",
76
+    "clone_url": "http://localhost:3000/gitea/webhooks.git",
77
+    "website": "",
78
+    "stars_count": 0,
79
+    "forks_count": 1,
80
+    "watchers_count": 1,
81
+    "open_issues_count": 7,
82
+    "default_branch": "master",
83
+    "created_at": "2017-02-26T04:29:06-05:00",
84
+    "updated_at": "2017-03-13T13:51:58-04:00"
85
+  },
86
+  "pusher": {
87
+    "id": 1,
88
+    "login": "gitea",
89
+    "full_name": "Gitea",
90
+    "email": "someone@gitea.io",
91
+    "avatar_url": "https://localhost:3000/avatars/1",
92
+    "username": "gitea"
93
+  },
94
+  "sender": {
95
+    "id": 1,
96
+    "login": "gitea",
97
+    "full_name": "Gitea",
98
+    "email": "someone@gitea.io",
99
+    "avatar_url": "https://localhost:3000/avatars/1",
100
+    "username": "gitea"
101
+  }
102
+}
103
+```

+ 18 - 0
docs/content/doc/features/webhooks.zh-cn.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Webhooks"
4
+slug: "webhooks"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "Webhooks"
12
+    weight: 30
13
+    identifier: "webhooks"
14
+---
15
+
16
+# Webhooks
17
+
18
+## TBD

+ 18 - 0
docs/content/doc/features/webhooks.zh-tw.md

@@ -0,0 +1,18 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Webhooks"
4
+slug: "webhooks"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "features"
11
+    name: "Webhooks"
12
+    weight: 30
13
+    identifier: "webhooks"
14
+---
15
+
16
+# Webhooks
17
+
18
+## TBD

+ 13 - 0
docs/content/doc/help.zh-cn.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2017-01-20T15:00:00+08:00"
3
+title: "帮助"
4
+slug: "help"
5
+weight: 50
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "帮助"
11
+    weight: 50
12
+    identifier: "help"
13
+---

+ 23 - 0
docs/content/doc/help/seek-help.zh-cn.md

@@ -0,0 +1,23 @@
1
+---
2
+date: "2017-01-20T15:00:00+08:00"
3
+title: "需要帮助"
4
+slug: "seek-help"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "help"
11
+    name: "需要帮助"
12
+    weight: 20
13
+    identifier: "seek-help"
14
+---
15
+
16
+## 需要帮助?
17
+
18
+如果您在使用或者开发过程中遇到问题,请到以下渠道咨询:
19
+
20
+- 到[Github issue](https://github.com/go-gitea/gitea/issues)提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问)
21
+- 中文问题到[gocn.io](https://gocn.io/topic/Gitea)提问
22
+- 访问 [Discord server - 英文](https://discord.gg/NsatcWJ)
23
+- 加入 QQ群 328432459 获得进一步的支持

+ 69 - 0
docs/content/doc/help/troubleshooting.en-us.md

@@ -0,0 +1,69 @@
1
+---
2
+date: "2016-11-08T16:00:00+02:00"
3
+title: "Troubleshooting"
4
+slug: "troubleshooting"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "Help"
11
+    name: "Troubleshooting"
12
+    weight: 20
13
+    identifier: "troubleshooting"
14
+---
15
+
16
+# Troubleshooting
17
+
18
+This page contains some common issues you can run into and their solutions.
19
+
20
+## SSH issues
21
+
22
+If you are having issues with reaching your repositories over `ssh` while the
23
+Gitea web front-end and `https` based git operations work fine, consider
24
+looking at the following items.
25
+
26
+```
27
+Permission denied (publickey).
28
+fatal: Could not read from remote repository.
29
+
30
+Please make sure you have the correct access rights
31
+and the repository exists.
32
+```
33
+
34
+This error signifies that the server rejected your log in attempt, check the
35
+following things:
36
+
37
+* On the client:
38
+  * Ensure the public and private ssh keys are added to the correct Gitea user.
39
+  * Make sure there are no issues in your remote url, ensure the name of the
40
+    git user (before the `@`) is spelled correctly.
41
+  * Ensure the public and private ssh keys are available and reachable on the
42
+    client machine.
43
+  * Try to `ssh git@myremote.example` to ensure that everything is set up
44
+    properly.
45
+* On the server:
46
+  * Check the permissions of the `.ssh` directory in the home directory of your
47
+    `git` user.
48
+  * Verify that the correct public keys are added to `.ssh/authorized_keys`.
49
+    Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the
50
+    Gitea admin panel.
51
+
52
+If you get a similar error without the public key part (shown below) then
53
+authentication succeeded, but some other setting is preventing ssh from
54
+reaching the correct repository.
55
+
56
+```
57
+fatal: Could not read from remote repository.
58
+
59
+Please make sure you have the correct access rights
60
+and the repository exists.
61
+```
62
+
63
+In this case, look into the following settings:
64
+
65
+* On the server:
66
+  * Make sure that your `git` user has a usable shell set. You can verify this
67
+    with `getent passwd git | cut -d: -f7`, `chsh` can be used to modify this.
68
+  * Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the
69
+    proper configuration file.

+ 13 - 0
docs/content/doc/installation.en-us.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Installation"
4
+slug: "installation"
5
+weight: 10
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "Installation"
11
+    weight: 10
12
+    identifier: "installation"
13
+---

+ 13 - 0
docs/content/doc/installation.zh-cn.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "安装"
4
+slug: "installation"
5
+weight: 10
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "安装"
11
+    weight: 10
12
+    identifier: "installation"
13
+---

+ 13 - 0
docs/content/doc/installation.zh-tw.md

@@ -0,0 +1,13 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "安裝"
4
+slug: "installation"
5
+weight: 10
6
+toc: false
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    name: "安裝"
11
+    weight: 10
12
+    identifier: "installation"
13
+---

+ 45 - 0
docs/content/doc/installation/from-binary.en-us.md

@@ -0,0 +1,45 @@
1
+---
2
+date: "2017-06-19T12:00:00+02:00"
3
+title: "Installation from binary"
4
+slug: "install-from-binary"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "From binary"
12
+    weight: 20
13
+    identifier: "install-from-binary"
14
+---
15
+
16
+# Installation from binary
17
+
18
+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:
19
+
20
+```
21
+wget -O gitea https://dl.gitea.io/gitea/1.0.1/gitea-1.0.1-linux-amd64
22
+chmod +x gitea
23
+```
24
+
25
+## Test
26
+
27
+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`.
28
+
29
+```
30
+./gitea web
31
+```
32
+
33
+## Troubleshooting
34
+
35
+### Old glibc versions
36
+
37
+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" >}}).
38
+
39
+### Running gitea on another port
40
+
41
+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`.
42
+
43
+## Anything missing?
44
+
45
+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.

+ 35 - 0
docs/content/doc/installation/from-binary.zh-cn.md

@@ -0,0 +1,35 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "从二进制安装"
4
+slug: "install-from-binary"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "从二进制安装"
12
+    weight: 20
13
+    identifier: "install-from-binary"
14
+---
15
+
16
+# 从二进制安装
17
+
18
+所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例):
19
+
20
+```
21
+wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64
22
+chmod +x gitea
23
+```
24
+
25
+## 测试
26
+
27
+在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。
28
+
29
+```
30
+./gitea web
31
+```
32
+
33
+## 需要帮助?
34
+
35
+如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}})

+ 35 - 0
docs/content/doc/installation/from-binary.zh-tw.md

@@ -0,0 +1,35 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "執行檔安裝"
4
+slug: "install-from-binary"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "執行檔"
12
+    weight: 20
13
+    identifier: "install-from-binary"
14
+---
15
+
16
+# 從執行檔安裝
17
+
18
+所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了:
19
+
20
+```
21
+wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64
22
+chmod +x gitea
23
+```
24
+
25
+## 測試
26
+
27
+執行完上述步驟,您將會得到 `gita` 執行檔,在複製到遠端伺服器前,您可以先測試看看,在命令列執行完成後,可以透過 `Ctrl + C` 關閉程式。
28
+
29
+```
30
+./gitea web
31
+```
32
+
33
+## 需要協助?
34
+
35
+如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。

+ 57 - 0
docs/content/doc/installation/from-package.en-us.md

@@ -0,0 +1,57 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Installation from package"
4
+slug: "install-from-package"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "From package"
12
+    weight: 20
13
+    identifier: "install-from-package"
14
+---
15
+
16
+# Installation from package
17
+
18
+## Linux
19
+
20
+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.
21
+
22
+## Windows
23
+
24
+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.
25
+
26
+## macOS
27
+
28
+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:
29
+
30
+```
31
+brew tap go-gitea/gitea
32
+brew install gitea
33
+```
34
+
35
+## FreeBSD
36
+
37
+A FreeBSD port `www/gitea` is available.  You can install a pre-built binary package:
38
+
39
+```
40
+pkg install gitea
41
+```
42
+
43
+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):
44
+
45
+```
46
+su -
47
+cd /usr/ports/www/gitea
48
+make install clean
49
+```
50
+
51
+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`.
52
+
53
+To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`. 
54
+
55
+## Anything missing?
56
+
57
+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.

+ 37 - 0
docs/content/doc/installation/from-package.zh-cn.md

@@ -0,0 +1,37 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "选择包安装"
4
+slug: "install-from-package"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "选择包安装"
12
+    weight: 20
13
+    identifier: "install-from-package"
14
+---
15
+
16
+# 使用包安装
17
+
18
+## Linux
19
+
20
+目前还没有对应的Linux安装包发布,如果我们发布了,我们将更新本页面。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。
21
+
22
+## Windows
23
+
24
+目前还没有对应的Windows安装包发布,如果我们发布了,我们将更新本页面。我们计划使用 `MSI` 安装器或者 [Chocolatey](https://chocolatey.org/)来制作安装包。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。
25
+
26
+## macOS
27
+
28
+macOS 平台下当前我们仅支持通过 `brew` 来安装。如果您没有安装 [Homebrew](http://brew.sh/),你冶可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令:
29
+
30
+```
31
+brew tap go-gitea/gitea
32
+brew install gitea
33
+```
34
+
35
+## 需要帮助?
36
+
37
+如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}})

+ 53 - 0
docs/content/doc/installation/from-package.zh-tw.md

@@ -0,0 +1,53 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "套件安裝"
4
+slug: "install-from-package"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "套件安裝"
12
+    weight: 20
13
+    identifier: "install-from-package"
14
+---
15
+
16
+# 從套件安裝
17
+
18
+## Linux
19
+
20
+目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。
21
+
22
+## Windows
23
+
24
+目前尚未發佈任何 Windows 套件,如果我們發佈了,會直接更新此網頁。我們計畫使用 `MSI`,或 [Chocolatey](https://chocolatey.org/) 來製作套件。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。
25
+
26
+## macOS
27
+
28
+目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令:
29
+
30
+```
31
+brew tap go-gitea/gitea
32
+brew install gitea
33
+```
34
+
35
+## FreeBSD
36
+
37
+下載 FreeBSD port `www/gitea` 套件。你可以安裝 pre-built 執行檔:
38
+
39
+```
40
+pkg install gitea
41
+```
42
+
43
+對於最新版本或想要自行編譯特定選項,請使用 [port 安裝](https://www.freebsd.org/doc/handbook/ports-using.html):
44
+
45
+```
46
+su -
47
+cd /usr/ports/www/gitea
48
+make install clean
49
+```
50
+
51
+## 需要協助?
52
+
53
+如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。

+ 79 - 0
docs/content/doc/installation/from-source.en-us.md

@@ -0,0 +1,79 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Installation from source"
4
+slug: "install-from-source"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "From source"
12
+    weight: 30
13
+    identifier: "install-from-source"
14
+---
15
+
16
+# Installation from source
17
+
18
+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).
19
+
20
+**Note**: Go version 1.7 or higher is required
21
+
22
+## Download
23
+
24
+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.
25
+
26
+```
27
+go get -d -u code.gitea.io/gitea
28
+cd $GOPATH/src/code.gitea.io/gitea
29
+```
30
+
31
+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.
32
+
33
+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:
34
+
35
+```
36
+git branch -a
37
+git checkout v1.0
38
+```
39
+
40
+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))
41
+
42
+```
43
+git fetch origin pull/xyz/head:pr-xyz
44
+```
45
+
46
+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:
47
+
48
+```
49
+git tag -l
50
+git checkout v1.0.0
51
+git checkout pr-xyz
52
+```
53
+
54
+## Build
55
+
56
+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:
57
+
58
+* `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.
59
+* `sqlite`: With this tag you can enable support for a [SQLite3](https://sqlite.org/) database, this is only suggested for tiny Gitea installations.
60
+* `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.
61
+* `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.
62
+
63
+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:
64
+
65
+```
66
+TAGS="bindata" make generate build
67
+```
68
+
69
+## Test
70
+
71
+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`.
72
+
73
+```
74
+./gitea web
75
+```
76
+
77
+## Anything missing?
78
+
79
+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.

+ 84 - 0
docs/content/doc/installation/from-source.zh-cn.md

@@ -0,0 +1,84 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "从源代码安装"
4
+slug: "install-from-source"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "从源代码安装"
12
+    weight: 30
13
+    identifier: "install-from-source"
14
+---
15
+
16
+# 从源代码安装
17
+
18
+首先你需要安装Golang,关于Golang的安装,参见官方文档 [install instructions](https://golang.org/doc/install)。
19
+
20
+## 下载
21
+
22
+你需要获取Gitea的源码,最方便的方式是使用 go 命令。执行以下命令:
23
+
24
+```
25
+go get -d -u code.gitea.io/gitea
26
+cd $GOPATH/src/code.gitea.io/gitea
27
+```
28
+
29
+然后你可以选择编译和安装的版本,当前你有多个选择。如果你想编译 `master` 版本,你可以直接跳到 [编译](#build) 部分,这是我们的开发分支,虽然也很稳定但不建议您在正式产品中使用。
30
+
31
+如果你想编译最新稳定分支,你可以执行以下命令签出源码:
32
+
33
+```
34
+git branch -a
35
+git checkout v1.0
36
+```
37
+
38
+最后,你也可以直接使用标签版本如 `v1.0.0`。你可以执行以下命令列出可用的版本并选择某个版本签出:
39
+
40
+```
41
+git tag -l
42
+git checkout v1.0.0
43
+```
44
+
45
+## 编译
46
+
47
+我们已经将所有的依赖项拷贝到本工程,我们提供了一些 [编译选项](https://github.com/go-gitea/gitea/blob/master/Makefile) 来让编译更简单。你可以按照你的需求来设置编译开关,可用编译选项如下:
48
+
49
+* `bindata`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。
50
+* `sqlite`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。
51
+* `tidb`: 这个编译选项启用tidb嵌入式数据库的支持,他跟SQLite类似但是是用纯Go编写的。
52
+* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。
53
+
54
+我们支持两种方式进行编译,Make 工具 和 Go 工具。不过我们推荐使用 Make工具,因为他将会给出更多的编译选项。
55
+
56
+**Note**: We recommend the Go version 1.6 or higher because we are using vendoring and we don't set the required env variable for 1.5 anywhere.
57
+
58
+* Make 工具
59
+
60
+这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate:
61
+
62
+```
63
+TAGS="bindata" make generate build
64
+```
65
+
66
+* Go 工具
67
+
68
+使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下:
69
+
70
+```
71
+go build
72
+```
73
+
74
+## 测试
75
+
76
+在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。
77
+
78
+```
79
+./gitea web
80
+```
81
+
82
+## 需要帮助?
83
+
84
+如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}})

+ 73 - 0
docs/content/doc/installation/from-source.zh-tw.md

@@ -0,0 +1,73 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "原始碼安裝"
4
+slug: "install-from-source"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "原始碼安裝"
12
+    weight: 30
13
+    identifier: "install-from-source"
14
+---
15
+
16
+# 從原始碼安裝
17
+
18
+我們不會在本文教大家如何安裝 Golang 環境。假如您不知道如何設定環境,請直接參考[官方安裝文件](https://golang.org/doc/install)。
19
+
20
+## 下載
21
+
22
+首先您必須先下載原始碼,最簡單的方式就是透過 Go 指令下載,請透過底下指令下載原始碼並且切換到工作目錄。
23
+
24
+```
25
+go get -d -u code.gitea.io/gitea
26
+cd $GOPATH/src/code.gitea.io/gitea
27
+```
28
+
29
+現在該決定您要編譯或安裝的 Gitea 版本,您有很多可以選擇。如果您想編譯 `master` 版本,你可以直接跳到[編譯章節](#build),這是我們開發分支,雖然很穩定,但是不建議用在正式環境。
30
+
31
+假如您想要編譯最新穩定版本,可以執行底下命令切換到正確版本:
32
+
33
+```
34
+git branch -a
35
+git checkout v1.0
36
+```
37
+
38
+最後您也可以直接編譯最新的標籤版本像是 `v1.0.0`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令::
39
+
40
+```
41
+git tag -l
42
+git checkout v1.0.0
43
+```
44
+
45
+## 編譯
46
+
47
+完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/master/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明:
48
+
49
+* `bindata`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。
50
+* `sqlite`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。
51
+* `tidb`: 使用此標籤來啟用 [TiDB](https://github.com/pingcap/tidb) 資料庫,它是檔案形式的資料庫,跟 SQLite 類似。
52
+* `pam`: 使用此標籤來啟用 PAM (Linux Pluggable Authentication Modules) 認證,對於系統使用者來說,此方式最方便了。
53
+
54
+現在您可以開始編譯執行檔了,我們建議使用 `bindata` 編譯選項,使用 `bindata` 選項前,您必須執行 `generate` 任務將所有資源都一起編譯進去,否則相關資源都不會被編譯進執行檔:
55
+
56
+```
57
+TAGS="bindata" make generate build
58
+```
59
+
60
+**注意**: 因為使用了套件管理工具,我們建議 Go 環境版本為 1.6 或者是更高,這樣不用在 Go 1.5 版本設定全域變數 `GO15VENDOREXPERIMENT`。
61
+
62
+## 測試
63
+
64
+完成上述步驟後,您可以在當下目錄發現 `gitea` 執行檔,在複製執行檔到遠端環境之前,您必須透過底下指令執行測試,使用 `Ctrl + C` 則可以關閉當下 gitea 程序。
65
+
66
+```
67
+./gitea web
68
+```
69
+
70
+## 需要協助?
71
+
72
+如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。
73
+

+ 68 - 0
docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md

@@ -0,0 +1,68 @@
1
+---
2
+date: "2017-07-21T12:00:00+02:00"
3
+title: "Run as service in Linux"
4
+slug: "linux-service"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "Linux service"
12
+    weight: 20
13
+    identifier: "linux-service"
14
+---
15
+
16
+### Run as service in Ubuntu 16.04 LTS  
17
+ 
18
+#### Using systemd  
19
+
20
+Run below command in terminal:  
21
+```
22
+sudo vim /etc/systemd/system/gitea.service
23
+```  
24
+
25
+Add code to the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service).  
26
+
27
+Uncomment any service need to be enabled like mysql in this case in Unit section.  
28
+
29
+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.  
30
+
31
+Lastly start and enable gitea at boot:  
32
+```
33
+sudo systemctl start gitea
34
+```  
35
+```
36
+sudo systemctl enable gitea
37
+```  
38
+
39
+
40
+#### Using supervisor  
41
+
42
+Install supervisor by running below command in terminal:  
43
+```
44
+sudo apt install supervisor
45
+```  
46
+
47
+Create a log dir for the supervisor logs(assuming gitea is installed in /home/git/gitea/):  
48
+```
49
+mkdir /home/git/gitea/log/supervisor
50
+```  
51
+
52
+Open supervisor config file in vi/vim/nano etc.  
53
+```
54
+sudo vim /etc/supervisor/supervisord.conf
55
+```  
56
+
57
+And append the code at the end of the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea).  
58
+
59
+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.  
60
+
61
+Lastly start and enable supervisor at boot:  
62
+```
63
+sudo systemctl start supervisor
64
+```  
65
+```
66
+sudo systemctl enable supervisor
67
+```  
68
+

+ 34 - 0
docs/content/doc/installation/windows-service.en-us.md

@@ -0,0 +1,34 @@
1
+---
2
+date: "2016-12-21T15:00:00-02:00"
3
+title: "Register as a Windows Service"
4
+slug: "windows-service"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "Windows Service"
12
+    weight: 30
13
+    identifier: "windows-service"
14
+---
15
+
16
+# Register as a Windows Service
17
+
18
+To register Gitea as a Windows service, first run `cmd` as an Administrator, and then run the following command:
19
+
20
+```
21
+sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini""
22
+```
23
+
24
+Do not forget to replace `C:\gitea` with your real Gitea folder.
25
+
26
+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).
27
+
28
+## Unregister as a service
29
+
30
+To unregister Gitea as a service, open `cmd` as an Administrator and run:
31
+
32
+```
33
+sc delete gitea
34
+```

+ 34 - 0
docs/content/doc/installation/windows-service.zh-cn.md

@@ -0,0 +1,34 @@
1
+---
2
+date: "2016-12-21T15:00:00-02:00"
3
+title: "注册为Windows服务"
4
+slug: "windows-service"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "Windows服务"
12
+    weight: 30
13
+    identifier: "windows-service"
14
+---
15
+
16
+# 注册为Windows服务
17
+
18
+要注册为Windows服务,首先以Administrator身份运行 `cmd`,然后执行以下命令:
19
+
20
+```
21
+sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini""
22
+```
23
+
24
+别忘了将 `C:\gitea` 替换成你的 Gitea 安装目录。
25
+
26
+之后在控制面板打开 "Windows Services",搜索 "gitea",右键选择 "Run"。在浏览器打开 `http://localhost:3000` 就可以访问了。(如果你修改了端口,请访问对应的端口,3000是默认端口)。
27
+
28
+## 从Windows服务中删除
29
+
30
+以Administrator身份运行 `cmd`,然后执行以下命令:
31
+
32
+```
33
+sc delete gitea
34
+```

+ 34 - 0
docs/content/doc/installation/windows-service.zh-tw.md

@@ -0,0 +1,34 @@
1
+---
2
+date: "2016-12-21T15:00:00-02:00"
3
+title: "註冊為 Windows 服務"
4
+slug: "windows-service"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "Windows 服務"
12
+    weight: 30
13
+    identifier: "windows-service"
14
+---
15
+
16
+# 註冊為 Windows 服務
17
+
18
+要註冊為 Windows 服務,首先要以管理者身份執行 `cmd`,跳出命令列視窗後執行底下指令:
19
+
20
+```
21
+sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini""
22
+```
23
+
24
+別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。
25
+
26
+之後打開 "Windows Services",並且搜尋服務名稱 "gitea",按右鍵選擇 "Run"。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。
27
+
28
+## 刪除服務
29
+
30
+要刪除 Gitea 服務,請用管理者身份執行 `cmd` 並且執行底下指令:
31
+
32
+```
33
+sc delete gitea
34
+```

+ 196 - 0
docs/content/doc/installation/with-docker.en-us.md

@@ -0,0 +1,196 @@
1
+---
2
+date: "2016-12-01T16:00:00+02:00"
3
+title: "Installation with Docker"
4
+slug: "install-with-docker"
5
+weight: 10
6
+toc: true
7
+draft: false
8
+menu:
9
+  sidebar:
10
+    parent: "installation"
11
+    name: "With Docker"
12
+    weight: 10
13
+    identifier: "install-with-docker"
14
+---
15
+
16
+# Installation with Docker
17
+
18
+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.
19
+
20
+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/).
21
+
22
+## Basics
23
+
24
+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`.
25
+
26
+```yaml
27
+version: "2"
28
+
29
+networks:
30
+  gitea:
31
+    external: false
32
+
33
+services:
34
+  server:
35
+    image: gitea/gitea:latest
36
+    restart: always
37
+    networks:
38
+      - gitea
39
+    volumes:
40
+      - ./gitea:/data
41
+    ports:
42
+      - 3000:3000
43
+      - 222:22
44
+```
45
+
46
+## Custom port
47
+
48
+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.
49
+
50
+```diff
51
+version: "2"
52
+
53
+networks:
54
+  gitea:
55
+    external: false
56
+
57
+services:
58
+  server:
59
+    image: gitea/gitea:latest
60
+    restart: always
61
+    networks:
62
+      - gitea
63
+    volumes:
64
+      - ./gitea:/data
65
+    ports:
66
+-      - 3000:3000
67
+-      - 222:22
68
++      - 8080:3000
69
++      - 2221:22
70
+```
71
+
72
+## MySQL database
73
+
74
+To start Gitea in combination with a MySQL database you should apply these changes to the `docker-compose.yml` file created above.
75
+
76
+```diff
77
+version: "2"
78
+
79
+networks:
80
+  gitea:
81
+    external: false
82
+
83
+services:
84
+  server:
85
+    image: gitea/gitea:latest
86
+    restart: always
87
+    networks:
88
+      - gitea
89
+    volumes:
90
+      - ./gitea:/data
91
+     ports:
92
+       - 3000:3000
93
+       - 222:22
94
++    depends_on:
95
++      - db
96
++
97
++  db:
98
++    image: mysql:5.7
99
++    restart: always
100
++    environment:
101
++      - MYSQL_ROOT_PASSWORD=gitea
102
++      - MYSQL_USER=gitea
103
++      - MYSQL_PASSWORD=gitea
104
++      - MYSQL_DATABASE=gitea
105
++    networks:
106
++      - gitea
107
++    volumes:
108
++      - ./mysql:/var/lib/mysql
109
+```
110
+
111
+## PostgreSQL database
112
+
113
+To start Gitea in combination with a PostgreSQL database you should apply these changes to the `docker-compose.yml` file created above.
114
+
115
+```diff
116
+version: "2"
117
+
118
+networks:
119
+  gitea:
120
+    external: false
121
+
122
+services:
123
+  server:
124
+    image: gitea/gitea:latest
125
+    restart: always
126
+    networks:
127
+      - gitea
128
+    volumes:
129
+      - ./gitea:/data
130
+     ports:
131
+       - 3000:3000
132
+       - 222:22
133
++    depends_on:
134
++      - db
135
++
136
++  db:
137
++    image: postgres:9.6
138
++    restart: always
139
++    environment:
140
++      - POSTGRES_USER=gitea
141
++      - POSTGRES_PASSWORD=gitea
142
++      - POSTGRES_DB=gitea
143
++    networks:
144
++      - gitea
145
++    volumes:
146
++      - ./postgr