diff --git a/config.json.dist b/config.json.dist deleted file mode 100644 index b5faadc2..00000000 --- a/config.json.dist +++ /dev/null @@ -1,32 +0,0 @@ -{ - "__comment": "Where factorio folder. Should be in the same folder as this config file.", - "factorioDirectory": "./factorio", - "databaseDirectory": "./database", - - "__commentMasterPort": "HTTP port for the master to listen to", - "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, - "sslCert": "database/certificates/cert.crt", - "sslPrivKey": "database/certificates/cert.key", - - "__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 on new instances", - "username": "", - "__comment4": "Token from your factorio.com profile page. Required for MP and mod manager services.", - "token": "", - - "__comment5": "General user settings", - "verify_user_identity": true, - "auto_pause": false, - "allow_commands": "admins-only", - "game_password": "", - "description": "This server runs Clusterio", - "visibility": { - "public": true, - "lan": true - }, -} diff --git a/lib/isFactorioCommand/index.js b/lib/isFactorioCommand/index.js deleted file mode 100644 index 408a2086..00000000 --- a/lib/isFactorioCommand/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./isFactorioCommand"); diff --git a/lib/isFactorioCommand/isFactorioCommand.js b/lib/isFactorioCommand/isFactorioCommand.js deleted file mode 100644 index 239bbc59..00000000 --- a/lib/isFactorioCommand/isFactorioCommand.js +++ /dev/null @@ -1,23 +0,0 @@ -const luamin = require("luamin"); -function isFactorioCommand(command){ - if(typeof command != "string"){ - return false; - } else if(!command.includes("/silent-command ") && !command.includes("/c ")){ - return false; - } else if(command[0] != "/"){ - return false; - } else { - // check that what follows /c is valid LUA - let x = command.replace("/silent-command ", "").replace("/c ",""); - let y - try{ - y = luamin.minify(x); - } catch (e) { - return false; - } - - // by this point it is surely a LUA command - return true; - } -} -module.exports = isFactorioCommand; \ No newline at end of file diff --git a/lib/typedef.js b/lib/typedef.js deleted file mode 100644 index 1e888ab7..00000000 --- a/lib/typedef.js +++ /dev/null @@ -1,11 +0,0 @@ -/** -An item with a count specified - -@typedef {object} itemStack -@property {string} name The name of the item in the stack -@property {(number|string)} count The amount of items in the stack - -@example -itemStack = {name:"iron-plate", count:"12"} -itemStack = {name:"copper-plate", count:972} -*/ \ No newline at end of file diff --git a/static/main.js b/static/main.js index 65b7a1e8..deceacfe 100644 --- a/static/main.js +++ b/static/main.js @@ -1,6 +1,5 @@ (function (){ - ensureSetting("Display offline slaves", "boolean", false); ensureSetting("Periodically update storage screen", "boolean", true); }()) diff --git a/static/slaveDisplay.js b/static/slaveDisplay.js deleted file mode 100644 index 6a0a5dc5..00000000 --- a/static/slaveDisplay.js +++ /dev/null @@ -1,26 +0,0 @@ - -// ask master for slaves and render them nicely on a page with production graphs -setTimeout(function() { - var xmlhttp = new XMLHttpRequest(); - xmlhttp.onreadystatechange = function() { - if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { - var slaveData = JSON.parse(xmlhttp.responseText); - var HTML = "

Current connections:

" - for(i=0;i

" + slaveData[key].instanceName + "

ID: " + slaveData[key].unique + "

Last seen: "+seenDate+"

Online players: "+slaveData[key].playerCount+"

IP: "+slaveData[key].publicIP +":"+ slaveData[key].serverPort+"

" - HTML += "

Host: "+slaveData[key].mac+"

"; - HTML += ""; - } - } - document.querySelector("#slaves > #display").innerHTML = HTML - } - } - xmlhttp.open("GET", "api/slaves", true); - xmlhttp.send(); -}, 0) diff --git a/test/lib/isFactorioCommand/isFactorioCommand.js b/test/lib/isFactorioCommand/isFactorioCommand.js deleted file mode 100644 index 8faa141c..00000000 --- a/test/lib/isFactorioCommand/isFactorioCommand.js +++ /dev/null @@ -1,18 +0,0 @@ -const isFactorioCommand = require("lib/isFactorioCommand"); -const assert = require("assert"); - -describe("inventoryImports/isFactorioCommand.js()", function(){ - it("Returns false if input is not a factorio command", function(){ - assert(isFactorioCommand({}) == false, "This is not even a string so should return false"); - assert(isFactorioCommand("Howdy boys!") == false, "This is not a command so should return false"); - assert(isFactorioCommand("/c this ain't a command because its invalid LUA") == false, "This is not valid LUA so it should return false"); - assert(isFactorioCommand("Trying to trick the system /c game.print('Hello world!')") == false, "this is still not a command"); - - }); - it("Returns true if it is a valid command", function(){ - assert(isFactorioCommand("/c game.print('hello world')"), "This is a valid command, should output true not false") - }); - it("Fails to understand that leading spaces are valid", function(){ - assert(isFactorioCommand(" /c game.print('Hello world!')") == false, "This should be true but often returns false unintentionally. If you see this you probably fixed the bug so change this test, OK?") - }); -}); \ No newline at end of file diff --git a/test/missing.js b/test/missing.js index f87ddc85..35e53b8d 100644 --- a/test/missing.js +++ b/test/missing.js @@ -3,4 +3,3 @@ require('lib/manager/modManager'); require('lib/npmPostinstall.js'); -require('lib/typedef'); diff --git a/views/nodes.ejs b/views/nodes.ejs index 31606dbb..cb879213 100644 --- a/views/nodes.ejs +++ b/views/nodes.ejs @@ -1,7 +1,6 @@ <%- include("head") %> -