- Dockerfile 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
The old shim did a second ssh hop to 127.0.0.1:2222 and depended on a host key for user git that did not survive a reinstall, causing '/usr/local/bin/gitea: not found' and 'Permission denied (publickey)'. Run the forced command directly in the forgejo container instead. |
||
| ansible | ||
| .gitignore | ||
| Caddyfile.local | ||
| Caddyfile.remote | ||
| docker-compose.production.yaml | ||
| docker-compose.yaml | ||
| Dockerfile | ||
| README.md | ||
| renovate.json | ||
Source Forge
This repo holds the config for deploying a source code forge to a remote server.
Bootstrap the remote instance
Anisible handles the bootstrapping and the deploying of local files to the server.
ansible-playbook -i ansible/inventory.ini ansible/playbook.yaml
Architecture
Caddy sits in front of the forge and docker compose runs the stack.
SSH git setup
Forgejo runs in Docker and its built-in SSH server is only published on host
port 2222. The host's own sshd (port 22) is what clients connect to.
Forgejo writes a forced command into the host's /home/git/.ssh/authorized_keys
(which is bind-mounted into the container at /data/git/.ssh) of the form:
command="/usr/local/bin/gitea --config=/data/gitea/conf/app.ini serv key-N",...
The Ansible git role installs a small host shim at /usr/local/bin/gitea
that runs that command inside the forgejo container with docker exec and
passes SSH_ORIGINAL_COMMAND through. The host git user therefore needs to be
in the docker group (the role does this).
Earlier versions forwarded via a second
sshhop to127.0.0.1:2222. That depended on a host SSH key that did not survive a reinstall, causingsh: 1: /usr/local/bin/gitea: not found/Permission denied (publickey).