diff --git a/stack/monitor/monitor-logout.py.cgi b/stack/monitor/monitor-logout.py.cgi deleted file mode 100644 index bcf1b9613c2fcdee7c265432ad9b10832f0ce591..0000000000000000000000000000000000000000 --- a/stack/monitor/monitor-logout.py.cgi +++ /dev/null @@ -1,2 +0,0 @@ -#!{{ python_executable }} -print("Status: 401 Unauthorized\r\nWWW-Authenticate: Basic realm=\"Private access\"\r\n\r") diff --git a/stack/monitor/monitor-password.py.cgi b/stack/monitor/monitor-password.py.cgi deleted file mode 100644 index 97d6c45640e50d0580aecbab2d3c3389913b33f6..0000000000000000000000000000000000000000 --- a/stack/monitor/monitor-password.py.cgi +++ /dev/null @@ -1,31 +0,0 @@ -#!{{ python_executable }} - -htpasswd_executable = "{{ htpasswd_executable }}" -htpasswd_path = "{{ htpasswd_path }}" -password_changed_once_path = "{{ password_changed_once_path }}" - -import cgi -import cgitb -import os -import sys - -cgitb.enable(display=0) - -def sh(args): - os.system(" ".join(["'" + arg.replace("'", "'\\''") + "'" for arg in args])) - -def touch(path): - open(path, "w").close() - -def main(): - form = cgi.FieldStorage() - password = form["password"].value - if sh([htpasswd_executable, "-b", htpasswd_path, "admin", password]): - sys.stdout.write("Status: 500 Internal Server Error\r\n\r\n") - return 1 - touch(password_changed_once_path) - sys.stdout.write("Status: 204 No Content\r\n\r\n") - return 0 - -if __name__ == "__main__": - exit(main()) diff --git a/stack/monitor/monitor-run-promise.py.cgi b/stack/monitor/monitor-run-promise.py.cgi deleted file mode 100644 index 6a2270060cee76d968b9428c58d6d3a652330b98..0000000000000000000000000000000000000000 --- a/stack/monitor/monitor-run-promise.py.cgi +++ /dev/null @@ -1,20 +0,0 @@ -#!{{ python_executable }} -# Put this file in the software release -promise_wrapper_folder = "{{ promise_wrapper_folder }}" - -import cgi -import cgitb -import os - -cgitb.enable(display=0) - -def main(): - form = cgi.FieldStorage() - promise_name = form["service"].value - if "/" not in promise_name: - promise_path = os.path.join(promise_wrapper_folder, promise_name) - os.spawnl(os.P_NOWAIT, promise_path, promise_path) - print("Status: 204 No Content\r\n\r") - -if __name__ == "__main__": - exit(main()) diff --git a/stack/monitor/monitor-service-run.in b/stack/monitor/monitor-service-run.in deleted file mode 100644 index 36ac9e9d8b2f3ee0e25f525d5d03c63cdc0aea68..0000000000000000000000000000000000000000 --- a/stack/monitor/monitor-service-run.in +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python - -configuration_location = "%(configuration_location)s" -process_pid_file = "%(process_pid_file)s" - -import sys -import os -import ConfigParser -import json -import subprocess - -def loadConfig(config_file): - config = ConfigParser.ConfigParser() - config.read(config_file) - return config - -def main(): - config = loadConfig(configuration_location) - script_path = config.get("service", "script-path") - executable_folder = os.path.dirname(script_path) - executable = os.path.basename(script_path) - parameter_json = os.path.join(os.path.abspath(os.path.dirname(__file__)), - 'parameters_%%s.json' %% executable) - with open(parameter_json, 'w') as fjson: - fjson.write(json.dumps(dict(config.items("parameter")))) - - process = subprocess.Popen( - [script_path, parameter_json], - stdin=None, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE - ) - with open(process_pid_file, "w") as pidfile: - pidfile.write(str(process.pid)) - -if __name__ == "__main__": - if len(sys.argv) == 1: - print "Use: %s Monitor_Config_File" - sys.exit(1) - - sys.exit(main()) \ No newline at end of file