Debugging Gitea SSH across Docker and two firewalls

The failure HTTPS access to Gitea worked, but cloning over SSH from my Windows machine failed: ssh: connect to host git.example.com port 2221: Network is unreachable The repository was configured to expose the container's SSH server on host port 2221: ports: - "2221:22" The correct clone form was therefore: ssh://git@git.example.com:2221/owner/repository.git So I tested each network layer on its own. Layer 1: Is Gitea's SSH server healthy? On the server, I tested the published port through loopback: ...

November 2, 2024

Upgrading Gitea and correcting its reverse-proxy configuration

Why this was more than an image update My Gitea installation had been running version 1.18.0 for several years. Upgrading a stateful service is not equivalent to replacing a stateless web container: Gitea owns database migrations, configuration, repositories, keys, and user-generated data. Before changing the image, I backed up MariaDB and the persistent Gitea directories. I also recorded the current Compose configuration and container versions. That created both a recovery path and a baseline for post-upgrade comparison. ...

October 17, 2024

Cleaning and securing a spam-abused Gitea instance

Discovering the abuse While investigating storage growth, I found repository owners I did not recognize. Their names and repositories followed patterns common to search-engine spam: product keywords, numeric suffixes, empty projects, and matching wiki repositories. The legitimate repositories belonged to my own user. The unknown accounts had accumulated over time because the Gitea instance was publicly reachable and registration had remained enabled. This changed the task from simple disk cleanup into incident response. Removing large files was not enough; I needed to remove the application records, close the registration path, and review credentials. ...

October 3, 2024

Recovering a Docker host from a full filesystem

The symptom was not the cause My self-hosted Gitea instance started returning 502 Bad Gateway. Nginx was still answering requests, so the error only told me that its upstream service was unavailable. Before changing the reverse proxy, I checked the host: df -h The root filesystem was completely full: Filesystem Size Used Avail Use% Mounted on /dev/root 50G 48G 0 100% / A full filesystem can stop a database from writing, prevent applications from creating temporary files, and even make configuration files impossible to save. The 502 was therefore a downstream symptom of a storage incident. ...

September 20, 2024