Compare commits

..
Author SHA1 Message Date
fauno 392ef640b9 feat: access log file 2026-11-10 16:54:38 -03:00
6 changed files with 23 additions and 34 deletions
+3 -5
View File
@@ -42,6 +42,7 @@ GITEA_SESSION_PROVIDER=db
GITEA_CACHE_ADAPTER=memory
GITEA_CACHE_HOST=
GITEA_CACHE_ITEM_TTL=16h
#GITEA_ACCESS_LOG=true
GITEA_REPO_UPLOAD_ENABLED=true
GITEA_REPO_UPLOAD_ALLOWED_TYPES=*/*
@@ -51,8 +52,8 @@ GITEA_REPO_UPLOAD_MAX_FILES=5
GITEA_MAILER_FROM=noreply@example.com
GITEA_MAILER_USER=noreply@example.com
# SSH Support
COMPOSE_FILE="$COMPOSE_FILE:compose.ssh.yml"
GITEA_SSH_PORT=2222
GITEA_SSH_ENABLED=1
SECRET_INTERNAL_TOKEN_VERSION=v1 # length=105
SECRET_DB_PASSWORD_VERSION=v1
@@ -111,6 +112,3 @@ GITEA_STORAGE_TYPE=local
# FORGEJO_METRICS_ENABLED_ISSUE_BY_REPOSITORY=false
# SECRET_FORGEJO_METRICS_TOKEN_VERSION=v1
# COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
# Enable access logs. See Access logs on Traefik.
#ACCESS_LOGS=true
+6 -4
View File
@@ -29,7 +29,7 @@
Run
```bash
abra app run YOURAPPNAME app -- forgejo --config /var/lib/gitea/custom/conf/app.ini admin user create --username USERNAME --admin --random-password --email EMAIL
abra app run YOURAPPNAME app forgejo -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`.
@@ -52,13 +52,15 @@ abra app deploy YOURTRAEFIKAPP
```
You might need to wait a bit. To check if it worked, you can run
```
telnet my.forgejo.example.com 2222
telnet my.gitea.example.com 2222
```
Once you have added a public SSH key, you can check that you can connect to your Forgejo server with
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.forgejo.example.com
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.
## Protect Forgejo from scrapers with Anubis
Uncomment the Anubis compose file from the `.env` file and re-deploy the
+2 -2
View File
@@ -1,5 +1,5 @@
export APP_INI_VERSION=v34
export DOCKER_SETUP_SH_VERSION=v3
export APP_INI_VERSION=v29
export DOCKER_SETUP_SH_VERSION=v2
export PG_BACKUP_VERSION=v1
abra_backup_app() {
+6 -5
View File
@@ -87,10 +87,9 @@ DOMAIN = {{ env "GITEA_DOMAIN" }}
LANDING_PAGE = {{ env "GITEA_LANDING_PAGE" }}
ROOT_URL = https://%(DOMAIN)s/
SSH_DOMAIN = {{ env "GITEA_DOMAIN" }}
SSH_LISTEN_PORT = 2222
SSH_PORT = 2222
START_SSH_SERVER = {{ env "GITEA_SSH_ENABLED" }}
DISABLE_SSH = {{ if eq (env "GITEA_SSH_ENABLED") "true" }}false{{ else }}true{{ end }}
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" }}
LFS_JWT_SECRET = {{ secret "lfs_jwt_secret" }}
@@ -136,15 +135,17 @@ IS_INPUT_FILE = false
[log]
MODE=console
LEVEL=DEBUG
LEVEL=WARN
STACKTRACE_LEVEL=None
ENABLE_XORM_LOG=false
{{ if eq (env "GITEA_ACCESS_LOG") "true" }}
LOGGER_ACCESS_MODE = access-file
[log.access-file]
MODE=file
LEVEL=Debug
FILE_NAME=access.log
{{ end }}
[session]
PROVIDER = {{ env "GITEA_SESSION_PROVIDER" }}
-11
View File
@@ -1,11 +0,0 @@
---
version: "3.8"
services:
app:
environment:
- GITEA_SSH_ENABLED=true
deploy:
labels:
- "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}"
+6 -7
View File
@@ -3,8 +3,7 @@ version: "3.8"
services:
app:
#image: git.sutty.abyaya.la/containers/forgejo:15.0.8-rootless
image: codeberg.org/forgejo/forgejo:17.0.2-rootless
image: codeberg.org/forgejo/forgejo:17.0.1-rootless
configs:
- source: app_ini
target: /var/lib/gitea/custom/conf/app.ini
@@ -16,7 +15,6 @@ services:
- jwt_secret
- secret_key
- lfs_jwt_secret
entrypoint: "/usr/bin/dumb-init -- /usr/local/bin/docker-entrypoint.sh"
environment:
- GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION
- GITEA_ALLOW_ONLY_INTERNAL_REGISTRATION
@@ -28,7 +26,7 @@ services:
- GITEA_ENABLE_OPENID_SIGNIN
- GITEA_ENABLE_OPENID_SIGNUP
- GITEA_SMTP_MAILER_ENABLED
- GITEA_SSH_ENABLED=false
- GITEA_SSH_PORT
- GITEA_DISABLE_GRAVATAR
- GITEA_ENABLE_FEDERATED_AVATAR
- GITEA_REGISTER_EMAIL_CONFIRM
@@ -67,7 +65,7 @@ services:
- proxy
- internal
healthcheck:
test: ["CMD", "curl", "--user-agent=healthcheck", "-f", "http://localhost:3000/api/healthz"]
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 30s
timeout: 10s
retries: 10
@@ -83,14 +81,15 @@ services:
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "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}"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}_cors"
- "traefik.http.routers.${STACK_NAME}.observability.accesslogs=${ACCESS_LOGS:-false}"
- "traefik.http.middlewares.${STACK_NAME}_cors.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
- "traefik.http.middlewares.${STACK_NAME}_cors.headers.accesscontrolallowheaders=content-type,authorization"
- "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"
- "traefik.http.middlewares.${STACK_NAME}-buffering.buffering.maxRequestBodyBytes=0"
- coop-cloud.${STACK_NAME}.version=6.0.2+17.0.1-rootless