You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

faq.en-us.md 16 kB

6 years ago
6 years ago
6 years ago
Restricted users (#6274) * Restricted users (#4334): initial implementation * Add User.IsRestricted & UI to edit it * Pass user object instead of user id to places where IsRestricted flag matters * Restricted users: maintain access rows for all referenced repos (incl public) * Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses * Add basic repo access tests for restricted users Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Mention restricted users in the faq Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Remove unnecessary `org.IsOrganization()` call Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert to an `int64` keyed `accessMap` * Add type `userAccess` * Add convenience func updateUserAccess() * Turn accessMap into a `map[int64]userAccess` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * or even better: `map[int64]*userAccess` * updateUserAccess(): use tighter syntax as suggested by lafriks * even tighter * Avoid extra loop * Don't disclose limited orgs to unauthenticated users * Don't assume block only applies to orgs * Use an array of `VisibleType` for filtering * fix yet another thinko * Ok - no need for u * Revert "Ok - no need for u" This reverts commit 5c3e886aabd5acd997a3b35687d322439732c200. Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
Restricted users (#6274) * Restricted users (#4334): initial implementation * Add User.IsRestricted & UI to edit it * Pass user object instead of user id to places where IsRestricted flag matters * Restricted users: maintain access rows for all referenced repos (incl public) * Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses * Add basic repo access tests for restricted users Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Mention restricted users in the faq Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Remove unnecessary `org.IsOrganization()` call Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert to an `int64` keyed `accessMap` * Add type `userAccess` * Add convenience func updateUserAccess() * Turn accessMap into a `map[int64]userAccess` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * or even better: `map[int64]*userAccess` * updateUserAccess(): use tighter syntax as suggested by lafriks * even tighter * Avoid extra loop * Don't disclose limited orgs to unauthenticated users * Don't assume block only applies to orgs * Use an array of `VisibleType` for filtering * fix yet another thinko * Ok - no need for u * Revert "Ok - no need for u" This reverts commit 5c3e886aabd5acd997a3b35687d322439732c200. Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. ---
  2. date: "2019-04-05T16:00:00+02:00"
  3. title: "FAQ"
  4. slug: "faq"
  5. weight: 5
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "help"
  11. name: "FAQ"
  12. weight: 5
  13. identifier: "faq"
  14. ---
  15. # Frequently Asked Questions
  16. This page contains some common questions and answers.
  17. Also see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}})
  18. * [Difference between 1.x and 1.x.x downloads](#difference-between-1-x-and-1-x-x-downloads)
  19. * [How to migrate from Gogs/GitHub/etc. to Gitea](#how-to-migrate-from-gogs-github-etc-to-gitea)
  20. * [Where does Gitea store "x" file](#where-does-gitea-store-x-file)
  21. * [Not seeing a clone URL or the clone URL being incorrect](#not-seeing-a-clone-url-or-the-clone-url-being-incorrect)
  22. * [Custom Templates not loading or working incorrectly](#custom-templates-not-loading-or-working-incorrectly)
  23. * [Active user vs login prohibited user](#active-user-vs-login-prohibited-user)
  24. * [Setting up logging](#setting-up-logging)
  25. * [What is Swagger?](#what-is-swagger)
  26. * [Adjusting your server for public/private use](#adjusting-your-server-for-public-private-use)
  27. * [Preventing spammers](#preventing-spammers)
  28. * [Only allow certain email domains](#only-allow-certain-email-domains)
  29. * [Only allow/block certain OpenID providers](#only-allow-block-certain-openid-providers)
  30. * [Issue only users](#issue-only-users)
  31. * [Restricted users](#restricted-users)
  32. * [Enable Fail2ban](#enable-fail2ban)
  33. * [Adding custom themes](#how-to-add-use-custom-themes)
  34. * [SSHD vs built-in SSH](#sshd-vs-built-in-ssh)
  35. * [Gitea is running slow](#gitea-is-running-slow)
  36. * [Can't create repositories/files](#cant-create-repositories-files)
  37. * [Translation is incorrect/how to add more translations](#translation-is-incorrect-how-to-add-more-translations)
  38. * [Hooks aren't running](#hooks-aren-t-running)
  39. * [SSH Issues](#ssh-issues)
  40. * [SSH Common Errors](#ssh-common-errors)
  41. * [Missing releases after migration repository with tags](#missing-releases-after-migrating-repository-with-tags)
  42. * [LFS Issues](#lfs-issues)
  43. * [How can I create users before starting Gitea](#how-can-i-create-users-before-starting-gitea)
  44. * [How can I enable password reset](#how-can-i-enable-password-reset)
  45. * [How can a user's password be changed](#how-can-a-user-s-password-be-changed)
  46. * [Why is my markdown broken](#why-is-my-markdown-broken)
  47. ## Difference between 1.x and 1.x.x downloads
  48. Version 1.7.x will be used for this example.
  49. **NOTE:** this example applies to Docker images as well!
  50. On our [downloads page](https://dl.gitea.io/gitea/) you will see a 1.7 directory, as well as directories for 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, and 1.7.6.
  51. The 1.7 and 1.7.0 directories are **not** the same. The 1.7 directory is built on each merged commit to the [`release/v1.7`](https://github.com/go-gitea/gitea/tree/release/v1.7) branch.
  52. The 1.7.0 directory, however, is a build that was created when the [`v1.7.0`](https://github.com/go-gitea/gitea/releases/tag/v1.7.0) tag was created.
  53. This means that 1.x downloads will change as commits are merged to their respective branch (think of it as a separate "master" branch for each release).
  54. On the other hand, 1.x.x downloads should never change.
  55. ## How to migrate from Gogs/GitHub/etc. to Gitea
  56. To migrate from Gogs to Gitea:
  57. * [Gogs version 0.9.146 or less]({{< relref "doc/upgrade/from-gogs.en-us.md" >}})
  58. * [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286)
  59. To migrate from GitHub to Gitea, you can use Gitea's built-in migration form.
  60. In order to migrate items such as issues, pull requests, etc. you will need to input at least your username.
  61. [Example (requires login)](https://try.gitea.io/repo/migrate)
  62. To migrate from Gitlab to Gitea, you can use this non-affiliated tool:
  63. https://github.com/loganinak/MigrateGitlabToGogs
  64. ## Where does Gitea store "x" file
  65. * WorkPath
  66. * Environment variable `GITEA_WORK_DIR`
  67. * Else binary location
  68. * AppDataPath (default for database, indexers, etc.)
  69. * `APP_DATA_PATH` from `app.ini`
  70. * Else `%(WorkPath)/data`
  71. * CustomPath (custom templates)
  72. * Environment variable `GITEA_CUSTOM`
  73. * Else `%(WorkPath)/custom`
  74. * HomeDir
  75. * Unix: Environment variable `HOME`
  76. * Windows: Environment variable `USERPROFILE`, else environment variables `HOMEDRIVE`+`HOMEPATH`
  77. * RepoRootPath
  78. * `ROOT` in `app.ini`
  79. * Else `%(HomeDir)/gitea-repositories`
  80. * INI (config file)
  81. * `-c` flag
  82. * Else `%(CustomPath)/conf/app.ini`
  83. * SQLite Database
  84. * `PATH` in `database` section of `app.ini`
  85. * Else `%(AppDataPath)/gitea.db`
  86. ## Not seeing a clone URL or the clone URL being incorrect
  87. There are a few places that could make this show incorrectly.
  88. 1. If using a reverse proxy, make sure you have followed the correction directions in the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}})
  89. 2. Make sure you have correctly set `ROOT_URL` in the `server` section of your `app.ini`
  90. If certain clone options aren't showing up (HTTP/S or SSH), the following options can be checked in your `app.ini`
  91. `DISABLE_HTTP_GIT`: if set to true, there will be no HTTP/HTTPS link
  92. `DISABLE_SSH`: if set to true, there will be no SSH link
  93. `SSH_EXPOSE_ANONYMOUS`: if set to false, SSH links will be hidden for anonymous users
  94. ## Custom Templates not loading or working incorrectly
  95. Gitea's custom templates must be added to the correct location or Gitea will not find and use them.
  96. The correct path for the template(s) will be relative to the `CustomPath`
  97. 1. To find `CustomPath`, look for Custom File Root Path in Site Administration -> Configuration
  98. * If that doesn't exist, you can try `echo $GITEA_CUSTOM`
  99. 2. If you are still unable to find a path, the default can be [calculated above](#where-does-gitea-store-x-file)
  100. 3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) page to add your template to the correct location.
  101. ## Active user vs login prohibited user
  102. In Gitea, an "active" user refers to a user that has activated their account via email.
  103. A "login prohibited" user is a user that is not allowed to log in to Gitea anymore
  104. ## Setting up logging
  105. * [Official Docs]({{< relref "doc/advanced/logging-documentation.en-us.md" >}})
  106. ## What is Swagger?
  107. [Swagger](https://swagger.io/) is what Gitea uses for its API.
  108. All Gitea instances have the built-in API, though it can be disabled by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`
  109. For more information, refer to Gitea's [API docs]({{< relref "doc/advanced/api-usage.en-us.md" >}})
  110. [Swagger Example](https://try.gitea.io/api/swagger)
  111. ## Adjusting your server for public/private use
  112. ### Preventing spammers
  113. There are multiple things you can combine to prevent spammers.
  114. 1. By only whitelisting certain domains with OpenID (see below)
  115. 2. Setting `ENABLE_CAPTCHA` to `true` in your `app.ini` and properly configuring `RECAPTCHA_SECRET` and `RECAPTCHA_SITEKEY`
  116. 3. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/usage/command-line.en-us.md" >}}), [API]({{< relref "doc/advanced/api-usage.en-us.md" >}}), or Gitea's Admin UI
  117. ### Only allow certain email domains
  118. You can configure `EMAIL_DOMAIN_WHITELIST` in your app.ini under `[service]`
  119. ### Only allow/block certain OpenID providers
  120. You can configure `WHITELISTED_URIS` or `BLACKLISTED_URIS` under `[openid]` in your `app.ini`
  121. **NOTE:** whitelisted takes precedence, so if it is non-blank then blacklisted is ignored
  122. ### Issue only users
  123. The current way to achieve this is to create/modify a user with a max repo creation limit of 0.
  124. ### Restricted users
  125. Restricted users are limited to a subset of the content based on their organization/team memberships and collaborations, ignoring the public flag on organizations/repos etc.__
  126. Example use case: A company runs a Gitea instance that requires login. Most repos are public (accessible/browseable by all co-workers).
  127. At some point, a customer or third party needs access to a specific repo and only that repo. Making such a customer account restricted and granting any needed access using team membership(s) and/or collaboration(s) is a simple way to achieve that without the need to make everything private.
  128. ### Enable Fail2ban
  129. Use [Fail2Ban]({{ relref "doc/usage/fail2ban-setup.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns
  130. ## How to add/use custom themes
  131. Gitea supports two official themes right now, `gitea` and `arc-green` (`light` and `dark` respectively)
  132. To add your own theme, currently the only way is to provide a complete theme (not just color overrides)
  133. As an example, let's say our theme is `arc-blue` (this is a real theme, and can be found [in this issue](https://github.com/go-gitea/gitea/issues/6011))
  134. Name the `.css` file `theme-arc-blue.css` and add it to your custom folder in `custom/pulic/css`
  135. Allow users to use it by adding `arc-blue` to the list of `THEMES` in your `app.ini`
  136. ## SSHD vs built-in SSH
  137. SSHD is the built-in SSH server on most Unix systems.
  138. Gitea also provides its own SSH server, for usage when SSHD is not available.
  139. ## Gitea is running slow
  140. The most common culprit for this is loading federated avatars.
  141. This can be turned off by setting `ENABLE_FEDERATED_AVATAR` to `false` in your `app.ini`
  142. Another option that may need to be changed is setting `DISABLE_GRAVATAR` to `true` in your `app.ini`
  143. ## Can't create repositories/files
  144. Make sure that Gitea has sufficient permissions to write to its home directory and data directory.
  145. See [AppDataPath and RepoRootPath](#where-does-gitea-store-x-file)
  146. **Note for Arch users:** At the time of writing this, there is an issue with the Arch package's systemd file including this line:
  147. `ReadWritePaths=/etc/gitea/app.ini`
  148. Which makes all other paths non-writeable to Gitea.
  149. ## Translation is incorrect/how to add more translations
  150. Our translations are currently crowd-sourced on our [Crowdin project](https://crowdin.com/project/gitea)
  151. Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration.
  152. ## Hooks aren't running
  153. If Gitea is not running hooks, a common cause is incorrect setup of SSH keys.
  154. See [SSH Issues](#ssh-issues) for more information.
  155. You can also try logging into the administration panel and running the `Resynchronize pre-receive, update and post-receive hooks of all repositories.` option.
  156. ## SSH issues
  157. If you cannot reach repositories over `ssh`, but `https` works fine, consider looking into the following.
  158. First, make sure you can access Gitea via SSH.
  159. `ssh git@myremote.example`
  160. If the connection is successful, you should receive an error message like the following:
  161. ```
  162. Hi there, You've successfully authenticated, but Gitea does not provide shell access.
  163. If this is unexpected, please log in with password and setup Gitea under another user.
  164. ```
  165. If you do not get the above message but still connect, it means your SSH key is **not** being managed by Gitea. This means hooks won't run, among other potential problems.
  166. If you cannot connect at all, your SSH key may not be configured correctly locally.
  167. This is specific to SSH and not Gitea, so will not be covered here.
  168. ### SSH Common Errors
  169. ```
  170. Permission denied (publickey).
  171. fatal: Could not read from remote repository.
  172. ```
  173. This error signifies that the server rejected a log in attempt, check the
  174. following things:
  175. * On the client:
  176. * Ensure the public and private ssh keys are added to the correct Gitea user.
  177. * Make sure there are no issues in the remote url. In particular, ensure the name of the
  178. git user (before the `@`) is spelled correctly.
  179. * Ensure public and private ssh keys are correct on client machine.
  180. * On the server:
  181. * Make sure the repository exists and is correctly named.
  182. * Check the permissions of the `.ssh` directory in the system user's home directory.
  183. * Verify that the correct public keys are added to `.ssh/authorized_keys`.
  184. Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the
  185. Gitea admin panel.
  186. * Read Gitea logs.
  187. * Read /var/log/auth (or similar).
  188. * Check permissions of repositories.
  189. The following is an example of a missing public SSH key where authentication
  190. succeeded, but some other setting is preventing SSH from reaching the correct
  191. repository.
  192. ```
  193. fatal: Could not read from remote repository.
  194. Please make sure you have the correct access rights
  195. and the repository exists.
  196. ```
  197. In this case, look into the following settings:
  198. * On the server:
  199. * Make sure that the `git` system user has a usable shell set
  200. * Verify this with `getent passwd git | cut -d: -f7`
  201. * `usermod` or `chsh` can be used to modify this.
  202. * Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the
  203. correct configuration file.
  204. ## Missing releases after migrating repository with tags
  205. To migrate an repository *with* all tags, you need to do two things:
  206. * Push tags to the repository:
  207. ```
  208. git push --tags
  209. ```
  210. * (Re-)sync tags of all repositories within Gitea:
  211. ```
  212. gitea admin repo-sync-releases
  213. ```
  214. ## LFS Issues
  215. For issues concerning LFS data upload
  216. ```
  217. batch response: Authentication required: Authorization error: <GITEA_LFS_URL>/info/lfs/objects/batch
  218. Check that you have proper access to the repository
  219. error: failed to push some refs to '<GIT_REPO_URL>'
  220. ```
  221. Check the value of `LFS_HTTP_AUTH_EXPIRY` in your `app.ini` file.
  222. By default, your LFS token will expire after 20 minutes. If you have a slow connection or a large file (or both), it may not finish uploading within the time limit.
  223. You may want to set this value to `60m` or `120m`.
  224. ## How can I create users before starting Gitea
  225. Gitea provides a sub-command `gitea migrate` to initialize the database, after which you can use the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}) to add users like normal.
  226. ## How can I enable password reset
  227. There is no setting for password resets. It is enabled when a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}) is configured, and disabled otherwise.
  228. ## How can a user's password be changed
  229. - As an **admin**, you can change any user's password (and optionally force them to change it on next login)...
  230. - By navigating to your `Site Administration -> User Accounts` page and editing a user.
  231. - By using the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}).
  232. Keep in mind most commands will also need a [global flag]({{< relref "doc/usage/command-line.en-us.md#global-options" >}}) to point the CLI at the correct configuration.
  233. - As a **user** you can change it...
  234. - In your account `Settings -> Account` page (this method **requires** you to know your current password).
  235. - By using the `Forgot Password` link.
  236. If the `Forgot Password/Account Recovery` page is disabled, please contact your administrator to configure a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}).
  237. ## Why is my markdown broken
  238. In Gitea version `1.11` we moved to [goldmark](https://github.com/yuin/goldmark) for markdown rendering, which is [CommonMark](https://commonmark.org/) compliant.
  239. If you have markdown that worked as you expected prior to version `1.11` and after upgrading it's not working anymore, please look through the CommonMark spec to see whether the problem is due to a bug or non-compliant syntax.
  240. If it is the latter, _usually_ there is a compliant alternative listed in the spec.