feat: lfs server #42

Merged
fauno merged 2 commits from lfs into master 2025-05-15 17:22:06 +00:00
5 changed files with 17 additions and 1 deletions

View File

@ -10,6 +10,7 @@ COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
# Enable to use forgejo instead of gitea # Enable to use forgejo instead of gitea
# COMPOSE_FILE="$COMPOSE_FILE:compose.forgejo.yml" # COMPOSE_FILE="$COMPOSE_FILE:compose.forgejo.yml"
# SECRET_LFS_JWT_SECRET_VERSION=v1 # length=43
GITEA_DOMAIN=git.example.com GITEA_DOMAIN=git.example.com
GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION=true GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION=true
@ -33,6 +34,7 @@ GITEA_DEFAULT_ORG_VISIBILITY=limited
GITEA_REQUIRE_SIGNIN_VIEW=true GITEA_REQUIRE_SIGNIN_VIEW=true
GITEA_ENABLE_PUSH_CREATE_USER=false GITEA_ENABLE_PUSH_CREATE_USER=false
GITEA_ENABLE_PUSH_CREATE_ORG=false GITEA_ENABLE_PUSH_CREATE_ORG=false
GITEA_LFS_START_SERVER=false
GITEA_REPO_UPLOAD_ENABLED=true GITEA_REPO_UPLOAD_ENABLED=true
GITEA_REPO_UPLOAD_ALLOWED_TYPES=*/* GITEA_REPO_UPLOAD_ALLOWED_TYPES=*/*

View File

@ -1,4 +1,4 @@
export APP_INI_VERSION=v20 export APP_INI_VERSION=v21
export DOCKER_SETUP_SH_VERSION=v1 export DOCKER_SETUP_SH_VERSION=v1
export PG_BACKUP_VERSION=v1 export PG_BACKUP_VERSION=v1

View File

@ -60,6 +60,10 @@ SSH_DOMAIN = {{ env "GITEA_DOMAIN" }}
SSH_LISTEN_PORT = {{ env "GITEA_SSH_PORT" }} SSH_LISTEN_PORT = {{ env "GITEA_SSH_PORT" }}
SSH_PORT = {{ env "GITEA_SSH_PORT" }} SSH_PORT = {{ env "GITEA_SSH_PORT" }}
START_SSH_SERVER = true START_SSH_SERVER = true
LFS_START_SERVER = {{ env "GITEA_LFS_START_SERVER" }}
{{ if eq (env "FORGE") "forgejo" }}
decentral1se marked this conversation as resolved Outdated

Perhaps reusing the COMPOSE_FILE value with strings.Contains for "compose.forgejo.yml" is also an option? I feel like people might forget that switch (FORGEJO) or not understand what it relates to (since it is only used now for the LFS functionality. Up to you!

Perhaps reusing the `COMPOSE_FILE` value with [`strings.Contains`](https://docs.gomplate.ca/functions/strings/#examples-1) for `"compose.forgejo.yml"` is also an option? I feel like people might forget that switch (`FORGEJO`) or not understand what it relates to (since it is only used now for the LFS functionality. Up to you!
Outdated
Review

i was thinking of setting ENVVAR=gitea for gitea and ENVVAR=forgejo, or even forking the recipe to make one exclusive for forgejo if they start being too different. i couldn't come up with a descriptive name for ENVVAR though

i was thinking of setting ENVVAR=gitea for gitea and ENVVAR=forgejo, or even forking the recipe to make one exclusive for forgejo if they start being too different. i couldn't come up with a descriptive name for ENVVAR though

@fauno tbh i think now that forgejo is a hard fork splitting up the recipe would be best (like we do for Mastodon/Hometown). but that's a bit of work... the ENVVAR approach is fine for now tho. Maybe open a ticket so we don't forget about it?

@fauno tbh i think now that forgejo is [a hard fork](https://forgejo.org/2024-02-forking-forward/) splitting up the recipe would be best (like we do for Mastodon/Hometown). but that's a bit of work... the `ENVVAR` approach is fine for now tho. Maybe open a ticket so we don't forget about it?
Outdated
Review

done!

done!
LFS_JWT_SECRET = {{ secret "lfs_jwt_secret" }}
{{ end }}
[security] [security]
INSTALL_LOCK = true INSTALL_LOCK = true

View File

@ -3,3 +3,11 @@ version: '3.8'
services: services:
app: app:
image: codeberg.org/forgejo/forgejo:10.0.0-rootless image: codeberg.org/forgejo/forgejo:10.0.0-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

View File

@ -15,6 +15,7 @@ services:
- jwt_secret - jwt_secret
- secret_key - secret_key
environment: environment:
- FORGE=gitea
- GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION - GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION
- GITEA_APP_NAME - GITEA_APP_NAME
- GITEA_AUTO_WATCH_NEW_REPOS - GITEA_AUTO_WATCH_NEW_REPOS
@ -52,6 +53,7 @@ services:
- GITEA_DEFAULT_ORG_VISIBILITY - GITEA_DEFAULT_ORG_VISIBILITY
- GITEA_REQUIRE_SIGNIN_VIEW - GITEA_REQUIRE_SIGNIN_VIEW
- GITEA__oauth2__REFRESH_TOKEN_EXPIRATION_TIME - GITEA__oauth2__REFRESH_TOKEN_EXPIRATION_TIME
- GITEA_LFS_START_SERVER=${GITEA_LFS_START_SERVER:-false}
volumes: volumes:
- data:/var/lib/gitea - data:/var/lib/gitea
- config:/etc/gitea - config:/etc/gitea