1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

General documentation cleanup (#3317)

* Clean up spelling, grammar, perspective, whitespace, language, markup, etc.
This commit is contained in:
Michael Lustfield
2018-01-08 16:48:42 -06:00
committed by Kim "BKC" Carlbäcker
parent 923c0105f4
commit 3ee8be3849
30 changed files with 500 additions and 279 deletions

View File

@@ -15,11 +15,13 @@ menu:
# Backup and Restore
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.
Gitea currently has a `dump` command that will save the installation to a zip file. This
file can be unpacked and used to restore an instance.
## Backup Command (`dump`)
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:
Switch to the user running gitea: `su git`. Run `./gitea dump` in the gitea installation
directory. There should be some output similar to the following:
```
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
@@ -30,17 +32,31 @@ First, switch to the user running gitea: `su git` (or whatever user you are usin
2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
```
Inside the `gitea-dump-1482906742.zip` file, you will find the following:
Inside the `gitea-dump-1482906742.zip` file, will be the following:
* `custom/conf/app.ini` - This is your server config.
* `gitea-db.sql` - SQL dump of your database.
* `gitea-repo.zip` - This zip will be a complete copy of your repo folder.
See Config -> repository -> `ROOT` for the location.
* `log/` - this will contain various logs. You don't need these if you are doing
a migration.
* `custom/conf/app.ini` - Server config.
* `gitea-db.sql` - SQL dump of database
* `gitea-repo.zip` - Complete copy of the repository directory.
* `log/` - Various logs. They are not needed for a recovery or migration.
Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable.
Intermediate backup files are created in a temporary directory specified either with the
`--tempdir` command-line parameter or the `TMPDIR` environment variable.
## Restore Command (`restore`)
WIP: Does not exist yet.
There is currently no support for a recovery command. It is a manual process that mostly
involves moving files to their correct locations and restoring a database dump.
Example:
```
apt-get install gitea
unzip gitea-dump-1482906742.zip
cd gitea-dump-1482906742
mv custom/conf/app.ini /etc/gitea/conf/app.ini
unzip gitea-repo.zip
mv gitea-repo/* /var/lib/gitea/repositories/
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
mysql -u$USER -p$PASS $DATABASE <gitea-db.sql
# or sqlite3 $DATABASE_PATH <gitea-db.sql
service gitea restart
```

View File

@@ -20,13 +20,17 @@ menu:
`gitea [global options] command [command options] [arguments...]`
### Global options
- `--help`, `-h`: Show help text and exit. Optional. This can be used with any of the subcommands to see help text for it.
- `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`).
- `--help`, `-h`: Show help text and exit. Optional. This can be used with any of the
subcommands to see help text for it.
- `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version
1.1.0+218-g7b907ed built with: bindata, sqlite`).
### Commands
#### web
Starts the server
Starts the server:
- Options:
- `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file.
- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
@@ -36,10 +40,14 @@ Starts the server
- `gitea web --port 80`
- `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid`
- Notes:
- 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.
- 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.
#### admin
Admin operations
Admin operations:
- Commands:
- `create-user`
- Options:
@@ -51,18 +59,24 @@ Admin operations
- Examples:
- `gitea admin create-user --name myname --password asecurepassword --email me@example.com`
- `change-password`
- Arguments:
- Options:
- `--username value`, `-u value`: Username. Required.
- `--password value`, `-p value`: New password. Required.
- Examples:
- `gitea admin change-password --username myname --password asecurepassword`
#### cert
Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current directory and will overwrite any existing files.
Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current
directory and will overwrite any existing files.
- Options:
- `--host value`: Comma seperated hostnames and ips which this certificate is valid for. Wildcards are supported. Required.
- `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options are P224, P256, P384, P521.
- `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is set. (default: 2048).
- `--host value`: Comma seperated hostnames and ips which this certificate is valid for.
Wildcards are supported. Required.
- `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options
are P224, P256, P384, P521.
- `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is
set. (default: 2048).
- `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`).
- `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s)
- `--ca`: If provided, this cert generates it's own certificate authority. Optional.
@@ -70,7 +84,10 @@ Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in
- `gitea cert --host git.example.com,example.com,www.example.com --ca`
#### dump
Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip` in the current directory.
Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip`
in the current directory.
- Options:
- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
- `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp).