Factorio Update Helper (an aid for headless server owners)

Find multiplayer games.
Tools/scripts to run a dedicated server.
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Factorio Update Helper (an aid for headless server owners)

Post by Narc »

I didn't want to (yet again) download the full Factorio Linux64 package and throw it up to my server, so I wrote a script to fetch the updates for me.

Figuring that others might also like it, I've put it up on Github. The README should be reasonably comprehensive (though feel free to let me know if it needs more, as long as you're not asking for a whole tutorial on setting up Python or the like).

It's not much more than four hours of work, so there are bound to be plenty of rough edges, but you can probably make it work for you with a minimum of thought.


Download
Just the script, or the full package.


License
The Factorio Update Helper is released under the MIT license, meaning you can do whatever you like with it as long as my name stays on it somewhere.

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

nice one, I've just edited my update from yesterday ;) https://forums.factorio.com/forum/vie ... 097#p99097
Hosting a factorio server? Take a look at this || init script ||.

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

Bisa wrote:nice one, I've just edited my update from yesterday ;) https://forums.factorio.com/forum/vie ... 097#p99097
Heh. Yeah, getting Factorio to apply the update is almost certainly better than blindly extracting -- I believe the update packages include instructions for deleting obsolete files, which otherwise would get left behind; this was a problem for me when manually updating to 0.12.0 when it came out (some of the files in 0.11 got renamed/deleted).

Feel free to integrate the update helper directly into your init script; if you keep the updater username and token in your config file, you can just pass those automatically; combine with having the updater output to a controlled directory, and you can get pretty complete automation in place.

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

And there we go, thnx a bunch - keep scripting! ;)
Hosting a factorio server? Take a look at this || init script ||.

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

*bump* This topic ain't seein nuff views - this is a wonderful piece of code :)
Hosting a factorio server? Take a look at this || init script ||.

JyeGuru
Inserter
Inserter
Posts: 21
Joined: Thu Sep 11, 2014 3:59 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by JyeGuru »

Narc wrote:1 API key was invalidated during the development of this script.
I love this comment. :)

lordfiSh
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Feb 28, 2016 11:39 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by lordfiSh »

steam version has no api key inside the json
Would use steamcmd to update the game, but it require you to be signed it :?

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

lordfiSh wrote:steam version has no api key inside the json
Would use steamcmd to update the game, but it require you to be signed it :?
Indeed, there was really no way to fix this from my end, but thankfully Tomas (aka slpwnd) took a hand in the situation so now the script should just work without needing the updater username or token -- as long as you only need the headless server updates.

I took the liberty to update the documentation regarding this new development (as well as bring the --help output in line), but there should be no need to update if you have a copy of the script already.

gloix
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Mar 25, 2016 8:18 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by gloix »

It seems that the factorio servers don't keep updates for older versions. One is forced to always keep the game to the latest version, otherwise a case like mine can occur.

I have headless version 0.12.26 and the current update is for 0.12.28 to upgrade to 0.12.29. I guess I'll have to manually update :|

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

gloix wrote:It seems that the factorio servers don't keep updates for older versions. One is forced to always keep the game to the latest version
I'm planning to implement a type of install command to my init script, but without the "latest" version on an accessible link it's a bit finnicky - if you would like to see this supported may I suggest you show some love in viewtopic.php?f=6&t=22210

(this feature would essentially allow you to do "clean install" or "force latest version" alleviating the need to "update manually" )
Hosting a factorio server? Take a look at this || init script ||.

gloix
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Mar 25, 2016 8:18 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by gloix »

Done!

Also... how will the init script update functionality differ from the update script by Narc if the latest-version-url-thingy is done? (in terms of updating functionality).
That is to say, why would I prefer one over the other?

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

gloix wrote:Done!

Also... how will the init script update functionality differ from the update script by Narc if the latest-version-url-thingy is done? (in terms of updating functionality).
That is to say, why would I prefer one over the other?
the init script relies on narcs updater - the "force latest version" would probably just delete the factorio folder (retaining conf/saves etc) then download the tar from /latest/, not sure how I'm going to do that yet.
Hosting a factorio server? Take a look at this || init script ||.

Khossus
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 13, 2016 10:48 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Khossus »

Seems like it won't work for now..

Code: Select all

1.220 Info Updater.cpp:752: Downloading https://www.factorio.com/updater/get-available-versions?username=myemail@address&token=<private>&apiVersion=2
   2.351 Download failed (status 500; Connection to the authorization server failed.)

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by daniel34 »

Khossus wrote:Seems like it won't work for now..

Code: Select all

1.220 Info Updater.cpp:752: Downloading https://www.factorio.com/updater/get-available-versions?username=myemail@address&token=<private>&apiVersion=2
   2.351 Download failed (status 500; Connection to the authorization server failed.)
Probably the same as this bug: viewtopic.php?f=7&t=23592
quick links: log file | graphical issues | wiki

TheHalfwayXBray
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Apr 15, 2016 9:36 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by TheHalfwayXBray »

does anyone know how to kick and ban people from your dedicated server and if not are there any mods to do so?

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by daniel34 »

TheHalfwayXBray wrote:does anyone know how to kick and ban people from your dedicated server and if not are there any mods to do so?
At the most you can do is get their IP from the log files and disable access using a firewall/iptables (blacklisting).
Or invite players by only giving them your IP/Port or enabling for them to join using firewall/iptables (whitelisting).

0.13 should bring some improvements.
quick links: log file | graphical issues | wiki

TheHalfwayXBray
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Apr 15, 2016 9:36 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by TheHalfwayXBray »

cant wait for .13 because running a public server without an easy way to ban people is a nightmare and keeps you worried at all time

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

TheHalfwayXBray wrote:cant wait for .13 because running a public server without an easy way to ban people is a nightmare and keeps you worried at all time
My experience so far running a public server since ~June last year:
- auto saves, keep as many auto saves as you are comfortable with being "away" from the server, that way you can always revert to a known good state
- mods, it has a small but noticeable effect on the amount of random idiots entering your server (I prefer vanilla+ mods myself to keep the experience as close to and even better as vanilla factorio)

This beeing said, yea I long for the authentication changes hinted about in the other weeks FFF :)
Hosting a factorio server? Take a look at this || init script ||.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by daniel34 »

Bisa wrote:auto saves, keep as many auto saves as you are comfortable with being "away" from the server, that way you can always revert to a known good state
Note that clients copy the autosave settings. If you set it to 100 autosaves, the clients will also store the same number. I did this and later reverted it after I found that out, because I didn't want to be the reason for 2GB (20MB x100) of storage on the clients playing on my server.
quick links: log file | graphical issues | wiki

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Bisa »

daniel34 wrote:
Bisa wrote:auto saves, keep as many auto saves as you are comfortable with being "away" from the server, that way you can always revert to a known good state
Note that clients copy the autosave settings. If you set it to 100 autosaves, the clients will also store the same number. I did this and later reverted it after I found that out, because I didn't want to be the reason for 2GB (20MB x100) of storage on the clients playing on my server.
I know, however, I rather have a persistent world =P ppl can always delete saves fromt he folder ;)
Hosting a factorio server? Take a look at this || init script ||.

Post Reply

Return to “Multiplayer / Dedicated Server”