Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Iliya Manolov
slapos
Commits
3c897682
Commit
3c897682
authored
Apr 19, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 1.0
parents
4c531834
e7de55e2
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
20 additions
and
114 deletions
+20
-114
setup.py
setup.py
+1
-1
software/kvm/common.cfg
software/kvm/common.cfg
+3
-3
software/kvm/instance-kvm-cluster.cfg.jinja2.in
software/kvm/instance-kvm-cluster.cfg.jinja2.in
+2
-2
software/kvm/instance-kvm-input-schema.json
software/kvm/instance-kvm-input-schema.json
+2
-2
software/kvm/instance-kvm-resilient.cfg.jinja2
software/kvm/instance-kvm-resilient.cfg.jinja2
+2
-2
software/kvm/instance-kvm.cfg.jinja2
software/kvm/instance-kvm.cfg.jinja2
+2
-2
software/slaprunner/common.cfg
software/slaprunner/common.cfg
+2
-2
software/slaprunner/instance-resilient.cfg.jinja2
software/slaprunner/instance-resilient.cfg.jinja2
+2
-2
software/slaprunner/instance-runner-input-schema.json
software/slaprunner/instance-runner-input-schema.json
+2
-2
software/slaprunner/instance-runner.cfg
software/slaprunner/instance-runner.cfg
+2
-2
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.
setup.py
View file @
3c897682
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import
glob
import
glob
import
os
import
os
version
=
'1.0.2
5
'
version
=
'1.0.2
6.dev0
'
name
=
'slapos.cookbook'
name
=
'slapos.cookbook'
long_description
=
open
(
"README.txt"
).
read
()
+
"
\
n
"
+
\
long_description
=
open
(
"README.txt"
).
read
()
+
"
\
n
"
+
\
open
(
"CHANGES.txt"
).
read
()
+
"
\
n
"
open
(
"CHANGES.txt"
).
read
()
+
"
\
n
"
...
...
software/kvm/common.cfg
View file @
3c897682
...
@@ -98,7 +98,7 @@ mode = 0644
...
@@ -98,7 +98,7 @@ mode = 0644
recipe = hexagonit.recipe.download
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
mode = 644
mode = 644
md5sum =
341bb135769421fdb1bc3666c921dbb2
md5sum =
88d7622b207760f4c0bdb1b149730478
download-only = true
download-only = true
on-update = true
on-update = true
...
@@ -106,7 +106,7 @@ on-update = true
...
@@ -106,7 +106,7 @@ on-update = true
recipe = hexagonit.recipe.download
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in
url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in
mode = 644
mode = 644
md5sum =
24a717e6ccadf5708b8d5d82a75a7b25
md5sum =
d5c3728faa0972c55506b6cfc2359b59
download-only = true
download-only = true
on-update = true
on-update = true
...
@@ -114,7 +114,7 @@ on-update = true
...
@@ -114,7 +114,7 @@ on-update = true
recipe = hexagonit.recipe.download
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-resilient.cfg.jinja2
url = ${:_profile_base_location_}/instance-kvm-resilient.cfg.jinja2
mode = 644
mode = 644
md5sum =
c8481ad7ef56b245e89df76cd19242db
md5sum =
e7c613f15fec8b440180d3c26476ed18
download-only = true
download-only = true
on-update = true
on-update = true
...
...
software/kvm/instance-kvm-cluster.cfg.jinja2.in
View file @
3c897682
...
@@ -72,7 +72,7 @@ config-httpd-port = {{ dumps(kvm_parameter_dict.get('httpd-port', 8081)) }}
...
@@ -72,7 +72,7 @@ config-httpd-port = {{ dumps(kvm_parameter_dict.get('httpd-port', 8081)) }}
config-data-to-vm = {{ dumps(kvm_parameter_dict.get('data-to-vm', '')) }}
config-data-to-vm = {{ dumps(kvm_parameter_dict.get('data-to-vm', '')) }}
{% endif -%}
{% endif -%}
config-enable-monitor = {{ dumps(kvm_parameter_dict.get('enable-monitor', True)) }}
config-enable-monitor = {{ dumps(kvm_parameter_dict.get('enable-monitor', True)) }}
config-monitor-cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.
node.vifib
.com') }}
config-monitor-cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.
app.officejs
.com') }}
config-monitor-username = ${monitor-htpasswd:username}
config-monitor-username = ${monitor-htpasswd:username}
config-monitor-password = ${monitor-htpasswd:passwd}
config-monitor-password = ${monitor-htpasswd:passwd}
...
@@ -240,7 +240,7 @@ recipe = slapos.cookbook:publish
...
@@ -240,7 +240,7 @@ recipe = slapos.cookbook:publish
{% for name, value in publish_dict.items() -%}
{% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }}
{{ name }} = {{ value }}
{% endfor %}
{% endfor %}
{% set monitor_interface_url = slapparameter_dict.get('monitor-interface-url', 'https://monitor.
node.vifib
.com') -%}
{% set monitor_interface_url = slapparameter_dict.get('monitor-interface-url', 'https://monitor.
app.officejs
.com') -%}
{% if monitor_interface_url -%}
{% if monitor_interface_url -%}
monitor-setup-url = {{ monitor_interface_url }}/#page=settings_configurator&url=${publish:monitor-url}
monitor-setup-url = {{ monitor_interface_url }}/#page=settings_configurator&url=${publish:monitor-url}
{% endif -%}
{% endif -%}
...
...
software/kvm/instance-kvm-input-schema.json
View file @
3c897682
...
@@ -168,13 +168,13 @@
...
@@ -168,13 +168,13 @@
"description"
:
"Give Url of HTML web interface that will be used to render this monitor instance."
,
"description"
:
"Give Url of HTML web interface that will be used to render this monitor instance."
,
"type"
:
"string"
,
"type"
:
"string"
,
"format"
:
"uri"
,
"format"
:
"uri"
,
"default"
:
"https://monitor.
node.vifib
.com"
"default"
:
"https://monitor.
app.officejs
.com"
},
},
"monitor-cors-domains"
:
{
"monitor-cors-domains"
:
{
"title"
:
"Monitor CORS domains"
,
"title"
:
"Monitor CORS domains"
,
"description"
:
"List of cors domains separated with space. Needed for ajax query on this monitor instance from a different domain."
,
"description"
:
"List of cors domains separated with space. Needed for ajax query on this monitor instance from a different domain."
,
"type"
:
"string"
,
"type"
:
"string"
,
"default"
:
"monitor.
node.vifib
.com"
"default"
:
"monitor.
app.officejs
.com"
},
},
"enable-http-server"
:
{
"enable-http-server"
:
{
"title"
:
"Enable local http server"
,
"title"
:
"Enable local http server"
,
...
...
software/kvm/instance-kvm-resilient.cfg.jinja2
View file @
3c897682
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
{% if slapparameter_dict.get('enable-monitor', 'True').lower() == 'true' -%}
{% if slapparameter_dict.get('enable-monitor', 'True').lower() == 'true' -%}
{% set monitor_return = ['monitor-base-url', 'monitor-url', 'monitor-user', 'monitor-password'] -%}
{% set monitor_return = ['monitor-base-url', 'monitor-url', 'monitor-user', 'monitor-password'] -%}
{% set monitor_parameter = {'monitor-cors-domains': slapparameter_dict.pop('monitor-cors-domains', "monitor.
node.vifib
.com")} -%}
{% set monitor_parameter = {'monitor-cors-domains': slapparameter_dict.pop('monitor-cors-domains', "monitor.
app.officejs
.com")} -%}
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return} -%}
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return} -%}
{% endif -%}
{% endif -%}
{% set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'https://monitor.
node.vifib
.com') -%}
{% set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'https://monitor.
app.officejs
.com') -%}
[buildout]
[buildout]
eggs-directory = {{ eggs_directory }}
eggs-directory = {{ eggs_directory }}
...
...
software/kvm/instance-kvm.cfg.jinja2
View file @
3c897682
...
@@ -320,7 +320,7 @@ port = ${httpd:port}
...
@@ -320,7 +320,7 @@ port = ${httpd:port}
[monitor-instance-parameter]
[monitor-instance-parameter]
monitor-httpd-port = 8026
monitor-httpd-port = 8026
monitor-title = {{ slapparameter_dict.get('name', 'KVM Standalone') }}
monitor-title = {{ slapparameter_dict.get('name', 'KVM Standalone') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.
node.vifib
.com') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.
app.officejs
.com') }}
{% if slapparameter_dict.get('monitor-username', '') -%}
{% if slapparameter_dict.get('monitor-username', '') -%}
username = {{ slapparameter_dict['monitor-username'] }}
username = {{ slapparameter_dict['monitor-username'] }}
{% endif -%}
{% endif -%}
...
@@ -369,7 +369,7 @@ monitor-base-url = ${publish:monitor-base-url}
...
@@ -369,7 +369,7 @@ monitor-base-url = ${publish:monitor-base-url}
monitor-url = ${publish:monitor-url}
monitor-url = ${publish:monitor-url}
monitor-user = ${publish:monitor-user}
monitor-user = ${publish:monitor-user}
monitor-password = ${publish:monitor-password}
monitor-password = ${publish:monitor-password}
{% set monitor_interface_url = slapparameter_dict.get('monitor-interface-url', 'https://monitor.
node.vifib
.com') -%}
{% set monitor_interface_url = slapparameter_dict.get('monitor-interface-url', 'https://monitor.
app.officejs
.com') -%}
{% if monitor_interface_url -%}
{% if monitor_interface_url -%}
monitor-setup-url = {{ monitor_interface_url }}/#page=settings_configurator&url=${publish:monitor-url}
monitor-setup-url = {{ monitor_interface_url }}/#page=settings_configurator&url=${publish:monitor-url}
{% endif -%}
{% endif -%}
...
...
software/slaprunner/common.cfg
View file @
3c897682
...
@@ -54,7 +54,7 @@ mode = 0644
...
@@ -54,7 +54,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in
output = ${buildout:directory}/template-runner.cfg.in
md5sum =
f7076baab3b51818d76be2aa8ce23f4c
md5sum =
8fedcc83e2ecb488910ddd8a1c82fe24
mode = 0644
mode = 0644
[template-runner-import-script]
[template-runner-import-script]
...
@@ -90,7 +90,7 @@ mode = 0644
...
@@ -90,7 +90,7 @@ mode = 0644
[template-resilient]
[template-resilient]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2
url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2
md5sum = 1
721ed960ae5b9ae55864bcdc5b1d487
md5sum = 1
60bf71d8a15f1359d80eb5586109781
filename = instance-resilient.cfg.jinja2
filename = instance-resilient.cfg.jinja2
mode = 0644
mode = 0644
...
...
software/slaprunner/instance-resilient.cfg.jinja2
View file @
3c897682
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
{% set number_of_instances = 2 %}
{% set number_of_instances = 2 %}
{% endif %}
{% endif %}
{% set monitor_return = ['monitor-base-url', 'monitor-url', 'monitor-user', 'monitor-password'] -%}
{% set monitor_return = ['monitor-base-url', 'monitor-url', 'monitor-user', 'monitor-password'] -%}
{% set monitor_parameter = {'monitor-cors-domains': slapparameter_dict.pop('monitor-cors-domains', "monitor.
node.vifib
.com")} -%}
{% set monitor_parameter = {'monitor-cors-domains': slapparameter_dict.pop('monitor-cors-domains', "monitor.
app.officejs
.com")} -%}
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return, 'set-monitor-url': True} -%}
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return, 'set-monitor-url': True} -%}
{% set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'https://monitor.
node.vifib
.com') -%}
{% set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'https://monitor.
app.officejs
.com') -%}
{% import 'parts' as parts %}
{% import 'parts' as parts %}
{% import 'replicated' as replicated %}
{% import 'replicated' as replicated %}
...
...
software/slaprunner/instance-runner-input-schema.json
View file @
3c897682
...
@@ -103,13 +103,13 @@
...
@@ -103,13 +103,13 @@
"description"
:
"Give Url of HTML web interface that will be used to render this monitor instance."
,
"description"
:
"Give Url of HTML web interface that will be used to render this monitor instance."
,
"type"
:
"string"
,
"type"
:
"string"
,
"format"
:
"uri"
,
"format"
:
"uri"
,
"default"
:
"https://monitor.
node.vifib
.com"
"default"
:
"https://monitor.
app.officejs
.com"
},
},
"monitor-cors-domains"
:
{
"monitor-cors-domains"
:
{
"title"
:
"Monitor CORS domains"
,
"title"
:
"Monitor CORS domains"
,
"description"
:
"List of cors domains separated with space. Needed for ajax query on this monitor instance from a different domain."
,
"description"
:
"List of cors domains separated with space. Needed for ajax query on this monitor instance from a different domain."
,
"type"
:
"string"
,
"type"
:
"string"
,
"default"
:
"monitor.
node.vifib
.com"
"default"
:
"monitor.
app.officejs
.com"
},
},
"cpu-usage-ratio"
:
{
"cpu-usage-ratio"
:
{
"title"
:
"CPU Usage Ratio"
,
"title"
:
"CPU Usage Ratio"
,
...
...
software/slaprunner/instance-runner.cfg
View file @
3c897682
...
@@ -478,7 +478,7 @@ monitor-url = $${publish:monitor-url}
...
@@ -478,7 +478,7 @@ monitor-url = $${publish:monitor-url}
monitor-user = $${publish:monitor-user}
monitor-user = $${publish:monitor-user}
monitor-password = $${publish:monitor-password}
monitor-password = $${publish:monitor-password}
{% if not slapparameter_dict.get('authorized-key', '') -%}
{% if not slapparameter_dict.get('authorized-key', '') -%}
{% set monitor_interface_url = slapparameter_dict.get('monitor-interface-url', 'https://monitor.
node.vifib
.com') -%}
{% set monitor_interface_url = slapparameter_dict.get('monitor-interface-url', 'https://monitor.
app.officejs
.com') -%}
monitor_setup_url = {{ monitor_interface_url }}/#page=settings_configurator&url=$${publish:monitor-url}
monitor_setup_url = {{ monitor_interface_url }}/#page=settings_configurator&url=$${publish:monitor-url}
{% endif -%}
{% endif -%}
#---------------------------
#---------------------------
...
@@ -722,7 +722,7 @@ monitor-httpd-port = $${slap-parameter:monitor-port}
...
@@ -722,7 +722,7 @@ monitor-httpd-port = $${slap-parameter:monitor-port}
{% if slapparameter_dict.get('name', '') -%}
{% if slapparameter_dict.get('name', '') -%}
monitor-title = {{ slapparameter_dict['name'] }}
monitor-title = {{ slapparameter_dict['name'] }}
{% endif -%}
{% endif -%}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.
node.vifib
.com') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.
app.officejs
.com') }}
{% if slapparameter_dict.get('monitor-username', '') -%}
{% if slapparameter_dict.get('monitor-username', '') -%}
username = {{ slapparameter_dict['monitor-username'] }}
username = {{ slapparameter_dict['monitor-username'] }}
{% endif -%}
{% endif -%}
...
...
stack/monitor/monitor-logout.py.cgi
deleted
100644 → 0
View file @
4c531834
#!{{ 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 @
4c531834
#!{{ 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 @
4c531834
#!{{ 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 @
4c531834
#!/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