Hornwitser
5e410a6ac3
Use full path when referencing files in documentation
...
Include the packages/ component in paths referenced in the documentation
to make it clear where the files are located in the repository.
[skip travis]
2020-09-21 19:57:52 +02:00
Hornwitser
0cca9ed22c
Mark user creation tests as slow
...
Mark the "should not create the user if not instructed to" and "should
create the user if instructed to" tests as slow as these take more than
2 seconds to execute on travis.
2020-09-21 19:27:24 +02:00
Hornwitser
6621e37e23
Do not use ci in travis environment
...
Disable ci mode for lerna in travis environment as this requires
package-lock.json files to be commited to the repository and we do not
for the time being do this.
2020-09-21 18:51:21 +02:00
Hornwitser
bd8f685a18
Fix JSDoc module references
...
Fix module names, which are incorrectly deduced by JSDoc, and references
to master, slave and ctl modules that are now in separate packages.
2020-09-21 18:00:07 +02:00
Hornwitser
3485c9ac68
Rename clusterctl to clusterioctl
...
Rename the clusterctl command line utility to clusterioctl in order to
be consistent with the naming of the commands for master and slave.
2020-09-21 18:00:07 +02:00
Hornwitser
bf5a4a8a9c
Split up into multiple packages with Lerna
...
Split up codebase into the packages @clsterio/lib, @clusterio/master,
@clusterio/slave, and @clusterio/ctl using lerna to manage them. This
will allow deployment to use only the parts needed reducing install
size, and better separate the code into shared library, master, slave
and control.
2020-09-21 18:00:07 +02:00
Hornwitser
198d5c344b
Remove unused dependencies from dead code
...
Remove dependencies used by inventoryImports, external plugins and the
removed modManager code.
2020-09-16 15:09:23 +02:00
Hornwitser
efa3eff0d5
Delete old mod manager code
2020-09-16 15:09:23 +02:00
Hornwitser
6fde461da5
Merge pull request #313 from Hornwitser/list-management
...
List management
2020-09-16 15:08:21 +02:00
Hornwitser
3753c303dd
Add changelog entry for list synchronization
...
[skip travis]
2020-09-01 20:33:31 +02:00
Hornwitser
08ec542907
Move integration tests for lists sync
...
Move the integration tests for the admin, user, and ban list sync to be
done while an instance is running in order to hit more lines in the
coverage with them.
2020-09-01 20:16:17 +02:00
Hornwitser
a8b8232d73
Merge pull request #314 from RMuskovets/readme-typo-factorio-version
...
Fix a typo in README.md
2020-09-01 19:17:56 +02:00
Hornwitser
84450b83b4
Implement adminlist, whitelist and banlist sync
...
Add integration of the server adminlist, whitelist and banlist into
clusterio. Membership is stored as booleans in the user acconuts and
changes are synchronized live to slaves which pass it on to instances
which in turn will update the running server's lists with RCON commands.
2020-09-01 18:17:40 +02:00
Hornwitser
f08774bd4a
Add execCtl shortcut for clusterctl tests
...
Add execCtl which is a shortcut to execute node clusterctl with the test
config set.
2020-09-01 18:17:40 +02:00
Hornwitser
5e5a47ce02
Leave out roles array in serialized user
...
Leave out the roles property containing the array of role ids if the
user does not have any roles.
2020-09-01 17:59:19 +02:00
Hornwitser
9761fbb71c
Fix test names for clusterctl
...
Rename the test cases named after the old clusterctl commands for the
integrations to the new clusterctl commands.
2020-09-01 17:59:19 +02:00
Hornwitser
3c55188a87
Merge pull request #311 from Hornwitser/fix-logger-warning
...
Fix logger.warning is not a function
Fixes #303
2020-08-27 11:41:43 +02:00
Hornwitser
a40c78d85d
Fix logger.warning is not a function
...
Replace logger.warning with logger.warn as I incorrectly assumed the
warning method of console was called console.warning instead of
console.warn.
2020-08-27 11:31:36 +02:00
Hornwitser
2dcc5c9d47
Remove bcrypt dependency
...
Remove the unused dependencies to bcrypt and bcrypt-promise. These were
used by the playerManager plugin to implement password based
authentication, but this plugin is likely not going to be ported to 2.0.
2020-08-27 11:17:35 +02:00
Hornwitser
c59c30b840
Merge pull request #304 from Hornwitser/clusterctl-restructure
...
Restructre clusterctl cli interface
2020-08-26 13:23:33 +02:00
Hornwitser
fd307e58c2
Add global-chat shout command
...
Add command to broadcast a message to all instances from clusterctl.
2020-08-18 18:52:11 +02:00
Hornwitser
da1cbc16f7
Restructre clusterctl cli interface
...
Turn the flat list of commands into a hierarchy of commands, converting
most required parameters into positional parameters and add plugin
loading support for clusterctl.
2020-08-18 18:52:11 +02:00
Hornwitser
0802c5b29d
Merge pull request #301 from Hornwitser/custom-scenario
...
Add support for running custom scenarios
2020-07-08 12:46:49 +02:00
Hornwitser
781e40428f
Add enable_save_patching to mock instance config
...
Handle the factorio.enable_save_patching config option in the mock
instance as these are queried by instances after 9458155 .
2020-07-07 14:24:47 +02:00
Hornwitser
999386c088
Add --keep-open option to clusterctl
...
Add option to keep the console log open after starting an instance
instead of exiting as soon as it has finished starting up.
2020-07-06 13:16:57 +02:00
Hornwitser
8c6130adba
Add load scenario command
...
Add alternative method of starting an instance by loading a scenario.
Since there's no save when starting a scenario it can only be used if
the save patching is disabled.
2020-07-06 13:10:26 +02:00
Hornwitser
9458155a1b
Add option to disable save patching
...
Add factorio.enable_save_patching config entry to allow disabling the
save patching done on startup. This is for running vannila games or
scenarios that are not compatible with Clusterio.
2020-07-04 16:45:42 +02:00
Hornwitser
0969e07d79
Merge pull request #300 from Hornwitser/lint
...
Lint codebase
2020-06-17 22:12:27 +02:00
Hornwitser
9c9b3ac625
Document running tests and linting
...
Add section to contributing docs detailing how to run tests and linting
on the project.
2020-06-17 21:08:45 +02:00
Hornwitser
7814656241
Add ESLint check to travis integration
...
Invoke the lint package.json script during travis integration check.
2020-06-17 20:59:37 +02:00
Hornwitser
e9f5cae4f0
Fix misc problems detected by ESLint
...
Reformat and clean up issues detected by ESLint.
2020-06-17 20:59:37 +02:00
Hornwitser
8cb21c5fa8
Add dangling commas
...
Ensure multiline object and array litterals are consistenly typed out
with dangling commas for the last element.
2020-06-17 20:59:37 +02:00
Hornwitser
3e4f0b6b5e
Fix indents
...
Fix incorrectly indented code as detected by ESLint.
2020-06-17 20:59:33 +02:00
Hornwitser
703fda43ad
Fix JSDoc issues
...
Fix missing documentation for parameters and return types, incorect
config and errors in type definitions.
2020-06-17 20:53:18 +02:00
Hornwitser
3dba92a03d
Use strict mode
...
Add strict mode directives to all js files.
2020-06-17 20:53:18 +02:00
Hornwitser
b254e4189d
Use more consistent spacing in objects literals
2020-06-17 20:53:18 +02:00
Hornwitser
29f066a191
Fix missing semicolons
...
Ensure all statements end with a semicolon.
2020-06-17 20:53:18 +02:00
Hornwitser
34aaeee354
Use double quotes
...
Convert existing mix of double quotes and single quotes to only use
double quotes unless the string contains double quotes.
2020-06-17 20:53:18 +02:00
Hornwitser
efd759bec5
Add code linting using ESLint
...
Add ESLint as a dev dependency and configure it to match the preferred
style for the project. The config options set to warn are tentative and
may not be sensible as they haven't been fully investigated yet.
2020-06-17 20:53:18 +02:00
Hornwitser
922c6af632
Merge pull request #299 from Hornwitser/user-management
...
User management and authentication rework
2020-06-17 20:47:52 +02:00
Hornwitser
cf6f2cb70a
Add user and permission system
...
Add users, roles and permissions and rework the authentication to use
separate user and slave tokens for control and slave connections
respectively.
Add commands for listing permissions, roles and users, and creating,
editing and deleting roles and users.
2020-06-15 16:47:15 +02:00
Hornwitser
2acf57d23d
Fix erroneous delete of local variable
...
The delete operator only works on object properties, and causes the code
coverage to fail for the file in question if used on a local variable.
2020-06-15 00:13:25 +02:00
Hornwitser
07cff0ab9a
Fix error during slave authentication failure
...
Treat sending messages over a link that is not connected as a
SessionLost error and handle AuthenticationFailed error in the
startup logic of slave.
2020-06-15 00:13:25 +02:00
Hornwitser
3dfed4d2ad
Remove master.factorio_directory config
...
Remove old config entry for the old locale API that was removed with the
introduction of the new export system in 260f976 .
2020-06-15 00:13:25 +02:00
Hornwitser
c3179f0423
Move ControlConfig to lib/config/definitions.js
...
Move the definition of the control config to lib/config so that the
master code can use it.
2020-06-15 00:13:25 +02:00
Hornwitser
37bff10382
Merge pull request #298 from Hornwitser/config-event
...
Config events
2020-06-11 22:07:23 +02:00
Hornwitser
931ad4816f
Update config of running Factorio instances
...
Monitor the factorio.settings config for changes and apply them to
running instances via the /config set command.
2020-05-31 22:28:51 +02:00
Hornwitser
5b043524b4
Implement setProp in configs
...
Add setProp method for selectively changing one property of an object
field in a config group.
2020-05-31 16:08:21 +02:00
Hornwitser
8c9daff0bb
Add name shortcut for ConfigGroup instances
...
Add .name shortcut to get the groupName class property of config group
instances.
2020-05-31 14:16:06 +02:00
Hornwitser
67ca8dcc4d
Implement config notification event
...
Add fieldChanged event to config objects that is triggered when the
value of a field in a group belonging to it is changed.
2020-05-30 14:27:59 +02:00
Hornwitser
fc3686b865
Invoke plugin hooks via common function
...
Use a common function to iterate through and invoke the given hook in
every plugin, and ignore errors thrown by plugins from these hooks.
2020-05-30 14:27:59 +02:00
Hornwitser
01ea301a8c
Merge pull request #297 from Hornwitser/automate-export
...
Automate export process
2020-05-26 18:13:17 +02:00
Hornwitser
36cf14074e
Automatically upload export to master server
...
Upload the created export data zip file to a new /api/upload-export
endpoint on the master server which unpacks it into the appropriate
directory on the master.
2020-05-26 15:31:42 +02:00
Hornwitser
f3d4cfdcf5
Add reference to Slave in Instance
...
Add a reference to the Slave that's running the given instance in order
for it to be able to access the slave config.
2020-05-26 14:04:25 +02:00
Hornwitser
f8597f500c
Remove license note for angels icons
...
Remove notice about license for the now removed modded angels icons.
2020-05-26 13:17:58 +02:00
Hornwitser
2b20c943bb
Merge pull request #296 from Hornwitser/item-export
...
Implement icon and locale export
Closes #290
2020-05-26 13:16:11 +02:00
Hornwitser
1bddea8cec
Remove Factorio icons
...
Remove no longer used Factorio icons.
2020-05-26 01:12:05 +02:00
Hornwitser
e2255ddb7c
Remove inclusion of 3625 Angels item icons
...
Remove obsolete inclusion of the 3625 Angels item icons added by
09f476e .
2020-05-26 01:12:05 +02:00
Hornwitser
453226f246
Implement locale trenslation of resource names
...
Translate the names of the resources using the exported Factorio locale.
2020-05-26 01:12:05 +02:00
Hornwitser
260f976fa3
Implement export of item icons and locale
...
Add mod and command for exporting the Factorio locale including mods,
and item icons assemled into a sprite sheet including mods.
2020-05-26 01:11:49 +02:00
Hornwitser
d1b851d890
Move clusterio_lib to lua/clusterio_lib
...
Move the library mod to lua/clusterio_lib and restructure build_mod.js
to handle additonal files as a property to info.js instead of being hard
coded.
2020-05-25 20:45:09 +02:00
Hornwitser
2e24d6c8ae
Merge pull request #295 from Hornwitser/fix-windows
...
Fix Windows stop logic
2020-05-25 17:58:54 +02:00
Hornwitser
203f2d2a14
Fix Windows stop logic
...
Handle the Factorio server not exiting when encountering an error on
Windows and fix the hang detection for .stop().
2020-05-21 18:06:20 +02:00
Hornwitser
87d14252fc
Merge pull request #294 from Hornwitser/plugin-track
...
Integrate plugins closer with connections
2020-05-12 14:23:04 +02:00
Hornwitser
3211fbe985
Notify master about instance status update
...
Send updates to the master server when the running status of instances
change and add onInstanceStatusChanged hook to master plugins.
2020-05-11 18:10:11 +02:00
Hornwitser
a8e29fdc56
Separate instance from config in master
...
Separate the instance object and the config that belongs to the instance
object in the instances db held in memory on the master.
2020-05-11 18:07:41 +02:00
Hornwitser
a194508f52
Filter plugin messages forwarded to links
...
Drop events forwarded to a slave or instance that does not have the
plugin the event is defined in. Reject requests for the same reason.
2020-05-11 18:04:03 +02:00
Hornwitser
ca2839594e
Timeout quikly when disconnecting existing slave
...
If a slave that is already connected attempts connecting the existing
connection for that slave is disconnected. The most common scenario for
this is that the existing connection is stale and the slave is
attempting to connect agan. However if the connection is stale then the
disconnection will take 15 minutes to time out and the slave will appear
unresponsive during this time. Fix this problem by setting the timeout
to 15 seconds before disconnecting the existing connection.
2020-05-09 16:36:33 +02:00
Hornwitser
1b427af5f0
Fix client send buffer not being sent on ready
...
Fix WebSocketClientConnector not sending the send buffer queued up
between starting the connection and the master server sending the ready
signal for it.
2020-05-09 16:34:46 +02:00
Hornwitser
04ee3d3f96
Fix WebSocketClientConnector lifecycle events
...
Fix drop being repeatedly emitted while reconnecting and close not being
emitted on connection timeout.
2020-05-09 16:28:07 +02:00
Hornwitser
c87538ca58
Handle connection being closed in slave
...
Listen for the close event and connect again if the connection was
closed from proper disconnect or initiate a shutdown if the connection
was unexpectedly closed. Unexpected closure happens from authentication
failure and if a connection fails to reconnect before the timeout.
2020-05-09 16:24:02 +02:00
Hornwitser
c35b6de70e
Notify on connection events
...
Implement notification to plugins for disconnect request, connect, drop,
and close. This allows plugins to properly handle slaves and the master
server shutting down without sending messages that will get lost.
2020-05-08 23:49:28 +02:00
Hornwitser
b8b8c44083
Fix onExit not being invoked if plugin load fails
...
Fix instance not properly exiting if an error occurs during the loading
of a plugin.
2020-05-08 18:15:17 +02:00
Hornwitser
1beffb1bfd
Fix crash on hartbeat on closing connection
...
Fix heartbeat incorrectly asserting it cannot be sent on a connection in
the closing state.
2020-05-08 18:09:48 +02:00
Hornwitser
b151dd8469
Fix documentation
...
Fix missing module declarations, broken lings, broken formating and
incorrect scopes in the documentation. For modules split over several
files it appears the only viable option is to use the memberof directive
on each documented member and only declare the index file as a module.
2020-05-08 17:28:06 +02:00
Hornwitser
7a9b6592e6
Handle disconnect in link integration test
...
Handle the prepareDisconnect request properly in the TestControl in
test/integration/link.js.
2020-05-07 13:23:11 +02:00
Hornwitser
5c1214ad38
Rename connected and dropped events
...
Rename the connector events connected and dropped to connect and drop
respectively to be consistent with common Node.js names for events like
close.
2020-05-07 12:36:43 +02:00
Hornwitser
1629eaf225
Track plugins loaded by master and slaves
...
Send a mapping of the plugins the master server has loaded to slaves
vice versa. Limit the plugins that may be loaded by instances to only
those that the master server has loaded.
2020-05-06 20:14:40 +02:00
Hornwitser
4060c75142
Merge pull request #293 from Hornwitser/alpha-bugfixes-2
...
Alpha bugfixes 2
2020-05-06 20:13:22 +02:00
Hornwitser
f3c13eab21
Simplify level logic
...
Simplify tech level logic according to TheAiBot's suggestion.
2020-05-06 19:49:33 +02:00
Hornwitser
e9fab3cc10
Fix level > max_level crash in research_sync
...
Fix crash when technologiy level stored on the master is greater than
the max_level for the technology in Factorio. This can happen with mods
that for example reduce the max_level from inifity to a finite level.
2020-04-24 15:27:30 +02:00
Hornwitser
446333f4aa
Fix stylesheet loaded from wrong location
...
Fix stylesheet path not taking into account the web_root config.
2020-04-24 15:26:52 +02:00
Hornwitser
f8817ecf0c
Merge pull request #292 from Hornwitser/alpha-bugfixes
...
Alpha bugfixes
2020-04-19 23:32:10 +02:00
Hornwitser
c601c53044
Fix typo in clusterctl.js
...
Fix SessionLost being refered to as a global instead of from the errors
module in clusterctl.js.
2020-04-19 18:24:43 +02:00
Hornwitser
3603b16901
Fix missing space in researched notification
...
Add space between the technology name and the level in the notification
for researched technologies.
2020-04-19 18:23:37 +02:00
Hornwitser
f4ca8366e2
Handle contributions to the next level of a technology
...
Fix research_sync sending out contribution events for the previous level
of a researched technology and sending finished events for the wrong
level when synchronizing technologies. Both of these issues are related
to failing to accunt for the unlocked level being one less than the
level stored when the researched property is false.
2020-04-19 18:20:28 +02:00
Hornwitser
b6585e6364
Fix reconnect giving up too early
...
Fix the reconnect logic giving immediately if a previous reconnection
had been made long prior to the connection being dropped again.
2020-04-18 23:37:50 +02:00
Hornwitser
d2fb33f8b9
Fix log spam by subspace_storage plugin
...
Fix log spam when the dole distribution method is used on
subspace_storage plugin. This was caused by a bogus if condition being
translated into a sensible but wrong one.
2020-04-18 23:37:50 +02:00
Hornwitser
15ad64e356
Fix web icons ignoring web_root ( #291 )
...
Fix the URLs for the item icons in the web interface ignoring the
web_root config option.
[travis skip]
2020-04-17 17:46:17 +02:00
Hornwitser
534408856c
Merge pull request #284 from Hornwitser/small-things-2
...
Small things 2
2020-04-11 02:04:59 +02:00
Hornwitser
430aa6d207
Disable heap and memory size tests
...
Disable the tests for the memory and heap size metrics as the travis
environment is apparently using 3x as much memory as locally.
2020-04-09 20:44:06 +02:00
Hornwitser
00d1d304d2
Fix integration test certificate path
...
Fix integration tests using the default certificate paths instead of
having them located in the dedicated test database directory. Also
increment key size to the minimum allowed of 1024.
2020-04-09 20:35:51 +02:00
Hornwitser
38c392ff6d
Fix kill logic of integration test
...
Test if the process variable exists before trying to call kill on it, as
in certain failure situations it is not set.
2020-04-09 20:08:04 +02:00
Hornwitser
4f463a8180
Reduce number of bits in generated test cert
...
Add config entry for the number of bits to use in the auto generate TLS
certificate for the master server and reduce it to 512 for the
integration test. This reduces the time needed to generate the
certificate in the integration test.
2020-04-09 20:02:29 +02:00
Hornwitser
2c855a5846
Add debug-dump-ws command
...
Add debug command to dump the WebSocket messages being sent and received
by the master server to aid in finding chatty events.
2020-04-09 19:50:01 +02:00
Hornwitser
61d92a6910
Rename master plugin onExit hook to onShutdown
...
Rename the onExit hook for master plugins to onShutdown to better
reflect when it is invoked.
2020-04-09 19:50:01 +02:00
Hornwitser
9507608e59
Rework disconnect logic for connectors
...
Rework the way disconnection at shutdown is done to properly close
the connections when the master server is shut down.
2020-04-09 19:50:01 +02:00
Hornwitser
47ea8f5477
Rename connection shutdown to prepare disconnect
...
Rename the shutdownConnection request to prepareDisconnect to better
reflect its actual purpose.
2020-04-09 16:17:38 +02:00
Hornwitser
e7d1039942
Link to writings plugins document in docs
...
Replace notice about in development plugin interface with a link to the
writing plugins document in the developing for clusterio document.
2020-04-09 16:17:38 +02:00
Hornwitser
fc04fd9ebc
Remove master branch warning
...
Remove warning of master branch being broken now that it's no longer
completely broken.
2020-04-09 16:17:38 +02:00