├── .drone.yml ├── .editorconfig ├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── CONTRIBUTING.md ├── DCO ├── Dockerfile ├── LICENSE ├── MAINTAINERS ├── Makefile ├── README.md ├── config.yaml ├── content ├── doc │ ├── advanced.en-us.md │ ├── advanced.zh-cn.md │ ├── advanced │ │ ├── config-cheat-sheet.en-us.md │ │ ├── config-cheat-sheet.zh-cn.md │ │ ├── customizing-gitea.en-us.md │ │ ├── hacking-on-gitea.en-us.md │ │ ├── hacking-on-gitea.zh-cn.md │ │ ├── make.en-us.md │ │ └── specific-variables.en-us.md │ ├── features.en-us.md │ ├── features.zh-cn.md │ ├── features.zh-tw.md │ ├── features │ │ ├── authentication.en-us.md │ │ ├── authentication.zh-cn.md │ │ ├── authentication.zh-tw.md │ │ ├── localization.en-us.md │ │ ├── localization.zh-cn.md │ │ ├── localization.zh-tw.md │ │ ├── webhooks.en-us.md │ │ ├── webhooks.zh-cn.md │ │ └── webhooks.zh-tw.md │ ├── help.zh-cn.md │ ├── help │ │ ├── seek-help.zh-cn.md │ │ └── troubleshooting.en-us.md │ ├── installation.en-us.md │ ├── installation.zh-cn.md │ ├── installation.zh-tw.md │ ├── installation │ │ ├── from-binary.en-us.md │ │ ├── from-binary.zh-cn.md │ │ ├── from-binary.zh-tw.md │ │ ├── from-package.en-us.md │ │ ├── from-package.zh-cn.md │ │ ├── from-package.zh-tw.md │ │ ├── from-source.en-us.md │ │ ├── from-source.zh-cn.md │ │ ├── from-source.zh-tw.md │ │ ├── run-as-service-in-ubuntu.en-us.md │ │ ├── windows-service.en-us.md │ │ ├── windows-service.zh-cn.md │ │ ├── windows-service.zh-tw.md │ │ ├── with-docker.en-us.md │ │ ├── with-docker.zh-cn.md │ │ └── with-docker.zh-tw.md │ ├── upgrade.en-us.md │ ├── upgrade.zh-cn.md │ ├── upgrade.zh-tw.md │ ├── upgrade │ │ ├── from-gogs.en-us.md │ │ ├── from-gogs.zh-cn.md │ │ └── from-gogs.zh-tw.md │ ├── usage.en-us.md │ └── usage │ │ ├── backup-and-restore.en-us.md │ │ ├── backup-and-restore.zh-tw.md │ │ └── command-line.md └── page │ ├── index.en-us.md │ ├── index.zh-cn.md │ └── index.zh-tw.md ├── docker └── caddy.conf ├── layouts └── index.html ├── scripts └── trans-copy └── static └── .gitkeep /.drone.yml: -------------------------------------------------------------------------------- 1 | workspace: 2 | base: /srv/app 3 | path: src 4 | 5 | clone: 6 | git: 7 | image: plugins/git:1 8 | depth: 50 9 | tags: true 10 | 11 | pipeline: 12 | build: 13 | image: webhippie/hugo:latest 14 | pull: true 15 | commands: 16 | - make trans-copy 17 | - make clean 18 | - make build 19 | 20 | docker: 21 | image: plugins/docker:17.05 22 | pull: true 23 | secrets: [ docker_username, docker_password ] 24 | repo: gitea/docs 25 | tags: [ '${DRONE_BRANCH##release/v}' ] 26 | when: 27 | event: [ push ] 28 | branch: [ release/* ] 29 | 30 | docker: 31 | image: plugins/docker:17.05 32 | pull: true 33 | secrets: [ docker_username, docker_password ] 34 | repo: gitea/docs 35 | tags: [ 'latest' ] 36 | when: 37 | event: [ push ] 38 | branch: [ master ] 39 | 40 | discord: 41 | image: appleboy/drone-discord:1.0.0 42 | pull: true 43 | secrets: [ discord_webhook_id, discord_webhook_token ] 44 | when: 45 | event: [ push, tag, pull_request ] 46 | status: [ changed, failure ] 47 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 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 35 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Please check the following: 2 | 3 | 1. Make sure you are targeting the `master` branch, pull requests on release branches are only allowed for bug fixes. 4 | 2. Read contributing guidelines: https://github.com/go-gitea/docs/blob/master/CONTRIBUTING.md 5 | 3. Describe what your pull request does and which issue you're targeting (if any) 6 | 7 | **You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.** 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | public/ 2 | themes/ 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | ## Introduction 4 | 5 | This document explains how to contribute changes to the Gitea project. It assumes you have followed the [installation instructions](https://github.com/go-gitea/docs/tree/master/en-US/installation). Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io). 6 | 7 | ## Bug reports 8 | 9 | Please search the issues on the issue tracker with a variety of keywords to ensure your bug is not already reported. 10 | 11 | If unique, [open an issue](https://github.com/go-gitea/gitea/issues/new) and answer the questions so we can understand and reproduce the problematic behavior. 12 | 13 | To show us that the issue you are having is in Gitea itself, please write clear, concise instructions so we can reproduce the behavior (even if it seems obvious). The more detailed and specific you are, the faster we can fix the issue. Check out [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html). 14 | 15 | Please be kind, remember that Gitea comes at no cost to you, and you're getting free help. 16 | 17 | ## Discuss your design 18 | 19 | The project welcomes submissions but please let everyone know what you're working on if you want to change or add something to the Gitea repositories. 20 | 21 | Before starting to write something new for the Gitea project, please [file an issue](https://github.com/go-gitea/gitea/issues/new). Significant changes must go through the [change proposal process](https://github.com/go-gitea/proposals) before they can be accepted. 22 | 23 | This process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside the goals for the project and tools. It also checks that the design is sound before code is written; the code review tool is not the place for high-level discussions. 24 | 25 | ## Testing redux 26 | 27 | Before sending code out for review, run all the tests for the whole tree to make sure the changes don't break other usage and keep the compatibility on upgrade. To make sure you are running the test suite exactly like we do, you should install the CLI for [Drone CI](https://github.com/drone/drone), as we are using the server for continuous testing, following [these instructions](http://readme.drone.io/0.5/install/cli/). After that you can simply call `drone exec` within your working directory and it will try to run the test suite locally. 28 | 29 | ## Code review 30 | 31 | Changes to Gitea must be reviewed before they are accepted, no matter who makes the change even if it is an owner or a maintainer. We use GitHub's pull request workflow to do that and we also use [LGTM](http://lgtm.co) to ensure every PR is reviewed by at least 2 maintainers. 32 | 33 | Please try to make your pull request easy to review for us. Please read the "[How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md)" guide, it has lots of useful tips for any project you may want to contribute. Some of the key points: 34 | 35 | * Make small pull requests. The smaller, the faster to review and the more likely it will be merged soon. 36 | * Don't make changes unrelated to your PR. Maybe there are typos on some comments, maybe refactoring would be welcome on a function... but if that is not related to your PR, please make *another* PR for that. 37 | * Split big pull requests into multiple small ones. An incremental change will be faster to review than a huge PR. 38 | 39 | ## Sign your work 40 | 41 | The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: If you can certify [DCO](DCO), then you just add a line to every git commit message: 42 | 43 | ``` 44 | Signed-off-by: Joe Smith 45 | ``` 46 | 47 | Please use your real name, we really dislike pseudonyms or anonymous contributions. We are in the open-source world without secrets. If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. 48 | 49 | ## Maintainers 50 | 51 | To make sure every PR is checked, we have [team maintainers](https://github.com/orgs/go-gitea/teams/maintainers). Every PR **MUST** be reviewed by at least two maintainers (or owners) before it can get merged. A maintainer should be a contributor of Gitea (or Gogs) and contributed at least 4 accepted PRs. A contributor should apply as a maintainer in the [Discord #develop channel](https://discord.gg/NsatcWJ). The owners or the team maintainers may invite the contributor. A maintainer should spend some time on code reviews. If a maintainer has no time to do that, they should apply to leave the maintainers team and we will give them the honor of being a member of the [advisors team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if an advisor has time to code review, we will gladly welcome them back to the maintainers team. If a maintainer is inactive for more than 3 months and forgets to leave the maintainers team, the owners may move him or her from the maintainers team to the advisors team. 52 | 53 | ## Owners 54 | 55 | Since Gitea is a pure community organization without any company support, to keep the development healthy we will elect three owners every year. All contributors may vote to elect up to three candidates, one of which will be the main owner, and the other two the assistant owners. When the new owners have been elected, the old owners will give up ownership to the newly elected owners. If an owner is unable to do so, the other owners will assist in ceding ownership to the newly elected owners. 56 | 57 | After the election, the new owners should proactively agree with our [CONTRIBUTING](CONTRIBUTING.md) requirements on the [Discord #general channel](https://discord.gg/NsatcWJ). Below are the words to speak: 58 | 59 | ``` 60 | I'm honored to having been elected an owner of Gitea, I agree with [CONTRIBUTING](CONTRIBUTING.md). I will spend part of my time on Gitea and lead the development of Gitea. 61 | ``` 62 | 63 | To honor the past owners, here's the history of the owners and the time they served: 64 | 65 | * 2016-11-04 ~ 2017-12-31 66 | * [Lunny Xiao](https://github.com/lunny) 67 | * [Thomas Boerger](https://github.com/tboerger) 68 | * [Kim Carlbäcker](https://github.com/bkcsoft) 69 | 70 | ## Versions 71 | 72 | Gitea has the `master` branch as a tip branch and has version branches such as `v0.9`. `v0.9` is a release branch and we will tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept pull requests on the `v0.9` branch and publish a `v0.9.1` tag, after bringing the bug fix also to the master branch. 73 | 74 | Since the `master` branch is a tip version, if you wish to use Gitea in production, please download the latest release tag version. All the branches will be protected via GitHub, all the PRs to every branch must be reviewed by two maintainers and must pass the automatic tests. 75 | 76 | ## Copyright 77 | 78 | Code that you contribute should use the standard copyright header: 79 | 80 | ``` 81 | // Copyright 2017 The Gitea Authors. All rights reserved. 82 | // Use of this source code is governed by a MIT-style 83 | // license that can be found in the LICENSE file. 84 | ``` 85 | 86 | Files in the repository contain copyright from the year they are added to the year they are last changed. If the copyright author is changed, just paste the header below the old one. 87 | -------------------------------------------------------------------------------- /DCO: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 660 York Street, Suite 102, 6 | San Francisco, CA 94110 USA 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this 9 | license document, but changing it is not allowed. 10 | 11 | 12 | Developer's Certificate of Origin 1.1 13 | 14 | By making a contribution to this project, I certify that: 15 | 16 | (a) The contribution was created in whole or in part by me and I 17 | have the right to submit it under the open source license 18 | indicated in the file; or 19 | 20 | (b) The contribution is based upon previous work that, to the best 21 | of my knowledge, is covered under an appropriate open source 22 | license and I have the right under that license to submit that 23 | work with modifications, whether created in whole or in part 24 | by me, under the same open source license (unless I am 25 | permitted to submit under a different license), as indicated 26 | in the file; or 27 | 28 | (c) The contribution was provided directly to me by some other 29 | person who certified (a), (b) or (c) and I have not modified 30 | it. 31 | 32 | (d) I understand and agree that this project and the contribution 33 | are public and that a record of the contribution (including all 34 | personal information I submit with it, including my sign-off) is 35 | maintained indefinitely and may be redistributed consistent with 36 | this project or the open source license(s) involved. -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 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"] 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 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. 203 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Alexey Makhov (@makhov) 2 | Andrey Nering (@andreynering) 3 | Bo-Yi Wu (@appleboy) 4 | Ethan Koenig (@ethantkoenig) 5 | Kees de Vries (@Bwko) 6 | Kim Carlbäcker (@bkcsoft) 7 | LefsFlare (@LefsFlarey) 8 | Lunny Xiao (@lunny) 9 | Matthias Loibl (@metalmatze) 10 | Rachid Zarouali (@xinity) 11 | Rémy Boulanouar (@DblK) 12 | Sandro Santilli (@strk) 13 | Thibault Meyer (@0xbaadf00d) 14 | Thomas Boerger (@tboerger) 15 | Patrick G (@geek1011) 16 | Lauris Bukšis-Haberkorns (@lafriks) 17 | Jonas Östanbäck (@cez81) 18 | David Schneiderbauer (@daviian) 19 | Peter Žeby (@morlinest) 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 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 $@ 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATION NOTICE 2 | 3 | This repository is deprecated in favour of keeping the documentation a part of the [main repository](https://github.com/go-gitea/gitea). 4 | 5 | This documentation can now be found [here](https://github.com/go-gitea/gitea/tree/master/docs) 6 | 7 | # Gitea: Docs 8 | 9 | [![Build Status](http://drone.gitea.io/api/badges/go-gitea/docs/status.svg)](http://drone.gitea.io/go-gitea/docs) 10 | [![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ) 11 | [![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com") 12 | 13 | ## Hosting 14 | 15 | This page is hosted on our infrastructure within Docker containers, it gets 16 | automatically updated on every push to the `master` branch. 17 | 18 | If you want to host this page on your own you can take our docker image 19 | [gitea/docs](https://hub.docker.com/r/gitea/docs/). 20 | 21 | ## Install 22 | 23 | This pages uses the [Hugo](https://github.com/spf13/hugo) static site generator. 24 | If you are planning to contribute you'll want to download and install Hugo on 25 | your local machine. 26 | 27 | The installation of Hugo is out of the scope of this document, so please take 28 | the [official install instructions](https://gohugo.io/overview/installing/) to 29 | get Hugo up and running. 30 | 31 | ## Development 32 | 33 | To generate the website and serve it on [localhost:1313](http://localhost:1313) 34 | just execute this command and stop it with `Ctrl+C`: 35 | 36 | ``` 37 | make server 38 | ``` 39 | 40 | When you are done with your changes just create a pull request, after merging 41 | the pull request the website will be updated automatically. 42 | 43 | ## Contributing 44 | 45 | Fork -> Patch -> Push -> Pull Request 46 | 47 | ## Authors 48 | 49 | * [Maintainers](https://github.com/orgs/go-gitea/people) 50 | * [Contributors](https://github.com/go-gitea/docs/graphs/contributors) 51 | 52 | ## License 53 | 54 | This project is under the Apache-2.0 License. See the [LICENSE](LICENSE) file 55 | for the full license text. 56 | 57 | ## Copyright 58 | 59 | ``` 60 | Copyright (c) 2016 The Gitea Authors 61 | ``` 62 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 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 238 | -------------------------------------------------------------------------------- /content/doc/advanced.en-us.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/advanced.zh-cn.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/advanced/config-cheat-sheet.en-us.md: -------------------------------------------------------------------------------- 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 `~//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" \ 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. 219 | -------------------------------------------------------------------------------- /content/doc/advanced/config-cheat-sheet.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-26T16:00:00+02:00" 3 | title: "配置说明" 4 | slug: "config-cheat-sheet" 5 | weight: 20 6 | toc: false 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "advanced" 11 | name: "配置说明" 12 | weight: 20 13 | identifier: "config-cheat-sheet" 14 | --- 15 | 16 | # 配置说明 17 | 18 | 这是针对Gitea配置文件的说明,你可以了解Gitea的强大配置。需要说明的是,你的所有改变请修改 `custom/conf/app.ini` 文件而不是源文件。所有默认值可以通过 [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) 查看到。如果你发现 `%(X)s` 这样的内容,请查看 [ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。 19 | 20 | ## Overall (`DEFAULT`) 21 | 22 | - `APP_NAME`: 应用名称,改成你希望的名字。 23 | - `RUN_USER`: 运行Gitea的用户,推荐使用 `git`;如果在你自己的个人电脑使用改成你自己的用户名。如果设置不正确,Gitea可能崩溃。 24 | - `RUN_MODE`: 从性能考虑,如果在产品级的服务上改成 `prod`。如果您使用安装向导安装的那么会自动设置为 `prod`。 25 | 26 | ## Repository (`repository`) 27 | 28 | - `ROOT`: 存放git工程的根目录。这里必须填绝对路径,默认值是 `~//gitea-repositories`。 29 | - `SCRIPT_TYPE`: 服务器支持的Shell类型,通常是 `bash`,但有些服务器也有可能是 `sh`。 30 | - `ANSI_CHARSET`: 默认字符编码。 31 | - `FORCE_PRIVATE`: 强制所有git工程必须私有。 32 | - `MAX_CREATION_LIMIT`: 全局最大每个用户创建的git工程数目, `-1` 表示没限制。 33 | - `PULL_REQUEST_QUEUE_LENGTH`: 小心:合并请求测试队列的长度,尽量放大。 34 | 35 | ## UI (`ui`) 36 | 37 | - `EXPLORE_PAGING_NUM`: 探索页面每页显示的仓库数量。 38 | - `ISSUE_PAGING_NUM`: 工单页面每页显示的工单数量。 39 | - `FEED_MAX_COMMIT_NUM`: 活动流页面显示的最大提交树木。 40 | 41 | ### UI - Admin (`ui.admin`) 42 | 43 | - `USER_PAGING_NUM`: 用户管理页面每页显示的用户数量。 44 | - `REPO_PAGING_NUM`: 仓库管理页面每页显示的仓库数量。 45 | - `NOTICE_PAGING_NUM`: 系统提示页面每页显示的提示数量。 46 | - `ORG_PAGING_NUM`: 组织管理页面每页显示的组织数量。 47 | 48 | ## Markdown (`markdown`) 49 | 50 | - `ENABLE_HARD_LINE_BREAK`: 是否启用硬换行扩展。 51 | 52 | ## Server (`server`) 53 | 54 | - `PROTOCOL`: 可选 `http` 或 `https`。 55 | - `DOMAIN`: 服务器域名。 56 | - `ROOT_URL`: Gitea服务器的对外 URL。 57 | - `HTTP_ADDR`: HTTP 监听地址。 58 | - `HTTP_PORT`: HTTP 监听端口。 59 | - `DISABLE_SSH`: 是否禁用SSH。 60 | - `START_SSH_SERVER`: 是否启用内部SSH服务器。 61 | - `SSH_PORT`: SSH端口,默认为 `22`。 62 | - `OFFLINE_MODE`: 针对静态和头像文件禁用 CDN。 63 | - `DISABLE_ROUTER_LOG`: 关闭日志中的路由日志。 64 | - `CERT_FILE`: 启用HTTPS的证书文件。 65 | - `KEY_FILE`: 启用HTTPS的密钥文件。 66 | - `STATIC_ROOT_PATH`: 存放模板和静态文件的根目录,默认是 Gitea 的根目录。 67 | - `ENABLE_GZIP`: 启用应用级别的 GZIP 压缩。 68 | - `LANDING_PAGE`: 未登录用户的默认页面,可选 `home` 或 `explore`。 69 | - `LFS_START_SERVER`: 是否启用 git-lfs 支持. 可以为 `true` 或 `false`, 默认是 `false`。 70 | - `LFS_CONTENT_PATH`: 存放 lfs 命令上传的文件的地方,默认是 `data/lfs`。 71 | - `LFS_JWT_SECRET`: LFS 认证密钥,改成自己的。 72 | 73 | ## Database (`database`) 74 | 75 | - `DB_TYPE`: 数据库类型,可选 `mysql`, `postgres`, `mssql`, `tidb` 或 `sqlite3`。 76 | - `HOST`: 数据库服务器地址和端口。 77 | - `NAME`: 数据库名称。 78 | - `USER`: 数据库用户名。 79 | - `PASSWD`: 数据库用户密码。 80 | - `SSL_MODE`: PostgreSQL数据库是否启用SSL模式。 81 | - `PATH`: Tidb 或者 SQLite3 数据文件存放路径。 82 | 83 | ## Security (`security`) 84 | 85 | - `INSTALL_LOCK`: 是否允许运行安装向导,(跟管理员账号有关,十分重要)。 86 | - `SECRET_KEY`: 全局服务器安全密钥 **最好改成你自己的** (当你运行安装向导的时候会被设置为一个随机值)。 87 | - `LOGIN_REMEMBER_DAYS`: Cookie 保存时间,单位天。 88 | - `COOKIE_USERNAME`: 保存用户名的 cookie 名称。 89 | - `COOKIE_REMEMBER_NAME`: 保存自动登录信息的 cookie 名称。 90 | - `REVERSE_PROXY_AUTHENTICATION_USER`: 反向代理认证的 HTTP 头名称。 91 | 92 | ## Service (`service`) 93 | 94 | - `ACTIVE_CODE_LIVE_MINUTES`: 登陆验证码失效时间,单位分钟。 95 | - `RESET_PASSWD_CODE_LIVE_MINUTES`: 重置密码失效时间,单位分钟。 96 | - `REGISTER_EMAIL_CONFIRM`: 启用注册邮件激活,前提是 `Mailer` 已经启用。 97 | - `DISABLE_REGISTRATION`: 禁用注册,启用后只能用管理员添加用户。 98 | - `SHOW_REGISTRATION_BUTTON`: 是否显示注册按钮。 99 | - `REQUIRE_SIGNIN_VIEW`: 是否所有页面都必须登录后才可访问。 100 | - `ENABLE_CACHE_AVATAR`: 是否缓存来自 Gravatar 的头像。 101 | - `ENABLE_NOTIFY_MAIL`: 是否发送工单创建等提醒邮件,需要 `Mailer` 被激活。 102 | - `ENABLE_REVERSE_PROXY_AUTHENTICATION`: 允许反向代理认证,更多细节见:https://github.com/gogits/gogs/issues/165 103 | - `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: 允许通过反向认证做自动注册。 104 | - `ENABLE_CAPTCHA`: 注册时使用图片验证码。 105 | 106 | ## Webhook (`webhook`) 107 | 108 | - `QUEUE_LENGTH`: 说明: Hook 任务队列长度。 109 | - `DELIVER_TIMEOUT`: 请求webhooks的超时时间,单位秒。 110 | - `SKIP_TLS_VERIFY`: 是否允许不安全的证书。 111 | - `PAGING_NUM`: 每页显示的Webhook 历史数量。 112 | 113 | ## Mailer (`mailer`) 114 | 115 | - `ENABLED`: 是否启用邮件服务。 116 | - `DISABLE_HELO`: 禁用 HELO 命令。 117 | - `HELO_HOSTNAME`: 自定义主机名来回应 HELO 命令。 118 | - `HOST`: SMTP 主机地址和端口 (例如:smtp.gitea.io:587)。 119 | - `FROM`: 邮件发送地址,RFC 5322. 这里可以填一个邮件地址或者 "Name" \ 格式。 120 | - `USER`: 用户名(通常就是邮件地址)。 121 | - `PASSWD`: 密码。 122 | - `SKIP_VERIFY`: 忽略证书验证。 123 | 124 | 说明:实际上 Gitea 仅仅支持基于 STARTTLS 的 SMTP。 125 | 126 | ## Cache (`cache`) 127 | 128 | - `ADAPTER`: 缓存引擎,可以为 `memory`, `redis` 或 `memcache`。 129 | - `INTERVAL`: 只对内存缓存有效,GC间隔,单位秒。 130 | - `HOST`: 针对redis和memcache有效,主机地址和端口。 131 | - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180` 132 | - Memache: `127.0.0.1:9090;127.0.0.1:9091` 133 | 134 | ## Session (`session`) 135 | 136 | - `PROVIDER`: Session 内容存储方式,可选 `memory`, `file`, `redis` 或 `mysql`。 137 | - `PROVIDER_CONFIG`: 如果是文件,那么这里填根目录;其他的要填主机地址和端口。 138 | - `COOKIE_SECURE`: 强制使用 HTTPS 作为session访问。 139 | - `GC_INTERVAL_TIME`: Session失效时间。 140 | 141 | ## Picture (`picture`) 142 | 143 | - `GRAVATAR_SOURCE`: 头像来源,可以是 `gravatar`, `duoshuo` 或者类似 `http://cn.gravatar.com/avatar/` 的来源 144 | - `DISABLE_GRAVATAR`: 开启则只使用内部头像。 145 | - `ENABLE_FEDERATED_AVATAR`: 启用头像联盟支持 (参见 http://www.libravatar.org) 146 | 147 | ## Attachment (`attachment`) 148 | 149 | - `ENABLED`: 是否允许用户上传附件。 150 | - `PATH`: 附件存储路径 151 | - `ALLOWED_TYPES`: 允许上传的附件类型。比如:`image/jpeg|image/png`,用 `*/*` 表示允许任何类型。 152 | - `MAX_SIZE`: 附件最大限制,单位 MB,比如: `4`。 153 | - `MAX_FILES`: 一次最多上传的附件数量,比如: `5`。 154 | 155 | ## Log (`log`) 156 | 157 | - `ROOT_PATH`: 日志文件根目录。 158 | - `MODE`: 日志记录模式,默认是为 `console`。如果要写到多个通道,用逗号分隔 159 | - `LEVEL`: 日志级别,默认为`Trace`。 160 | 161 | ## Cron (`cron`) 162 | 163 | - `ENABLED`: 是否在后台运行定期任务。 164 | - `RUN_AT_START`: 是否启动时自动运行。 165 | 166 | ### Cron - Update Mirrors (`cron.update_mirrors`) 167 | 168 | - `SCHEDULE`: 自动同步镜像仓库的Cron语法,比如:`@every 1h`。 169 | 170 | ### Cron - Repository Health Check (`cron.repo_health_check`) 171 | 172 | - `SCHEDULE`: 仓库健康监测的Cron语法,比如:`@every 24h`。 173 | - `TIMEOUT`: 仓库健康监测的超时时间,比如:`60s`. 174 | - `ARGS`: 执行 `git fsck` 命令的参数,比如:`--unreachable --tags`。 175 | 176 | ### Cron - Repository Statistics Check (`cron.check_repo_stats`) 177 | 178 | - `RUN_AT_START`: 是否启动时自动运行仓库统计。 179 | - `SCHEDULE`: 藏亏统计时的Cron 语法,比如:`@every 24h`. 180 | 181 | ## Git (`git`) 182 | 183 | - `MAX_GIT_DIFF_LINES`: 比较视图中,一个文件最多显示行数。 184 | - `MAX_GIT_DIFF_LINE_CHARACTERS`: 比较视图中一行最大字符数。 185 | - `MAX_GIT_DIFF_FILES`: 比较视图中的最大现实文件数目。 186 | - `GC_ARGS`: 执行 `git gc` 命令的参数, 比如: `--aggressive --auto`。 187 | 188 | ## Other (`other`) 189 | 190 | - `SHOW_FOOTER_BRANDING`: 为真则在页面底部显示Gitea的字样。 191 | - `SHOW_FOOTER_VERSION`: 为真则在页面底部显示Gitea的版本。 192 | -------------------------------------------------------------------------------- /content/doc/advanced/customizing-gitea.en-us.md: -------------------------------------------------------------------------------- 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`. -------------------------------------------------------------------------------- /content/doc/advanced/hacking-on-gitea.en-us.md: -------------------------------------------------------------------------------- 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:/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. 43 | -------------------------------------------------------------------------------- /content/doc/advanced/hacking-on-gitea.zh-cn.md: -------------------------------------------------------------------------------- 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:/gitea.git 37 | git fetch --all --prune 38 | ``` 39 | 40 | 然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。 41 | 42 | 好了,到这里你已经设置好了所有的开发Gitea所需的环境。欢迎成为 Gitea 的 Contributor。 43 | -------------------------------------------------------------------------------- /content/doc/advanced/make.en-us.md: -------------------------------------------------------------------------------- 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` 45 | -------------------------------------------------------------------------------- /content/doc/advanced/specific-variables.en-us.md: -------------------------------------------------------------------------------- 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 | 68 | -------------------------------------------------------------------------------- /content/doc/features.en-us.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/features.zh-cn.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/features.zh-tw.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/features/authentication.en-us.md: -------------------------------------------------------------------------------- 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. 195 | -------------------------------------------------------------------------------- /content/doc/features/authentication.zh-cn.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/features/authentication.zh-tw.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/features/localization.en-us.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/features/localization.zh-cn.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/features/localization.zh-tw.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/features/webhooks.en-us.md: -------------------------------------------------------------------------------- 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 | ``` 104 | -------------------------------------------------------------------------------- /content/doc/features/webhooks.zh-cn.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/features/webhooks.zh-tw.md: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /content/doc/help.zh-cn.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/help/seek-help.zh-cn.md: -------------------------------------------------------------------------------- 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 获得进一步的支持 24 | -------------------------------------------------------------------------------- /content/doc/help/troubleshooting.en-us.md: -------------------------------------------------------------------------------- 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. 70 | -------------------------------------------------------------------------------- /content/doc/installation.en-us.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/installation.zh-cn.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/installation.zh-tw.md: -------------------------------------------------------------------------------- 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 | --- 14 | -------------------------------------------------------------------------------- /content/doc/installation/from-binary.en-us.md: -------------------------------------------------------------------------------- 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. 46 | -------------------------------------------------------------------------------- /content/doc/installation/from-binary.zh-cn.md: -------------------------------------------------------------------------------- 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" >}}) 36 | -------------------------------------------------------------------------------- /content/doc/installation/from-binary.zh-tw.md: -------------------------------------------------------------------------------- 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),在那邊可以快速得到協助。 36 | -------------------------------------------------------------------------------- /content/doc/installation/from-package.en-us.md: -------------------------------------------------------------------------------- 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. 58 | -------------------------------------------------------------------------------- /content/doc/installation/from-package.zh-cn.md: -------------------------------------------------------------------------------- 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" >}}) 38 | -------------------------------------------------------------------------------- /content/doc/installation/from-package.zh-tw.md: -------------------------------------------------------------------------------- 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),在那邊可以快速得到協助。 54 | -------------------------------------------------------------------------------- /content/doc/installation/from-source.en-us.md: -------------------------------------------------------------------------------- 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. See here how to get Make. 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. 80 | -------------------------------------------------------------------------------- /content/doc/installation/from-source.zh-cn.md: -------------------------------------------------------------------------------- 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" >}}) 85 | -------------------------------------------------------------------------------- /content/doc/installation/from-source.zh-tw.md: -------------------------------------------------------------------------------- 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 | 74 | -------------------------------------------------------------------------------- /content/doc/installation/run-as-service-in-ubuntu.en-us.md: -------------------------------------------------------------------------------- 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 | 69 | -------------------------------------------------------------------------------- /content/doc/installation/windows-service.en-us.md: -------------------------------------------------------------------------------- 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 | ``` 35 | -------------------------------------------------------------------------------- /content/doc/installation/windows-service.zh-cn.md: -------------------------------------------------------------------------------- 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 | ``` 35 | -------------------------------------------------------------------------------- /content/doc/installation/windows-service.zh-tw.md: -------------------------------------------------------------------------------- 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 | ``` 35 | -------------------------------------------------------------------------------- /content/doc/installation/with-docker.en-us.md: -------------------------------------------------------------------------------- 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 | + - ./postgres:/var/lib/postgresql/data 147 | ``` 148 | 149 | ## Named volumes 150 | 151 | To use named volumes instead of host volumes you just have to define and use the named volume within the `docker-compose.yml` configuration. This change will automatically create the required volume. 152 | 153 | ```diff 154 | version: "2" 155 | 156 | networks: 157 | gitea: 158 | external: false 159 | 160 | +volumes: 161 | + gitea: 162 | + driver: local 163 | + 164 | services: 165 | server: 166 | image: gitea/gitea:latest 167 | restart: always 168 | networks: 169 | - gitea 170 | volumes: 171 | - - ./gitea:/data 172 | + - gitea:/data 173 | ports: 174 | - 3000:3000 175 | - 222:22 176 | ``` 177 | 178 | If you are using MySQL or PostgreSQL it's up to you to create named volumes for these containers as well. 179 | 180 | ## Start 181 | 182 | To start this setup based on `docker-compose` you just have to execute `docker-compose up -d` to launch Gitea in the background. You can see if it started properly via `docker-compose ps`, and you can tail the log output via `docker-compose logs`. 183 | 184 | If you want to shutdown the setup again just execute `docker-compose down`, this will stop and kill the containers, the volumes will still exist. 185 | 186 | ## Install 187 | 188 | After starting the Docker setup via `docker-compose` you should access Gitea with your favorite browser to finalize the installation. Please visit http://server-ip:3000 and follow the installation wizard. If you have started a database with the `docker-compose` setup as documented above please note that you have to use `db` as the database hostname. 189 | 190 | # Customization 191 | 192 | Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should be placed in `/data/gitea` directory. If you are using host volumes it's quite easy to access these files, for named volumes you have to do it through another container or you should directly access `/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at `/data/gitea/conf/app.ini` after the installation. 193 | 194 | # Anything missing? 195 | 196 | 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. 197 | -------------------------------------------------------------------------------- /content/doc/installation/with-docker.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "从Docker安装" 4 | slug: "install-with-docker" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "installation" 11 | name: "从Docker安装" 12 | weight: 10 13 | identifier: "install-with-docker" 14 | --- 15 | 16 | # 从Docker安装 17 | 18 | 阅读本章之前我们已经假设您对docker已经有了解并能够正常使用docker。 19 | 20 | 我们在 Docker Hub 的 Gitea 组织中提供了自动更新的 Docker 镜像,它会保持最新的稳定版。你也可以用其它 Docker 服务来更新。首先你需要pull镜像: 21 | 22 | ``` 23 | docker pull gitea/gitea:latest 24 | ``` 25 | 26 | 如果要将git和其它数据持久化,你需要创建一个目录来作为数据存储的地方: 27 | 28 | ``` 29 | sudo mkdir -p /var/lib/gitea 30 | ``` 31 | 32 | 然后就可以运行 docker 容器了,这很简单。 当然你需要定义端口数数据目录: 33 | 34 | ``` 35 | docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest 36 | ``` 37 | 38 | 然后 容器已经运行成功,在浏览器中访问 http://hostname:10080 就可以看到界面了。你可以尝试在上面创建项目,clone操作 `git clone ssh://git@hostname:10022/username/repo.git`. 39 | 40 | ## 需要帮助? 41 | 42 | 如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) 43 | -------------------------------------------------------------------------------- /content/doc/installation/with-docker.zh-tw.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "Docker 安裝" 4 | slug: "install-with-docker" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "installation" 11 | name: "Docker 安裝" 12 | weight: 10 13 | identifier: "install-with-docker" 14 | --- 15 | 16 | # 用 Docker 安裝 17 | 18 | 我們在 Docker Hub 提供了自動更新的映像檔,它會保持最新穩定版。根據您的部屬環境來使用最新版本或用其他服務來更新 Docker 映像檔。首先您需要下載映像檔: 19 | 20 | ``` 21 | docker pull gitea/gitea:latest 22 | ``` 23 | 24 | 為了儲存您的所有 Git 儲存庫資料,您應該建立一個目錄,用來存放資料的地方。 25 | 26 | ``` 27 | sudo mkdir -p /var/lib/gitea 28 | ``` 29 | 30 | 現在就可以直接啟動 Docker 容器,這是一個非常簡單的過程,您必須定義啟動連接埠,並且提供上面所建立的資料儲存路徑: 31 | 32 | ``` 33 | docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest 34 | ``` 35 | 36 | 然後 Gitea 容器已經開始運行,您可以透過個人喜愛的瀏覽器來訪問 http://hostname:10080,假如您想要開始 Clone 儲存庫,可以直接執行 `git clone ssh://git@hostname:10022/username/repo.git` 指令。 37 | 38 | ## 需要協助? 39 | 40 | 如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 41 | -------------------------------------------------------------------------------- /content/doc/upgrade.en-us.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "Upgrade" 4 | slug: "upgrade" 5 | weight: 10 6 | toc: false 7 | draft: false 8 | menu: 9 | sidebar: 10 | name: "Upgrade" 11 | weight: 20 12 | identifier: "upgrade" 13 | --- 14 | -------------------------------------------------------------------------------- /content/doc/upgrade.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "升级" 4 | slug: "upgrade" 5 | weight: 10 6 | toc: false 7 | draft: false 8 | menu: 9 | sidebar: 10 | name: "升级" 11 | weight: 20 12 | identifier: "upgrade" 13 | --- 14 | -------------------------------------------------------------------------------- /content/doc/upgrade.zh-tw.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "升級" 4 | slug: "upgrade" 5 | weight: 10 6 | toc: false 7 | draft: false 8 | menu: 9 | sidebar: 10 | name: "升級" 11 | weight: 20 12 | identifier: "upgrade" 13 | --- 14 | -------------------------------------------------------------------------------- /content/doc/upgrade/from-gogs.en-us.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "Upgrade from Gogs" 4 | slug: "upgrade-from-gogs" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "upgrade" 11 | name: "From Gogs" 12 | weight: 10 13 | identifier: "upgrade-from-gogs" 14 | --- 15 | 16 | # Upgrade from Gogs 17 | 18 | Gogs versions up to 0.9.146 (db schema version 15) can be smoothly upgraded to Gitea. 19 | 20 | There are some steps to do so below. On Unix run as your Gogs user: 21 | 22 | * Create a Gogs backup with `gogs dump`. This creates `gogs-dump-[timestamp].zip` file containing all your Gogs data. 23 | * Download the file matching your platform from the [downloads page](https://dl.gitea.io/gitea). 24 | * Put the binary at the desired install location. 25 | * Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`. 26 | * If you have custom `templates, public` in `gogs/custom/` copy them to `gitea/custom/`. 27 | * If you have any other custom folders like `gitignore, label, license, locale, readme` in `gogs/custom/conf` copy them to `gitea/custom/options`. 28 | * Copy `gogs/data/` to `gitea/data/`. It contains issue attachments and avatars. 29 | * Verify by starting Gitea with `gitea web`. 30 | * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`, then run `Rewrite all update hook of repositories` (needed when custom config path is changed). 31 | 32 | ### Change gogs specific information: 33 | 34 | * Rename `gogs-repositories/` to `gitea-repositories/` 35 | * Rename `gogs-data/` to `gitea-data/` 36 | * In your `gitea/custom/conf/app.ini` change: 37 | 38 | FROM: 39 | ``` 40 | [database] 41 | PATH = /home/:USER/gogs/data/:DATABASE.db 42 | [attachment] 43 | PATH = /home/:USER/gogs-data/attachments 44 | [picture] 45 | AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars 46 | [log] 47 | ROOT_PATH = /home/:USER/gogs/log 48 | ``` 49 | 50 | TO: 51 | ``` 52 | [database] 53 | PATH = /home/:USER/gitea/data/:DATABASE.db 54 | [attachment] 55 | PATH = /home/:USER/gitea-data/attachments 56 | [picture] 57 | AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars 58 | [log] 59 | ROOT_PATH = /home/:USER/gitea/log 60 | ``` 61 | 62 | * Verify by starting Gitea with `gitea web` 63 | 64 | ### Troubleshooting 65 | 66 | * If you encounter errors relating to custom templates in the `gitea/custom/templates` folder, try moving the templates causing the errors away one by one. They may not be compatible with Gitea. 67 | 68 | ### Add Gitea to startup on Unix 69 | 70 | Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) with the right environment variables. 71 | 72 | For distro's with systemd: 73 | 74 | * Copy the updated script to `/etc/systemd/system/gitea.service` 75 | * Add the service to the startup with: `sudo systemctl enable gitea` 76 | * Disable old gogs startup script: `sudo systemctl disable gogs` 77 | 78 | For distro's with SysVinit: 79 | 80 | * Copy the updated script to `/etc/init.d/gitea` 81 | * Add the service to the startup with: `sudo rc-update add gitea` 82 | * Disable old gogs startup script: `sudo rc-update del gogs` 83 | -------------------------------------------------------------------------------- /content/doc/upgrade/from-gogs.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "从 Gogs 升级" 4 | slug: "upgrade-from-gogs" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "upgrade" 11 | name: "从 Gogs 升级" 12 | weight: 10 13 | identifier: "upgrade-from-gogs" 14 | --- 15 | 16 | # 从 Gogs 升级 17 | 18 | 如果你正在运行Gogs 0.9.146以下版本,你可以平滑的升级到Gitea。该升级需要如下的步骤: 19 | 20 | * 停止 Gogs 的运行 21 | * 拷贝 Gogs 的配置文件 `custom/conf/app.ini` 到 Gitea 的相应位置。 22 | * 拷贝 Gitea 的 `options/` 到 Home 目录下。 23 | * 如果你还有更多的自定义内容,比如templates和localization文件,你需要手工合并你的修改到 Gitea 的 Options 下对应目录。 24 | * 拷贝 Gogs 的数据目录 `data/` 到 Gitea 相应位置。这个目录包含附件和头像文件。 25 | * 运行 Gitea 26 | * 登陆 Gitea 并进入 管理面板, 运行 `重新生成 '.ssh/authorized_keys' 文件(警告:不是 Gitea 的密钥也会被删除)` 和 `重新生成所有仓库的 Update 钩子(用于自定义配置文件被修改)`。 27 | -------------------------------------------------------------------------------- /content/doc/upgrade/from-gogs.zh-tw.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-01T16:00:00+02:00" 3 | title: "從 Gogs 升級" 4 | slug: "upgrade-from-gogs" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "upgrade" 11 | name: "從 Gogs 升級" 12 | weight: 10 13 | identifier: "upgrade-from-gogs" 14 | --- 15 | 16 | # 從 Gogs 升級 17 | 18 | 假如您正在運行 Gogs 0.9.146 以下版本,你可以很平順的升級到 Gitea,請參考底下升級步驟: 19 | 20 | * 停止 Gogs 服務。 21 | * 複製 Gogs 設定檔 `custom/conf/app.ini` 到 Gitea 相對應位置。 22 | * 複製 Gogs `conf/` 目錄到 Gitea `options/` 目錄。 23 | * 假如您還有更多自訂的檔案在 `custom/` 目錄,像是多國語系檔案或模板,你應該手動將設定轉移到 Gitea 上,因為這些檔案在 Gitea 上有些不同。 24 | * 複製 `data/` 目錄到 Gitea 相對應目錄,此目錄包含 issue 附件檔及頭像。 25 | * 啟動 Gitea 服務 26 | * 進入 Gitea 管理介面,執行 `重新產生 '.ssh/authorized_keys' 檔案` (警告: 非 Gitea 金鑰將被刪除) 和 `重新產生全部倉庫 update hook` (當自訂設定檔已經被修改,則需要此步驟)。 27 | -------------------------------------------------------------------------------- /content/doc/usage.en-us.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-12-27T16:00:00+02:00" 3 | title: "Usage" 4 | slug: "usage" 5 | weight: 35 6 | toc: false 7 | draft: false 8 | menu: 9 | sidebar: 10 | name: "Usage" 11 | weight: 35 12 | identifier: "usage" 13 | --- 14 | -------------------------------------------------------------------------------- /content/doc/usage/backup-and-restore.en-us.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2017-01-01T16:00:00+02:00" 3 | title: "Usage: Backup and Restore" 4 | slug: "backup-and-restore" 5 | weight: 11 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "usage" 11 | name: "Backup and Restore" 12 | weight: 11 13 | identifier: "backup-and-restore" 14 | --- 15 | 16 | # Backup and Restore 17 | 18 | Gitea currently has a `dump` command that will save your installation to a zip file. There will be a `restore` command implemented at some point in the future. You will be able to use this to back up your installation, as well as make migrating servers easier. 19 | 20 | ## Backup Command (`dump`) 21 | 22 | First, switch to the user running gitea: `su git` (or whatever user you are using). Run `./gitea dump` in the gitea installation directory. You should see some output similar to this: 23 | 24 | ``` 25 | 2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 26 | 2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories 27 | 2016/12/27 22:32:22 Dumping database... 28 | 2016/12/27 22:32:22 Packing dump files... 29 | 2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 30 | 2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip 31 | ``` 32 | 33 | Inside the `gitea-dump-1482906742.zip` file, you will find the following: 34 | 35 | * `custom/conf/app.ini` - This is your server config. 36 | * `gitea-db.sql` - SQL dump of your database. 37 | * `gitea-repo.zip` - This zip will be a complete copy of your repo folder. 38 | See Config -> repository -> `ROOT` for the location. 39 | * `log/` - this will contain various logs. You don't need these if you are doing 40 | a migration. 41 | 42 | Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable. 43 | 44 | ## Restore Command (`restore`) 45 | 46 | WIP: Does not exist yet. 47 | -------------------------------------------------------------------------------- /content/doc/usage/backup-and-restore.zh-tw.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2017-01-01T16:00:00+02:00" 3 | title: "用法: 備份與還原" 4 | slug: "backup-and-restore" 5 | weight: 11 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "usage" 11 | name: "備份與還原" 12 | weight: 11 13 | identifier: "backup-and-restore" 14 | --- 15 | 16 | # 備份與還原 17 | 18 | Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續會提供還原指令,讓你可以輕易的將備份資料及還原到另外一台機器。 19 | 20 | ## 備份指令 (`dump`) 21 | 22 | 首先,切換到執行 Gitea 的使用者: `su git` (請修改成您指定的使用者),並在安裝目錄內執行 `./gitea dump` 指令,你可以看到 console 畫面如下: 23 | 24 | ``` 25 | 2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 26 | 2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories 27 | 2016/12/27 22:32:22 Dumping database... 28 | 2016/12/27 22:32:22 Packing dump files... 29 | 2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 30 | 2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip 31 | ``` 32 | 33 | 備份出來的 `gitea-dump-1482906742.zip` 檔案,檔案內會包含底下內容: 34 | 35 | * `custom/conf/app.ini` - 伺服器設定檔。 36 | * `gitea-db.sql` - SQL 備份檔案。 37 | * `gitea-repo.zip` - 此 zip 檔案為全部的 repo 目錄。 38 | 請參考 Config -> repository -> `ROOT` 所設定的路徑。 39 | * `log/` - 全部 logs 檔案,如果你要 migrate 到其他伺服器,此目錄不用保留。 40 | 41 | 你可以透過設定 `--tempdir` 指令參數來指定備份檔案目錄,或者是設定 `TMPDIR` 環境變數來達到此功能。 42 | 43 | ## 還原指令 (`restore`) 44 | 45 | 持續更新中: 此文件尚未完成. 46 | -------------------------------------------------------------------------------- /content/doc/usage/command-line.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2017-01-01T16:00:00+02:00" 3 | title: "Usage: Command Line" 4 | slug: "command-line" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | menu: 9 | sidebar: 10 | parent: "usage" 11 | name: "Command Line" 12 | weight: 10 13 | identifier: "command-line" 14 | --- 15 | 16 | ## Command Line 17 | 18 | ### Usage 19 | 20 | `gitea [global options] command [command options] [arguments...]` 21 | 22 | ### Global options 23 | - `--help`, `-h`: Show help text and exit. Optional. This can be used with any of the subcommands to see help text for it. 24 | - `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`). 25 | 26 | ### Commands 27 | 28 | #### web 29 | Starts the server 30 | - Options: 31 | - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file. 32 | - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini). 33 | - `--pid path`, `-P path`: Pidfile path. Optional. 34 | - Examples: 35 | - `gitea web` 36 | - `gitea web --port 80` 37 | - `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid` 38 | - Notes: 39 | - Gitea should not be run as root. To bind to a port below 1000, you can use setcap on Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be redone every time you update Gitea. 40 | 41 | #### admin 42 | Admin operations 43 | - Commands: 44 | - `create-user` 45 | - Options: 46 | - `--name value`: Username. Required. 47 | - `--password value`: Password. Required. 48 | - `--email value`: Email. Required. 49 | - `--admin`: If provided, this makes the user an admin. Optional. 50 | - `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini). 51 | - Examples: 52 | - `gitea admin create-user --name myname --password asecurepassword --email me@example.com` 53 | - `change-password` 54 | - Arguments: 55 | - `--username value`, `-u value`: Username. Required. 56 | - `--password value`, `-p value`: New password. Required. 57 | - Examples: 58 | - `gitea admin change-password --username myname --password asecurepassword` 59 | 60 | #### cert 61 | Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current directory and will overwrite any existing files. 62 | - Options: 63 | - `--host value`: Comma seperated hostnames and ips which this certificate is valid for. Wildcards are supported. Required. 64 | - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options are P224, P256, P384, P521. 65 | - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is set. (default: 2048). 66 | - `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`). 67 | - `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s) 68 | - `--ca`: If provided, this cert generates it's own certificate authority. Optional. 69 | - Examples: 70 | - `gitea cert --host git.example.com,example.com,www.example.com --ca` 71 | 72 | #### dump 73 | Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip` in the current directory. 74 | - Options: 75 | - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini). 76 | - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp). 77 | - `--verbose`, `-v`: If provided, shows additional details. Optional. 78 | - Examples: 79 | - `gitea dump` 80 | - `gitea dump --verbose` 81 | -------------------------------------------------------------------------------- /content/page/index.en-us.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-11-08T16:00:00+02:00" 3 | title: "Documentation" 4 | slug: "documentation" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | --- 9 | 10 | # What is Gitea? 11 | 12 | Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on [Gogs](http://gogs.io) but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read [this](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post. 13 | 14 | ## Purpose 15 | 16 | The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. With Go, this can be done with an independent binary distribution across ALL platforms that Go supports, including Linux, macOS and Windows, even on architectures like ARM or PowerPC. 17 | 18 | ## Features 19 | 20 | - User Dashboard 21 | - Context switcher (organization or current user) 22 | - Activity timeline 23 | - Commits 24 | - Issues 25 | - Pull requests 26 | - Repository creation 27 | - Searchable repository list 28 | - List of your organizations 29 | - A list of mirror repositories 30 | - Issues dashboard 31 | - Context switcher (organization or current user) 32 | - Filter by 33 | - Open 34 | - Closed 35 | - Your repositories 36 | - Assigned issues 37 | - Your issues 38 | - Repository 39 | - Sort by 40 | - Oldest 41 | - Last updated 42 | - Number of comments 43 | - Pull request dashboard 44 | - Same as issue dashboard 45 | - Repository types 46 | - Mirror 47 | - Normal 48 | - Migrated 49 | - Notifications (email and web) 50 | - Read 51 | - Unread 52 | - Pin 53 | - Explore page 54 | - Users 55 | - Repos 56 | - Organizations 57 | - Search 58 | - Custom templates 59 | - Override public files (logo, css, etc) 60 | - CSRF and XSS protection 61 | - HTTPS support 62 | - Set allowed upload sizes and types 63 | - Logging 64 | - Configuration 65 | - Databases 66 | - MySQL 67 | - PostgreSQL 68 | - SQLite3 69 | - MSSQL 70 | - [TiDB](https://github.com/pingcap/tidb) (experimental) 71 | - Configuration file 72 | - See [here](https://github.com/go-gitea/gitea/blob/master/conf/app.ini) 73 | - Admin panel 74 | - Statistics 75 | - Actions 76 | - Delete inactive accounts 77 | - Delete cached repository archives 78 | - Delete repositories records which are missing their files 79 | - Run garbage collection on repositories 80 | - Rewrite SSH keys 81 | - Resync hooks 82 | - Recreate repositories which are missing 83 | - Server status 84 | - Uptime 85 | - Memory 86 | - Current # of goroutines 87 | - And more 88 | - User management 89 | - Search 90 | - Sort 91 | - Last login 92 | - Authentication source 93 | - Maximum repositories 94 | - Disable account 95 | - Admin permissions 96 | - Permission to create git hooks 97 | - Permission to create organizations 98 | - Permission to import repositories 99 | - Organization management 100 | - People 101 | - Teams 102 | - Avatar 103 | - Hooks 104 | - Repository management 105 | - See all repository information and manage repositories 106 | - Authentication sources 107 | - OAuth 108 | - PAM 109 | - LDAP 110 | - SMTP 111 | - Configuration viewer 112 | - Everything in config file 113 | - System notices 114 | - When somthing unexpected happens 115 | - Monitoring 116 | - Current processes 117 | - Cron jobs 118 | - Update mirrors 119 | - Repository health check 120 | - Check repository statstics 121 | - Clean up old archives 122 | - Environment variables 123 | - Command line options 124 | - Multi-language support ([21 languages](https://github.com/go-gitea/gitea/tree/master/options/locale)) 125 | - Mail service 126 | - Notifications 127 | - Registration confirmation 128 | - Password reset 129 | - Reverse proxy support 130 | - Includes subpaths 131 | - Users 132 | - Profile 133 | - Name 134 | - Username 135 | - Email 136 | - Website 137 | - Join date 138 | - Followers and following 139 | - Organizations 140 | - Repositories 141 | - Activity 142 | - Starred repositories 143 | - Settings 144 | - Same as profile and more below 145 | - Keep email private 146 | - Avatar 147 | - Gravatar 148 | - Libravatar 149 | - Custom 150 | - Password 151 | - Mutiple email addresses 152 | - SSH Keys 153 | - Connected applications 154 | - Two factor authentication 155 | - Linked OAuth2 sources 156 | - Delete account 157 | - Repositories 158 | - Clone with SSH/HTTP/HTTPS 159 | - Git LFS 160 | - Watch, Star, Fork 161 | - View watchers, stars, and forks 162 | - Code 163 | - Branch browser 164 | - Web based file upload and creation 165 | - Clone urls 166 | - Download 167 | - ZIP 168 | - TAR.GZ 169 | - Web based editor 170 | - Markdown editor 171 | - Plain text editor 172 | - Syntax highlighting 173 | - Diff preview 174 | - Preview 175 | - Choose where to commit to 176 | - View file history 177 | - Delete file 178 | - View raw 179 | - Issues 180 | - Issue templates 181 | - Milestones 182 | - Labels 183 | - Assign issues 184 | - Filter 185 | - Open 186 | - Closed 187 | - Assigned person 188 | - Created by you 189 | - Mentioning you 190 | - Sort 191 | - Oldest 192 | - Last updated 193 | - Number of comments 194 | - Search 195 | - Comments 196 | - Attachments 197 | - Pull requests 198 | - Same features as issues 199 | - Commits 200 | - Commit graph 201 | - Commits by branch 202 | - Search 203 | - Search in all branches 204 | - View diff 205 | - View SHA 206 | - View author 207 | - Browse files in commit 208 | - Releases 209 | - Attachments 210 | - Title 211 | - Content 212 | - Delete 213 | - Mark as pre-release 214 | - Choose branch 215 | - Wiki 216 | - Import 217 | - Markdown editor 218 | - Settings 219 | - Options 220 | - Name 221 | - Description 222 | - Private/Public 223 | - Website 224 | - Wiki 225 | - Enabled/disabled 226 | - Internal/external 227 | - Issues 228 | - Enabled/disabled 229 | - Internal/external 230 | - External supports url rewriting for better integration 231 | - Enable/disable pull requests 232 | - Transfer repository 233 | - Delete wiki 234 | - Delete repository 235 | - Collaboration 236 | - Read/write/admin 237 | - Branches 238 | - Default branch 239 | - Branch protection 240 | - Webhooks 241 | - Git hooks 242 | - Deploy keys 243 | 244 | ## System Requirements 245 | 246 | - A cheap Raspberry Pi is powerful enough for basic functionality. 247 | - 2 CPU cores and 1GB RAM would be the baseline for teamwork. 248 | - Gitea is supposed to be run with a dedicated non-root user account on UNIX systems, no other mode of operation is supported. (**NOTE**: in case you run it with your own user account and the built-in SSH server disabled, Gitea modifies the `~/.ssh/authorized_keys` file so you will **not** be able to interactively log in.) 249 | 250 | ## Browser Support 251 | 252 | - Please see [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) for specific versions of supported browsers. 253 | - The official support minimal size is **1024*768**, UI may still looks right in smaller size but no promises and fixes. 254 | 255 | ## Components 256 | 257 | * Web framework: [Macaron](http://go-macaron.com/) 258 | * ORM: [XORM](https://github.com/go-xorm/xorm) 259 | * UI components: 260 | * [Semantic UI](http://semantic-ui.com/) 261 | * [GitHub Octicons](https://octicons.github.com/) 262 | * [Font Awesome](http://fontawesome.io/) 263 | * [DropzoneJS](http://www.dropzonejs.com/) 264 | * [Highlight](https://highlightjs.org/) 265 | * [Clipboard](https://zenorocha.github.io/clipboard.js/) 266 | * [Emojify](https://github.com/Ranks/emojify.js) 267 | * [CodeMirror](https://codemirror.net/) 268 | * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) 269 | * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) 270 | * Database drivers: 271 | * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) 272 | * [github.com/lib/pq](https://github.com/lib/pq) 273 | * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) 274 | * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) 275 | * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) 276 | 277 | ## Software and Service Support 278 | 279 | - [Drone](https://github.com/drone/drone) (CI) 280 | -------------------------------------------------------------------------------- /content/page/index.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-11-08T16:00:00+02:00" 3 | title: "文档" 4 | slug: "documentation" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | --- 9 | 10 | # 关于Gitea 11 | 12 | Gitea 是一个自己托管的Git服务程序。他和GitHub, Bitbucket or Gitlab等比较类似。他是从 [Gogs](http://gogs.io) 发展而来,不过我们已经Fork并且命名为Gitea。对于我们Fork的原因可以看 [这里](https://blog.gitea.io/2016/12/welcome-to-gitea/)。 13 | 14 | ## 目标 15 | 16 | Gitea的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用Go作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了x86,amd64,还包括 ARM 和 PowerPC。 17 | 18 | ## 功能特性 19 | 20 | - 支持活动时间线 21 | - 支持 SSH 以及 HTTP/HTTPS 协议 22 | - 支持 SMTP、LDAP 和反向代理的用户认证 23 | - 支持反向代理子路径 24 | - 支持用户、组织和仓库管理系统 25 | - 支持添加和删除仓库协作者 26 | - 支持仓库和组织级别 Web 钩子(包括 Slack 集成) 27 | - 支持仓库 Git 钩子和部署密钥 28 | - 支持仓库工单(Issue)、合并请求(Pull Request)以及 Wiki 29 | - 支持迁移和镜像仓库以及它的 Wiki 30 | - 支持在线编辑仓库文件和 Wiki 31 | - 支持自定义源的 Gravatar 和 Federated Avatar 32 | - 支持邮件服务 33 | - 支持后台管理面板 34 | - 支持 MySQL、PostgreSQL、SQLite3, MSSQL 和 TiDB(实验性支持) 数据库 35 | - 支持多语言本地化(21 种语言) 36 | 37 | ## 系统要求 38 | 39 | - 最低的系统硬件要求为一个廉价的树莓派 40 | - 如果用于团队项目,建议使用 2 核 CPU 及 1GB 内存 41 | 42 | ## 浏览器支持 43 | 44 | - 请根据 [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) 查看具体支持的浏览器版本。 45 | - 官方支持的最小 UI 尺寸为 **1024*768**,UI 不一定会在更小尺寸的设备上被破坏,但我们无法保证且不会修复。 46 | 47 | ## 组件 48 | 49 | * Web框架: [Macaron](http://go-macaron.com/) 50 | * ORM: [XORM](https://github.com/go-xorm/xorm) 51 | * UI组件: 52 | * [Semantic UI](http://semantic-ui.com/) 53 | * [GitHub Octicons](https://octicons.github.com/) 54 | * [Font Awesome](http://fontawesome.io/) 55 | * [DropzoneJS](http://www.dropzonejs.com/) 56 | * [Highlight](https://highlightjs.org/) 57 | * [Clipboard](https://zenorocha.github.io/clipboard.js/) 58 | * [Emojify](https://github.com/Ranks/emojify.js) 59 | * [CodeMirror](https://codemirror.net/) 60 | * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) 61 | * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) 62 | * 数据库驱动: 63 | * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) 64 | * [github.com/lib/pq](https://github.com/lib/pq) 65 | * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) 66 | * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) 67 | * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) 68 | 69 | ## 软件及服务支持 70 | 71 | - [Drone](https://github.com/drone/drone) (CI) 72 | 73 | ## 需要帮助? 74 | 75 | 如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) 76 | -------------------------------------------------------------------------------- /content/page/index.zh-tw.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: "2016-11-08T16:00:00+02:00" 3 | title: "文件" 4 | slug: "documentation" 5 | weight: 10 6 | toc: true 7 | draft: false 8 | --- 9 | 10 | # 關於 Gitea 11 | 12 | Gitea 是一個可自行託管的 Git 服務。你可以拿 GitHub、Bitbucket 或 Gitlab 來比較看看。初期是從 [Gogs](http://gogs.io) 發展而來,不過我們已經 Fork 並且命名為 Gitea。如果您想更深入了解 Fork 原因,請直接參考[這裡](https://blog.gitea.io/2016/12/welcome-to-gitea/)。 13 | 14 | ## 目標 15 | 16 | Gitea 的首要目標是建立一個容易安裝,運行快速,安装和使用體驗良好的自建 Git 服務。我們採用 GO 為後端語言,Go 可以產生各平台使用的執行檔。除了支援 Linux、macOS 和 Windows 外,甚至還包含 ARM 和 PowerPC。 17 | 18 | ## 功能 19 | 20 | - 支援個人活動時間表 21 | - 支援 SSH 和 HTTP/HTTPS 協定 22 | - 支援 SMTP/LDAP/Reverse 代理認證 23 | - 支援反向代理子路徑 24 | - 支援帳號/組織/儲存庫管理 25 | - 支援新增/刪除儲存庫合作帳號 26 | - 支援儲存庫/組織 webhooks (包含 Slack) 27 | - 支援儲存庫 Git hooks/部署金鑰 28 | - 支援儲存庫問題列表 (issues), 合併請求 (pull requests) 及 wiki 29 | - 支援遷移及複製儲存庫及 wiki 30 | - 支援線上編輯儲存庫檔案及 wiki 31 | - 支援自訂來源 Gravatar 及 Federated avatar 32 | - 支援郵件服務 33 | - 支援後台管理 34 | - 支援 MySQL, PostgreSQL, SQLite3, MSSQL 和 [TiDB](https://github.com/pingcap/tidb) (實驗性) 35 | - 支援多國語言 ([21 國語言](https://github.com/go-gitea/gitea/tree/master/options/locale)) 36 | 37 | ## 系統需求 38 | 39 | - 最低的系統需求就是一片便宜的樹莓派 (Raspberry Pi)。 40 | - 如果用於團隊,建議使用 2 核 CPU 和 1GB 記憶體。 41 | 42 | ## 瀏覽器支援 43 | 44 | - 請參考 [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) 所支援的瀏覽器列表。 45 | - 官方支援最小 UI 尺寸為 **1024*768**, UI 在更小尺寸也看起來不錯,但是我們並不保證。 46 | 47 | ## 元件 48 | 49 | * Web 框架: [Macaron](http://go-macaron.com/) 50 | * ORM: [XORM](https://github.com/go-xorm/xorm) 51 | * UI 元件: 52 | * [Semantic UI](http://semantic-ui.com/) 53 | * [GitHub Octicons](https://octicons.github.com/) 54 | * [Font Awesome](http://fontawesome.io/) 55 | * [DropzoneJS](http://www.dropzonejs.com/) 56 | * [Highlight](https://highlightjs.org/) 57 | * [Clipboard](https://zenorocha.github.io/clipboard.js/) 58 | * [Emojify](https://github.com/Ranks/emojify.js) 59 | * [CodeMirror](https://codemirror.net/) 60 | * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) 61 | * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) 62 | * 資料庫: 63 | * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) 64 | * [github.com/lib/pq](https://github.com/lib/pq) 65 | * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) 66 | * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) 67 | * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) 68 | -------------------------------------------------------------------------------- /docker/caddy.conf: -------------------------------------------------------------------------------- 1 | :80 { 2 | root /srv/www 3 | 4 | locale en-US zh-CN zh-TW pt-BR nl-NL { 5 | detect header 6 | } 7 | 8 | redir 301 { 9 | if {path} match ^/$ 10 | / /{>Detected-Locale}/ 11 | } 12 | 13 | rewrite /en-US/ { 14 | regexp (.*) 15 | to /en-us/{1} 16 | } 17 | 18 | rewrite /zh-CN/ { 19 | regexp (.*) 20 | to /zh-cn/{1} 21 | } 22 | 23 | rewrite /zh-TW/ { 24 | regexp (.*) 25 | to /zh-tw/{1} 26 | } 27 | 28 | rewrite /pt-BR/ { 29 | regexp (.*) 30 | to /pt-br/{1} 31 | } 32 | 33 | rewrite /nl-NL/ { 34 | regexp (.*) 35 | to /nl-nl/{1} 36 | } 37 | 38 | header / Vary "Accept-Language" 39 | } 40 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | {{ partial "navbar.html" . }} 3 | 4 |
5 |
6 |
7 | {{ partial "menu" . }} 8 |
9 |
10 | {{ range where .Site.Pages "Type" "page" }} 11 | {{ .Content }} 12 | {{ end }} 13 | 14 | {{ if .Site.DisqusShortname }} 15 |
16 | {{ partial "disqus.html" . }} 17 |
18 | {{ end }} 19 |
20 |
21 |
22 | 23 | {{ partial "footer.html" . }} 24 | -------------------------------------------------------------------------------- /scripts/trans-copy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # 5 | # This script is used to copy the en-US content to our available locales as a 6 | # fallback to always show all pages when displaying a specific locale that is 7 | # missing some documents to be translated. 8 | # 9 | # Just execute the script without any argument and you will get the missing 10 | # files copied into the content folder. We are calling this script within the CI 11 | # server simply by `make trans-copy`. 12 | # 13 | 14 | declare -a LOCALES=( 15 | "nl-nl" 16 | "pt-br" 17 | "zh-cn" 18 | "zh-tw" 19 | ) 20 | 21 | ROOT=$(realpath $(dirname $0)/..) 22 | 23 | for SOURCE in $(find ${ROOT}/content -type f -iname *.en-us.md); do 24 | for LOCALE in "${LOCALES[@]}"; do 25 | DEST="${SOURCE%.en-us.md}.${LOCALE}.md" 26 | 27 | if [[ ! -f ${DEST} ]]; then 28 | echo "Creating fallback for ${DEST#${ROOT}/content/}" 29 | cp ${SOURCE} ${DEST} 30 | fi 31 | done 32 | done 33 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-gitea/docs/553a5f0a43999b1355c7c08fe8c8729ae2bac9c8/static/.gitkeep --------------------------------------------------------------------------------