Introducing ScriptForm: Stand-alone webserver that generates forms to serve as frontends to scripts
Monday, December 7th, 2015
I've just releases v1.0 of ScriptForm.
ScriptForm is a stand-alone webserver that automatically generates forms from JSON to serve as frontends to scripts. It takes a JSON file which contains form definitions, constructs web forms from this JSON and serves these to users over HTTP. The user can select a form and fill it out. When the user submits the form, it is validated and the associated script is called. Data entered in the form is passed to the script through the environment. See the Example to learn more about how it works.
I wrote ScriptForm to quickly give non-technical users the ability to perform restricted actions through a friendly web interface. Some use-cases I've used it for so far:
- Allow users to upload CSV files that need to be processed
- Let non-technical users create and modify Apache htpasswd files (add, delete and reset user passwords).
- Give customers the ability to view their services' status and restart certain services which tend to hang every so often.
- Given a certain date range, export data as CSV files.
- Serve as a simple REST API that's incredibly easy to set up and use.
Some features it includes are:
- Very rapidly construct forms with backends.
- Completely standalone HTTP server; only requires Python.
- Callbacks to any kind of script / program that supports environment variables.
- User authentication support through Basic HTAuth.
- Validates form values before calling scripts.
- Uploaded files are automatically saved to temporary files, which are passed on to the callback.
- Multiple forms in a single JSON definition file.
- Scripts can produce normal output, HTML output or stream their own HTTP response to the client. The last one lets you stream images or binaries to the browser.
- Run scripts as different users without requiring sudo.
ScriptForm is Free Software / Open Source software released under the GNU GPL v3.
Some links for further information:
Github repository / source: https://github.com/fboender/scriptform
Download releases: https://github.com/fboender/scriptform/releases, packages are available for Debian, Redhat and other Linux-bases systems.