From 384707639213af3381dec03e59590072dc2e3384 Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 29 Jun 2024 18:04:15 -0400 Subject: [PATCH 1/8] feat: adds forgejo service with runners --- templates/compose/forgejo-with-mariadb.yaml | 45 ++++++ templates/compose/forgejo-with-mysql.yaml | 46 +++++++ .../compose/forgejo-with-postgresql.yaml | 44 ++++++ .../compose/forgejo-with-runner-mariadb.yaml | 128 ++++++++++++++++++ .../forgejo-with-runner-with-mysql.yaml | 128 ++++++++++++++++++ .../forgejo-with-runner-with-postgresql.yaml | 127 +++++++++++++++++ templates/compose/forgejo-with-runner.yaml | 105 ++++++++++++++ templates/compose/forgejo.yaml | 22 +++ 8 files changed, 645 insertions(+) create mode 100644 templates/compose/forgejo-with-mariadb.yaml create mode 100644 templates/compose/forgejo-with-mysql.yaml create mode 100644 templates/compose/forgejo-with-postgresql.yaml create mode 100644 templates/compose/forgejo-with-runner-mariadb.yaml create mode 100644 templates/compose/forgejo-with-runner-with-mysql.yaml create mode 100644 templates/compose/forgejo-with-runner-with-postgresql.yaml create mode 100644 templates/compose/forgejo-with-runner.yaml create mode 100644 templates/compose/forgejo.yaml diff --git a/templates/compose/forgejo-with-mariadb.yaml b/templates/compose/forgejo-with-mariadb.yaml new file mode 100644 index 000000000..e1d49515b --- /dev/null +++ b/templates/compose/forgejo-with-mariadb.yaml @@ -0,0 +1,45 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, mariadb +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=mysql + - HOST=mariadb + - NAME=${MYSQL_DATABASE-forgejo} + - USER=$SERVICE_USER_MYSQL + - PASSWD=$SERVICE_PASSWORD_MYSQL + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + depends_on: + mariadb: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + + mariadb: + image: mariadb:11 + volumes: + - forgejo-mariadb-data:/var/lib/mysql + environment: + - MYSQL_USER=${SERVICE_USER_MYSQL} + - MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT} + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 5s + timeout: 20s + retries: 10 diff --git a/templates/compose/forgejo-with-mysql.yaml b/templates/compose/forgejo-with-mysql.yaml new file mode 100644 index 000000000..f46b2c447 --- /dev/null +++ b/templates/compose/forgejo-with-mysql.yaml @@ -0,0 +1,46 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, mysql +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - SERVICE_FQDN_FORGEJO_3000 + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=mysql + - HOST=mysql + - NAME=${MYSQL_DATABASE-forgejo} + - USER=$SERVICE_USER_MYSQL + - PASSWD=$SERVICE_PASSWORD_MYSQL + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + depends_on: + mysql: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + + mysql: + image: mysql:8 + volumes: + - forgejo-mysql-data:/var/lib/mysql + environment: + - MYSQL_USER=${SERVICE_USER_MYSQL} + - MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT} + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"] + interval: 5s + timeout: 20s + retries: 10 diff --git a/templates/compose/forgejo-with-postgresql.yaml b/templates/compose/forgejo-with-postgresql.yaml new file mode 100644 index 000000000..4c39fc1b9 --- /dev/null +++ b/templates/compose/forgejo-with-postgresql.yaml @@ -0,0 +1,44 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, postgresql +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=postgres + - HOST=postgresql + - NAME=${POSTGRESQL_DATABASE-forgejo} + - USER=$SERVICE_USER_POSTGRESQL + - PASSWD=$SERVICE_PASSWORD_POSTGRESQL + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + depends_on: + postgresql: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + + postgresql: + image: postgres:16-alpine + volumes: + - forgejo-postgresql-data:/var/lib/postgresql/data + environment: + - POSTGRES_USER=${SERVICE_USER_POSTGRESQL} + - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL} + - POSTGRES_DB=${POSTGRESQL_DATABASE} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 20s + retries: 10 diff --git a/templates/compose/forgejo-with-runner-mariadb.yaml b/templates/compose/forgejo-with-runner-mariadb.yaml new file mode 100644 index 000000000..1f4b932d1 --- /dev/null +++ b/templates/compose/forgejo-with-runner-mariadb.yaml @@ -0,0 +1,128 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - SERVICE_FQDN_FORGEJO_3000 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=mysql + - HOST=mariadb + - NAME=${MYSQL_DATABASE-forgejo} + - USER=$SERVICE_USER_MYSQL + - PASSWD=$SERVICE_PASSWORD_MYSQL + - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true + - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false + - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + depends_on: + mariadb: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + command: >- + bash -c ' + /bin/s6-svscan /etc/s6 & + sleep 10 ; + su -c "forgejo forgejo-cli actions register --secret ${RUNNER_SHARED_SECRET}" git ; + sleep infinity + ' + + mariadb: + image: mariadb:11 + volumes: + - forgejo-mariadb-data:/var/lib/mysql + environment: + - MYSQL_USER=${SERVICE_USER_MYSQL} + - MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT} + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 5s + timeout: 20s + retries: 10 + + docker-in-docker: + image: docker:dind + hostname: docker + privileged: true + restart: 'unless-stopped' + healthcheck: + disable: true + environment: + DOCKER_TLS_CERTDIR: /certs + DOCKER_HOST: docker-in-docker + volumes: + - forgejo-did-certs:/certs + + runner-register: + image: code.forgejo.org/forgejo/runner:3.5.0 + restart: 'no' + links: + - docker-in-docker + - forgejo + environment: + - DOCKER_HOST=tcp://docker-in-docker:2376 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + volumes: + - forgejo-runner-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + healthcheck: + disable: true + user: 0:0 + command: >- + bash -ec ' + while : ; do + forgejo-runner create-runner-file --connect --instance http://forgejo:3000 --name runner --secret ${RUNNER_SHARED_SECRET} && break ; + sleep 1 ; + done ; + sed -i -e "s|\"labels\": null|\"labels\": [\"docker:docker://node:20-bookworm\", \"ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04\"]|" .runner ; + forgejo-runner generate-config > config.yml ; + sed -i -e "s|network: .*|network: host|" config.yml ; + sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://docker:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ; + sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ; + sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ; + chown -R 1000:1000 /data ; + exit 0 + ' + + runner: + image: code.forgejo.org/forgejo/runner:3.5.0 + links: + - docker-in-docker + - forgejo + depends_on: + docker-in-docker: + condition: service_started + environment: + - DOCKER_HOST=tcp://docker:2376 + - DOCKER_CERT_PATH=/certs/client + - DOCKER_TLS_VERIFY=1 + user: 1000:1000 + volumes: + - forgejo-runner-data:/data + - forgejo-did-certs:/certs + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + restart: 'unless-stopped' + healthcheck: + disable: true + command: >- + bash -c ' + while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done + ' \ No newline at end of file diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml new file mode 100644 index 000000000..0dd87767e --- /dev/null +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -0,0 +1,128 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - SERVICE_FQDN_FORGEJO_3000 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=mysql + - HOST=mysql + - NAME=${MYSQL_DATABASE-forgejo} + - USER=$SERVICE_USER_MYSQL + - PASSWD=$SERVICE_PASSWORD_MYSQL + - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true + - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false + - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + depends_on: + mysql: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + command: >- + bash -c ' + /bin/s6-svscan /etc/s6 & + sleep 10 ; + su -c "forgejo forgejo-cli actions register --secret ${RUNNER_SHARED_SECRET}" git ; + sleep infinity + ' + + mysql: + image: mysql:8 + volumes: + - forgejo-mysql-data:/var/lib/mysql + environment: + - MYSQL_USER=${SERVICE_USER_MYSQL} + - MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT} + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"] + interval: 5s + timeout: 20s + retries: 10 + + docker-in-docker: + image: docker:dind + hostname: docker + privileged: true + restart: 'unless-stopped' + healthcheck: + disable: true + environment: + DOCKER_TLS_CERTDIR: /certs + DOCKER_HOST: docker-in-docker + volumes: + - forgejo-did-certs:/certs + + runner-register: + image: code.forgejo.org/forgejo/runner:3.5.0 + restart: 'no' + links: + - docker-in-docker + - forgejo + environment: + - DOCKER_HOST=tcp://docker-in-docker:2376 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + volumes: + - forgejo-runner-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + healthcheck: + disable: true + user: 0:0 + command: >- + bash -ec ' + while : ; do + forgejo-runner create-runner-file --connect --instance http://forgejo:3000 --name runner --secret ${RUNNER_SHARED_SECRET} && break ; + sleep 1 ; + done ; + sed -i -e "s|\"labels\": null|\"labels\": [\"docker:docker://node:20-bookworm\", \"ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04\"]|" .runner ; + forgejo-runner generate-config > config.yml ; + sed -i -e "s|network: .*|network: host|" config.yml ; + sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://docker:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ; + sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ; + sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ; + chown -R 1000:1000 /data ; + exit 0 + ' + + runner: + image: code.forgejo.org/forgejo/runner:3.5.0 + links: + - docker-in-docker + - forgejo + depends_on: + docker-in-docker: + condition: service_started + environment: + - DOCKER_HOST=tcp://docker:2376 + - DOCKER_CERT_PATH=/certs/client + - DOCKER_TLS_VERIFY=1 + user: 1000:1000 + volumes: + - forgejo-runner-data:/data + - forgejo-did-certs:/certs + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + restart: 'unless-stopped' + healthcheck: + disable: true + command: >- + bash -c ' + while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done + ' \ No newline at end of file diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml new file mode 100644 index 000000000..590ba7617 --- /dev/null +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -0,0 +1,127 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - SERVICE_FQDN_FORGEJO_3000 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=postgres + - HOST=postgresql + - NAME=${POSTGRESQL_DATABASE-forgejo} + - USER=$SERVICE_USER_POSTGRESQL + - PASSWD=$SERVICE_PASSWORD_POSTGRESQL + - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true + - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false + - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + depends_on: + postgresql: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + command: >- + bash -c ' + /bin/s6-svscan /etc/s6 & + sleep 10 ; + su -c "forgejo forgejo-cli actions register --secret ${RUNNER_SHARED_SECRET}" git ; + sleep infinity + ' + + postgresql: + image: postgres:16-alpine + volumes: + - forgejo-postgresql-data:/var/lib/postgresql/data + environment: + - POSTGRES_USER=${SERVICE_USER_POSTGRESQL} + - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL} + - POSTGRES_DB=${POSTGRESQL_DATABASE} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 20s + retries: 10 + + docker-in-docker: + image: docker:dind + hostname: docker + privileged: true + restart: 'unless-stopped' + healthcheck: + disable: true + environment: + DOCKER_TLS_CERTDIR: /certs + DOCKER_HOST: docker-in-docker + volumes: + - forgejo-did-certs:/certs + + runner-register: + image: code.forgejo.org/forgejo/runner:3.5.0 + restart: 'no' + links: + - docker-in-docker + - forgejo + environment: + - DOCKER_HOST=tcp://docker-in-docker:2376 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + volumes: + - forgejo-runner-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + healthcheck: + disable: true + user: 0:0 + command: >- + bash -ec ' + while : ; do + forgejo-runner create-runner-file --connect --instance http://forgejo:3000 --name runner --secret ${RUNNER_SHARED_SECRET} && break ; + sleep 1 ; + done ; + sed -i -e "s|\"labels\": null|\"labels\": [\"docker:docker://node:20-bookworm\", \"ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04\"]|" .runner ; + forgejo-runner generate-config > config.yml ; + sed -i -e "s|network: .*|network: host|" config.yml ; + sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://docker:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ; + sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ; + sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ; + chown -R 1000:1000 /data ; + exit 0 + ' + + runner: + image: code.forgejo.org/forgejo/runner:3.5.0 + links: + - docker-in-docker + - forgejo + depends_on: + docker-in-docker: + condition: service_started + environment: + - DOCKER_HOST=tcp://docker:2376 + - DOCKER_CERT_PATH=/certs/client + - DOCKER_TLS_VERIFY=1 + user: 1000:1000 + volumes: + - forgejo-runner-data:/data + - forgejo-did-certs:/certs + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + restart: 'unless-stopped' + healthcheck: + disable: true + command: >- + bash -c ' + while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done + ' \ No newline at end of file diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml new file mode 100644 index 000000000..ea476efa9 --- /dev/null +++ b/templates/compose/forgejo-with-runner.yaml @@ -0,0 +1,105 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - SERVICE_FQDN_FORGEJO_3000 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - USER_UID=1000 + - USER_GID=1000 + - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true + - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false + - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + ports: + - 22222:22 + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 + command: >- + bash -c ' + /bin/s6-svscan /etc/s6 & + sleep 10 ; + su -c "forgejo forgejo-cli actions register --secret ${RUNNER_SHARED_SECRET}" git ; + sleep infinity + ' + + docker-in-docker: + image: docker:dind + hostname: docker + privileged: true + restart: 'unless-stopped' + healthcheck: + disable: true + environment: + DOCKER_TLS_CERTDIR: /certs + DOCKER_HOST: docker-in-docker + volumes: + - forgejo-did-certs:/certs + + runner-register: + image: code.forgejo.org/forgejo/runner:3.5.0 + restart: 'no' + links: + - docker-in-docker + - forgejo + environment: + - DOCKER_HOST=tcp://docker-in-docker:2376 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + volumes: + - forgejo-runner-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + healthcheck: + disable: true + user: 0:0 + command: >- + bash -ec ' + while : ; do + forgejo-runner create-runner-file --connect --instance http://forgejo:3000 --name runner --secret ${RUNNER_SHARED_SECRET} && break ; + sleep 1 ; + done ; + sed -i -e "s|\"labels\": null|\"labels\": [\"docker:docker://node:20-bookworm\", \"ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04\"]|" .runner ; + forgejo-runner generate-config > config.yml ; + sed -i -e "s|network: .*|network: host|" config.yml ; + sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://docker:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ; + sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ; + sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ; + chown -R 1000:1000 /data ; + exit 0 + ' + + runner: + image: code.forgejo.org/forgejo/runner:3.5.0 + links: + - docker-in-docker + - forgejo + depends_on: + docker-in-docker: + condition: service_started + environment: + - DOCKER_HOST=tcp://docker:2376 + - DOCKER_CERT_PATH=/certs/client + - DOCKER_TLS_VERIFY=1 + user: 1000:1000 + volumes: + - forgejo-runner-data:/data + - forgejo-did-certs:/certs + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + restart: 'unless-stopped' + healthcheck: + disable: true + command: >- + bash -c ' + while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done + ' \ No newline at end of file diff --git a/templates/compose/forgejo.yaml b/templates/compose/forgejo.yaml new file mode 100644 index 000000000..fe633d609 --- /dev/null +++ b/templates/compose/forgejo.yaml @@ -0,0 +1,22 @@ +# documentation: https://forgejo.org/docs +# slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. +# tags: version control, collaboration, code, hosting, lightweight +# logo: svgs/forgejo.svg + +services: + forgejo: + image: codeberg.org/forgejo/forgejo:7 + environment: + - USER_UID=1000 + - USER_GID=1000 + ports: + - 22222:22 + volumes: + - forgejo-data:/data + - forgejo-timezone:/etc/timezone:ro + - forgejo-localtime:/etc/localtime:ro + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 2s + timeout: 10s + retries: 15 \ No newline at end of file From c1612a9e88d67270a8a498feb0b5568eab520def Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 29 Jun 2024 23:12:43 -0400 Subject: [PATCH 2/8] Fixes environment variables --- templates/compose/forgejo-with-mariadb.yaml | 12 +++++++----- templates/compose/forgejo-with-mysql.yaml | 11 ++++++----- templates/compose/forgejo-with-postgresql.yaml | 12 +++++++----- .../compose/forgejo-with-runner-mariadb.yaml | 15 ++++++++------- .../compose/forgejo-with-runner-with-mysql.yaml | 15 ++++++++------- .../forgejo-with-runner-with-postgresql.yaml | 15 ++++++++------- templates/compose/forgejo-with-runner.yaml | 5 +++-- templates/compose/forgejo.yaml | 2 ++ 8 files changed, 49 insertions(+), 38 deletions(-) diff --git a/templates/compose/forgejo-with-mariadb.yaml b/templates/compose/forgejo-with-mariadb.yaml index e1d49515b..6b58b683c 100644 --- a/templates/compose/forgejo-with-mariadb.yaml +++ b/templates/compose/forgejo-with-mariadb.yaml @@ -7,13 +7,15 @@ services: forgejo: image: codeberg.org/forgejo/forgejo:7 environment: + - SERVICE_FQDN_FORGEJO_3000 + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 - - DB_TYPE=mysql - - HOST=mariadb - - NAME=${MYSQL_DATABASE-forgejo} - - USER=$SERVICE_USER_MYSQL - - PASSWD=$SERVICE_PASSWORD_MYSQL + - FORGEJO__database__DB_TYPE=mysql + - FORGEJO__database__HOST=mariadb + - FORGEJO__database__NAME=${MYSQL_DATABASE-forgejo} + - FORGEJO__database__USER=$SERVICE_USER_MYSQL + - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_MYSQL volumes: - forgejo-data:/data - forgejo-timezone:/etc/timezone:ro diff --git a/templates/compose/forgejo-with-mysql.yaml b/templates/compose/forgejo-with-mysql.yaml index f46b2c447..2029ba39f 100644 --- a/templates/compose/forgejo-with-mysql.yaml +++ b/templates/compose/forgejo-with-mysql.yaml @@ -8,13 +8,14 @@ services: image: codeberg.org/forgejo/forgejo:7 environment: - SERVICE_FQDN_FORGEJO_3000 + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 - - DB_TYPE=mysql - - HOST=mysql - - NAME=${MYSQL_DATABASE-forgejo} - - USER=$SERVICE_USER_MYSQL - - PASSWD=$SERVICE_PASSWORD_MYSQL + - FORGEJO__database__DB_TYPE=mysql + - FORGEJO__database__HOST=mysql + - FORGEJO__database__NAME=${MYSQL_DATABASE-forgejo} + - FORGEJO__database__USER=$SERVICE_USER_MYSQL + - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_MYSQL volumes: - forgejo-data:/data - forgejo-timezone:/etc/timezone:ro diff --git a/templates/compose/forgejo-with-postgresql.yaml b/templates/compose/forgejo-with-postgresql.yaml index 4c39fc1b9..4549ab70f 100644 --- a/templates/compose/forgejo-with-postgresql.yaml +++ b/templates/compose/forgejo-with-postgresql.yaml @@ -7,13 +7,15 @@ services: forgejo: image: codeberg.org/forgejo/forgejo:7 environment: + - SERVICE_FQDN_FORGEJO_3000 + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 - - DB_TYPE=postgres - - HOST=postgresql - - NAME=${POSTGRESQL_DATABASE-forgejo} - - USER=$SERVICE_USER_POSTGRESQL - - PASSWD=$SERVICE_PASSWORD_POSTGRESQL + - FORGEJO__database__DB_TYPE=postgres + - FORGEJO__database__HOST=postgresql + - FORGEJO__database__NAME=${POSTGRESQL_DATABASE-forgejo} + - FORGEJO__database__USER=$SERVICE_USER_POSTGRESQL + - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_POSTGRESQL volumes: - forgejo-data:/data - forgejo-timezone:/etc/timezone:ro diff --git a/templates/compose/forgejo-with-runner-mariadb.yaml b/templates/compose/forgejo-with-runner-mariadb.yaml index 1f4b932d1..973d5e900 100644 --- a/templates/compose/forgejo-with-runner-mariadb.yaml +++ b/templates/compose/forgejo-with-runner-mariadb.yaml @@ -1,6 +1,6 @@ # documentation: https://forgejo.org/docs # slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. -# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# tags: version control, collaboration, code, hosting, lightweight, runner, mariadb, actions, cicd, ci # logo: svgs/forgejo.svg services: @@ -8,14 +8,15 @@ services: image: codeberg.org/forgejo/forgejo:7 environment: - SERVICE_FQDN_FORGEJO_3000 - - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 - - DB_TYPE=mysql - - HOST=mariadb - - NAME=${MYSQL_DATABASE-forgejo} - - USER=$SERVICE_USER_MYSQL - - PASSWD=$SERVICE_PASSWORD_MYSQL + - FORGEJO__database__DB_TYPE=mysql + - FORGEJO__database__HOST=mariadb + - FORGEJO__database__NAME=${MYSQL_DATABASE-forgejo} + - FORGEJO__database__USER=$SERVICE_USER_MYSQL + - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_MYSQL + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET-0000000000000000000000000000000000000000} - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml index 0dd87767e..3d0cae916 100644 --- a/templates/compose/forgejo-with-runner-with-mysql.yaml +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -1,6 +1,6 @@ # documentation: https://forgejo.org/docs # slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. -# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# tags: version control, collaboration, code, hosting, lightweight, runner, mysql, actions, cicd, ci # logo: svgs/forgejo.svg services: @@ -8,14 +8,15 @@ services: image: codeberg.org/forgejo/forgejo:7 environment: - SERVICE_FQDN_FORGEJO_3000 - - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 - - DB_TYPE=mysql - - HOST=mysql - - NAME=${MYSQL_DATABASE-forgejo} - - USER=$SERVICE_USER_MYSQL - - PASSWD=$SERVICE_PASSWORD_MYSQL + - FORGEJO__database__DB_TYPE=mysql + - FORGEJO__database__HOST=mysql + - FORGEJO__database__NAME=${MYSQL_DATABASE-forgejo} + - FORGEJO__database__USER=$SERVICE_USER_MYSQL + - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_MYSQL + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET-0000000000000000000000000000000000000000} - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml index 590ba7617..040626f9f 100644 --- a/templates/compose/forgejo-with-runner-with-postgresql.yaml +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -1,6 +1,6 @@ # documentation: https://forgejo.org/docs # slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. -# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# tags: version control, collaboration, code, hosting, lightweight, runner, postresql, actions, cicd, ci # logo: svgs/forgejo.svg services: @@ -8,14 +8,15 @@ services: image: codeberg.org/forgejo/forgejo:7 environment: - SERVICE_FQDN_FORGEJO_3000 - - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 - - DB_TYPE=postgres - - HOST=postgresql - - NAME=${POSTGRESQL_DATABASE-forgejo} - - USER=$SERVICE_USER_POSTGRESQL - - PASSWD=$SERVICE_PASSWORD_POSTGRESQL + - FORGEJO__database__DB_TYPE=postgres + - FORGEJO__database__HOST=postgresql + - FORGEJO__database__NAME=${POSTGRESQL_DATABASE-forgejo} + - FORGEJO__database__USER=$SERVICE_USER_POSTGRESQL + - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_POSTGRESQL + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET-0000000000000000000000000000000000000000} - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml index ea476efa9..e375279be 100644 --- a/templates/compose/forgejo-with-runner.yaml +++ b/templates/compose/forgejo-with-runner.yaml @@ -1,6 +1,6 @@ # documentation: https://forgejo.org/docs # slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job. -# tags: version control, collaboration, code, hosting, lightweight, runner, actions +# tags: version control, collaboration, code, hosting, lightweight, runner, actions, cicd, ci # logo: svgs/forgejo.svg services: @@ -8,9 +8,10 @@ services: image: codeberg.org/forgejo/forgejo:7 environment: - SERVICE_FQDN_FORGEJO_3000 - - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET} + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 + - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET-0000000000000000000000000000000000000000} - FORGEJO__repository__ENABLE_PUSH_CREATE_USER=true - FORGEJO__repository__DEFAULT_PUSH_CREATE_PRIVATE=false - FORGEJO__repository__DEFAULT_REPO_UNITS=repo.code,repo.actions diff --git a/templates/compose/forgejo.yaml b/templates/compose/forgejo.yaml index fe633d609..3f13f1323 100644 --- a/templates/compose/forgejo.yaml +++ b/templates/compose/forgejo.yaml @@ -7,6 +7,8 @@ services: forgejo: image: codeberg.org/forgejo/forgejo:7 environment: + - SERVICE_FQDN_FORGEJO_3000 + - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} - USER_UID=1000 - USER_GID=1000 ports: From 204aaf5dfa10935ebd699040de4ac52d56e333ca Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 29 Jun 2024 23:13:45 -0400 Subject: [PATCH 3/8] Fixes file name --- ...-runner-mariadb.yaml => forgejo-with-runner-with-mariadb.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename templates/compose/{forgejo-with-runner-mariadb.yaml => forgejo-with-runner-with-mariadb.yaml} (100%) diff --git a/templates/compose/forgejo-with-runner-mariadb.yaml b/templates/compose/forgejo-with-runner-with-mariadb.yaml similarity index 100% rename from templates/compose/forgejo-with-runner-mariadb.yaml rename to templates/compose/forgejo-with-runner-with-mariadb.yaml From 807304c50b395dff677ca0a37ecfbff63e1f7338 Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 29 Jun 2024 23:29:46 -0400 Subject: [PATCH 4/8] Adds healthcheck for DID --- templates/compose/forgejo-with-runner-with-mariadb.yaml | 5 ++++- templates/compose/forgejo-with-runner-with-mysql.yaml | 5 ++++- templates/compose/forgejo-with-runner-with-postgresql.yaml | 5 ++++- templates/compose/forgejo-with-runner.yaml | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/templates/compose/forgejo-with-runner-with-mariadb.yaml b/templates/compose/forgejo-with-runner-with-mariadb.yaml index 973d5e900..805aa0d9f 100644 --- a/templates/compose/forgejo-with-runner-with-mariadb.yaml +++ b/templates/compose/forgejo-with-runner-with-mariadb.yaml @@ -63,7 +63,10 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + interval: 10s + timeout: 30s + retries: 10 environment: DOCKER_TLS_CERTDIR: /certs DOCKER_HOST: docker-in-docker diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml index 3d0cae916..9487694af 100644 --- a/templates/compose/forgejo-with-runner-with-mysql.yaml +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -63,7 +63,10 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + interval: 10s + timeout: 30s + retries: 10 environment: DOCKER_TLS_CERTDIR: /certs DOCKER_HOST: docker-in-docker diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml index 040626f9f..bac4a4681 100644 --- a/templates/compose/forgejo-with-runner-with-postgresql.yaml +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -62,7 +62,10 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + interval: 10s + timeout: 30s + retries: 10 environment: DOCKER_TLS_CERTDIR: /certs DOCKER_HOST: docker-in-docker diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml index e375279be..7865e8fa4 100644 --- a/templates/compose/forgejo-with-runner.yaml +++ b/templates/compose/forgejo-with-runner.yaml @@ -40,7 +40,10 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + interval: 10s + timeout: 30s + retries: 10 environment: DOCKER_TLS_CERTDIR: /certs DOCKER_HOST: docker-in-docker From 793f91e7fb1fa265c2042ed120749122c7d9b810 Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 29 Jun 2024 23:42:26 -0400 Subject: [PATCH 5/8] Adds healthcheck for runner --- templates/compose/forgejo-with-runner-with-mariadb.yaml | 5 ++++- templates/compose/forgejo-with-runner-with-mysql.yaml | 5 ++++- templates/compose/forgejo-with-runner-with-postgresql.yaml | 5 ++++- templates/compose/forgejo-with-runner.yaml | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/templates/compose/forgejo-with-runner-with-mariadb.yaml b/templates/compose/forgejo-with-runner-with-mariadb.yaml index 805aa0d9f..b137c9382 100644 --- a/templates/compose/forgejo-with-runner-with-mariadb.yaml +++ b/templates/compose/forgejo-with-runner-with-mariadb.yaml @@ -125,7 +125,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml index 9487694af..21c62c06d 100644 --- a/templates/compose/forgejo-with-runner-with-mysql.yaml +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -125,7 +125,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml index bac4a4681..486c7a462 100644 --- a/templates/compose/forgejo-with-runner-with-postgresql.yaml +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -124,7 +124,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml index 7865e8fa4..2e526cbde 100644 --- a/templates/compose/forgejo-with-runner.yaml +++ b/templates/compose/forgejo-with-runner.yaml @@ -102,7 +102,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done From ea81d8ecfe811d31c6b914031e0d8d0c713e218f Mon Sep 17 00:00:00 2001 From: Italo Date: Thu, 4 Jul 2024 19:46:35 -0400 Subject: [PATCH 6/8] Adds external migration configuration --- templates/compose/forgejo-with-mariadb.yaml | 2 ++ templates/compose/forgejo-with-mysql.yaml | 2 ++ templates/compose/forgejo-with-postgresql.yaml | 2 ++ templates/compose/forgejo-with-runner-with-mariadb.yaml | 2 ++ templates/compose/forgejo-with-runner-with-mysql.yaml | 2 ++ templates/compose/forgejo-with-runner-with-postgresql.yaml | 2 ++ templates/compose/forgejo-with-runner.yaml | 2 ++ templates/compose/forgejo.yaml | 2 ++ 8 files changed, 16 insertions(+) diff --git a/templates/compose/forgejo-with-mariadb.yaml b/templates/compose/forgejo-with-mariadb.yaml index 6b58b683c..92e7843f1 100644 --- a/templates/compose/forgejo-with-mariadb.yaml +++ b/templates/compose/forgejo-with-mariadb.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - FORGEJO__database__DB_TYPE=mysql diff --git a/templates/compose/forgejo-with-mysql.yaml b/templates/compose/forgejo-with-mysql.yaml index 2029ba39f..9b2359c08 100644 --- a/templates/compose/forgejo-with-mysql.yaml +++ b/templates/compose/forgejo-with-mysql.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - FORGEJO__database__DB_TYPE=mysql diff --git a/templates/compose/forgejo-with-postgresql.yaml b/templates/compose/forgejo-with-postgresql.yaml index 4549ab70f..2a7596074 100644 --- a/templates/compose/forgejo-with-postgresql.yaml +++ b/templates/compose/forgejo-with-postgresql.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - FORGEJO__database__DB_TYPE=postgres diff --git a/templates/compose/forgejo-with-runner-with-mariadb.yaml b/templates/compose/forgejo-with-runner-with-mariadb.yaml index b137c9382..372da3866 100644 --- a/templates/compose/forgejo-with-runner-with-mariadb.yaml +++ b/templates/compose/forgejo-with-runner-with-mariadb.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - FORGEJO__database__DB_TYPE=mysql diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml index 21c62c06d..c7abc3193 100644 --- a/templates/compose/forgejo-with-runner-with-mysql.yaml +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - FORGEJO__database__DB_TYPE=mysql diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml index 486c7a462..16c9278ff 100644 --- a/templates/compose/forgejo-with-runner-with-postgresql.yaml +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - FORGEJO__database__DB_TYPE=postgres diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml index 2e526cbde..9e54fdda0 100644 --- a/templates/compose/forgejo-with-runner.yaml +++ b/templates/compose/forgejo-with-runner.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 - RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET-0000000000000000000000000000000000000000} diff --git a/templates/compose/forgejo.yaml b/templates/compose/forgejo.yaml index 3f13f1323..bb6846679 100644 --- a/templates/compose/forgejo.yaml +++ b/templates/compose/forgejo.yaml @@ -9,6 +9,8 @@ services: environment: - SERVICE_FQDN_FORGEJO_3000 - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO} + - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS} + - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false} - USER_UID=1000 - USER_GID=1000 ports: From e1a585c1941b74573ba6ef4a3be6918d2c819382 Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 13 Jul 2024 23:32:34 -0400 Subject: [PATCH 7/8] Healtcheck done to the process name --- templates/compose/forgejo-with-runner-with-mariadb.yaml | 2 +- templates/compose/forgejo-with-runner-with-mysql.yaml | 2 +- templates/compose/forgejo-with-runner-with-postgresql.yaml | 2 +- templates/compose/forgejo-with-runner.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/compose/forgejo-with-runner-with-mariadb.yaml b/templates/compose/forgejo-with-runner-with-mariadb.yaml index 372da3866..a751ee284 100644 --- a/templates/compose/forgejo-with-runner-with-mariadb.yaml +++ b/templates/compose/forgejo-with-runner-with-mariadb.yaml @@ -65,7 +65,7 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + test: ["CMD", "pgrep", "dockerd"] interval: 10s timeout: 30s retries: 10 diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml index c7abc3193..ccc33644f 100644 --- a/templates/compose/forgejo-with-runner-with-mysql.yaml +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -65,7 +65,7 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + test: ["CMD", "pgrep", "dockerd"] interval: 10s timeout: 30s retries: 10 diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml index 16c9278ff..0b4dcd3fe 100644 --- a/templates/compose/forgejo-with-runner-with-postgresql.yaml +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -64,7 +64,7 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + test: ["CMD", "pgrep", "dockerd"] interval: 10s timeout: 30s retries: 10 diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml index 9e54fdda0..abcaa6e7e 100644 --- a/templates/compose/forgejo-with-runner.yaml +++ b/templates/compose/forgejo-with-runner.yaml @@ -42,7 +42,7 @@ services: privileged: true restart: 'unless-stopped' healthcheck: - test: ["CMD", "nc", "-z", "127.0.0.1", "2376"] + test: ["CMD", "pgrep", "dockerd"] interval: 10s timeout: 30s retries: 10 From 633c8253ec1cd8ea51a0d1b18992ec3017aee149 Mon Sep 17 00:00:00 2001 From: Italo Date: Wed, 17 Jul 2024 14:53:45 -0400 Subject: [PATCH 8/8] Adds missing forgejo logo svg --- public/svgs/forgejo.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 public/svgs/forgejo.svg diff --git a/public/svgs/forgejo.svg b/public/svgs/forgejo.svg new file mode 100644 index 000000000..804b05e28 --- /dev/null +++ b/public/svgs/forgejo.svg @@ -0,0 +1 @@ + \ No newline at end of file