{"id":13557581,"url":"https://github.com/fboender/scriptform","last_synced_at":"2025-06-14T00:03:05.138Z","repository":{"id":28954280,"uuid":"32480365","full_name":"fboender/scriptform","owner":"fboender","description":"Webserver that automatically generates forms to serve as frontends to scripts","archived":false,"fork":false,"pushed_at":"2021-03-27T09:48:05.000Z","size":600,"stargazers_count":46,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T13:37:24.570Z","etag":null,"topics":["automation","forms","frontend","lightweight","runner","script","web"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fboender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-18T19:43:36.000Z","updated_at":"2024-02-18T07:24:12.000Z","dependencies_parsed_at":"2022-08-17T18:45:26.779Z","dependency_job_id":null,"html_url":"https://github.com/fboender/scriptform","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/fboender/scriptform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboender%2Fscriptform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboender%2Fscriptform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboender%2Fscriptform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboender%2Fscriptform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fboender","download_url":"https://codeload.github.com/fboender/scriptform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboender%2Fscriptform/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259737891,"owners_count":22903869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","forms","frontend","lightweight","runner","script","web"],"created_at":"2024-08-01T12:04:25.981Z","updated_at":"2025-06-14T00:03:05.082Z","avatar_url":"https://github.com/fboender.png","language":"Python","readme":"# ScriptForm\n\n![Status: Stable](https://img.shields.io/badge/status-stable-green.svg)\n![Build Status](http://build.electricmonk.nl/job/scriptform/shield)\n![Activity: Active development](https://img.shields.io/badge/activity-active%20development-green.svg)\n![License: GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)\n\nA stand-alone webserver that automatically generates forms from JSON to serve\nas frontends to scripts.\n\nScriptForm takes a JSON file which contains form definitions. It then\nconstructs web forms from this JSON and serves these to users over HTTP. The\nuser can select a form and fill it out. When the user submits the form, it is\nvalidated and the associated script is called. Data entered in the form is\npassed to the script through the environment.\n\nPackages are available for:\n\n* [Debian / Ubuntu](https://github.com/fboender/scriptform/releases)\n* [RedHat / Centos](https://github.com/fboender/scriptform/releases)\n* [Other operating systems](https://github.com/fboender/scriptform/releases)\n\n## Features\n\n- Very rapidly construct forms with backends.\n- Completely standalone HTTP server; only requires Python.\n- Callbacks to any kind of script / program that supports environment\n  variables.\n- User authentication support through Basic HTAuth.\n- Validates form values before calling scripts.\n- Uploaded files are automatically saved to temporary files, which are passed\n  on to the callback.\n- Multiple forms in a single JSON definition file.\n- Scripts can produce normal output, HTML output or stream their own HTTP\n  response to the client. The last one lets you stream images or binaries to\n  the browser.\n- Run scripts as different users without requiring sudo.\n- Audit log: All form submissions including entered values can be logged to a\n  logfile for auditing.\n\n\n## Use-cases\n\nScriptform is very flexible and as such serves many use-cases. Most of these\nrevolve around giving non-technical users a user friendly way to safely run\nscripts on a server.\n\nHere are some of the potential uses of Scriptform:\n\n- Add / remove users from htpasswd files.\n- Execute SQL snippets.\n- View service status\n- Upload data to be processed.\n- Restart, enable and disable services.\n- Trigger for batch processing.\n\n## Example\n\nThe following example lets you add new users to a htpasswd file via ScriptForm.\nIt presents the user with a form to enter the user's details. When the form is\nsubmitted, the `job_add_user.sh` script is called which adds the user to the\nhtpasswd file.\n\n\nForm configuration file: `test_server.json`\n\n    {\n      \"title\": \"Test server\",\n      \"forms\": [\n        {\n          \"name\": \"add_user\",\n          \"title\": \"Add user\",\n          \"description\": \"Add a user to the htpasswd file\",\n          \"submit_title\": \"Add user\",\n          \"script\": \"job_add_user.sh\",\n          \"fields\": [\n            {\"name\": \"username\", \"title\": \"Username\", \"type\": \"string\"},\n            {\"name\": \"password1\", \"title\": \"Password\", \"type\": \"password\"},\n            {\"name\": \"password2\", \"title\": \"Repeat password\", \"type\": \"password\"}\n          ]\n        }\n      ]\n    }\n\nThe script `job_add_user.sh`:\n\n    #!/bin/sh\n\n    if [ -z \"$password1\" ]; then\n        echo \"Empty password specified\" \u003e\u00262; exit 1\n    fi\n    if [ \"$password1\" != \"$password2\" ]; then\n        echo \"Passwords do not match\" \u003e\u00262; exit 1\n    fi\n\n    htpasswd -s -b .htpasswd \"$username\" \"$password1\" || exit $?\n\n    echo \"User created or password updated\"\n\nSet some rights and create the initial `htpasswd` file:\n\n    $ chmod 755 job_add_user.sh\n    $ touch .htpasswd\n\nWe can now start ScriptForm to start serving the form over HTTP. By default it\nstarts as a daemon, so we specify the `-f` option to start it in the foreground\ninstead. We also specify the port, even though 8081 is already the default.\n\n    $ scriptform -f -p8081 ./test_server.json\n\nThe user is presented with the following form:\n\n![](https://raw.githubusercontent.com/fboender/scriptform/master/doc/screenshots/form.png)\n\nWhen submitting the form, the results are displayed.\n\n![](https://raw.githubusercontent.com/fboender/scriptform/master/doc/screenshots/result.png)\n\nFor more examples, see the [examples directory](https://github.com/fboender/scriptform/tree/master/examples)\n\nFor more screenshots, see the [screenshots Wiki page](https://github.com/fboender/scriptform/wiki/Screenshots)\n\n## Installation\n\n### Requirements\n\nThe binary release of Scriptform requires:\n\n* Glibc v2.2.5+\n\nThe python release of Scriptform requires:\n\n* Python 3.6+\n\nNo other libraries are required.\n\n### Installation\n\nGet the package for your operating system from the [Github releases page](https://github.com/fboender/scriptform/releases). \n\nThe **binary release** should work on most modern systems:\n\nGet the latest `*-bin64.tar.gz` release from the [releases page](https://github.com/fboender/scriptform/releases).\n\nUnpack it and copy it to some location in your `PATH`:\n\n    tar -vxzf scriptform-*-bin64.tar.gz\n    sudo cp scriptform-*-bin64/scriptform /usr/local/bin\n\nFor **Debian / Ubuntu** systems:\n\n    sudo dpkg -i scriptform*.deb\n\nFor **Redhat / Centos** systems:\n\n    sudo yum install scriptform*.rpm\n\nFor **Other** systems:\n\n    tar -vxzf scriptform*.tar.gz\n    cd scriptform*\n    sudo make install\n\n### Configuration\n\nScriptform provides init scripts to automatically start Scriptform at boot\ntime.  These are not installed by default. You can find init scripts for\nDebian / Ubuntu at `/usr/share/doc/scriptform/scriptform.init.d_debian` and\nfor Redhat / Centos at `/usr/share/doc/scriptform/scriptform.init.d_debian`. \n\n**NOTE**: If you use an init script, Scriptform will run as user `root`, which\nwill cause Scriptform to automatically drop privileges to user `nobody` and\ngroup `nobody` when executing shell scripts. This may cause \"permission\ndenied\" problems! See the \"Execution security policy\" chapter in the User\nManual for more information.\n\nTo install the init script:\n\nFor **Debian / Ubuntu** systems:\n\n    sudo cp /usr/share/doc/scriptform/scriptform.init.d_debian /etc/init.d/scriptform\n    sudo chmod 755 /etc/init.d/scriptform\n    sudo update-rc.d scriptform defaults\n\nThen edit `/etc/init.d/scriptform` and change the `FORM_CONFIG` setting to\npoint at the form configuration JSON file you'd like to use.\n\nFor **RedHat / Centos** systems:\n\n    sudo cp /usr/share/doc/scriptform/scriptform.init.d_redhat /etc/init.d/scriptform\n    sudo chmod 755 /etc/init.d/scriptform\n    sudo chkconfig --add scriptform\n    sudo chkconfig scriptform on\n\nThen edit `/etc/init.d/scriptform` and change the `FORM_CONFIG` setting to\npoint at the form configuration JSON file you'd like to use.\n\nThere's also a **Systemd** unit file, which should work on most systems that\nrun on systemd:\n\n    sudo cp /usr/share/doc/scriptform/scriptform.service /etc/systemd/system/\n\nThen edit `/etc/systemd/system/scriptform.service` and make change the\n`FORM_CONFIG` environment variable to point at the form configuration JSON\nfile you'd like to use.\n\n\n\n\n## Usage\n\nUsage:\n\n\tUsage: /usr/bin/scriptform [option] (--start|--stop) \u003cform_definition.json\u003e\n\t\t   /usr/bin/scriptform --generate-pw\n\n\tOptions:\n\t  --version             show program's version number and exit\n\t  -h, --help            show this help message and exit\n\t  -g, --generate-pw     Generate password\n\t  -p PORT, --port=PORT  Port to listen on (default=8081)\n\t  -f, --foreground      Run in foreground (debugging)\n\t  -r, --reload          Reload form config on every request (DEV)\n\t  --pid-file=PID_FILE   Pid file\n\t  --log-file=LOG_FILE   Log file\n\t  --start               Start daemon\n\t  --stop                Stop daemon\n\n\nScriptForm can run both in daemon mode or in the foreground. In daemon mode, we\ncan control ScriptForm with the `--start` and `--stop` options. By default it\nruns on port 8081, which we can change with the `-p` option.\n\n    $ scriptform -p8081 ./test_server.json\n\nThis puts ScriptForm in the background as a daemon. It creates a PID file and a\nlog file.\n\n    $ tail scriptform.log\n    2015-04-08 07:57:27,160:DAEMON:INFO:Starting\n    2015-04-08 07:57:27,161:DAEMON:INFO:PID = 5614\n    2015-04-08 07:57:27,162:SCRIPTFORM:INFO:Listening on 0.0.0.0:8081\n\nIn order to stop the daemon:\n\n    $ scriptform --stop\n\nWe can control the location of the PID file and log file with the `--pid-file`\nand `--log-file` options. If we don't specify these, ScriptForm will create\nthem in the local directory.\n\nTo run ScriptForm in the foreground, specify the `-f` option. \n\nIf you're going to use built-in basic authentication, you can generate a\npassword for your user with the `--generate-pw` option:\n\n    $ scriptform --generate-pw\n    Password: \n    Repeat password: \n    2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\n\nYou can paste the generated password into the password field. You can also use\nan Apache (or other webserver) frontend for authentication. For more\ninformation, see the User Manual.\n\n## Documentation\n\nThe [User Manual](https://github.com/fboender/scriptform/blob/master/doc/MANUAL.md) is the main source for all your documentation\nneeds:\n\n* Read the [tutorial](https://github.com/fboender/scriptform/blob/master/doc/MANUAL.md#tutorial) to quickly get aquinted with\n  Scriptform.\n* Read about [form configurations](https://github.com/fboender/scriptform/blob/master/doc/MANUAL.md#form_config) to learn all the\n  configuration options for Scriptform and your forms.\n* The [field types](https://github.com/fboender/scriptform/blob/master/doc/doc/MANUAL.md#field_types) chapter lists all the possible\n  fields and which options they take.\n\n## Security\n\nScriptForm is only as secure as you write your scripts. Although form values\nare validated before calling scripts, many possible security problems should be\ntaken into consideration. As such, you should *never* expose ScriptForm to the\npublic internet. Its intended end users should be people you trust at least to\na certain degree.\n\n## License\n\nScriptForm is released under the following license:\n\nGPLv3 license.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","funding_links":[],"categories":["Python","frontend"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffboender%2Fscriptform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffboender%2Fscriptform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffboender%2Fscriptform/lists"}