From 32e21ddc4fce1248c67747529a9faa0b38e20b94 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Fri, 23 Feb 2024 02:10:59 +0300 Subject: [PATCH] gitea. Migrating to Forgejo. --- README.md | 2 +- {gitea => forgejo}/.env.dist | 10 ++++--- {gitea => forgejo}/data/.gitignore | 0 forgejo/docker-compose.yml | 21 ++++++++++++++ forgejo/docker-compose_embedded_db.yml | 40 ++++++++++++++++++++++++++ {gitea => forgejo}/nginx/gitea.conf | 2 +- gitea/docker-compose.yml | 21 -------------- gitea/docker-compose_embedded_db.yml | 40 -------------------------- 8 files changed, 69 insertions(+), 67 deletions(-) rename {gitea => forgejo}/.env.dist (65%) rename {gitea => forgejo}/data/.gitignore (100%) create mode 100644 forgejo/docker-compose.yml create mode 100644 forgejo/docker-compose_embedded_db.yml rename {gitea => forgejo}/nginx/gitea.conf (99%) delete mode 100644 gitea/docker-compose.yml delete mode 100644 gitea/docker-compose_embedded_db.yml diff --git a/README.md b/README.md index f439f90..7651a2f 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ Not every stack is tested to fully work. | Element-web | ✅ | `vectorim/element-web` | Web Matrix client. | [Website](https://element.io), [Github](https://github.com/vector-im/element-web/) | | emby | ✅ | `emby/embyserver` | Media server with online transcoding support. | [Website](https://emby.media) | | Folding@Home | ✅ | `johnktims/folding-at-home` | Protein folding distributed computing platform. | [Website](https://foldingathome.org), [My guide](https://skobk.in/2020/06/folding-at-home-quick-start/) | +| Forgejo | ✅ | `codeberg.org/forgejo/forgejo` | Lightweight Git hosting platform. | [Website](https://forgejo.org), [Github](https://codeberg.org/forgejo/forgejo) | | Gatus | ✅ | `twinproduction/gatus` | Advanced service(s) status page. | [Website](https://gatus.io), [Github](https://github.com/TwiN/gatus) | -| Gitea | ✅ | `gitea/gitea` | Lightweight Git hosting platfom. | [Website](https://gitea.io/), [Github](https://github.com/go-gitea/gitea) | | Home Assistant | ✅ | `ghcr.io/home-assistant/home-assistant` | Home automation suite. | [Website](https://www.home-assistant.io/), [Github](https://github.com/home-assistant) | | Homer | ✅ | `b4bz/homer` | Server homepage generator. | [Github](https://github.com/bastienwirtz/homer), [Demo](https://homer-demo.netlify.app), [Configuration](https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md) | | I2PD | ✅ | `purplei2p/i2pd` | The Invisible Internet router. | [Website](https://i2pd.website), [Github](https://github.com/PurpleI2P/i2pd/), [I2P project](https://geti2p.net/) | diff --git a/gitea/.env.dist b/forgejo/.env.dist similarity index 65% rename from gitea/.env.dist rename to forgejo/.env.dist index 4cd4956..d7fc857 100644 --- a/gitea/.env.dist +++ b/forgejo/.env.dist @@ -1,7 +1,9 @@ -# see https://docs.gitea.io/en-us/install-with-docker/ +# see https://forgejo.org/docs/latest/admin/installation-docker/ USER_UID=1000 USER_GID=1000 +IMAGE_TAG=1.21 + HOST_DATA_DIR=./data HOST_PG_DATA_DIR=./db HTTP_BIND_ADDR=127.0.0.1 @@ -12,9 +14,9 @@ EXT_SSH_PORT=222 # Leave default for embedded database DB_HOST=db DB_PORT=5432 -DB_NAME=gitea -DB_USER=gitea -DB_PASSWD=gitea +DB_NAME=forgejo +DB_USER=forgejo +DB_PASSWD=forgejo LOG_MAX_SIZE=5m LOG_MAX_FILE=5 diff --git a/gitea/data/.gitignore b/forgejo/data/.gitignore similarity index 100% rename from gitea/data/.gitignore rename to forgejo/data/.gitignore diff --git a/forgejo/docker-compose.yml b/forgejo/docker-compose.yml new file mode 100644 index 0000000..fdd5c04 --- /dev/null +++ b/forgejo/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.7' + +services: + server: + image: "codeberg.org/forgejo/forgejo:${IMAGE_TAG:-1.21}" + container_name: forgejo + restart: unless-stopped + network_mode: host + ports: + - "${HTTP_BIND_ADDR:-127.0.0.1}:${EXT_HTTP_PORT:-3000}:3000" + - "${EXT_SSH_PORT:-222}:22" + volumes: + - "${HOST_DATA_DIR:-./data}:/data" + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + environment: + - "FORGEJO__database__DB_TYPE=postgres" + - "FORGEJO__database__HOST=${DB_HOST:-db}:${DB_PORT:-5432}" + - "FORGEJO__database__NAME=${DB_NAME:-forgejo}" + - "FORGEJO__database__USER=${DB_USER:-forgejo}" + - "FORGEJO__database__PASSWD=${DB_PASSWD:-forgejo}" diff --git a/forgejo/docker-compose_embedded_db.yml b/forgejo/docker-compose_embedded_db.yml new file mode 100644 index 0000000..4f6d6ac --- /dev/null +++ b/forgejo/docker-compose_embedded_db.yml @@ -0,0 +1,40 @@ +version: '3.7' + +networks: + forgejo: + external: false + +services: + server: + image: "codeberg.org/forgejo/forgejo:${IMAGE_TAG:-1.21}" + container_name: forgejo + depends_on: + - db + restart: unless-stopped + networks: + - forgejo + ports: + - "${HTTP_BIND_ADDR:-127.0.0.1}:${EXT_HTTP_PORT:-3000}:3000" + - "${EXT_SSH_PORT:-222}:22" + volumes: + - "${HOST_DATA_DIR:-./data}:/data" + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + environment: + - "FORGEJO__database__DB_TYPE=postgres" + - "FORGEJO__database__HOST=${DB_HOST:-db}:${DB_PORT:-5432}" + - "FORGEJO__database__NAME=${DB_NAME:-forgejo}" + - "FORGEJO__database__USER=${DB_USER:-forgejo}" + - "FORGEJO__database__PASSWD=${DB_PASSWD:-forgejo}" + + db: + image: postgres:13 + restart: unless-stopped + environment: + - "POSTGRES_USER=${DB_USER:-forgejo}" + - "POSTGRES_PASSWORD=${DB_PASSWD:-forgejo}" + - "POSTGRES_DB=${DB_NAME:-forgejo}" + networks: + - forgejo + volumes: + - "${HOST_PG_DATA_DIR:-./db}:/var/lib/postgresql/data" \ No newline at end of file diff --git a/gitea/nginx/gitea.conf b/forgejo/nginx/gitea.conf similarity index 99% rename from gitea/nginx/gitea.conf rename to forgejo/nginx/gitea.conf index 2e628f1..9e896e0 100644 --- a/gitea/nginx/gitea.conf +++ b/forgejo/nginx/gitea.conf @@ -20,4 +20,4 @@ server { # SSL config #include ssl/domain.tld.conf; -} \ No newline at end of file +} diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml deleted file mode 100644 index 88c7938..0000000 --- a/gitea/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: '3.7' - -services: - server: - image: gitea/gitea:latest - container_name: gitea - restart: unless-stopped - network_mode: host - ports: - - "${HTTP_BIND_ADDR:-127.0.0.1}:${EXT_HTTP_PORT:-3000}:3000" - - "${EXT_SSH_PORT:-222}:22" - volumes: - - "${HOST_DATA_DIR:-./data}:/data" - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - environment: - - GITEA__database__DB_TYPE=postgres - - "GITEA__database__HOST=${DB_HOST:-db}:${DB_PORT:-5432}" - - "GITEA__database__NAME=${DB_NAME:-gitea}" - - "GITEA__database__USER=${DB_USER:-gitea}" - - "GITEA__database__PASSWD=${DB_PASSWD:-gitea}" diff --git a/gitea/docker-compose_embedded_db.yml b/gitea/docker-compose_embedded_db.yml deleted file mode 100644 index 676f87c..0000000 --- a/gitea/docker-compose_embedded_db.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '3.7' - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:latest - container_name: gitea - depends_on: - - db - restart: unless-stopped - networks: - - gitea - ports: - - "${HTTP_BIND_ADDR:-127.0.0.1}:${EXT_HTTP_PORT:-3000}:3000" - - "${EXT_SSH_PORT:-222}:22" - volumes: - - "${HOST_DATA_DIR:-./data}:/data" - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - environment: - - GITEA__database__DB_TYPE=postgres - - "GITEA__database__HOST=${DB_HOST:-db}:${DB_PORT:-5432}" - - "GITEA__database__NAME=${DB_NAME:-gitea}" - - "GITEA__database__USER=${DB_USER:-gitea}" - - "GITEA__database__PASSWD=${DB_PASSWD:-gitea}" - - db: - image: postgres:13 - restart: unless-stopped - environment: - - "POSTGRES_USER=${DB_USER:-gitea}" - - "POSTGRES_PASSWORD=${DB_PASSWD:-gitea}" - - "POSTGRES_DB=${DB_NAME:-gitea}" - networks: - - gitea - volumes: - - "${HOST_PG_DATA_DIR:-./db}:/var/lib/postgresql/data" \ No newline at end of file