Gogs: Automatic upgrade

Created on 21 Sep 2015  Â·  32Comments  Â·  Source: gogs/gogs

Though it's not the same kind of program, but I've recently tried Syncthing. It is also written in Golang, and it offers automatic upgrade. Yes, which means, it will upgrade once a new version is available, and automatically restart itself.
I hope this will be implemented in Gogs too.

maybe 🎯 feature

Most helpful comment

I wouldn't plan to implement automatic upgrade, but new version check.

All 32 comments

Thanks your feedback!

This feature has been thought long time ago, but based on the usage situation, people are often running Gogs in local network where does not have internet access to outside world.

I can make it as a optional feature, but may have low priority, if you wish. :smiley:

That would be a very nice feature.
At this time I have to do a lot of things:

  • stop the sserver (sudo service gog-service stop)
  • make a backup of the folder gogoits
  • delete the folder gogs in gogits
  • clone the dev-repo
  • go to new gogs folder
  • do a go get -u -tags "sqlite" ./...
  • do a go build - tags "sqlite"
  • copy the custom and the data folder from backup to the new gogs folder
  • start the service

If an automatic update could do these steps I would be very happy

Hi @focmb ,

clone the dev-repo

If you are using git clone to install Gogs from source, all you need to do it just do git pull and rebuild with go build -tags "sqlite" and you're good to restart again.

Oh, I will try that. Thanks for that hint.

What about just using the packager.io packages?

running gogs on araspberry pi2. there is no packager.io package

Than prebuilt binaries should help @Unknwon :)

@tboerger yes, if this is implemented, definitely will use binary or git pull if possible.

+1
This feature is good, but I think that need to be possible to enable or disable this option if you can.

+1

Is it possible to use Github API to get latest release created (and know if update is available or not) GET /repos/:owner/:repo/releases/latest (https://developer.github.com/v3/repos/releases/#get-the-latest-release) and get link to download right package (ie: linux_amd64.zip).

Or maybe adding a new gogs cmd action like ./gogs upgrade [--yes] (--yes stand for auto-accept migration if new version is available) could be a good option.

Than I'm pretty sure the github ratelimiting will be an issue for various people

I threw together a small test for this a while back. It's crude but semingly works. I just need to integrate it into Gogs admin-panel somehow :laughing:
And yes, ratelimiting applies...

https://gist.github.com/bkcsoft/7129de478392a09994384f3d2b3e096f

go-selfupdate works pretty good for my projects, but all my projects are single file deployments

@tboerger yeah, that's what I tried to "fix" with that one. I run it as part of a weekly cron-job. If the program (in the gist) updates gogs the script (ran by cron) restarts gogs :smiley:

Also, the rate-limit is 5000 hits per hour :trollface: (un-authenticated)

Don't forget company networks ;)

Not sure how that would change the rate-limit though :confused:

Not sure how that would change the rate-limit though 😕

I'm hitting quite often the rate limit of GitHub in my office. And this will happen for others as well, so pretty bad behavior especially since gogs can be easy used within corporate networks.

Corps don't auto-upgrade, problem solved :trollface:

But if they do wanna auto-upgrade, it's easy enough to provide gogs with a specific auth-token for that :smile: And (preferably) it would only check at "slow" intervals (think daily at most), so I don't really see how it would affect anyone at all.

We don't have to call GitHub APIs, we can host a file on https://dl.gogs.io . Also, I propose change this issue to check updates, but do not update itself which seems dangerous...

My first thought is to host a RSS feed file on gogs website, and to have
gogs instances regularly check that RSS feed to see if there's an update.
And speaking of file operations, making a backup of current gogs
installation would be just OK. Gogs can delete the backup archive after
running for several days, just like how Windows backup its system files
before updating.

On Fri, Aug 12, 2016, 16:14 æ— é—» [email protected] wrote:

We don't have to call GitHub APIs, we can host a file on
https://dl.gogs.io . Also, I propose change this issue to check updates,
but do not update itself which seems dangerous...

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/gogits/gogs/issues/1670#issuecomment-239387384, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABZbs9lepOuPkGciqj9s-Mj-gJXKl7Fjks5qfCtMgaJpZM4GA62t
.

RSS is too complex maybe, just get plain text file of latest version and make a comparison...

or just "cache" the result from githubs release-api? cache as in save the output on dl.gogs.io when you make a release

Would love to see a feature like this! It's just fine if you let the user choose whether to upgrade or not, as long as the upgrade process is entirely (or almost entirely) automatic.

I wouldn't plan to implement automatic upgrade, but new version check.

I wouldn't plan to implement automatic upgrade, but new version check.

Why not automatic upgrade as optional then? You can enable or not, but default is not enabled.

Why not automatic upgrade as optional then? You can enable or not, but default is not enabled.

Yes, maybe the reason for this is obvious but I can't see nor find it. Can you point out why are you not considering to implement the automatic upgrade feature?

@joubertredrat taking care of upgrade is much more non-core work and very environment dependent, use Docker instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

truongsinh picture truongsinh  Â·  81Comments

mohsenk picture mohsenk  Â·  49Comments

unknwon picture unknwon  Â·  82Comments

HLFH picture HLFH  Â·  33Comments

nd2s picture nd2s  Â·  45Comments