Set up gitea

This commit is contained in:
2023-06-14 16:06:17 -04:00
parent 4932a8b9be
commit d3a6ae8d3a
6 changed files with 207 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
APP_NAME = Gitea: Git with a cup of tea
RUN_USER = git
[repository]
ROOT = /var/lib/gitea/git/repositories
DEFAULT_BRANCH = master
[server]
SSH_DOMAIN = git.mjwilson.org
ROOT_URL = https://git.mjwilson.org
START_SSH_SERVER = true
SSH_PORT = 2222
LFS_START_SERVER = true
DOMAIN = git.mjwilson.org
OFFLINE_MODE = true
ENABLE_GZIP = true
LANDING_PAGE = explore
LFS_JWT_SECRET = {{ lfs_jwt_secret }}
[database]
DB_TYPE = postgres
HOST = db:5432
NAME = gitea
USER = gitea
PASSWD = gitea
[session]
PROVIDER = db
COOKIE_NAME = gitea_session
[security]
INSTALL_LOCK = true
# For automated deployments, generate secret key by hand. See here: https://docs.gitea.com/next/administration/command-line#generate
SECRET_KEY = {{ secret_key }}
REVERSE_PROXY_TRUSTED_PROXIES = *
INTERNAL_TOKEN = {{ internal_token }}
LOGIN_REMEMBER_DAYS = 30
[service]
DISABLE_REGISTRATION = true
[ui]
SHOW_USER_EMAIL = false
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = true
[mirror]
DEFAULT_INTERVAL = 1h
[federation]
ENABLED = true

View File

@@ -0,0 +1,39 @@
version: "{{ docker_compose_version }}"
networks:
traefik:
external: true
services:
server:
container_name: gitea
image: gitea/gitea:latest-rootless
restart: unless-stopped
networks:
- default
- traefik
user: "{{ service_user.uid }}"
volumes:
- "{{ data_dir }}/gitea/data:/var/lib/gitea"
- "{{ data_dir }}/gitea/config:/etc/gitea"
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- 2222:2222
tmpfs:
- /var/lib/gitea/tmp
labels:
traefik.enable: true
traefik.http.routers.gitea.rule: "Host(`git.{{ personal_domain }}`)"
traefik.http.services.gitea.loadbalancer.server.port: 3000
db:
image: postgres:14
restart: unless-stopped
environment:
POSTGRES_USER: gitea
POSTGRES_PASSWORD: gitea
POSTGRESS_DB: gitea
volumes:
- "{{ data_dir }}/postgres/gitea:/var/lib/postgresql/data"