How do I disable auto updates? (1.19 breaks Digital Ocean droplet)

My Gitea server went down earlier. I could only get it running again by restoring a backup. I realized that the backup has 1.18.5, and after a few minutes it automatically updates to 1.19, which breaks my server.

I don’t want 1.19! How do I disable the update?

The only way this can happen is if you use docker with the latest tag or similar.
We strongly recommend using a specific version instead, unless you always want to upgrade as soon as possible.
However, this is standard Docker behavior that Gitea (thankfully) has no influence over.
Or how exactly else did you manage to autoupdate your server? :face_with_raised_eyebrow:

I used the Digital Ocean One-Click droplet to set up the server about 8 months ago. But there is no docker command at the prompt. How else might I affect that part of the configuration?

Okay, didn’t know about Digital Ocean.
Perhaps you should ask them how to disable auto-updates.
Gitea can’t really do anything here (except not release anything anymore, which is not a viable solution).
If your provider decides to auto-update on a restart there’s nothing we can do…

On closer inspection, the Digital Ocean droplet uses snap to manage the Gitea installation. I learned that you can revert to the last version like so:

snap revert gitea

And then prevent it from re-updating like so:

snap refresh --hold

So that puts me back on 1.18.5, and the server works again.

1 Like

AFAICT the Digital Ocean one-click droplet never set up Gitea to run under a user named git, which 1.19 seems to assume is the case. Therefore, it’s possible other DO users may encounter this problem.

Do you happen to have any logs or error messages? git is what we recommend, but it isn’t required.

While I had 1.19 on my server and tried to run gitea start, I got this error —

setting.go:322:loadRunModeFrom() [F] 
Expect user 'git' but current user is: root

It seems to arise from this restriction in the source. I’m sure intentions were good but there may be gentler ways of nudging people away from root than bricking the server :wink:

That was added back in 1.16.0, so I’m not sure why it would pop up now.

It was listed as a breaking change back then iirc I guess it wasn’t…even though the PR was labeled breaking. I will take a look at that. That version is fairly old, but we may still want to update it for posterity.

wrt the warning, it should (imo) absolutely die early rather than run as the root user and start creating directories, etc on startup

I ran into this as well - I wasn’t able to troubleshoot the droplet instance and had to manually recover my repositories. I’m currently looking into another more stable solution for hosting git repos. Any recommendations?

The gitea binary behind a reverse proxy works well.

1 Like

Looking at your comment here, I wondered if my RUN_USER was set incorrectly on my Digital Ocean droplet. But my app.ini shows RUN_USER = git. Despite this, the 1.19 upgrade still failed with the error noted above.

Yep, your config seems correct. The problem appears to be that gitea is being ran as root on the machine, and that’s the part I’m not sure about. I don’t know much about droplets or how the single-click works, but perhaps the problem lies there.

FWIW the one-click droplet is attributed to the Gitea organization (unofficial droplets say “Digital Ocean”) and says “Supported By: Gitea” (again, other unofficial droplets say Digital Ocean). Which creates the impression, apparently incorrect, that the droplet is an official artifact of the Gitea developers (which is why I and perhaps others relied on it).

Instructions for converting droplet to binary installation.