blog/content/docs/server/services/gitea.md

107 lines
1.9 KiB
Markdown
Raw Normal View History

2023-02-04 18:56:06 +01:00
---
title: "Gitea"
weight: 1
# bookFlatSection: false
# bookToc: true
# bookHidden: false
# bookCollapseSection: false
# bookComments: false
# bookSearchExclude: false
---
# Gitea
## Installation
Install `gitea` package.
## Configuration
Configuration takes place in `/etc/gitea/app.ini`. Examples are provided at
`/etc/gitea/app.example.ini`.
### Server
Server configuration.
```
[server]
PROTOCOL = unix
DOMAIN = git.edgarpierre.fr
ROOT_URL = https://git.edgarpierre.fr/
STATIC_URL_PREFIX =
HTTP_ADDR = /run/gitea/gitea.socket
SSH_PORT = ***
OFFLINE_MODE = true
ENABLE_GZIP = true
ALLOW_GRACEFUL_RESTARTS = true
```
#### LFS
```
LFS_START_SERVER = true
LFS_JWT_SECRET =
```
### Database
Create user and database for `gitea` using postgres.
To use a unix socket connection to postgres, configuration should be :
```
[database]
DB_TYPE = postgres
HOST = /run/postgresql/
NAME = gitea
USER = gitea
```
### Security
```
[security]
INSTALL_LOCK = true
SECRET_KEY = ***
INTERNAL_TOKEN = ***
REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
```
```
[oauth2]
ENABLE = false
```
```
[service]
DISABLE_REGISTRATION = true
```
### Logs
```
[log]
ROOT_PATH = /var/log/gitea
```
### Repositories
```
[repository]
ROOT = /var/lib/gitea/repos
DEFAULT_BRANCH = main
```
### Email
```
[mailer]
ENABLED = true
SUBJECT_PREFIX = [Gitea]
HOST = edgarpierre.fr:465
FROM = gitea@edgarpierre.fr
USER = gitea
PASSWD = ***
SEND_AS_PLAIN_TEXT = true
MAILER_TYPE = smtp
```
### Webhooks
```
[webhook]
ALLOWED_HOST_LIST = loopback,edgarpierre.fr,*.edgarpierre.fr
```
## Service
Gitea is started using systemd service `gitea.service`.