diff --git a/src/doc/administration/server_side_scripting.rst b/src/doc/administration/server_side_scripting.rst index 3118142335fb70da584a6ebc5bab27ef5f12bd9f..59bce98682c6d1190fc90681fc8e14fd483e891e 100644 --- a/src/doc/administration/server_side_scripting.rst +++ b/src/doc/administration/server_side_scripting.rst @@ -33,10 +33,29 @@ Users will need the ``SCRIPTING:EXECUTE:path:to:the:script`` permission. Here th For more information see the :doc:`specification of the API <../specs/Server-side-scripting>` +Environment +------------ + +The script is called with several special environment variables to accommodate +for its special location. + +`HOME` +^^^^^^^^^^^^ +To be able to run with reduced privileges, the script has its `HOME` environment +variable set to a special directory with write access. This directory will be +deleted after the script has terminated. Its content is freshly copied for each +script invocation from a skeleton directory, located in the server directory, in +`scripting/home/`. By default, this directory contains the following: + +- `readme.md` :: A small text file describing the purpose of the directory. + +Users of CaosDB are invited to populate the directory with whatever their +scripts need. + Invocation ------------ -Server side scripts are triggered by sending a POST to the `/scripting` interface (see [API scripting](path??). There are the following arguments that can be provided: +Server side scripts are triggered by sending a POST to the `/scripting` resource. There are the following arguments that can be provided: - `call`: the name of the script to be called - `-pN`: positional arguments (e.g. `-p0`, `-p1` etc.) @@ -47,6 +66,7 @@ The arguments will be passed to the script. An invocation via a button in javascript could look like: .. code-block:: javascript + var _make_sss_button = function (entity) { const script = "script.py"; @@ -63,21 +83,3 @@ An invocation via a button in javascript could look like: For more information see the :doc:`specification of the API <../specs/Server-side-scripting>` -Environment ------------- - -The script is called with several special environment variables to accommodate -for its special location. - -`HOME` -^^^^^^^^^^^^ -To be able to run with reduced privileges, the script has its `HOME` environment -variable set to a special directory with write access. This directory will be -deleted after the script has terminated. Its content is freshly copied for each -script invocation from a skeleton directory, located in the server directory, in -`scripting/home/`. By default, this directory contains the following: - -- `readme.md` :: A small text file describing the purpose of the directory. - -Users of CaosDB are invited to populate the directory with whatever their -scripts need.