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

80 lines
3.4 KiB

  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. ## Command Line
  16. ### Usage
  17. `gitea [global options] command [command options] [arguments...]`
  18. ### Global options
  19. - `--help`, `-h`: Show help text and exit. Optional. This can be used with any of the subcommands to see help text for it.
  20. - `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`).
  21. ### Commands
  22. #### web
  23. Starts the server
  24. - Options:
  25. - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file.
  26. - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  27. - `--pid path`, `-P path`: Pidfile path. Optional.
  28. - Examples:
  29. - `gitea web`
  30. - `gitea web --port 80`
  31. - `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid`
  32. - Notes:
  33. - 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.
  34. #### admin
  35. Admin operations
  36. - Commands:
  37. - `create-user`
  38. - Options:
  39. - `--name value`: Username. Required.
  40. - `--password value`: Password. Required.
  41. - `--email value`: Email. Required.
  42. - `--admin`: If provided, this makes the user an admin. Optional.
  43. - `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  44. - Examples:
  45. - `gitea admin create-user --name myname --password asecurepassword --email me@example.com`
  46. - `change-password`
  47. - Arguments:
  48. - `--username value`, `-u value`: Username. Required.
  49. - `--password value`, `-p value`: New password. Required.
  50. - Examples:
  51. - `gitea admin change-password --username myname --password asecurepassword`
  52. #### cert
  53. Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current directory and will overwrite any existing files.
  54. - Options:
  55. - `--host value`: Comma seperated hostnames and ips which this certificate is valid for. Wildcards are supported. Required.
  56. - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options are P224, P256, P384, P521.
  57. - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is set. (default: 2048).
  58. - `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`).
  59. - `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s)
  60. - `--ca`: If provided, this cert generates it's own certificate authority. Optional.
  61. - Examples:
  62. - `gitea cert --host git.example.com,example.com,www.example.com --ca`
  63. #### dump
  64. Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip` in the current directory.
  65. - Options:
  66. - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  67. - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp).
  68. - `--verbose`, `-v`: If provided, shows additional details. Optional.
  69. - Examples:
  70. - `gitea dump`
  71. - `gitea dump --verbose`