Compare commits

...

110 Commits

Author SHA1 Message Date
3wc
270ed7bb93 chore: publish 3.3.1+1.23.8-rootless release 2025-05-16 20:54:29 +02:00
b2c9d95e60 Merge pull request 'fix: security release' (#44) from upgrade into master
Reviewed-on: coop-cloud/gitea#44
2025-05-16 18:53:40 +00:00
88b226f713 Merge branch 'master' into upgrade 2025-05-16 18:53:32 +00:00
85dcf3a0b1 Merge pull request 'forgejo upgrade' (#41) from forgejo into master
Reviewed-on: coop-cloud/gitea#41
Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech>
2025-05-15 17:27:24 +00:00
f
3840e87f2f fix: security release
https://blog.gitea.com/release-of-1.23.8/
2025-05-15 14:24:52 -03:00
f
777aad5da4 Merge branch 'master' into forgejo 2025-05-15 14:22:53 -03:00
5350ce207f Merge pull request 'feat: lfs server' (#42) from lfs into master
Reviewed-on: coop-cloud/gitea#42
2025-05-15 17:22:06 +00:00
2bfec14654 Update .drone.yml 2025-04-10 10:50:49 -07:00
f
b44e18f063 feat: configuration by forge 2025-02-20 09:17:58 -03:00
f
77624221b4 feat: lfs server 2025-02-18 15:44:59 -03:00
f
ce632c8e5f Merge branch 'master' of https://git.coopcloud.tech/coop-cloud/gitea 2025-02-13 12:29:31 -03:00
f
cac5c8d694 feat: upgrade to forgejo 10.0.1 2025-02-13 12:29:09 -03:00
cf2298162d chore: publish 3.3.0+1.23.1-rootless release 2025-02-12 14:35:34 +01:00
0bbac9ed9c feat: refresh token validity 2025-02-12 14:34:11 +01:00
f
8ffd4d33be chore: publish 3.2.0+1.23.1-rootless release 2025-01-21 10:23:43 -03:00
f
7364f0b87c feat: update forgejo to version 10.0.0 2025-01-21 10:23:08 -03:00
1619c333c3 chore: publish 3.1.1+1.23.1-rootless release 2025-01-18 15:14:06 +00:00
6d681457f8 chore: publish 3.1.0+1.23.0-rootless release 2025-01-18 15:13:22 +00:00
3wc
b2087cf373 chore: publish 3.0.3+1.22.6-rootless release 2025-01-15 12:09:07 -05:00
3wc
1418946974 Whoops, typo 😳 2025-01-14 17:37:38 -05:00
3wc
407e587646 chore: publish 3.0.2+1.22.6-rootless release 2025-01-08 12:56:24 -05:00
b4fdbfdbbb Merge pull request 'feat: toggle push to create' (#40) from push-to-create into master
Reviewed-on: coop-cloud/gitea#40
Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech>
2025-01-08 12:53:04 +00:00
544935a5e6 Merge pull request 'feat: sqlite3 support' (#37) from sqlite3 into master
Reviewed-on: coop-cloud/gitea#37
2025-01-07 20:14:28 +00:00
e45aee2257 Merge pull request 'feat: upgrade forgejo' (#38) from forgejo into master
Reviewed-on: coop-cloud/gitea#38
Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech>
2025-01-07 20:14:12 +00:00
e313c82857 Merge pull request 'feat: support other smtp protocols' (#39) from smtp into master
Reviewed-on: coop-cloud/gitea#39
Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech>
2025-01-07 20:12:17 +00:00
f
fb45547f0d fix: provide default 2025-01-07 14:26:12 -03:00
f
ace3ff1b4a feat: toggle push to create 2025-01-07 13:43:02 -03:00
f
b84edcbe75 feat: support other smtp protocols 2025-01-07 13:35:01 -03:00
f
25fd554ab7 feat: upgrade forgejo 2025-01-07 13:31:59 -03:00
f
b4273a95e3 feat: sqlite3 support 2025-01-07 13:30:03 -03:00
3wc
daf4a26f72 chore: publish 3.0.1+1.22.3-rootless release 2024-10-30 13:36:29 -04:00
3wc
7fec94eaec chore: publish 3.0.0+1.22.2-rootless release 2024-10-30 13:25:04 -04:00
0bfb666dd0 chore: publish 2.11.0+1.22.2-rootless release 2024-10-29 13:55:44 +01:00
2554109fab update forgejo to version 9.0.1 2024-10-29 13:55:32 +01:00
bd57d6121b update backupbot label 2024-10-24 17:01:04 +02:00
3wc
cae11a78e6 chore: publish 2.10.1+1.22.2-rootless release 2024-10-02 14:01:17 -04:00
8e8809fd07 chore: publish 2.10.0+1.22.1-rootless release 2024-08-23 19:21:01 +01:00
24e4b09b07 chore: publish 2.9.1+1.22.0-rootless release 2024-08-15 12:25:05 +02:00
43d43fb2b7 fix APP_INI_VERSION 2024-08-15 12:24:30 +02:00
3wc
c5dada903e chore: publish 2.9.0+1.22.0-rootless release 2024-07-03 14:26:42 -04:00
9687f7f738 chore: publish 2.8.0+1.21.11-rootless release 2024-05-13 16:20:13 +02:00
92073fbba5 fix backup label 2024-04-30 15:18:21 +02:00
f26296ba5c add backup label 2024-04-29 15:24:13 +02:00
baacc575c2 chore: publish 2.7.0+1.21.11-rootless release 2024-04-24 21:03:14 +01:00
53ffe86350 Merge pull request 'Adding more variable configs' (#36) from javielico/gitea:master into master
Reviewed-on: coop-cloud/gitea#36
Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech>
2024-04-24 10:01:46 +00:00
dbde635976 Removing access log to false as fallback has been removed on Gitea 1.21 2024-04-23 21:45:55 +01:00
2b15ff9c28 Added components to app.ini 2024-04-23 16:13:28 +01:00
94de0096fc Adding DISABLE_AUTH 2024-04-18 19:01:32 +01:00
e0d73083e2 Adding variable configs 2024-04-14 20:48:18 +01:00
ced3ea7978 chore: publish 2.6.2+1.21.10-rootless release 2024-04-01 17:05:17 +02:00
43abfe0483 chore: publish 2.6.1+1.21.10-rootless release 2024-04-01 16:38:05 +02:00
4683a81eeb Merge pull request 'feat: enable indexer for search' (#33) from indexer into master
Reviewed-on: coop-cloud/gitea#33
2024-04-01 11:58:54 +00:00
ea7e26698a
feat: enable indexer for search [ci skip]
See coop-cloud/organising#589
2024-03-31 01:31:39 +01:00
3wc
3815417c2c chore: publish 2.6.0+1.21.5-rootless release 2024-03-30 16:07:28 -03:00
3wc
4421f81a35 Add healthcheck, update metadata 2024-03-30 16:05:32 -03:00
3wc
a0e8ba4839 chore: publish 2.5.2+1.21.5-rootless release 2024-02-08 14:36:08 -03:00
3wc
ca9d0b4a6c chore: publish 2.5.1+1.21.4-rootless release 2024-01-17 17:56:28 -03:00
9d44d9e61c add [repository.upload] support to the configuration
Note: Requires updates to config file so add this to the release notes.
2023-12-07 18:01:05 -08:00
464c890afb Add LANDING_PAGE support for configuration 2023-12-07 17:47:53 -08:00
c8ea2ddf0c chore: publish 2.5.0+1.21.1-rootless release 2023-11-27 13:10:23 +01:00
3wc
b0ce473627 chore: publish 2.4.0+1.21.0-rootless release 2023-11-20 12:43:42 +00:00
3wc
73970dd79c chore: publish 2.3.3+1.20.5-rootless release 2023-10-30 12:43:03 +00:00
3wc
9153c4db2a chore: publish 2.3.2+1.20.3-rootless release 2023-08-28 14:08:11 +02:00
3wc
b95eae3b57 chore: publish 2.3.1+1.20.1-rootless release 2023-07-25 12:53:45 +01:00
3wc
d18379a364 Bump APP_INI_VERSION 2023-07-25 12:52:59 +01:00
3wc
46bb242fe7 chore: publish 2.3.0+1.20.1-rootless release 2023-07-25 12:50:30 +01:00
f9249f1284 chore: publish 2.2.0+1.19.3-rootless release 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
Reviewed-on: coop-cloud/gitea#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: #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 2023-01-20 10:55:04 +01:00
936fb940cb Revert "fix: drop db_password from main compose def"
This reverts commit 89400089ec2c837a4abc4c23726058a4e2f754fb.

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
f35689989c Merge pull request 'Adding Oauth2 options and up on versions' (#29) from javielico/gitea:master into master
Reviewed-on: coop-cloud/gitea#29
2022-11-13 21:54:01 +00:00
javielico
1d4dc8e8bb Bump version up on compose.yml 2022-11-13 00:45:23 +00:00
javielico
f85eaed26e Adding GITEA_OAUTH2_CLIENT_ENABLED to compose.yml and .env.sample 2022-11-11 16:47:52 +00:00
javielico
fbb36d5598 Up versions of gitea and mariadb 2022-11-11 16:15:34 +00:00
javielico
13c8af2356 Version bump 2022-11-11 16:11:33 +00:00
javielico
a4cddb7b09 Adding vars to compose.yml 2022-11-11 16:10:38 +00:00
javielico
daf24d521f Adding variables to .env.sample 2022-11-11 16:09:27 +00:00
javielico
b92ad0d45c Add oauth2_client options 2022-11-11 16:04:33 +00:00
af97db8082 chore: publish 1.3.0+1.17.2-rootless release 2022-09-07 14:45:39 +02:00
cd39f5fc82 chore: publish 1.2.1+1.16.8-rootless release 2022-06-01 09:46:21 +02:00
aa84c25a83 Bump app.ini version in abra.sh 2022-05-01 02:39:58 +00:00
cd3ded3c4e Add disable_gravatar and federated_avatar 2022-04-28 17:50:51 -07:00
0cad878de5 use domain env var 2022-03-27 21:08:50 +02:00
3a47a4164e chore: publish 1.2.0+1.16.3-rootless release 2022-03-09 12:01:02 +01:00
8ead189fde chore: publish 1.1.3+1.15.10-rootless release 2022-01-18 10:26:40 +01:00
c8ea311d7d fix: point to new drone instance [ci skip] 2021-12-31 16:31:34 +01:00
b2f29bc99e docs(README): how to enable SSH 2021-12-31 13:51:29 +01:00
741b8701e5 docs(README): correct command creating new user 2021-12-31 13:51:29 +01:00
bb1f0f082e Merge pull request 'docs(README): instruction to create first user' (#24) from aileoia/gitea:master into master
Reviewed-on: coop-cloud/gitea#24
2021-12-29 19:31:41 +00:00
cec9c2c061 docs(README): instruction to create first user 2021-12-29 18:13:43 +01:00
3wc
fee8fd5342 Goodbye, emojis! 😢
[ci skip]
2021-11-23 12:19:04 +02:00
3wc
83a9e9da6b chore: fix README bullet formatting
[ci skip]
2021-11-22 13:42:03 +02:00
16 changed files with 375 additions and 54 deletions

View File

@ -3,17 +3,21 @@ 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
PG_BACKUP_VERSION: v1
DOMAIN: gitea.swarm-test.autonomic.zone
GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION: true
GITEA_APP_NAME: Git with solidaritea
@ -37,11 +41,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:
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -2,6 +2,15 @@ TYPE=gitea
DOMAIN=gitea.example.com
LETS_ENCRYPT_ENV=production
COMPOSE_FILE="compose.yml"
ENABLE_BACKUPS=true
COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
# COMPOSE_FILE="$COMPOSE_FILE:compose.sqlite3.yml"
# COMPOSE_FILE="$COMPOSE_FILE:compose.postgres.yml"
# Enable to use forgejo instead of gitea
# COMPOSE_FILE="$COMPOSE_FILE:compose.forgejo.yml"
# SECRET_LFS_JWT_SECRET_VERSION=v1 # length=43
GITEA_DOMAIN=git.example.com
GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION=true
@ -11,6 +20,26 @@ GITEA_DISABLE_REGISTRATION=false
GITEA_ENABLE_NOTIFY_MAIL=true
GITEA_ENABLE_OPENID_SIGNIN=true
GITEA_ENABLE_OPENID_SIGNUP=true
GITEA_DISABLE_GRAVATAR=false
GITEA_ENABLE_FEDERATED_AVATAR=true
GITEA_LANDING_PAGE=organizations
GITEA_SHOW_USER_EMAIL=false
GITEA_DISABLE_REGULAR_ORG_CREATION=true
GITEA_DEFAULT_KEEP_EMAIL_PRIVATE=true
GITEA_DEFAULT_ALLOW_CREATE_ORGANIZATION=false
GITEA_ENABLE_USER_HEATMAP=false
GITEA_DEFAULT_USER_VISIBILITY=limited
GITEA_ALLOWED_USER_VISIBILITY_MODES=limited,private
GITEA_DEFAULT_ORG_VISIBILITY=limited
GITEA_REQUIRE_SIGNIN_VIEW=true
GITEA_ENABLE_PUSH_CREATE_USER=false
GITEA_ENABLE_PUSH_CREATE_ORG=false
GITEA_LFS_START_SERVER=false
GITEA_REPO_UPLOAD_ENABLED=true
GITEA_REPO_UPLOAD_ALLOWED_TYPES=*/*
GITEA_REPO_UPLOAD_MAX_SIZE=50
GITEA_REPO_UPLOAD_MAX_FILES=5
GITEA_MAILER_FROM=noreply@example.com
GITEA_MAILER_USER=noreply@example.com
@ -25,7 +54,27 @@ 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
# GITEA_MAILER_ADDR=mail.gandi.net
# GITEA_MAILER_PORT=465
# SECRET_SMTP_PASSWORD_VERSION=v1
# GITEA_MAILER_PROTOCOL=smtps
# OATH2 Options
# GITEA_REGISTER_EMAIL_CONFIRM=replace-me
# GITEA_REGISTER_EMAIL_CONFIRM=replace-me
# GITEA_OAUTH2_USERNAME=replace-me
# GITEA_UPDATE_AVATAR=replace-me
# GITEA_ACCOUNT_LINKING=replace-me
# GITEA_OAUTH2_CLIENT_ENABLED=replace-me
# Lifetime of an OAuth2 refresh token in hours, prolly no need to edit. We
# were hitting issues with infrequently pushed to repos that were not picked
# up by drone after a month of inactivity, hence the option.
# GITEA__oauth2__REFRESH_TOKEN_EXPIRATION_TIME=730
# Indexer (for issue search)
# GITEA_REPO_INDEXER_ENABLED=false
# GITEA_ISSUE_INDEXER_TYPE=db
# GITEA_STARTUP_TIMEOUT=-1

View File

@ -1,16 +1,16 @@
# Gitea
[![Build Status](https://drone.coopcloud.tech/api/badges/coop-cloud/gitea/status.svg)](https://drone.coopcloud.tech/coop-cloud/gitea)
[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/gitea/status.svg)](https://build.coopcloud.tech/coop-cloud/gitea)
<!-- metadata -->
- **Category**: Development
* **Status**: ❶💚
- **Image**: [`gitea/gitea`](https://hub.docker.com/gitea/gitea), ❶💚, upstream
- **Healthcheck**: Yes
* **Category**: Development
* **Status**: 5
* **Image**: [`gitea/gitea`](https://hub.docker.com/gitea/gitea), 4, upstream
* **Healthcheck**: Yes
* **Backups**: Yes
- **Email**: ?
- **Tests**: ❷💛
- **SSO**: ❶💚 (OAuth)
* **Email**: Yes
* **Tests**: 2
* **SSO**: 3 (OAuth)
<!-- endmetadata -->
## Basic usage
@ -19,6 +19,43 @@
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
Run
```bash
abra app run YOURAPPNAME app gitea -c /etc/gitea/app.ini admin user create --username USERNAME --admin --random-password --email EMAIL
```
See the [Gitea command-line documentation](https://docs.gitea.io/en-us/command-line/) for more options. Make sure not to forget the `-c /etc/gitea/app.ini`.
## Enable SSH
You most certainly want to be able to access your repository over SSH. To do so, make sure you uncomment the right lines in the configuration for `traefik`.
```
abra app config YOURTRAEFIKAPP
```
There uncomment or add these lines:
```
GITEA_SSH_ENABLED=1
COMPOSE_FILE="compose.yml:compose.gitea.yml"
```
Then redeploy traefik:
```
abra app undeploy YOURTRAEFIKAPP
abra app deploy YOURTRAEFIKAPP
```
You might need to wait a bit. To check if it worked, you can run
```
telnet my.gitea.example.com 2222
```
Once you have added a public SSH key, you can check that you can connect to your gitea server with
```
ssh -T -p 2222 git@my.gitea.example.com
```
Note that gitea should be configured to listen to port 2222, i.e. `GITEA_SSH_PORT=2222` in the gitea config.

View File

@ -1,5 +1,6 @@
export APP_INI_VERSION=v7
export APP_INI_VERSION=v21
export DOCKER_SETUP_SH_VERSION=v1
export PG_BACKUP_VERSION=v1
abra_backup_app() {
_abra_backup_dir "app:/var/lib/gitea"

View File

@ -2,16 +2,32 @@ APP_NAME = {{ env "GITEA_APP_NAME" }}
[database]
DB_TYPE = {{ env "GITEA_DB_TYPE" }}
{{ if ne (env "GITEA_DB_TYPE") "sqlite3" }}
HOST = {{ env "GITEA_DB_HOST" }}
NAME = {{ env "GITEA_DB_NAME" }}
PASSWD = {{ secret "db_password" }}
USER = {{ env "GITEA_DB_USER" }}
{{ else }}
SQLITE_JOURNAL_MODE = {{ env "GITEA_SQLITE_JOURNAL_MODE" }}
PATH = {{ env "GITEA_PATH" }}
{{ end }}
[picture]
DISABLE_GRAVATAR = {{ env "GITEA_DISABLE_GRAVATAR" }}
ENABLE_FEDERATED_AVATAR = {{ env "GITEA_ENABLE_FEDERATED_AVATAR" }}
[service]
ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ env "GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION" }}
AUTO_WATCH_NEW_REPOS = {{ env "GITEA_AUTO_WATCH_NEW_REPOS" }}
DISABLE_REGISTRATION = {{ env "GITEA_DISABLE_REGISTRATION" }}
ENABLE_NOTIFY_MAIL = {{ env "GITEA_ENABLE_NOTIFY_MAIL" }}
DEFAULT_KEEP_EMAIL_PRIVATE = {{ env "GITEA_DEFAULT_KEEP_EMAIL_PRIVATE" }}
DEFAULT_ALLOW_CREATE_ORGANIZATION = {{ env "GITEA_DEFAULT_ALLOW_CREATE_ORGANIZATION" }}
ENABLE_USER_HEATMAP = {{ env "GITEA_ENABLE_USER_HEATMAP" }}
DEFAULT_USER_VISIBILITY = {{ env "GITEA_DEFAULT_USER_VISIBILITY" }}
ALLOWED_USER_VISIBILITY_MODES = {{ env "GITEA_ALLOWED_USER_VISIBILITY_MODES" }}
DEFAULT_ORG_VISIBILITY = {{ env "GITEA_DEFAULT_ORG_VISIBILITY" }}
REQUIRE_SIGNIN_VIEW = {{ env "GITEA_REQUIRE_SIGNIN_VIEW" }}
[openid]
ENABLE_OPENID_SIGNIN = {{ env "GITEA_ENABLE_OPENID_SIGNIN" }}
@ -19,18 +35,35 @@ ENABLE_OPENID_SIGNUP = {{ env "GITEA_ENABLE_OPENID_SIGNUP" }}
[repository]
DEFAULT_BRANCH = main
ENABLE_PUSH_CREATE_USER = {{ env "GITEA_ENABLE_PUSH_CREATE_USER" }}
ENABLE_PUSH_CREATE_ORG = {{ env "GITEA_ENABLE_PUSH_CREATE_ORG" }}
[repository.upload]
ENABLED = {{ env "GITEA_REPO_UPLOAD_ENABLED" }}
ALLOWED_TYPES = {{ env "GITEA_REPO_UPLOAD_ALLOWED_TYPES" }}
FILE_MAX_SIZE = {{ env "GITEA_REPO_UPLOAD_MAX_SIZE" }}
MAX_FILES = {{ env "GITEA_REPO_UPLOAD_MAX_FILES" }}
[ui]
SHOW_USER_EMAIL = {{ env "GITEA_SHOW_USER_EMAIL" }}
[indexer]
STARTUP_TIMEOUT = 0
REPO_INDEXER_ENABLED = {{ or (env "GITEA_REPO_INDEXER_ENABLED") "false" }}
ISSUE_INDEXER_TYPE= {{ or (env "GITEA_ISSUE_INDEXER_TYPE") "db" }}
STARTUP_TIMEOUT = {{ or (env "GITEA_STARTUP_TIMEOUT") "-1" }}
[server]
DOMAIN = {{ env "GITEA_DOMAIN" }}
LANDING_PAGE = organizations
LANDING_PAGE = {{ env "GITEA_LANDING_PAGE" }}
ROOT_URL = https://%(DOMAIN)s/
SSH_DOMAIN = {{ env "GITEA_DOMAIN" }}
SSH_LISTEN_PORT = {{ env "GITEA_SSH_PORT" }}
SSH_PORT = {{ env "GITEA_SSH_PORT" }}
START_SSH_SERVER = true
LFS_START_SERVER = {{ env "GITEA_LFS_START_SERVER" }}
{{ if eq (env "FORGE") "forgejo" }}
LFS_JWT_SECRET = {{ secret "lfs_jwt_secret" }}
{{ end }}
[security]
INSTALL_LOCK = true
@ -39,6 +72,9 @@ REVERSE_PROXY_LIMIT = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
SECRET_KEY = {{ secret "secret_key" }}
[admin]
DISABLE_REGULAR_ORG_CREATION = {{ env "GITEA_DISABLE_REGULAR_ORG_CREATION" }}
[oauth2]
JWT_SECRET = {{ secret "jwt_secret" }}
@ -46,11 +82,21 @@ JWT_SECRET = {{ secret "jwt_secret" }}
[mailer]
ENABLED = true
FROM = {{ env "GITEA_MAILER_FROM" }}
HOST = {{ env "GITEA_MAILER_HOST" }}
PROTOCOL = {{ env "GITEA_MAILER_PROTOCOL" }}
SMTP_ADDR = {{ env "GITEA_MAILER_ADDR" }}
SMTP_PORT = {{ env "GITEA_MAILER_PORT" }}
USER = {{ env "GITEA_MAILER_USER" }}
PASSWD = {{ secret "smtp_password" }}
MAILER_TYPE = smtp
IS_TLS_ENABLED = true
{{ end }}
{{ if eq (env "GITEA_OAUTH2_CLIENT_ENABLED") "1" }}
[oauth2_client]
REGISTER_EMAIL_CONFIRM = {{ env "GITEA_REGISTER_EMAIL_CONFIRM" }}
ENABLE_AUTO_REGISTRATION = {{ env "GITEA_ENABLE_AUTO_REGISTRATION" }}
USERNAME = {{ env "GITEA_OAUTH2_USERNAME" }}
UPDATE_AVATAR = {{ env "GITEA_UPDATE_AVATAR" }}
ACCOUNT_LINKING = {{ env "GITEA_ACCOUNT_LINKING" }}
{{ end }}
[markup.restructuredtext]
@ -58,3 +104,9 @@ ENABLED = true
FILE_EXTENSIONS = .rst
RENDER_COMMAND = rst2html
IS_INPUT_FILE = false
[log]
MODE=console
LEVEL=WARN
STACKTRACE_LEVEL=None
ENABLE_XORM_LOG=false

13
compose.forgejo.yml Normal file
View File

@ -0,0 +1,13 @@
version: '3.8'
services:
app:
image: codeberg.org/forgejo/forgejo:10.0.1-rootless
environment:
- FORGE=forgejo
secrets:
- lfs_jwt_secret
secrets:
lfs_jwt_secret:
name: ${STACK_NAME}_lfs_jwt_secret_${SECRET_LFS_JWT_SECRET_VERSION}
external: true

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
secrets:
- db_password
db:
image: "mariadb:10.11.2"
deploy:
labels:
backupbot.backup.pre-hook: 'mysqldump --single-transaction -u root -p"$$(cat /run/secrets/db_root_password)" gitea > /var/lib/mysql/backup.sql'
backupbot.backup.volumes.mariadb.path: "backup.sql"
backupbot.restore.post-hook: "mariadb -u root -p\"$$(cat /run/secrets/db_root_password)\" gitea < /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:

45
compose.postgres.yml Normal file
View File

@ -0,0 +1,45 @@
version: '3.8'
services:
app:
environment:
- GITEA_DB_TYPE=postgres
- GITEA_DB_HOST="db:5432"
- GITEA_DB_NAME=gitea
- GITEA_DB_USER=gitea
secrets:
- db_password
db:
image: postgres:15.10
deploy:
labels:
backupbot.backup.pre-hook: "/pg_backup.sh backup"
backupbot.backup.volumes.db.path: "backup.sql"
backupbot.restore.post-hook: '/pg_backup.sh restore'
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
configs:
- source: pg_backup
target: /pg_backup.sh
mode: 0555
secrets:
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
volumes:
db:
configs:
pg_backup:
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
file: pg_backup.sh

View File

@ -5,8 +5,10 @@ services:
app:
environment:
- GITEA_MAILER_FROM
- GITEA_MAILER_HOST
- GITEA_MAILER_ADDR
- GITEA_MAILER_PORT
- GITEA_MAILER_USER
- "GITEA_MAILER_PROTOCOL=${GITEA_MAILER_PROTOCOL:-smtps}"
secrets:
- smtp_password

8
compose.sqlite3.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3.8'
services:
app:
environment:
- GITEA_DB_TYPE=sqlite3
- GITEA_SQLITE_JOURNAL_MODE=wal
- GITEA_PATH=/var/lib/gitea/gitea.db

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: "gitea/gitea:1.15.6-rootless"
image: "gitea/gitea:1.23.8-rootless"
configs:
- source: app_ini
target: /etc/gitea/app.ini
@ -11,18 +11,14 @@ services:
target: /usr/local/bin/docker-setup.sh
mode: 0555
secrets:
- db_password
- internal_token
- jwt_secret
- secret_key
environment:
- FORGE=gitea
- 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
@ -30,6 +26,34 @@ services:
- GITEA_ENABLE_OPENID_SIGNUP
- GITEA_SMTP_MAILER_ENABLED
- GITEA_SSH_PORT
- GITEA_DISABLE_GRAVATAR
- GITEA_ENABLE_FEDERATED_AVATAR
- GITEA_REGISTER_EMAIL_CONFIRM
- GITEA_ENABLE_AUTO_REGISTRATION
- GITEA_OAUTH2_USERNAME
- GITEA_UPDATE_AVATAR
- GITEA_ACCOUNT_LINKING
- GITEA_OAUTH2_CLIENT_ENABLED
- GITEA_CORS_ALLOW_DOMAIN
- GITEA_LANDING_PAGE
- GITEA_REPO_UPLOAD_ENABLED
- GITEA_REPO_UPLOAD_ALLOWED_TYPES
- GITEA_REPO_UPLOAD_MAX_SIZE
- GITEA_REPO_UPLOAD_MAX_FILES
- GITEA_REPO_INDEXER_ENABLED
- GITEA_ISSUE_INDEXER_TYPE
- GITEA_STARTUP_TIMEOUT
- GITEA_SHOW_USER_EMAIL
- GITEA_DISABLE_REGULAR_ORG_CREATION
- GITEA_DEFAULT_KEEP_EMAIL_PRIVATE
- GITEA_DEFAULT_ALLOW_CREATE_ORGANIZATION
- GITEA_ENABLE_USER_HEATMAP
- GITEA_DEFAULT_USER_VISIBILITY
- GITEA_ALLOWED_USER_VISIBILITY_MODES
- GITEA_DEFAULT_ORG_VISIBILITY
- GITEA_REQUIRE_SIGNIN_VIEW
- GITEA__oauth2__REFRESH_TOKEN_EXPIRATION_TIME
- GITEA_LFS_START_SERVER=${GITEA_LFS_START_SERVER:-false}
volumes:
- data:/var/lib/gitea
- config:/etc/gitea
@ -38,11 +62,18 @@ services:
networks:
- proxy
- internal
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
- "traefik.enable=true"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
@ -51,24 +82,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.1.2+1.15.6-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=3.3.1+1.23.8-rootless
db:
image: "mariadb:10.6"
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:
@ -86,12 +106,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
@ -105,4 +119,3 @@ secrets:
volumes:
data:
config:
mariadb:

34
pg_backup.sh Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
function backup {
export PGPASSWORD=$(cat $POSTGRES_PASSWORD_FILE)
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
}
function restore {
cd /var/lib/postgresql/data/
restore_config(){
# Restore allowed connections
cat pg_hba.conf.bak > pg_hba.conf
su postgres -c 'pg_ctl reload'
}
# Don't allow any other connections than local
cp pg_hba.conf pg_hba.conf.bak
echo "local all all trust" > pg_hba.conf
su postgres -c 'pg_ctl reload'
trap restore_config EXIT INT TERM
# Recreate Database
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
trap - EXIT INT TERM
restore_config
}
$@

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

View File

@ -0,0 +1 @@
This release adds a docker healthcheck for the main Gitea service -- please pay careful attention when updating apps, and as always feel free to ask in Matrix if you run into any bugs 🐛

View File

@ -0,0 +1,3 @@
BEWARE! 🚨 This release updates to the newer Gitea SMTP settings format.
If you are using SMTP, you will need to split the old GITEA_MAILER_HOST into separate GITEA_MAILER_ADDR (hostname) and GITEA_MAILER_PORT settings.