Use docusaurus warning/note syntax instead markdown

This commit is contained in:
Lunny Xiao
2024-06-07 18:03:08 +08:00
parent 91cd95dba0
commit b4dddf8804
139 changed files with 860 additions and 341 deletions
+11 -5
View File
@@ -23,7 +23,9 @@ If you use an unsupported database version, please [get in touch](/help/support)
Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database).
Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server application on database instance and client program on your Gitea server. The client program is used to test connection to the database from Gitea server, while Gitea itself use database driver provided by Go to accomplish the same thing. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers.
:::note
All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server application on database instance and client program on your Gitea server. The client program is used to test connection to the database from Gitea server, while Gitea itself use database driver provided by Go to accomplish the same thing. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers.
:::
## MySQL/MariaDB
@@ -155,7 +157,9 @@ Note: All steps below requires that the database engine of your choice is instal
Replace database name, user, and IP address of Gitea instance with your own.
Note: rules on `pg_hba.conf` are evaluated sequentially, that is the first matching rule will be used for authentication. Your PostgreSQL installation may come with generic authentication rules that match all users and databases. You may need to place the rules presented here above such generic rules if it is the case.
:::note
Rules on `pg_hba.conf` are evaluated sequentially, that is the first matching rule will be used for authentication. Your PostgreSQL installation may come with generic authentication rules that match all users and databases. You may need to place the rules presented here above such generic rules if it is the case.
:::
Restart PostgreSQL to apply new authentication rules.
@@ -163,13 +167,13 @@ Note: All steps below requires that the database engine of your choice is instal
For local database:
```
```bash
psql -U gitea -d giteadb
```
For remote database:
```
```bash
psql "postgres://gitea@203.0.113.3/giteadb"
```
@@ -239,7 +243,9 @@ The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both d
- `~/.postgresql/postgresql.key`: Database client private key
- `~/.postgresql/root.crt`: CA certificate chain to validate server certificate
Note: Those file names above are hardcoded in PostgreSQL and it is not possible to change them.
:::note
Those file names above are hardcoded in PostgreSQL and it is not possible to change them.
:::
7. Adjust credentials, ownership and permission as required:
+13 -4
View File
@@ -64,8 +64,10 @@ despite warnings like `This key is not certified with a trusted signature!`.
## Recommended server configuration
**NOTE:** Many of the following directories can be configured using [Environment Variables](administration/environment-variables.md) as well!
:::note
Many of the following directories can be configured using [Environment Variables](administration/environment-variables.md) as well!
Of note, configuring `GITEA_WORK_DIR` will tell Gitea where to base its working directory, as well as ease installation.
:::
### Prepare environment
@@ -111,7 +113,10 @@ chown root:git /etc/gitea
chmod 770 /etc/gitea
```
> **NOTE:** `/etc/gitea` is temporarily set with write permissions for user `git` so that the web installer can write the configuration file. After the installation is finished, it is recommended to set permissions to read-only using:
:::note
> `/etc/gitea` is temporarily set with write permissions for user `git` so that the web installer can write the configuration file. After the installation is finished, it is recommended to set permissions to read-only using:
:::
>
> ```sh
> chmod 750 /etc/gitea
@@ -129,7 +134,9 @@ See the [command line documentation](administration/command-line.md) for informa
### Configure Gitea's working directory
**NOTE:** If you plan on running Gitea as a Linux service, you can skip this step, as the service file allows you to set `WorkingDirectory`. Otherwise, consider setting this environment variable (semi-)permanently so that Gitea consistently uses the correct working directory.
:::note
If you plan on running Gitea as a Linux service, you can skip this step, as the service file allows you to set `WorkingDirectory`. Otherwise, consider setting this environment variable (semi-)permanently so that Gitea consistently uses the correct working directory.
:::
```sh
export GITEA_WORK_DIR=/var/lib/gitea/
@@ -185,7 +192,9 @@ To restart your Gitea instance, we recommend to use SIGHUP signal. If you know y
To gracefully stop the Gitea instance, a simple `kill $GITEA_PID` or `killall gitea` is enough.
**NOTE:** We don't recommend to use the SIGKILL signal (`-9`); you may be forcefully stopping some of Gitea's internal tasks, and it will not gracefully stop (tasks in queues, indexers, etc.)
:::note
We don't recommend to use the SIGKILL signal (`-9`); you may be forcefully stopping some of Gitea's internal tasks, and it will not gracefully stop (tasks in queues, indexers, etc.)
:::
See below for troubleshooting instructions to repair broken repositories after
an update of your Gitea version.
+3 -1
View File
@@ -27,9 +27,11 @@ Next, [install Node.js with npm](https://nodejs.org/en/download/) which is
required to build the JavaScript and CSS files. The minimum supported Node.js
version is @minNodeVersion@ and the latest LTS version is recommended.
**Note**: Go version @minGoVersion@ or higher is required. However, it is recommended to
:::note
Go version @minGoVersion@ or higher is required. However, it is recommended to
obtain the same version as our continuous integration, see the advice given in
[Hacking on Gitea](development/hacking-on-gitea.md)
:::
## Download
+1 -1
View File
@@ -46,7 +46,7 @@ Gitea comes with a health check endpoint `/api/healthz`, you can configure it in
a successful health check response will respond with http code `200`, here's example:
```
```json
HTTP/1.1 200 OK
{
+9 -5
View File
@@ -242,8 +242,10 @@ started properly. Logs can be viewed with `docker-compose logs`.
To shut down the setup, execute `docker-compose down`. This will stop
and kill the containers. The volumes will still exist.
Notice: if using a non-3000 port on http, change app.ini to match
:::note
If using a non-3000 port on http, change app.ini to match
`LOCAL_ROOT_URL = http://localhost:3000/`.
:::
## Install
@@ -252,7 +254,7 @@ favorite browser to finalize the installation. Visit http://server-ip:3000 and f
installation wizard. If the database was started with the `docker-compose` setup as
documented above, please note that `db` must be used as the database hostname.
# Customization
## Customization
Customization files described [here](administration/customizing-gitea.md) should
be placed in `/var/lib/gitea/custom` directory. If using host volumes, it's quite easy to access these
@@ -260,13 +262,15 @@ files; for named volumes, this is done through another container or by direct ac
`/var/lib/docker/volumes/gitea_gitea/_/var_lib_gitea`. The configuration file will be saved at
`/etc/gitea/app.ini` after the installation.
# Upgrading
## Upgrading
:::warning
:exclamation::exclamation: **Make sure you have volumed data to somewhere outside Docker container** :exclamation::exclamation:
:::
To upgrade your installation to the latest release:
```
```bash
# Edit `docker-compose.yml` to update the version, if you have one specified
# Pull new images
docker-compose pull
@@ -274,7 +278,7 @@ docker-compose pull
docker-compose up -d
```
# Upgrading from standard image
## Upgrading from standard image
- Backup your setup
- Change volume mountpoint from /data to /var/lib/gitea
+3 -1
View File
@@ -243,8 +243,10 @@ started properly. Logs can be viewed with `docker-compose logs`.
To shut down the setup, execute `docker-compose down`. This will stop
and kill the containers. The volumes will still exist.
Notice: if using a non-3000 port on http, change app.ini to match
:::note
If using a non-3000 port on http, change app.ini to match
`LOCAL_ROOT_URL = http://localhost:3000/`.
:::
## Installation