@@ -33,10 +33,29 @@ Users will need the ``SCRIPTING:EXECUTE:path:to:the:script`` permission. Here th
...
@@ -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>`
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
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: