From 97e9a1d205b47a5c7daaa1ca6d09fe72478b1e8d Mon Sep 17 00:00:00 2001 From: Chris Zerafa Date: Mon, 3 Aug 2026 14:37:49 -0400 Subject: [PATCH] Add edge01 Gitea configuration --- edge01/docker/gitea/.gitignore | 5 ++ edge01/docker/gitea/README.md | 24 ++++++ edge01/docker/gitea/compose.yaml | 50 ++++++++++++ edge01/docker/gitea/config/app.ini.example | 95 ++++++++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 edge01/docker/gitea/.gitignore create mode 100644 edge01/docker/gitea/README.md create mode 100644 edge01/docker/gitea/compose.yaml create mode 100644 edge01/docker/gitea/config/app.ini.example diff --git a/edge01/docker/gitea/.gitignore b/edge01/docker/gitea/.gitignore new file mode 100644 index 0000000..7421bff --- /dev/null +++ b/edge01/docker/gitea/.gitignore @@ -0,0 +1,5 @@ +.env +config/app.ini +data/ +postgres/ +backups/ diff --git a/edge01/docker/gitea/README.md b/edge01/docker/gitea/README.md new file mode 100644 index 0000000..9b3e46b --- /dev/null +++ b/edge01/docker/gitea/README.md @@ -0,0 +1,24 @@ +# Gitea + +## Purpose +Self-hosted Git server for Zerafa infrastructure and projects. + +## URL +https://git.zerafa.com + +## Containers +- gitea +- gitea-postgres + +## Runtime Data +- data/ +- postgres/ + +These directories are intentionally excluded from Git. + +## Configuration +- compose.yaml +- config/app.ini + +## Backup +Protected by nightly Restic backups on edge01. diff --git a/edge01/docker/gitea/compose.yaml b/edge01/docker/gitea/compose.yaml new file mode 100644 index 0000000..ef321ff --- /dev/null +++ b/edge01/docker/gitea/compose.yaml @@ -0,0 +1,50 @@ +services: + postgres: + image: postgres:16-alpine + container_name: gitea-postgres + restart: unless-stopped + env_file: + - .env + volumes: + - ./postgres:/var/lib/postgresql/data + networks: + - gitea-internal + healthcheck: + test: ["CMD-SHELL", "pg_isready -U gitea -d gitea"] + interval: 10s + timeout: 5s + retries: 5 + + gitea: + image: gitea/gitea:latest + container_name: gitea + restart: unless-stopped + ports: + - "2222:22" + depends_on: + postgres: + condition: service_healthy + env_file: + - .env + environment: + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=postgres:5432 + - GITEA__database__NAME=${POSTGRES_DB} + - GITEA__database__USER=${POSTGRES_USER} + - GITEA__database__PASSWD=${POSTGRES_PASSWORD} + - GITEA__server__DOMAIN=git.zerafa.com + - GITEA__server__ROOT_URL=https://git.zerafa.com/ + - GITEA__server__HTTP_PORT=3000 + - GITEA__service__DISABLE_REGISTRATION=true + volumes: + - ./data:/data + networks: + - gitea-internal + - proxy + +networks: + gitea-internal: + internal: true + + proxy: + external: true diff --git a/edge01/docker/gitea/config/app.ini.example b/edge01/docker/gitea/config/app.ini.example new file mode 100644 index 0000000..20037b9 --- /dev/null +++ b/edge01/docker/gitea/config/app.ini.example @@ -0,0 +1,95 @@ +APP_NAME = ZCom Git +RUN_MODE = prod +RUN_USER = git +WORK_PATH = /data/gitea + +[repository] +ROOT = /data/git/repositories + +[repository.local] +LOCAL_COPY_PATH = /data/gitea/tmp/local-repo + +[repository.upload] +TEMP_PATH = /data/gitea/uploads + +[server] +APP_DATA_PATH = /data/gitea +DOMAIN = git.zerafa.com +SSH_DOMAIN = git.zerafa.com +HTTP_PORT = 3000 +ROOT_URL = https://git.zerafa.com/ +DISABLE_SSH = false +SSH_PORT = 2222 +SSH_LISTEN_PORT = 22 +LFS_START_SERVER = true +LFS_JWT_SECRET = REPLACE_ME + +[database] +PATH = /data/gitea/gitea.db +DB_TYPE = postgres +HOST = postgres:5432 +NAME = gitea +USER = gitea +PASSWD = h53AdnR7R7a1NRSsuVmgyhnTlTA3daxnuPcV6gF+Xrg= +LOG_SQL = false +SCHEMA = +SSL_MODE = disable + +[indexer] +ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve + +[session] +PROVIDER_CONFIG = /data/gitea/sessions +PROVIDER = file + +[picture] +AVATAR_UPLOAD_PATH = /data/gitea/avatars +REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars + +[attachment] +PATH = /data/gitea/attachments + +[log] +MODE = console +LEVEL = info +ROOT_PATH = /data/gitea/log + +[security] +INSTALL_LOCK = true +SECRET_KEY = +INTERNAL_TOKEN = REPLACE_ME +PASSWORD_HASH_ALGO = pbkdf2 + +[service] +DISABLE_REGISTRATION = true +REQUIRE_SIGNIN_VIEW = false +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +ALLOW_ONLY_EXTERNAL_REGISTRATION = false +ENABLE_CAPTCHA = false +DEFAULT_KEEP_EMAIL_PRIVATE = false +DEFAULT_ALLOW_CREATE_ORGANIZATION = true +DEFAULT_ENABLE_TIMETRACKING = true +NO_REPLY_ADDRESS = noreply.git.zerafa.com + +[lfs] +PATH = /data/git/lfs + +[mailer] +ENABLED = false + +[openid] +ENABLE_OPENID_SIGNIN = true +ENABLE_OPENID_SIGNUP = false + +[cron.update_checker] +ENABLED = false + +[repository.pull-request] +DEFAULT_MERGE_STYLE = merge + +[repository.signing] +DEFAULT_TRUST_MODEL = committer + +[oauth2] +JWT_SECRET = REPLACE_ME