Sending ^C via the terminal on Linux may cause SIGINT to be sent twice
to the factorio process, causing it to exit without completing the
saving. This happens because the shell sends the interupt to all
members of the process group for the job and this includes both the
node client process and the factorio server process.
Avoid this situation by passing detached to spawn when the platform is
Linux, which causes the process to be created with its own process group
and therefore not targeted by a SIGINT from the shell.
This unfortunately does not work on Windows as we can't send SIGINT or
^C to a process there. Doing subprocces.kill on Windows terminates the
process similarly to how SIGKILL works on Linux.
Authenticate connections made to the socket.io server via a token query
parameter that's validated in a similar manner to the x-access-token for
HTTP requests.
A 50 kb library is not needed to make a function run once, especially
not when it doesn't work. _.once does not modify the function passed to
it to only run once it returns a new function that only runs once.
Since the result of once was discarded, it had no effect.
Remove underscore and implement instanceManagement running once properly
with 3 lines of code.
Replace the 10 MB of dependencies that is hash-files with a homebrew
Promise based implementation of hashFile that uses crypto and fs. This
somehow also ends up being the same amount of code as the one using
hash-files.
#add tailing of files to prevent lost data between factorio and clusterio
#move socketio connect to the bottom after the plugins are loaded
to prevent plugins not getting the connection event
#add some more transfer compression in different places
Move the contents of node_modules/_app into lib/ as there shouldn't be
any content in node_modules. This directory is automatically managed
and pruned by npm.
Add lib/ as a local package in package.json, this allows scripts
everywhere to require it's content as "lib/path" instead of relying on
local paths. This shadows the StdLib Node.js Bindings package, but I
could care less.
Change all requires with lib as a local path and _app to use just lib.
Adds a "info" field to config.json and allows the client to send the contents of this info field to the master, so it also shows up (i.e. with /api/slaves)
Adds a "info" field to config.json and allows the client to send the contents of this info field to the master, so it also shows up (i.e. with /api/slaves)
Docker doesn't really do anything with the '/quit'.
However, changing from 'quit' to 'serverprocess.kill("SIGINT");' solved this issue.
The node exits with:
'[dumb-init] Child exited with status 0. Goodbye.'