Minetest server-sent CSM proof-of-concept
Source (alternate links: GitHub, GitLab).A lua-based implementation of SSCSMs. This mod (probably) requires Minetest 5.0.0 or later.
How it works
Any client with the CSM installed will automatically attempt to request SSCSMs from the server via a mod channel. If the server has this mod installed, it will reply with a few messages containing the mod name and partially minified mod code. The CSM will then create a separate environment so SSCSMs cannot mess with existing CSMs (and so CSMs do not accidentally interfere with SSCSMs), and execute the SSCSMs inside this environment. Note that it is trivial for users to modify this environment. The server-side mod sends two "built-in" SSCSMs before and after all other SSCSMs to add extra helper functions (in the sscsm namespace), to execute register_on_mods_loaded callbacks and attempt to leave the mod channel.
Installation (client-side mod)
To install the CSM, you can follow GreenDimond's CSM installation guide. If you would like to allow/deny/inspect code before running SSCSMs, use the "csm_strict" directory (and make sure to rename it to "sscsm_strict" or "sscsm") instead.
Direct download
Installation (server-side mod)
The server-side mod can be installed normally, however mod channels must be enabled to communiate with clients (add enable_mod_channels = true to minetest.conf). SSCSMs will most likely require a less strict csm_restriction_flags setting, adding csm_restriction_flags = 60 to minetest.conf should fix most chat-oriented SSCSMs (but will also allow other CSMs to send chat messages).
API
The API is available on the git repository.
Dependencies
This mod is a library for other mods to use and has no dependencies.
License
This SSCSM implementation is licensed under the LGPL v3.0+ license.