From ba29719ed102a7569b4da5d7b196d414dbc12b74 Mon Sep 17 00:00:00 2001 From: Simon C Date: Thu, 2 Feb 2023 16:50:59 +0100 Subject: [PATCH 1/3] feat(Traefik): Pilot is deprecated https://traefik.io/blog/announcing-traefik-proxy-2-8/ --- traefik/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/traefik/docker-compose.yml b/traefik/docker-compose.yml index 651a062..f030402 100644 --- a/traefik/docker-compose.yml +++ b/traefik/docker-compose.yml @@ -30,7 +30,6 @@ services: - --log.level=${TRAEFIK_LOG_LEVEL:-INFO} - --global.sendanonymoususage=${TRAEFIK_GLOBAL_SENDANONYMOUSUSAGE:-false} - --global.checknewversion=${TRAEFIK_GLOBAL_CHECKNEWVERSION:-false} - - --pilot.dashboard=${TRAEFIK_PILOT_DASHBOARD:-false} - --metrics.prometheus=${TRAEFIK_METRICS_PROMETHEUS:-true} - --accesslog=${TRAEFIK_ACCESSLOG:-false} -- 2.40.1 From e8a022e7e3f4de32385ff2f7b15b84cb30aa345f Mon Sep 17 00:00:00 2001 From: Simon C Date: Tue, 21 Feb 2023 11:58:06 +0100 Subject: [PATCH 2/3] feat(Gitea): Upgrade to 1.19 and update configuration --- gitea/docker-compose.smtp.yml | 11 +++++++---- gitea/docker-compose.traefik.yml | 12 +++++------- gitea/docker-compose.yml | 20 ++++++++++++-------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/gitea/docker-compose.smtp.yml b/gitea/docker-compose.smtp.yml index fa37a1a..f01131d 100644 --- a/gitea/docker-compose.smtp.yml +++ b/gitea/docker-compose.smtp.yml @@ -4,9 +4,12 @@ services: gitea: environment: - GITEA__mailer__ENABLED=true - - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} - - GITEA__mailer__MAILER_TYPE=smtp - - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} - - GITEA__mailer__IS_TLS_ENABLED=true + - GITEA__mailer__PROTOCOL=${GITEA__mailer__PROTOCOL:-smtp} + - GITEA__mailer__SMTP_ADDR=${GITEA__mailer__SMTP_ADDR:?GITEA__mailer__SMTP_ADDR not set} + - GITEA__mailer__SMTP_PORT=${GITEA__mailer__SMTP_PORT:?GITEA__mailer__SMTP_PORT not set} + - GITEA__mailer__USER=${GITEA__mailer__USER:?GITEA__mailer__USER not set} - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" + + - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} + - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} diff --git a/gitea/docker-compose.traefik.yml b/gitea/docker-compose.traefik.yml index b4b8447..f3a5562 100644 --- a/gitea/docker-compose.traefik.yml +++ b/gitea/docker-compose.traefik.yml @@ -7,10 +7,8 @@ networks: services: gitea: labels: - traefik.enable: 'true' - traefik.docker.network: ${TRAEFIK_NETWORK_NAME:-traefik} - - traefik.http.routers.gitea.rule: 'Host(`${GITEA_DOMAIN:?err}`)' - traefik.http.routers.gitea.entrypoints: 'web' - - traefik.http.services.gitea.loadbalancer.server.port: '3000' + - traefik.enable=true + - traefik.docker.network=${TRAEFIK_NETWORK_NAME:-traefik} + - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-gitea}.rule=Host(`${GITEA_DOMAIN:?err}`) + - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-gitea}.entrypoints=${TRAEFIK_ENTRYPOINTS:-web} + - traefik.http.services.${TRAEFIK_ROUTER_NAME:-gitea}.loadbalancer.server.port=3000 diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml index a2ae51c..67eb748 100644 --- a/gitea/docker-compose.yml +++ b/gitea/docker-compose.yml @@ -7,16 +7,20 @@ volumes: services: gitea: container_name: ${GITEA_CONTAINER_NAME:-gitea} - image: ${GITEA_IMAGE:-gitea/gitea:1.16.5} + image: ${GITEA_IMAGE:-gitea/gitea:1.18.4} restart: always environment: - # - USER_UID=1000 - # - USER_GID=1000 - DB_TYPE: postgres - DB_HOST: ${POSTGRES_CONTAINER_NAME:-postgres}:5432 # Default name is same as ../postgres/docker-compose.yml:8 - DB_NAME: ${POSTGRES_DB} - DB_USER: ${POSTGRES_USER} - DB_PASSWD: ${POSTGRES_PASSWORD} + - USER_UID=${GITEA_UID:-1000} + - USER_GID=${GITEA_GID:-1000} + # Database + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=${POSTGRES_CONTAINER_NAME:-postgres}:5432 + - GITEA__database__NAME=${POSTGRES_DB} + - GITEA__database__USER=${POSTGRES_USER} + - GITEA__database__PASSWD=${POSTGRES_PASSWORD} + # Security + - GITEA__security__SECRET_KEY=${GITEA_SECRET_KEY:-} + - GITEA__security__INTERNAL_TOKEN=${GITEA_INTERNAL_TOKEN:-} volumes: - gitea:/data - /etc/timezone:/etc/timezone:ro -- 2.40.1 From 8f5fcec3a9bf8684eae5fee31f476790f63470cd Mon Sep 17 00:00:00 2001 From: Simon C Date: Tue, 21 Feb 2023 12:44:00 +0100 Subject: [PATCH 3/3] feat(Gitea): Update configuration --- gitea/.env | 36 +++++++++++++++++++++-------------- gitea/docker-compose.smtp.yml | 1 - gitea/docker-compose.yml | 6 ++++-- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/gitea/.env b/gitea/.env index 3db8400..2b34046 100644 --- a/gitea/.env +++ b/gitea/.env @@ -1,26 +1,34 @@ -COMPOSE_FILE=../postgres/docker-compose.yml:./docker-compose.yml:./docker-compose.override.yml +######## +# DOCKER -# APP +SERVICES_DIR=".." +COMPOSE_FILE=${SERVICES_DIR}/gitea/docker-compose.yml:${SERVICES_DIR}/gitea/docker-compose.traefik.yml:${SERVICES_DIR}/gitea/docker-compose.smtp.yml:${SERVICES_DIR}/gitea/docker-compose.metrics.yml:${SERVICES_DIR}/postgres/docker-compose.yml +COMPOSE_PROJECT_NAME=$GITEA_DOMAIN -GITEA_VOLUME_NAME=gitea -GITEA_PROTOCOL=http -GITEA_DOMAIN=gitea.lan - -# APP CONFIG +####### +# GITEA # https://docs.gitea.io/en-us/install-with-docker/#environments-variables -DISABLE_SSH=true -RUN_MODE=prod -ROOT_URL=${GITEA_PROTOCOL}://${GITEA_DOMAIN} -DISABLE_REGISTRATION=true -DISABLE_GRAVATAR=true -#INSTALL_LOCK=true +GITEA_DOMAIN=gitea.lan +GITEA_VOLUME_NAME=gitea +GITEA_IMAGE=gitea/gitea:1.18.4 +GITEA_PROTOCOL=http +GITEA_SECRET_KEY=kt5UdK0m9lI9MDyhVOFEB5jk7VwFynDyaxcUjEJUpWJBrC6FyH4dkUDKLYEa7hGn +GITEA_INTERNAL_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2NzY5NzkxMzZ9.Iopu6DBUhglmNPzEyYylfmTmEUpYLHYEsNrm50GoBkU + +# SMTP + +GITEA__mailer__FROM='"Name" ' +GITEA__mailer__SMTP_ADDR=smtp.gitea.lan +GITEA__mailer__SMTP_PORT=465 +GITEA__mailer__USER=gitea.lan +GITEA__mailer__PASSWD=gitea.lan # DATABASE -# Voir la description ../postgres/README.md POSTGRES_USER=user-example POSTGRES_PASSWORD=password-example POSTGRES_DB=postgres-database-name-example POSTGRES_CONTAINER_NAME=gitea-postgres POSTGRES_VOLUME_NAME=gitea-postgres +POSTGRES_IMAGE=postgres:15.2-alpine diff --git a/gitea/docker-compose.smtp.yml b/gitea/docker-compose.smtp.yml index f01131d..af25854 100644 --- a/gitea/docker-compose.smtp.yml +++ b/gitea/docker-compose.smtp.yml @@ -12,4 +12,3 @@ services: - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} - - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml index 67eb748..f30608b 100644 --- a/gitea/docker-compose.yml +++ b/gitea/docker-compose.yml @@ -19,8 +19,10 @@ services: - GITEA__database__USER=${POSTGRES_USER} - GITEA__database__PASSWD=${POSTGRES_PASSWORD} # Security - - GITEA__security__SECRET_KEY=${GITEA_SECRET_KEY:-} - - GITEA__security__INTERNAL_TOKEN=${GITEA_INTERNAL_TOKEN:-} + # docker run -it --rm gitea/gitea:1 gitea generate secret SECRET_KEY + - GITEA__security__SECRET_KEY=${GITEA_SECRET_KEY} + # docker run -it --rm gitea/gitea:1 gitea generate secret INTERNAL_TOKEN + - GITEA__security__INTERNAL_TOKEN=${GITEA_INTERNAL_TOKEN} volumes: - gitea:/data - /etc/timezone:/etc/timezone:ro -- 2.40.1