Hornwitser
a63c341209
Move unit tests to test/ folder
...
Move unit tests for client, master, and the lib to test/ and move plugin
unit tests to <plugin dir>/test.
2019-09-14 14:49:52 +02:00
Arvids Godjuks
74c99b9e13
Merge pull request #233 from Hornwitser/client-refactor-and-fixes
...
Client refactor and fixes
2019-09-14 02:14:38 +02:00
Hornwitser
bcb22d2af7
Securely generate rcon password
...
Replace Math.random() based password generation for the rcon interface
with a more secure method based crypto.randomBytes.
2019-09-14 01:18:51 +02:00
Hornwitser
eb1b863cec
Remove unimplemented mods update command
...
Remove the mods update command from the client command line interface as
this calls the non-existant modManager.updateAllMods function.
2019-09-14 01:15:36 +02:00
Hornwitser
2428cba2bd
Default to ports in the dynamic range
...
Use random ports in the dynamic range as define by RFC 6335 for
instaces.
2019-09-14 01:15:01 +02:00
Hornwitser
500c9584eb
Remove commented out itemStats code
...
Remove old commented out code dealing with item statistics that is no
longer relevant.
2019-09-14 00:56:22 +02:00
Hornwitser
18a904d9de
Use as-table for listInstances
...
Rewrite listInstances to use as-table instead of manually coded table
generation.
2019-09-14 00:54:32 +02:00
Hornwitser
85daf6df19
Rename listPlugins to listInstances
...
Rename incorrectly named function listPlugins to listInstances.
2019-09-14 00:53:50 +02:00
Arvids Godjuks
a57b0a3b5e
Merge pull request #231 from Hornwitser/auth-master
...
Port socket.io Authentication to master
2019-09-11 17:52:10 +02:00
Hornwitser
8aa66e9e68
Port authentication of socket.io server
...
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.
This is a port of 0c45e57 .
2019-09-11 16:59:11 +02:00
Hornwitser
d378287941
Restructure Changelog
...
Make "Changelog" the top level header, and move the existing headers one
level down.
2019-09-10 23:53:21 +02:00
AlienXAXS
ea5c0d5aa3
Fixes editSlaveMeta and db AddItem errors ( #228 )
...
Fixed editSlaveMeta to pass a number to db.addItem method
2019-09-10 17:52:09 +02:00
Arvids Godjuks
094d44a7f5
Merge pull request #227 from Hornwitser/config-part-2
...
Config Rewrite Part 2
2019-09-09 14:06:50 +02:00
Hornwitser
1bbf1542d2
Refactor client.js command handling into functions
...
Move the various actions performed by client.js into separate async
functions and do the command action logic if client.js is invoked as a
module directly.
2019-09-09 12:44:09 +02:00
Hornwitser
98900e72dc
Merge masterIP and masterPort into masterURL
...
Merge the masterIP and masterPort configuration entries into a single
masterURL entry. Fixes the problem with connecting to an HTTPS version
of the master server and also makes it easier to host the master server
behind a reverse proxy.
This breaks all known code interfacing Clusterio.
2019-09-09 12:44:09 +02:00
Hornwitser
da99b39402
Remove compiled TypeScript code
...
Remove the compiled output of veladon's clusterioModel project. The
source code can be found at https://github.com/veladon/clusterioModel
and doesn't really belong in Clusterio as it's specific to the train
teleports plugin.
2019-09-06 15:43:44 +02:00
Arvids Godjuks
aba22960a6
Merge pull request #226 from Hornwitser/check-tests
...
Check the exit status of the tests script
2019-09-06 12:55:17 +02:00
Hornwitser
0ec37414c2
Deduplicate test script and check exit status
...
Remove the explicit ignoring of the exit status of the test scripts.
This makes the Travis CI build be considered a failure if one of the
tests fail. Also rewrite the fast-test script to use the test script.
2019-09-06 00:16:13 +02:00
Arvids Godjuks
2e50921d32
Documentation adjustments ( #225 )
...
README.md update - adjusted install instruction to be against the stable branch
2019-09-05 14:55:42 +02:00
TheAIBot
e14f7c22fd
Merge pull request #222 from Hornwitser/config-part-1
...
Config Rewrite Part 1
2019-09-05 11:33:43 +02:00
Hornwitser
a31778c7ff
Remove unused config parameter to pluginManager
...
Remove the unused library initialization parameter config to
pluginManager and reorganize pluginManager to no longer be defined by a
function.
2019-09-04 20:43:13 +02:00
Hornwitser
35546b4b18
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.
2019-09-04 20:43:13 +02:00
Hornwitser
651b09b613
Refactor database and item retreival
...
Change the ugly global slaves object to be a member of the db object and
implement the items database as a separate integrety verifying class in
lib/database.
2019-09-04 20:43:13 +02:00
Arvids Godjuks
e1263a40b1
Merge pull request #221 from Hornwitser/fix-socketio
...
Fix master socket.io broken by a3fc1dd
2019-09-04 18:28:22 +02:00
Hornwitser
23ce86aef6
Fix master socket.io broken by a3fc1dd
...
Add missing attach calls to the master socket.io object that was
accidentally removed by the refactoring in a3fc1dd . Unfortunately I've
been unable to determine if socket.io actually supports listening on
multiple servers at the same time, this needs further investigation.
2019-09-04 17:39:49 +02:00
Hornwitser
5d6f6de379
Export app as a separate entry from master.js
...
Change the module exports from master.js to allow additional objects to
be passed to allow better unit testing.
2019-09-04 17:36:06 +02:00
Hornwitser
af2471b427
Remove config dependency in lib/authenticate
...
Restructure lib/authenticate to set the authentication secret at a later
point in time via setAuthSecret. This breaks playerManager.
2019-09-04 17:36:06 +02:00
Arvids Godjuks
8c1c8d07a9
Merge pull request #224 from Hornwitser/duck-tape-researchsync
...
Duck tape researchsync tests
2019-09-04 17:34:28 +02:00
Arvids Godjuks
b0ad02d412
Merge pull request #219 from Hornwitser/dev-notice
...
Add development warning
2019-09-04 17:32:51 +02:00
Arvids Godjuks
7d61cd9716
Updated README.md to warn about master usage
...
And checkout the 1.2.x branch instead or use the release.
2019-09-04 16:22:58 +02:00
Hornwitser
31298c7c1c
Duct tape together researchSync tests
...
Add nock that responds to the requests the researchSync module makes
during the tests, and disable broken tests.
2019-09-04 14:59:25 +02:00
Hornwitser
b191f7d831
Use instanceName in researchSync
...
Remove silly roundabout way to the get the current instance name.
2019-09-04 14:59:21 +02:00
Hornwitser
f4ca5d92a1
Pass instance name to plugins
...
Add instanceName entry to the config passed to plugins that contains the
name of the current instance.
2019-09-04 14:59:01 +02:00
Hornwitser
703423ae54
Add development branch warning at startup
...
Add a big banner based warning telling this is the development branch
for clusterio to the startup of client.js and master.js.
2019-09-01 23:34:52 +02:00
Hornwitser
84f48e36f4
Improve error reporting at startup
...
Add StartupError that differentiates unhandled errors from errors with
known causes and use it to only print the "please report" banner when an
unhandled error occurs.
Also makes the error reporting more visible in the console.
2019-09-01 23:24:32 +02:00
Hornwitser
6ee84c41bf
Add development branch notice
...
Add notice to the top of README.md stating this is the development
branch for 2.0 and that the 1.2.x branch should be used for production
systems.
2019-08-30 19:34:23 +02:00
Arvids Godjuks
ef66ab37da
Merge pull request #218 from Hornwitser/remove-remanent-remotemap
...
Remove remanent remoteMap code
2019-08-29 14:36:51 +02:00
Hornwitser
b73b202513
Remove remanent remoteMap code
...
Remove remoteMap specific code left behind after the removal of the
remoteMap plugin in 6415784 . The plugin interface should be versatile
enough to allow all of this code to reside inside the plugin itself.
2019-08-29 11:38:57 +02:00
Arvids Godjuks
5d28718175
Merge pull request #215 from Hornwitser/various-fixes
...
Various unrelated fixes and improvements
2019-08-24 16:36:26 +02:00
Hornwitser
3b08b73c37
Remove unused function parseJsString
...
Remove unused and dangerous parseJsString function from
inventoryImports.
2019-08-24 11:55:19 +02:00
Hornwitser
9c9b4463a4
Fix nested headers in static/nodes
...
Fix instance names being nested in both h2 and h5 headers, which is not
allowed in html.
2019-08-24 11:35:57 +02:00
Hornwitser
fb2519cb50
Add fast-test and fast-cover npm scripts
...
Add alternate test and coverage scripts that skips tests that are slow.
2019-08-24 11:25:40 +02:00
Hornwitser
5a9e2a8825
Fix inventoryImports/interfacingFunctions test
...
Fix test in inventoryImports/interfacingFunctions breaking due to
masterAuthSecret not being defined in the config.
2019-08-24 11:25:40 +02:00
Hornwitser
a39a17b220
Throw Error objects in inventoryImports/interfacingFunctions
...
Change throwing of strings objcts to throw proper Error objects.
2019-08-24 11:25:40 +02:00
Hornwitser
940a7b9180
Refactor getFactorioLocale spec
...
Fix the incorrect error validation, be more lenient about empty values
and convert the checks to use async functions instead of error prone
callbacks.
Remove excessive getFactorioLocale checks in master.spec.
2019-08-24 11:25:40 +02:00
Hornwitser
ab2a377ca5
Remove Prometheus pushgateway code
...
Remove code pushing metrics to a hardcoded Prometheus pushgateway that
is no longer in operation. There's no point supporting the use of a
pushgateway as there's already a full client implemented and since the
master server is not ephemeral or batch job it shouldn't be using a
pushgateway in the first place.
2019-08-24 11:25:40 +02:00
Hornwitser
ea2f291025
Remove reference to old authentication scheme
...
Remove long comment and commented out code about an old sanity check in
/api/place.
2019-08-24 11:25:40 +02:00
Hornwitser
3e80e40223
Move database and masterMods folder creation
...
Move the code creating the database and masterMods folders into the
startServer function in master.js.
2019-08-24 11:25:39 +02:00
Hornwitser
ed54db0db9
Handle errors during master startup
...
Print a message urging unhandled exceptions thrown by startup to be
reported to the GitHub issue tracker and initiate shutdown.
2019-08-24 11:09:01 +02:00
Hornwitser
7dcd46a99a
Add .vs to .gitignore
...
Prevent Visual Studio workspace files from getting accidentally added to
the project.
2019-08-24 11:04:58 +02:00