mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Move loading of config in master to startServer
Move the loading of the config file in the master server to the startServer function. Remove config.json.test as it's no longer needed.
This commit is contained in:
1 parent
651b09b613
commit
35546b4b18
4 files changed
+14
-53
No files matched your search
+9
-4
@@ -5,17 +5,22 @@ const parallel = require('mocha.parallel');
|
||||
const jwt = require("jsonwebtoken");
|
||||
|
||||
const master = require('./master.js');
|
||||
const config = require('./config.json');
|
||||
const authenticate = require('lib/authenticate');
|
||||
const database = require('lib/database');
|
||||
|
||||
|
||||
authenticate.setAuthSecret(config.masterAuthSecret);
|
||||
master._db.slaves = new Map();
|
||||
master._db.items = new database.ItemDatabase();
|
||||
|
||||
const token =
|
||||
jwt.sign( { id: "api" }, config.masterAuthSecret, { expiresIn: 600 });
|
||||
// Fields required in the config
|
||||
master._config.factorioDirectory = "factorio";
|
||||
master._config.itemStats = { maxEntries:60, entriesPerSecond: 1 / 60 };
|
||||
master._config.disableFairItemDistribution = true;
|
||||
|
||||
const testSecret = "TestSecretDoNotUse";
|
||||
authenticate.setAuthSecret(testSecret);
|
||||
|
||||
const token = jwt.sign({ id: "api" }, testSecret, { expiresIn: 600 });
|
||||
|
||||
async function get(path) {
|
||||
return await request(master.app).get(path).expect(200);
|
||||
|
||||
Reference in new issue
Block a user