Gitea
cd /home/myusername/docker
mkdir -p gitea/data/gitea/public/assets/css && cd gitea && mkdir actrunner && cd "$_" && touch act-config.yml && cd ..
nano docker-compose.yml
services:
db:
image: postgres:latest
container_name: gitea-postgresql
restart: unless-stopped
environment:
POSTGRES_DB: gitea
POSTGRES_USER: gitea
POSTGRES_PASSWORD: gitea!
volumes:
- ./db:/var/lib/postgresql/data
gitea:
image: gitea/gitea:latest
container_name: gitea
restart: unless-stopped
environment:
USER_UID: 1000
USER_GID: 1000
GITEA__database__DB_TYPE: postgres
GITEA__database__HOST: db
GITEA__database__NAME: gitea
GITEA__database__USER: gitea
GITEA__database__PASSWD: gitea!
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- 8223:3000
- 8224:22 # Optional for SSH Access
depends_on:
- db
actrunner:
image: gitea/act_runner:latest
container_name: gitea-act-runner
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./actrunner/data:/data
- ./actrunner/act-config.yml:/act-config.yml
environment:
GITEA_RUNNER_NAME: gitea-act-runner
GITEA_INSTANCE_URL: http://localhost:8223
GITEA_RUNNER_REGISTRATION_TOKEN: insert_registration_token_here
docker compose up -d
actrunner registration token
-
Go to:
Site Administration -> Actions -> Runners -
Click on:
Create new Runner -
Copy and paste the REGISTRATION TOKEN into docker-compose.yml at actrunner replace the insert_registration_token_here
docker compose up -d
Configure themes
cd /home/myusername/docker/gitea/conf
nano app.ini
Insert the following lines at the bottom:
[ui]
THEMES = github, my-custom-theme
DEFAULT_THEME = github
Download the following theme file:
Upload the file to:
cd /home/myusername/docker/gitea/public/assets/css
Custom Gitea homepage
cd /home/myusername/docker/gitea/data/gitea
mkdir templates && cd "$_"
Download and Import the following files into the templates folder
Custom Gitea Login/Register page
cd /home/myusername/docker/gitea/data/gitea/public/assets/css
Download and Import the following css file into the css folder
cd /home/myusername/docker/gitea/data/gitea/templates
mkdir -p user/auth && cd "$_"
Download and Import the following files into the auth folder
link_account.tmpl
signup.tmpl
signin.tmpl
Custom login auth flow background
-
Go to:
Admin interface -> Flows & Stages -> Flows -
Edit
default-authentication-flow -
Click on
Appearance settingsand upload a custom Background image
Configure mail server (optional)
cd /home/myusername/docker/gitea/data/gitea/conf
nano app.ini
[mailer]
ENABLED = true
FROM = [email protected]
MAILER_TYPE = smtp
SMTP_ADDR = mail.DOMAIN.COM
SMTP_PORT = 587
IS_TLS_ENABLED = false
USER = [email protected]
PASSWD = REPLACE_WITH_YOUR_EMAIL_PASSWORD
Configure Gitea with Authentik
- Go to: Admin interface > Applications > Providers
- Click on: Create
- Select: OAuth2/OpenID Provider then click Next
- Insert the following settings then click on Finish:
- Name: Gitea
- Authentication flow: default-authentication-flow (Welcome to authentik!)
- Authorization flow: default-provider-authorization-explicit-consent (Authorize Application)
Make sure to save the Client ID and Client Secret because you need it later
- Go to: Admin interface > Applications > Applications
- Click on: Create
- Insert the following settings then click on Create:
- Name: Gitea
- Slug: gitea
- Provider: Gitea
- Choose a app icon in: UI settings > Icon
- Go to: Admin interface > Applications > Providers
- Click on Gitea
Make sure to save the OpenID Configuration URL because you need it later
Setup inside gitea
- Go to:
Site Administration > Identity & Access > Authentication Sources - Click on
Add Authentication Source - Insert the following settings then click on
Add Authentication Source
- Authentication Type:
OAuth2 - Authentication Name:
Authentik - OAuth2 Provider:
OpenID Connect - Client Id >
PASTE_THE_CLIENT_ID_YOU_SAVED - Client Secret >
PASTE_THE_CLIENT_SECRET_YOU_SAVED - Icon URL:
https://authentik.DOMAIN.COM/static/dist/assets/icons/icon.svg - OpenID Connect Auto Discovery URL:
PASTE_THE_OPENID_CONFIGURATION_URL_YOU_SAVED - Additional Scopes:
email profile