faq.mdx 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ---
  2. title: "FAQ"
  3. description: "Frequently asked questions about using and administering Gogs"
  4. icon: "circle-question"
  5. ---
  6. Answers to common questions about Gogs configuration, administration, and usage.
  7. ## Deployment
  8. <AccordionGroup>
  9. <Accordion title="What do I do if another service is already using port 3000?">
  10. You can change the listening port on the first run by passing the `-port` flag:
  11. ```bash
  12. gogs web -port 3001
  13. ```
  14. This flag also updates the port number shown on the install page, so pick the port you intend to keep using.
  15. </Accordion>
  16. <Accordion title="How do I run Gogs in offline mode or on an intranet?">
  17. Set the `OFFLINE_MODE` option to `true` in the `[server]` section of your `custom/conf/app.ini`:
  18. ```ini
  19. [server]
  20. OFFLINE_MODE = true
  21. ```
  22. This disables external network calls such as CDN resource loading and Gravatar avatar fetching.
  23. </Accordion>
  24. <Accordion title="How do I make a custom robots.txt?">
  25. Create a file named `robots.txt` in the `custom` directory at the root of your Gogs installation:
  26. ```
  27. custom/robots.txt
  28. ```
  29. Gogs will serve this file automatically at `/robots.txt`.
  30. </Accordion>
  31. </AccordionGroup>
  32. ## Administration
  33. <AccordionGroup>
  34. <Accordion title="How can I become an administrator?">
  35. The first user to register (with `ID = 1`) is automatically granted administrator privileges. No email confirmation is required for this account, even if email confirmation is enabled.
  36. Once logged in, the administrator can promote other users by navigating to **Admin Panel** > **Users** and editing user accounts. A user who registers through the initial install page is also made an administrator.
  37. </Accordion>
  38. <Accordion title="How do I reset a forgotten administrator password?">
  39. If you have shell access to the server, follow these steps:
  40. 1. **Stop Gogs**, then create a temporary admin user from the command line:
  41. ```bash
  42. su git
  43. cd /home/git/gogs
  44. gogs admin create-user --name tmpuser --password tmppassword --admin --email tmp@example.com
  45. ```
  46. 2. **Start Gogs** again, then log in as `tmpuser` in your browser. Navigate to **Admin Panel** > **Users**, click **Edit** next to the original administrator account, and set a new password.
  47. 3. **Clean up** by logging out, logging back in as the original administrator with the new password, then deleting the `tmpuser` account from **Admin Panel** > **Users**.
  48. It is safest to stop Gogs before creating the temporary user via the command line, then start it again afterward.
  49. </Accordion>
  50. </AccordionGroup>
  51. ## Repository management
  52. <AccordionGroup>
  53. <Accordion title="How do I give Git hooks permission to users?">
  54. **Git hooks permission is a high-level privilege** that can allow arbitrary code execution on the server. Only grant it to users you fully trust.
  55. To enable or disable this permission, go to the **Admin Panel** > **Users**, select the user, and toggle the Git hooks permission in their account settings (`/admin/users/:userid`).
  56. </Accordion>
  57. </AccordionGroup>
  58. ## Other
  59. <AccordionGroup>
  60. <Accordion title="Why can't I create a wiki for my mirrored repository?">
  61. Mirrored repositories cannot have their own wiki because the mirror is a read-only copy of the upstream repository.
  62. If you see the "Welcome to Wiki!" page but no green "Create the first page" button, your repository was likely created as a mirror. You have two options:
  63. 1. Edit the wiki on the upstream repository that is being mirrored.
  64. 2. Convert the mirror to a regular repository under **Settings** > **Danger Zone** if you no longer need it to be a mirror.
  65. </Accordion>
  66. </AccordionGroup>