mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 15:24:52 +09:00
Added support for both https AND http, config is now untracked by git
This commit is contained in:
1 parent
a9532dd0d3
commit
94bbf62c26
3 files changed
+37
-21
No files matched your search
@@ -70,17 +70,19 @@ NodeJS does not support EOL ubuntu releases. Make sure you are on the most recen
|
||||
|
||||
Master and all slaves:
|
||||
|
||||
sudo curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - \
|
||||
sudo apt install -y nodejs python-dev git wget curl tar build-essential \
|
||||
sudo npm install pm2 -g \
|
||||
git clone https://github.com/Danielv123/factorioClusterio.git \
|
||||
cd factorioClusterio \
|
||||
npm install \
|
||||
curl -o factorio.tar.gz -L https://www.factorio.com/get-download/latest/headless/linux64 \
|
||||
sudo curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
|
||||
sudo apt install -y nodejs python-dev git wget curl tar build-essential
|
||||
sudo npm install pm2 -g
|
||||
git clone https://github.com/Danielv123/factorioClusterio.git
|
||||
cd factorioClusterio
|
||||
curl -o factorio.tar.gz -L https://www.factorio.com/get-download/latest/headless/linux64
|
||||
tar -xf factorio.tar.gz
|
||||
npm install
|
||||
|
||||
downloads and installs nodejs, pm2, git and clusterio. To specify a version, change "latest" in the link to a version number like 0.14.21.
|
||||
|
||||
*Copy config.json.dist to config.json* - Otherwise it will crash, as you'd expect.
|
||||
|
||||
**Master**
|
||||
|
||||
pm2 start master.js --name master
|
||||
@@ -141,17 +143,21 @@ reboot when you are done, then proceed to the next steps. *reboots matter*
|
||||
|
||||
1. download and run https://puu.sh/toFHl/01eebbb333.bat
|
||||
|
||||
2. You do not *need* to follow the given instructions, but you should
|
||||
2. Copy config.json.dist to config.json
|
||||
|
||||
3. type `node master.js`
|
||||
3. You do not *need* to follow the given instructions, but you should
|
||||
|
||||
4. type `node master.js`
|
||||
|
||||
**Server Host**
|
||||
|
||||
1. download and run https://puu.sh/toFHl/01eebbb333.bat
|
||||
|
||||
2. Follow the instructions given
|
||||
2. Copy config.json.dist to config.json
|
||||
|
||||
3. Type `node client.js start [instancename]` to create a new instance.
|
||||
3. Follow the instructions given
|
||||
|
||||
4. Type `node client.js start [instancename]` to create a new instance.
|
||||
|
||||
To connect to a master server running on a remote machine, open config.json with your favourite text editor (notepad++). You can also set it up to use the official server browser.
|
||||
|
||||
|
||||
@@ -7,18 +7,27 @@
|
||||
|
||||
"__comment2": "IP the master web server runs at, can be ignored on the master system",
|
||||
"masterIP": "localhost",
|
||||
|
||||
"__commentMasterPort": "HTTP port for the master to listen to, set to 0 or an empty string to not listen for HTTP requests",
|
||||
"masterPort": 8080,
|
||||
|
||||
"__commentsslPort": "HTTPS port for the master to listen to. Set to 0 or an empty string to not use HTTPS.",
|
||||
"sslPort": 443,
|
||||
"sslCert": "database/certificates/cert.crt",
|
||||
"sslPrivKey": "database/certificates/cert.key",
|
||||
|
||||
"__commentMasterAuthToken": "Authentication token to connect to the master server. Find it in secret-api-token.txt on the master.",
|
||||
"masterAuthToken": "",
|
||||
|
||||
"__commentAuthSecret": "This is a long random string generated by keyboard mashing. Please mash you own string for security.",
|
||||
"masterAuthSecret": "anfeåpvunuennuusnvzunsrevunåzeufnewnufasiojfåqwoiuajknwkjfdabewfkjadfnewåfundjkcvnewmfqewrmn123",
|
||||
"__commentAuthSecret": "This is a long random string used for generating authentication tokens. Do not share. Regenerates when secret-api-token.txt is deleted.",
|
||||
"masterAuthSecret": "",
|
||||
|
||||
"__comment3": "Your factorio.com username for factorio MP services, also username will be admin",
|
||||
"__comment3": "Your factorio.com username for factorio MP services, also username will be admin on new instances",
|
||||
"username": "",
|
||||
"__comment4": "Token from your factorio.com profile page. Required for MP and mod manager services.",
|
||||
"token": "",
|
||||
"factorio_version": "0.16.41",
|
||||
"__comment7": "Used for communication with the mod portal, not needed if you manage mods by hand",
|
||||
"factorio_version": "0.16.41",
|
||||
|
||||
"__comment5": "General user settings",
|
||||
"verify_user_identity": false,
|
||||
@@ -911,15 +911,16 @@ app.get("/api/getFactorioLocale", function(req,res){
|
||||
httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);
|
||||
});
|
||||
});
|
||||
if(config.masterPort == 443){
|
||||
var privateKey = fs.readFileSync( 'privatekey.pem' );
|
||||
var certificate = fs.readFileSync( 'certificate.pem' );
|
||||
if(config.sslPort){
|
||||
var certificate = fs.readFileSync( 'database/certificates/cert.crt' );
|
||||
var privateKey = fs.readFileSync( 'database/certificates/cert.key' );
|
||||
|
||||
server = https.createServer({
|
||||
httpsServer = https.createServer({
|
||||
key: privateKey,
|
||||
cert: certificate
|
||||
}, app).listen(443);
|
||||
} else {
|
||||
}, app).listen(config.sslPort);
|
||||
}
|
||||
if(config.masterPort){
|
||||
server = require("http").Server(app);
|
||||
server.listen(config.masterPort || 8080, function () {
|
||||
console.log("Listening on port %s...", server.address().port);
|
||||
|
||||
Reference in new issue
Block a user