From dbef2bd2b3d46d836cd2b2fd8375246de49d17cd Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Oct 2019 23:25:20 +0200 Subject: [PATCH 1/4] Add -q option to wget Avoid very confusing output of wget with it showing the progress for the download at the same time as sudo asks for password input. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac480c94..b7335e49 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ NodeJS does not support EOL ubuntu releases. Make sure you are on the most recen Master and all slaves: - wget -O - https://deb.nodesource.com/setup_10.x | sudo -E bash - + wget -qO - https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt install -y nodejs python-dev git build-essential git clone -b 1.2.x https://github.com/Danielv123/factorioClusterio.git cd factorioClusterio From 74d9ec38dcf369208a90d944e5b5701d0ca32524 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Oct 2019 23:31:18 +0200 Subject: [PATCH 2/4] Disable listening on SSL port by default Set sslPort to 0 in the default config as this doesn't work properly in 1.2.x and also require elevated privileges to liste on. --- config.json.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json.dist b/config.json.dist index d7f6a6b3..b3373b6e 100644 --- a/config.json.dist +++ b/config.json.dist @@ -14,7 +14,7 @@ "masterPort": 8080, "__commentsslPort": "HTTPS port for the master to listen to. Set to 0 or an empty string to not listen for HTTPS.", - "sslPort": 443, + "sslPort": 0, "sslCert": "database/certificates/cert.crt", "sslPrivKey": "database/certificates/cert.key", From 6e26d32fedc1ea6346aecfdeafcf4dc6790f7274 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Oct 2019 23:36:43 +0200 Subject: [PATCH 3/4] Recommend running without pm2 first Recommend running master server without pm2 first as this makes discovering any potential errors much simpler. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b7335e49..05fea855 100644 --- a/README.md +++ b/README.md @@ -122,11 +122,12 @@ Pretty much all the blank fields should be filled in, except on the master where **Master** + node master.js + +Or with pm2 (it's recommened to run it without pm2 first): + pm2 start master.js --name master -OR - - node master.js **Server Host** From 8b4ec584598e7a3955d52df859e7b18624ae8cce Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Oct 2019 23:39:40 +0200 Subject: [PATCH 4/4] Exit if masterAuthToken is missing Exit client.js with a non-zero exit code if it's detected that the masterAuthToken is missing in the config. --- client.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.js b/client.js index 55be41d3..787f3dcc 100644 --- a/client.js +++ b/client.js @@ -53,6 +53,8 @@ if(!config.masterAuthToken || typeof config.masterAuthToken !== "string"){ console.error("Master server now needs an access token for write operations. As clusterio slaves depends \ upon this, please add your token to config.json in the field named masterAuthToken. \ You can retrieve your auth token from the master in secret-api-token.txt after running it once."); + process.exitCode = 1; + return; } const needleOptionsWithTokenAuthHeader = { compressed:true,