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.

command-line.md 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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
  20. subcommands to see help text for it.
  21. - `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version
  22. 1.1.0+218-g7b907ed built with: bindata, sqlite`).
  23. ### Commands
  24. #### web
  25. Starts the server:
  26. - Options:
  27. - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file.
  28. - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  29. - `--pid path`, `-P path`: Pidfile path. Optional.
  30. - Examples:
  31. - `gitea web`
  32. - `gitea web --port 80`
  33. - `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid`
  34. - Notes:
  35. - Gitea should not be run as root. To bind to a port below 1000, you can use setcap on
  36. Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be
  37. redone every time you update Gitea.
  38. #### admin
  39. Admin operations:
  40. - Commands:
  41. - `create-user`
  42. - Options:
  43. - `--name value`: Username. Required.
  44. - `--password value`: Password. Required.
  45. - `--email value`: Email. Required.
  46. - `--admin`: If provided, this makes the user an admin. Optional.
  47. - `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  48. - Examples:
  49. - `gitea admin create-user --name myname --password asecurepassword --email me@example.com`
  50. - `change-password`
  51. - Options:
  52. - `--username value`, `-u value`: Username. Required.
  53. - `--password value`, `-p value`: New password. Required.
  54. - `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  55. - Examples:
  56. - `gitea admin change-password --username myname --password asecurepassword`
  57. - `regenerate`
  58. - Options:
  59. - `hooks`: Regenerate git-hooks for all repositories
  60. - `keys`: Regenerate authorized_keys file
  61. - Examples:
  62. - `gitea admin regenerate hooks`
  63. - `gitea admin regenerate keys`
  64. #### cert
  65. Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current
  66. directory and will overwrite any existing files.
  67. - Options:
  68. - `--host value`: Comma seperated hostnames and ips which this certificate is valid for.
  69. Wildcards are supported. Required.
  70. - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options
  71. are P224, P256, P384, P521.
  72. - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is
  73. set. (default: 2048).
  74. - `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`).
  75. - `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s)
  76. - `--ca`: If provided, this cert generates it's own certificate authority. Optional.
  77. - Examples:
  78. - `gitea cert --host git.example.com,example.com,www.example.com --ca`
  79. #### dump
  80. Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip`
  81. in the current directory.
  82. - Options:
  83. - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
  84. - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp).
  85. - `--verbose`, `-v`: If provided, shows additional details. Optional.
  86. - Examples:
  87. - `gitea dump`
  88. - `gitea dump --verbose`
  89. #### generate
  90. Generates random values and tokens for usage in configuration file. Useful for generating values
  91. for automatic deployments.
  92. - Commands:
  93. - `secret`:
  94. - Options:
  95. - `INTERNAL_TOKEN`: Token used for an internal API call authentication.
  96. - `LFS_JWT_SECRET`: LFS authentication secret.
  97. - `SECRET_KEY`: Global secret key.
  98. - Examples:
  99. - `gitea generate secret INTERNAL_TOKEN`
  100. - `gitea generate secret LFS_JWT_SECRET`
  101. - `gitea generate secret SECRET_KEY`