Public | Automated Build

Last pushed: a day ago
Short Description
A little web server, where paths and exec-commands can be configured with env variables.
Full Description

ShServer

A little web server, where paths and exec-commands can be configured with env variables

Usage

This server written to be used as a docker container.
The image can be found here.

You can set the paths the server responds to in environment variables that start with SHSERVER_. The rest of the variable is used as root path. Server handles only GET-requests.
The content of the env variables is executed with nodejs child_process.exec

Example:

docker run -d -p 3000:3000 -e SHSERVER_ls='ls -lh /somefile' -e SHSERVER_uptime='w' freiit/shserver

The output is a JSON-string with the elements stdout, stderr and error, if the execution call itself failed.

Example:

curl http://localhost:3000/uptime

Result:

{"error":null,
 "stdout":" 20:00:37 up 21 days,  5:28,  0 users,  load average: 0.00, 0.01, 0.05\nUSER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT\n",
 "stderr":""}
Docker Pull Command
Owner
freiit
Source Repository

Comments (0)