38 lines
979 B
Markdown
38 lines
979 B
Markdown
# Gitea
|
|
## Prerequisites
|
|
### Set up database
|
|
- Create database called `gitea` in Postgres
|
|
|
|
### Set up non-root user for container
|
|
We are providing a non-root user to the container to limit the attack surface for privilege escalations. In order for this to work in our setup, please make sure to check if you have a user called `gitea` set up
|
|
|
|
1. Check if user `gitea`
|
|
|
|
```
|
|
cat /etc/passwd | grep gitea
|
|
```
|
|
|
|
In case user doesn't exist, please create the user by running
|
|
```
|
|
sudo useradd gitea
|
|
```
|
|
|
|
2. `data` & `config` folder ownership
|
|
Also you need to make sure that the `gitea` owner owns the volumes mounted for docker
|
|
```
|
|
sudo chown -R gitea:gitea data
|
|
sudo chmod 770 data
|
|
|
|
sudo chown -R gitea:gitea config
|
|
sudo chmod 770 config
|
|
```
|
|
|
|
3. Adjust compose.yml
|
|
Within `services > gitea > user`, make sure to replace `gitea` with the UID of the user on your machine
|
|
```
|
|
cat /etc/passwd | grep gitea
|
|
```
|
|
|
|
## Initial setup
|
|
1. `docker compose up -d`
|
|
2. Open IP:8030 and continue set up |