Skip to content

New SikulixServer Design

Raimund Hocke edited this page Jun 8, 2019 · 21 revisions

Starting

To start SikulixServer from a command line:
java -jar sikulix.jar -s -g groups-config -x ip-config

-g groups-config will be detailed later Groups -x ip-config will be detailed later Security

Groups

A group represents a folder location or more general a location somewhere in the world. (only local folder location currently)
SikulixServer accesses resources through a group.

Group configuration is given at SikulixServer starting.
There are three ways to do this.

  • -g folder-spec :: sets the default location
  • -g someFile[.txt] :: contains lines group-name : folderspec, first line defines the default
  • -g someFile.json :: same as JSON

A default group (default location) is that is implicitly referenced when /groups is omitted in some commands described later.

Commands (REST-Like API)

Scripts

This command must be preceded by /groups. However, if omitted, the default group is assumed to be preceded.

  • /scripts
    Represents the available scripts in the group.
    GET - Return a list of available scripts in the group.

  • /scripts/:name
    Represents the named script.
    GET - Returns info about the named script.

  • /scripts/:name/run?args=:args
    A controller that executes the named script.
    GET/POST - Executes the script synchronously and waits for it to finish before returning. Create a new task implicitly as this request is also going to be queued in.

  • /scripts/:name/tasks?args=:args
    Represents the named script's tasks.
    POST - Creates a new task which runs the given script and returns a task object. (asynchronous)

Groups

This command can only be used at the first path.

  • /groups
    Represents the available groups.
    GET - Returns a list of available groups.

  • /groups/:name
    Represents the named group.
    GET - Returns the subtree (folder only) in the group.

Tasks

This command can be preceded by /scripts. In that case, only the tasks for the script are referenced.

  • /tasks
    Represents the tasks.
    GET - Returns a list of tasks.

  • /tasks/:id
    Represents the task of ID.
    GET - Returns the task of ID.

  • /tasks/:id/cancel
    A controller that cancels the task of ID.
    PUT - Cancels the task of ID.

Server Controllers

This command can only be used at the first path.

  • GET/POST /pause
    Finishes the currently running script and pauses further script execution.
    Calls to run after pause should give some 4xx error to indicate that the server is in pause mode. Asynchronous runs can still be placed in the task queue.

  • GET/POST /resume
    Resumes script execution.

  • GET/POST /stop
    Stops SikulixServer.

Security

SikulixServer do the source IP checking.
Have the user define a list of allowed remote IPs. (Only localhost by default). * configuration is undecided.
If the user is using a reverse proxy he can just leave this setting on localhost and implement access restrictions there.