Improve Forgejo

This commit is contained in:
2025-06-29 14:54:45 +02:00
parent c7b7ce8585
commit e942d364fe
2 changed files with 37 additions and 9 deletions

View File

@ -88,6 +88,7 @@ And then, caddy will generate the certificate for you and renew it automatically
| [qbittorrent.bensuperpc.org](https://qbittorrent.bensuperpc.org) | Sub | Torrent client/server |
| [transmission.bensuperpc.org](https://transmission.bensuperpc.org) | Sub | Torrent client/server |
| [git.bensuperpc.org](https://git.bensuperpc.org) | Sub | Gitea for git |
| [forgejo.bensuperpc.org](https://forgejo.bensuperpc.org/) | Sub | Fork of Gitea for git |
| [link.bensuperpc.org](https://link.bensuperpc.org) | Sub | For link shortener |
| [jellyfin.bensuperpc.org](https://jellyfin.bensuperpc.org) | Sub | Jellyfin for media server |
| [syncthing.bensuperpc.org](https://syncthing.bensuperpc.org) | Sub | SyncThing for file synchronization |
@ -284,19 +285,39 @@ You can change the homepage config in these files:
```sh
docker exec -it forgejo_runner /bin/bash
```
```sh
forgejo-runner generate-config > /data/config.yml
```
Now update the config.yml file to support docker-in-docker:
```yml
envs:
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: /certs/client
DOCKER_HOST: tcp://docker:2376
labels: ["ubuntu-latest:docker://node:20-bookworm", "ubuntu-22.04:docker://node:20-bookworm"]
network: host
options: -v /certs/client:/certs/client
valid_volumes:
- /certs/client
```
Register the runner with your Forgejo instance:
```sh
forgejo-runner register
```
You will need to provide the following information:
```sh
https://forgejo.bensuperpc.org/
<Your Registration Token, in https://forgejo.bensuperpc.org/admin/actions/runners>
main
ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04
main
```
### Docker volumes

View File

@ -14,7 +14,6 @@ services:
env_file:
- ./env/forgejo.env
volumes:
# /var/lib/gitea/custom/conf/app.ini
- forgejo_data:/var/lib/gitea
- forgejo_config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
@ -45,15 +44,19 @@ services:
# forgejo-runner
docker-in-docker:
image: docker:dind
image: code.forgejo.org/oci/docker:dind
container_name: 'docker_dind'
hostname: docker
networks:
- infra-network
profiles:
- forgejo
container_name: 'docker_dind'
privileged: true
command: [ 'dockerd', '-H', 'tcp://0.0.0.0:2375', '--tls=false' ]
restart: 'unless-stopped'
environment:
DOCKER_TLS_CERTDIR: /certs
DOCKER_HOST: docker-in-docker
volumes:
- forgejo_certs:/certs
forgejo_runner:
image: 'code.forgejo.org/forgejo/runner:6.3.1'
@ -68,14 +71,18 @@ services:
condition: service_started
container_name: 'forgejo_runner'
environment:
DOCKER_HOST: tcp://docker-in-docker:2375
DOCKER_HOST: tcp://docker:2376
DOCKER_CERT_PATH: /certs/client
DOCKER_TLS_VERIFY: "1"
# user: 1001:1001
volumes:
# - ./config/forgejo_runner/config.yaml:/config.yaml:ro
- forgejo_runner:/data
- forgejo_certs:/certs
restart: 'unless-stopped'
# command: '/bin/sh -c "while : ; do sleep 1 ; done ;"'
command: '/bin/sh -c "sleep 5; forgejo-runner -c /data/config.yml daemon"'
command: '/bin/sh -c "while : ; do sleep 1 ; done ;"'
# command: '/bin/sh -c "sleep 5; forgejo-runner -c /data/config.yml daemon"'
volumes:
forgejo_data: