Compare commits

...

26 Commits

Author SHA1 Message Date
6643761eff fix backup label 2024-04-30 15:15:49 +02:00
2fe008de5a update forgejo to 1.20.1-0-rootless 2024-04-29 16:12:15 +02:00
3915bf7493 add backup label 2024-04-29 15:03:49 +02:00
3wc
46bb242fe7 chore: publish 2.3.0+1.20.1-rootless release
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-25 12:50:30 +01:00
f9249f1284 chore: publish 2.2.0+1.19.3-rootless release
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-06 17:31:14 +02:00
9fe02cb19f reduce logging verbosity 2023-06-06 16:19:52 +02:00
1e612d84a2 Merge pull request 'Updated images for MariaDB/Gitea and Postgres to latest stable or LTS' (#31) from javielico/gitea:master into master
All checks were successful
continuous-integration/drone/tag Build is passing
Reviewed-on: #31
2023-05-18 10:36:25 +00:00
77dd223f94 Added commit message warning about Pgsql upgrade 2023-05-09 20:31:17 +01:00
d5577a0f75 Mariadb to stable lts 10.11.2 2023-05-08 21:03:09 +01:00
8f5587099d Postgres up to 15.2 2023-05-08 21:01:16 +01:00
d56a1474fe Gitea up to latest stable 1.19.3 2023-05-08 20:58:58 +01:00
dc3f54d5ea Merge pull request 'master' (#1) from coop-cloud/gitea:master into master
Reviewed-on: javielico/gitea#1
2023-05-08 19:47:16 +00:00
8b466acf66 chore: publish 2.1.0+1.18.5-rootless release 2023-03-15 13:18:39 -07:00
3wc
9cf26a0154 Switch to thecoopcloud/stack-ssh-deploy 2023-01-20 23:31:14 -08:00
3wc
a04fe41c1b Specify mariadb for tests 2023-01-20 22:38:13 -08:00
3wc
63118ecbd8 Fix CI by adding networks: [mass update] 2023-01-20 22:32:13 -08:00
3wc
cd0fff667a Automatically generate catalogue on release [mass update]
Re: coop-cloud/recipes-catalogue-json#4
2023-01-20 22:32:13 -08:00
9413c79e8f chore: publish 2.0.1+1.18.2-rootless release 2023-01-20 11:00:24 +01:00
7d7761dec6 feat: add forgejo overwrite
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-20 10:55:04 +01:00
936fb940cb Revert "fix: drop db_password from main compose def"
This reverts commit 89400089ec.

db_password secret is still needed in app service to set the db
secret in app.ini.tmpl
2023-01-20 10:50:35 +01:00
3wc
e2cd36873c Update abra syntax in examples (finally) [mass update] 2023-01-19 16:27:03 -08:00
89400089ec fix: drop db_password from main compose def
Now available in mariadb/postgresql compose files.
2023-01-17 10:45:19 +01:00
1ea412525f chore: publish 2.0.0+1.18.0-rootless release 2023-01-09 17:02:07 +01:00
910dac0c1b add: postgresdb alternative 2023-01-09 16:54:54 +01:00
3wc
f7ee9b63c4 Add optional CORS headers 2023-01-08 19:12:53 -08:00
3wc
a1dde38834 Switch to <recipe>.example.com 2022-11-24 10:53:27 -08:00
10 changed files with 135 additions and 39 deletions

View File

@ -3,14 +3,17 @@ kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: decentral1se/stack-ssh-deploy:latest
image: thecoopcloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: gitea
networks:
- proxy
generate_secrets: true
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
compose: "compose.yml:compose.mariadb.yml"
environment:
APP_INI_VERSION: v1
DOCKER_SETUP_SH_VERSION: v1
@ -37,11 +40,17 @@ trigger:
- master
---
kind: pipeline
name: recipe release
name: generate recipe catalogue
steps:
- name: release a new version
image: thecoopcloud/drone-abra:latest
image: plugins/downstream
settings:
command: recipe gitea release
deploy_key:
from_secret: abra_bot_deploy_key
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -1,7 +1,13 @@
TYPE=gitea
DOMAIN={{ .Domain }}
DOMAIN=gitea.example.com
LETS_ENCRYPT_ENV=production
COMPOSE_FILE="compose.yml"
COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
# COMPOSE_FILE="$COMPOSE_FILE:compose.postgres.yml"
# Enable to use forgejo instead of gitea
# COMPOSE_FILE="$COMPOSE_FILE:compose.forgejo.yml"
GITEA_DOMAIN=git.example.com
GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION=true
@ -27,7 +33,7 @@ SECRET_JWT_SECRET_VERSION=v1 # length=43
SECRET_SECRET_KEY_VERSION=v1 # length=64
# SMTP Mailer
# COMPOSE_FILE="compose.yml:compose.smtp.yml"
# COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml"
# GITEA_SMTP_MAILER_ENABLED=1
# GITEA_MAILER_HOST=mail.gandi.net:465
# SECRET_SMTP_PASSWORD_VERSION=v1

View File

@ -19,9 +19,9 @@
2. Deploy [`coop-cloud/traefik`][cc-traefik]
3. `abra app new gitea --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass`)
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
5. `abra app deploy YOURAPPDOMAIN`
## Create first user

View File

@ -71,3 +71,10 @@ ENABLED = true
FILE_EXTENSIONS = .rst
RENDER_COMMAND = rst2html
IS_INPUT_FILE = false
[log]
MODE=console
LEVEL=WARN
STACKTRACE_LEVEL=None
ENABLE_ACCESS_LOG=false
ENABLE_XORM_LOG=false

5
compose.forgejo.yml Normal file
View File

@ -0,0 +1,5 @@
version: '3.8'
services:
app:
image: codeberg.org/forgejo/forgejo:1.20.1-0-rootless

43
compose.mariadb.yml Normal file
View File

@ -0,0 +1,43 @@
version: '3.8'
services:
app:
environment:
- GITEA_DB_TYPE=mysql
- GITEA_DB_HOST="db:3306"
- GITEA_DB_NAME=gitea
- GITEA_DB_USER=gitea
db:
image: "mariadb:10.11.2"
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: 'mysqldump --single-transaction -u root -p"$$(cat /run/secrets/db_root_password)" gitea > /var/lib/mysql/backup.sql'
backupbot.backup.post-hook: "rm -rf /var/lib/mysql/backup.sql"
backupbot.backup.path: "/var/lib/mysql/backup.sql"
command: |
mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
- MYSQL_DATABASE=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
secrets:
- db_password
- db_root_password
volumes:
- "mariadb:/var/lib/mysql"
networks:
- internal
secrets:
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
db_root_password:
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
external: true
volumes:
mariadb:
internal:

36
compose.postgres.yml Normal file
View File

@ -0,0 +1,36 @@
version: '3.8'
services:
app:
environment:
- GITEA_DB_TYPE=postgres
- GITEA_DB_HOST="db:5432"
- GITEA_DB_NAME=gitea
- GITEA_DB_USER=gitea
db:
image: postgres:15.3
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
backupbot.backup.post-hook: "rm -r /var/lib/postgresql/data/backup.sql"
backupbot.backup.path: "/var/lib/postgresql/data"
environment:
- POSTGRES_DB=gitea
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
secrets:
- db_password
volumes:
- db:/var/lib/postgresql/data
networks:
- internal
secrets:
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
volumes:
db:
internal:

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: "gitea/gitea:1.17.3-rootless"
image: "gitea/gitea:1.20.1-rootless"
configs:
- source: app_ini
target: /etc/gitea/app.ini
@ -19,10 +19,6 @@ services:
- GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION
- GITEA_APP_NAME
- GITEA_AUTO_WATCH_NEW_REPOS
- GITEA_DB_HOST="db:3306"
- GITEA_DB_NAME=gitea
- GITEA_DB_TYPE=mysql
- GITEA_DB_USER=gitea
- GITEA_DISABLE_REGISTRATION
- GITEA_DOMAIN=${DOMAIN}
- GITEA_ENABLE_NOTIFY_MAIL
@ -38,6 +34,7 @@ services:
- GITEA_UPDATE_AVATAR
- GITEA_ACCOUNT_LINKING
- GITEA_OAUTH2_CLIENT_ENABLED
- GITEA_CORS_ALLOW_DOMAIN
volumes:
- data:/var/lib/gitea
- config:/etc/gitea
@ -51,6 +48,7 @@ services:
failure_action: rollback
order: start-first
labels:
- "backupbot.backup=true"
- "traefik.enable=true"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
@ -59,24 +57,13 @@ services:
- "traefik.tcp.routers.${STACK_NAME}-ssh.rule=HostSNI(`*`)"
- "traefik.tcp.routers.${STACK_NAME}-ssh.entrypoints=gitea-ssh"
- "traefik.tcp.services.${STACK_NAME}-ssh.loadbalancer.server.port=${GITEA_SSH_PORT}"
- coop-cloud.${STACK_NAME}.version=1.3.1+1.17.3-rootless
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}_cors"
- "traefik.http.middlewares.${STACK_NAME}_cors.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
- "traefik.http.middlewares.${STACK_NAME}_cors.headers.accesscontrolalloworiginlist=https://${GITEA_CORS_ALLOW_DOMAIN}"
- "traefik.http.middlewares.${STACK_NAME}_cors.headers.accesscontrolmaxage=100"
- "traefik.http.middlewares.${STACK_NAME}_cors.headers.addvaryheader=true"
- coop-cloud.${STACK_NAME}.version=2.3.0+1.20.1-rootless
db:
image: "mariadb:10.9"
command: |
mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
- MYSQL_DATABASE=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
secrets:
- db_password
- db_root_password
volumes:
- "mariadb:/var/lib/mysql"
networks:
- internal
networks:
internal:
@ -94,12 +81,6 @@ configs:
template_driver: golang
secrets:
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
db_root_password:
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
external: true
internal_token:
name: ${STACK_NAME}_internal_token_${SECRET_INTERNAL_TOKEN_VERSION}
external: true
@ -113,4 +94,3 @@ secrets:
volumes:
data:
config:
mariadb:

View File

@ -0,0 +1,8 @@
This release adds the possibility to run gitea with postgres.
Please add the following lines to your servers .env file!
```
COMPOSE_FILE="compose.yml"
COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
# COMPOSE_FILE="$COMPOSE_FILE:compose.postgres.yml"
```

View File

@ -0,0 +1,2 @@
Beware that you'll also be updating Postgres if you're running it. Usually with major updates it might involve pg_dumpall / pg_restore either side of the upgrade because the server app doesn't know how to upgrade data storage formats, won't launch if it detects an old data format, a pg_upgrade command is available. More info on https://git.coopcloud.tech/coop-cloud/gitea/pulls/31