Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
e7de55e2
Commit
e7de55e2
authored
Apr 18, 2016
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/monitor: Remove unused files.
parent
ba721017
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
94 deletions
+0
-94
stack/monitor/monitor-logout.py.cgi
stack/monitor/monitor-logout.py.cgi
+0
-2
stack/monitor/monitor-password.py.cgi
stack/monitor/monitor-password.py.cgi
+0
-31
stack/monitor/monitor-run-promise.py.cgi
stack/monitor/monitor-run-promise.py.cgi
+0
-20
stack/monitor/monitor-service-run.in
stack/monitor/monitor-service-run.in
+0
-41
No files found.
stack/monitor/monitor-logout.py.cgi
deleted
100644 → 0
View file @
ba721017
#!{{ python_executable }}
print("Status: 401 Unauthorized\r\nWWW-Authenticate: Basic realm=\"Private access\"\r\n\r")
stack/monitor/monitor-password.py.cgi
deleted
100644 → 0
View file @
ba721017
#!{{ 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())
stack/monitor/monitor-run-promise.py.cgi
deleted
100644 → 0
View file @
ba721017
#!{{ 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())
stack/monitor/monitor-service-run.in
deleted
100644 → 0
View file @
ba721017
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment