HOWTO debug a Gitea instance

Launch Gitea

$ version=1.16.7
$ docker run --volume /tmp/gitea:/data/gitea --name gitea1 -p 8781:3000 -p 2721:22 -e GITEA__security__INSTALL_LOCK=true -e GITEA__log__LEVEL=debug -e GITEA__server__DOMAIN=0.0.0.0 -e GITEA__server__SSH_DOMAIN=0.0.0.0 -e GITEA__server__ROOT_URL=http://0.0.0.0:8781/ -e GITEA__service__DEFAULT_KEEP_EMAIL_PRIVATE=true -d gitea/gitea:$version
$ docker exec --user 1000 gitea1 gitea admin user create --access-token --admin --username admin --password admin --email admin@example.com

Edit the database

$ sudo sqlite3 /tmp/gitea/gitea.db

Run the doctor

$ docker exec --user 1000 gitea1 gitea doctor recreate-table

Or

$ docker exec gitea1 gitea doctor --list

Watch the logs

$ docker logs -f gitea1
1 Like