pax_global_header 0000666 0000000 0000000 00000000064 12722051723 0014513 g ustar 00root root 0000000 0000000 52 comment=cfe0767d3871a61feb29710171804351e6c714a0
slapos-master-software/ 0000775 0000000 0000000 00000000000 12722051723 0015501 5 ustar 00root root 0000000 0000000 slapos-master-software/software/ 0000775 0000000 0000000 00000000000 12722051723 0017333 5 ustar 00root root 0000000 0000000 slapos-master-software/software/agent/ 0000775 0000000 0000000 00000000000 12722051723 0020431 5 ustar 00root root 0000000 0000000 slapos-master-software/software/agent/agent.cfg.in 0000664 0000000 0000000 00000000412 12722051723 0022612 0 ustar 00root root 0000000 0000000 [agent]
timeout = ${slap-parameter:timeout}
node_title = ${slap-parameter:node_title}
project_title = ${slap-parameter:project_title}
task_count = ${slap-parameter:task_count}
report_url = ${slap-parameter:report_url}
working_directory = ${directory:testnode}
slapos-master-software/software/agent/instance-agent.cfg 0000664 0000000 0000000 00000001736 12722051723 0024021 0 ustar 00root root 0000000 0000000 [buildout]
parts =
instance
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[directory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
service = $${buildout:directory}/etc/service
run = $${buildout:directory}/etc/run
agentlog = $${buildout:directory}/var/log/agent
srv = $${buildout:directory}/srv
bin = $${buildout:directory}/bin
testnode = $${buildout:directory}/srv/testnode
[instance]
recipe = slapos.cookbook:wrapper
command-line =
${buildout:bin-directory}/agent
--pidfile=$${buildout:directory}/srv/agent.pid
--log=$${buildout:directory}/var/log/agent/agent.log
$${agent-cfg:output}
wrapper-path = $${directory:service}/agent
output = $${:wrapper-path}
[agent-cfg]
recipe = slapos.recipe.template
url = ${agent.cfg.in:target}
output = $${directory:etc}/agent.cfg
[slap-parameter]
timeout = 3600
node_title =
test_title =
project_title =
task_count = 1
report_url =
slapos-master-software/software/agent/instance.cfg 0000664 0000000 0000000 00000000401 12722051723 0022711 0 ustar 00root root 0000000 0000000 [buildout]
parts =
switch_softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch_softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${template-agent:output}
slapos-master-software/software/agent/software.cfg 0000664 0000000 0000000 00000002554 12722051723 0022752 0 ustar 00root root 0000000 0000000 [buildout]
extends =
../../component/lxml-python/buildout.cfg
../../component/git/buildout.cfg
../../stack/slapos.cfg
parts =
agent.cfg.in
template
template-agent
slapos-cookbook
script
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
md5sum = bcd3b3cb8a305c83bb048d5ac1c583fe
mode = 0644
[template-agent]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-agent.cfg
output = ${buildout:directory}/template-agent.cfg
md5sum = 797e80e43bbf9c0d0e0c5db88a091667
mode = 0644
[agent.cfg.in]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/agent.cfg.in
md5sum = 056b1bb005080c4324cd9d755d254131
mode = 0644
[script]
recipe = zc.recipe.egg
eggs =
zc.buildout
slapos.core
slapos.toolbox[agent]
erp5.util
[versions]
apache-libcloud = 0.18.0
ecdsa = 0.13
erp5.util = 0.4.44
gitdb = 0.6.4
pycrypto = 2.6.1
slapos.recipe.download = 1.0
slapos.recipe.template = 2.8
slapos.toolbox = 0.55
smmap = 0.9.0
# Required by:
# slapos.toolbox==0.55
GitPython = 2.0.2
# Required by:
# slapos.toolbox==0.55
atomize = 0.2.0
# Required by:
# slapos.toolbox==0.55
feedparser = 5.2.1
# Required by:
# slapos.toolbox==0.55
lockfile = 0.12.2
# Required by:
# slapos.toolbox==0.55
paramiko = 2.0.0
# Required by:
# slapos.toolbox==0.55
rpdb = 0.1.5
slapos-master-software/software/ajaxplorer/ 0000775 0000000 0000000 00000000000 12722051723 0021502 5 ustar 00root root 0000000 0000000 slapos-master-software/software/ajaxplorer/instance-apachephp.cfg 0000664 0000000 0000000 00000024170 12722051723 0025722 0 ustar 00root root 0000000 0000000 [buildout]
parts =
certificate-authority
ca-stunnel
logrotate
logrotate-entry-apache
logrotate-entry-stunnel
cron
cron-entry-logrotate
promise
frontend-ajaxupload-promise
frontend-website2-promise
frontend-website-promise
# content-promise
publish-connection-informations
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
#----------------
#--
#-- Creation of all needed directories.
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
var = $${buildout:directory}/var
srv = $${buildout:directory}/srv
bin = $${buildout:directory}/bin
tmp = $${buildout:directory}/tmp
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/service
run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
[directory]
recipe = slapos.cookbook:mkdirectory
cron-entries = $${rootdirectory:etc}/cron.d
crontabs = $${rootdirectory:etc}/crontabs
cronstamps = $${rootdirectory:etc}/cronstamps
ca-dir = $${rootdirectory:srv}/ssl
httpd-log = $${basedirectory:log}/apache
php-ini-dir = $${rootdirectory:etc}/php
tmp-php = $${rootdirectory:tmp}/php
logrotate-entries = $${rootdirectory:etc}/logrotate.d
logrotate-backup = $${basedirectory:backup}/logrotate
report = $${rootdirectory:etc}/report
stunnel-conf = $${rootdirectory:etc}/stunnel
xml-report = $${rootdirectory:var}/xml_report
www = $${rootdirectory:srv}/www/
[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:ca-dir}/requests
private = $${directory:ca-dir}/private
certs = $${directory:ca-dir}/certs
newcerts = $${directory:ca-dir}/newcerts
crl = $${directory:ca-dir}/crl
#----------------
#--
#-- Deploy cron.
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${basedirectory:log}/crond.log
#----------------
#--
#-- Deploy logrotate.
[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${logrotate:wrapper}
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${rootdirectory:bin}/logrotate
conf = $${rootdirectory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status
#----------------
#--
#-- Deploy stunnel.
[stunnel]
recipe = slapos.cookbook:stunnel
client = true
stunnel-binary = ${stunnel:location}/bin/stunnel
remote-host = $${mariadb-urlparse:host}
remote-port = $${mariadb-urlparse:port}
local-host = $${slap-network-information:local-ipv4}
local-port = 3306
log-file = $${basedirectory:log}/stunnel.log
config-file = $${directory:stunnel-conf}/stunnel.conf
key-file = $${directory:stunnel-conf}/stunnel.key
cert-file = $${directory:stunnel-conf}/stunnel.crt
pid-file = $${basedirectory:run}/stunnel.pid
wrapper = $${rootdirectory:bin}/raw_stunnel
post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
[logrotate-entry-stunnel]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = stunnel
log = $${stunnel:log-file}
frequency = daily
rotate-num = 30
notifempty = true
create = true
post = $${stunnel:post-rotate-script}
#----------------
#--
#-- Certificate stuff.
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${basedirectory:services}/ca
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}
[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${stunnel:wrapper}
wrapper = $${basedirectory:services}/stunnel
key-file = $${stunnel:key-file}
cert-file = $${stunnel:cert-file}
#----------------
#--
#-- Request MariaDB instance and parse its URL.
[request-mariadb]
<= slap-connection
recipe = slapos.cookbook:request
name = MariaDB
software-url = $${slap-connection:software-release-url}
software-type = mariadb
return = url
sla-computer_guid = $${slap-connection:computer-id}
[mariadb-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-mariadb:connection-url}
#----------------
#--
#-- Deploy Apache + PHP application.
[httpd-conf]
recipe = slapos.recipe.template
url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
output = $${rootdirectory:etc}/apache.conf
mode = 0600
document_root = $${rootdirectory:srv}/www/
pid_file = $${basedirectory:run}/apache.pid
lock_file = $${basedirectory:run}/apache.lock
ip = $${slap-network-information:global-ipv6}
port = 8080
port2 = 8070
port3 = 8090
error_log = $${directory:httpd-log}/error.log
access_log = $${directory:httpd-log}/access.log
php_ini_dir = $${directory:php-ini-dir}
# Deploy Apache + PHP application
[apache-php]
recipe = slapos.cookbook:apachephp
source = ${application:location}
template =
configuration =
htdocs = $${directory:www}
pid-file = $${basedirectory:run}/apache.pid
lock-file = $${basedirectory:run}/apache.lock
ip = $${httpd-conf:ip}
port = $${httpd-conf:port}
url = http://[$${:ip}]:$${:port}/
error-log = $${directory:httpd-log}/error.log
access-log = $${directory:httpd-log}/access.log
php-ini-dir = $${directory:php-ini-dir}
tmp-dir = $${directory:tmp-php}
wrapper = $${basedirectory:services}/apache
httpd-binary = ${apache:location}/bin/httpd
default-conf = false
httpd-conf = $${httpd-conf:output}
mysql-username = $${mariadb-urlparse:username}
mysql-password = $${mariadb-urlparse:password}
mysql-database = $${mariadb-urlparse:path}
mysql-host = $${stunnel:local-host}
mysql-port = $${stunnel:local-port}
[logrotate-entry-apache]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = apache
log = $${apache-php:error-log} $${apache-php:access-log}
frequency = daily
rotate-num = 30
sharedscripts = true
notifempty = true
create = true
#----------------
#--
#-- Request frontends.
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Frontend-Website
# XXX We have hardcoded SR URL here.
software-url = $${slap-parameter:frontend-software-url}
slave = true
config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
return = site_url
config-custom_domain = $${slap-parameter:domain}
[request-frontend-ajaxupload]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Frontend-FileManager
# XXX We have hardcoded SR URL here.
software-url = $${slap-parameter:frontend-software-url}
slave = true
config-url = http://[$${httpd-conf:ip}]:$${httpd-conf:port2}/
return = site_url
config-custom_domain = $${slap-parameter:domain2}
[request-frontend2]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Frontend-Website2
# XXX We have hardcoded SR URL here.
software-url = $${slap-parameter:frontend-software-url}
slave = true
config-url = http://[$${httpd-conf:ip}]:$${httpd-conf:port3}/
return = site_url
config-custom_domain = $${slap-parameter:domain3}
#----------------
#--
#-- Deploy slapmonitor.
#[slapmonitor]
#recipe = slapos.cookbook:slapmonitor
#pid-file = $${basedirectory:run}/apache.pid
#database-path = $${basedirectory:log}/slapmonitor.db
#slapmonitor-path = ${buildout:bin-directory}/slapmonitor
#path = $${basedirectory:services}/slapmonitor
#
#[slapmonitor-xml]
#recipe = slapos.cookbook:slapmonitor-xml
#database-path = $${basedirectory:log}/slapmonitor.db
#slapmonitor-xml-path = ${buildout:bin-directory}/slapmonitor-xml
#path = $${directory:report}/slapmonitor-xml
#----------------
#--
#-- Publish instance parameters.
[publish-connection-informations]
recipe = slapos.cookbook:publish
website-backend-url = $${apache-php:url}
website-url = $${request-frontend:connection-site_url}
website2-backend-url = http://[$${apache-php:ip}]:$${httpd-conf:port3}
website2-url = $${request-frontend2:connection-site_url}
filemanager-backend-url = http://[$${apache-php:ip}]:$${httpd-conf:port2}
fileManager-url = $${request-frontend-ajaxupload:connection-site_url}
mysql-username = $${mariadb-urlparse:username}
mysql-password = $${mariadb-urlparse:password}
mysql-database = $${mariadb-urlparse:path}
mysql-host = $${stunnel:local-host}
mysql-port = $${stunnel:local-port}
#----------------
#--
#-- Deploy promises scripts.
[promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/apache
hostname = $${apache-php:ip}
port = $${apache-php:port}
[frontend-website-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend-website
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[frontend-website2-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend-website2
url = $${request-frontend2:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[frontend-ajaxupload-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend-ajaxupload
url = $${request-frontend-ajaxupload:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[content-promise]
recipe = slapos.cookbook:check_page_content
path = $${basedirectory:promises}/content
url = $${request-frontend-ajaxupload:connection-site_url}
match = AjaXplorer
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[slap-parameter]
# Default value if no domain is specified
domain =
domain2 =
domain3 =
frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
# Default value if no ssh parameter is specified
logbox-ip =
logbox-port =
logbox-user =
logbox-passwd =
slapos-master-software/software/ajaxplorer/instance.cfg 0000664 0000000 0000000 00000000446 12722051723 0023773 0 ustar 00root root 0000000 0000000 [buildout]
parts =
switch_softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch_softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${instance-apache:output}
mariadb = ${instance-mariadb:output} slapos-master-software/software/ajaxplorer/software.cfg 0000664 0000000 0000000 00000004660 12722051723 0024023 0 ustar 00root root 0000000 0000000 [buildout]
parts =
slapos-cookbook
subversion
apache-php
instance
instance-apache
instance-mariadb
template-httpd-conf
application
website1-template
website2-template
extends =
../../stack/slapos.cfg
../../component/apache/buildout.cfg
../../component/apache-php/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/subversion/buildout.cfg
../../component/gzip/buildout.cfg
../../component/dcron/buildout.cfg
../../component/dash/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/lxml-python/buildout.cfg
[instance]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
mode = 0644
md5sum = 4c7936accb3658871b635158198b7905
[instance-apache]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apachephp.cfg
output = ${buildout:directory}/template-apachephp.cfg
md5sum = 8be713bd2656e184651c8ec10579d668
mode = 0644
[instance-mariadb]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/../../stack/lamp/mariadb/instance-mariadb.cfg.in
output = ${buildout:directory}/template-mariadb.cfg
mode = 0644
[application]
recipe = hexagonit.recipe.download
ignore-existing = true
url = http://garr.dl.sourceforge.net/project/ajaxplorer/ajaxplorer/dev-channel/4.3.4/ajaxplorer-core-4.3.4.tar.gz
md5sum = 2f2ff8bda7bbe841ef0e870c724eb74f
strip-top-level-dir = true
[website]
recipe = z3c.recipe.mkdir
path1 = ${application:location}/data/files/website
path2 = ${application:location}/data/files/website2
paths =
${:path1}
${:path2}
[website1-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/templates/index.html.in
output = ${website:path1}/index.html
md5sum = c5695762361b801c284ee23a150cd1f1
mode = 0644
[website2-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/templates/index.html.in
output = ${website:path2}/index.html
md5sum = c5695762361b801c284ee23a150cd1f1
mode = 0644
[template-httpd-conf]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644
filename = apache.conf.in
md5sum = 6788381fadd8ca96f892d33df3163da0
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[versions]
# Numpy 1.7.0 doesn't install well
numpy = 1.6.2
# websockify 0.4.1 doesn't install well
websockify = 0.3.0
plone.recipe.command = 1.1
slapos.recipe.template = 2.4.2
z3c.recipe.mkdir = 0.5
slapos-master-software/software/ajaxplorer/templates/ 0000775 0000000 0000000 00000000000 12722051723 0023500 5 ustar 00root root 0000000 0000000 slapos-master-software/software/ajaxplorer/templates/apache.conf.in 0000664 0000000 0000000 00000005617 12722051723 0026206 0 ustar 00root root 0000000 0000000 # Apache static configuration
# Automatically generated
# Basic server configuration
PidFile "${:pid_file}"
Listen ${:ip}:8070
Listen ${:ip}:8080
Listen ${:ip}:8090
PHPINIDir ${:php_ini_dir}
ServerAdmin someone@email
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php .phtml .php5 .php4
AddType application/x-httpd-php-source .phps
# Log configuration
ErrorLog "${:error_log}"
LogLevel warn
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b" common
CustomLog "${:access_log}" common
NameVirtualHost ${:ip}:8090
NameVirtualHost ${:ip}:8080
NameVirtualHost ${:ip}:8070
$(${trafficserver:location}/bin/traffic_shell $${monitor-ats-cache-stats-config:rendered})" extra-context = key content monitor-ats-cache-stats-wrapper:command [monitor-ats-cache-stats-config] < = jinja2-template-base template = ${template-empty:target} rendered = $${trafficserver-configuration-directory:target}/cache-config.stats mode = 644 context = raw content show:cache-stats [monitor-verify-re6st-connectivity] recipe = slapos.cookbook:check_url_available path = $${directory:promise}/re6st-connectivity url = $${public:re6st-verification-url} dash_path = ${dash:location}/bin/dash curl_path = ${curl:location}/bin/curl [public] re6st-verification-url = http://[2001:67c:1254:4::1]/index.html slapos-master-software/software/apache-frontend/instance-apache-input-schema.json 0000664 0000000 0000000 00000002521 12722051723 0030702 0 ustar 00root root 0000000 0000000 { "type": "object", "$schema": "http://json-schema.org/draft-04/schema", "title": "Input Parameters", "properties": { "public-ipv4": { "title": "Public IPv4", "description": "Public IPv4 that will be provided to Slaves to configure DNS.", "type": "string" }, "-frontend-authorized-slave-string": { "title": "Authorized Slave String", "description": "List of SOFTINST-XXX of Slaves, separated by space which is allowed to use custom configuration.", "type": "string" }, "apache-key": { "title": "Apache Key", "description": "Apache Key", "textarea": true, "type": "string" }, "apache-certificate": { "title": "Apache Certificate", "description": "Apache Certificate", "textarea": true, "type": "string" }, "apache-ca-certificate": { "title": "Apache CA Certificate", "description": "Apache CA Certificate", "textarea": true, "type": "string" }, "domain": { "title": "Domain", "description": "Base Domain for create subdomains (ie.: example.com).", "type": "string", "pattern": "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$" }, "-frontend-quantity": { "title": "Frontend Replication Quantity", "description": "Quantity of Frontends Replicate.", "type": "integer" } } } slapos-master-software/software/apache-frontend/instance-apache-replicate.cfg.in 0000664 0000000 0000000 00000016713 12722051723 0030460 0 ustar 00root root 0000000 0000000 {% if slap_software_type in software_type -%} [jinja2-template-base] recipe = slapos.recipe.template:jinja2 rendered = ${buildout:directory}/${:filename} extra-context = context = import json_module json key eggs_directory buildout:eggs-directory key develop_eggs_directory buildout:develop-eggs-directory key slap_software_type slap-parameter:slap_software_type key slave_instance_list slap-parameter:slave_instance_list ${:extra-context} {% set part_list = [] -%} {% set single_type_key = 'single-' %} {% if slap_software_type == "replicate" %} {% set frontend_type = slapparameter_dict.pop('-frontend-type', 'single-default') -%} {% elif slap_software_type in ['default', 'RootSoftwareInstance'] -%} {% set frontend_type = "%s%s" % (single_type_key, 'custom-personal') -%} {% else -%} {% set frontend_type = "%s%s" % (single_type_key, slap_software_type) -%} {% endif -%} {% set frontend_quantity = slapparameter_dict.pop('-frontend-quantity', '1') | int -%} {% set slave_list_name = 'extra_slave_instance_list' -%} {% set frontend_list = [] %} {% set frontend_section_list = [] %} {% set request_dict = {} %} {% set namebase = 'apache-frontend' -%} # XXX Dirty hack, not possible to define default value before {% set sla_computer_apache_1_key = '-sla-1-computer_guid' -%} {% if not sla_computer_apache_1_key in slapparameter_dict -%} {% do slapparameter_dict.__setitem__(sla_computer_apache_1_key, '${slap-connection:computer-id}') -%} {% endif -%} # Here we request individualy each frontend. # The presence of sla parameters is checked and added if found {% for i in range(1, frontend_quantity + 1) -%} {% set frontend_name = "%s-%s" % (namebase, i) -%} {% set request_section_title = 'request-%s' % frontend_name -%} {% set sla_key = "-sla-%s-" % i -%} {% set sla_key_length = sla_key | length %} {% set sla_dict = {} %} {% set config_key = "-frontend-config-%s-" % i %} {% set config_key_length = config_key | length %} {% set config_dict = {} %} {% for key in slapparameter_dict.keys() %} {% if key.startswith(sla_key) %} {% do sla_dict.__setitem__(key[sla_key_length:], slapparameter_dict.pop(key)) %} # We check for specific configuration regarding the frontend {% elif key.startswith(config_key) -%} {% do config_dict.__setitem__(key[config_key_length:], slapparameter_dict.pop(key)) %} {% endif -%} {% endfor -%} {% do frontend_list.append(frontend_name) -%} {% do frontend_section_list.append(request_section_title) -%} {% do part_list.append(request_section_title) -%} # Filling request dict for slave {% set state_key = "-frontend-%s-state" % i %} {% do request_dict.__setitem__(request_section_title, { 'config': config_dict, 'name': frontend_name, 'sla': sla_dict, 'state': slapparameter_dict.pop(state_key, None) }) %} {% endfor -%} {% set authorized_slave_string = slapparameter_dict.pop('-frontend-authorized-slave-string', '') -%} {% set authorized_slave_list = [] %} {% set rejected_slave_list = [] %} {% for slave in slave_instance_list %} {% if not (slave.has_key('apache_custom_http') and not slave.get('slave_reference') in authorized_slave_string) %} {% do authorized_slave_list.append(slave) %} {% else %} {% do rejected_slave_list.append(slave.get('slave_reference')) %} {% endif %} {% endfor -%} [replicate] <= slap-connection recipe = slapos.cookbook:requestoptional config-monitor-cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }} config-monitor-username = ${monitor-htpasswd:username} config-monitor-password = ${monitor-htpasswd:passwd} {% set frontend_software_url_key = "-frontend-software-release-url" %} {% if slapparameter_dict.has_key(frontend_software_url_key) %} software-url = {{ slapparameter_dict.pop(frontend_software_url_key) }} {% else %} software-url = ${slap-connection:software-release-url} {% endif %} software-type = {{frontend_type}} return = private-ipv4 public-ipv4 slave-instance-information-list monitor-base-url {% for section, frontend_request in request_dict.iteritems() %} [{{section}}] <= replicate name = {{ frontend_request.get('name') }} {% if frontend_request.get('state') %} state = {{ frontend_request.get('state') }} {% endif%} {% set slave_configuration_dict = frontend_request.get('config') %} {% do slave_configuration_dict.update(**slapparameter_dict) %} {% do slave_configuration_dict.__setitem__(slave_list_name, json_module.dumps(authorized_slave_list)) %} {% do slave_configuration_dict.__setitem__("frontend-name", frontend_request.get('name')) %} config-_ = {{ json_module.dumps(slave_configuration_dict) }} {% if frontend_request.get('sla') %} {% for parameter, value in frontend_request.get('sla').iteritems() -%} sla-{{ parameter }} = {{ value }} {% endfor -%} {% endif -%} {% endfor -%} [publish-information] recipe = slapos.cookbook:publish domain = {{ slapparameter_dict.get('domain') }} slave-amount = {{ slave_instance_list | length }} accepted-slave-amount = {{ authorized_slave_list | length }} rejected-slave-amount = {{ rejected_slave_list | length }} rejected-slave-list = {{ json_module.dumps(rejected_slave_list) }} monitor-base-url = ${monitor-conf-parameters:base-url} monitor-url = ${:monitor-base-url}/public/feeds monitor-user = ${monitor-instance-parameter:username} monitor-password = ${monitor-instance-parameter:password} {% 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=${:monitor-url} #---------------------------- #-- #-- Publish slave information [publish-slave-information] recipe = slapos.cookbook:softwaretype default = ${dynamic-publish-slave-information:rendered} RootSoftwareInstance = ${dynamic-publish-slave-information:rendered} replicate = ${dynamic-publish-slave-information:rendered} custom-personal = ${dynamic-publish-slave-information:rendered} custom-group = ${dynamic-publish-slave-information:rendered} [slave-information] {% for frontend_section in frontend_section_list -%} {{ frontend_section }} = {{ "${%s:connection-slave-instance-information-list}" % frontend_section }} {% endfor -%} [dynamic-publish-slave-information] < = jinja2-template-base template = {{ template_publish_slave_information }} filename = dynamic-publish-slave-information.cfg extensions = jinja2.ext.do extra-context = section slave_information slave-information [monitor-conf-parameters] monitor-url-list += {% for frontend in frontend_section_list %} {{ ' ${' + frontend + ':connection-monitor-base-url}' }} {% endfor -%} [buildout] extends = {{ template_monitor }} parts = monitor-base publish-slave-information publish-information {% for part in part_list -%} {{ ' %s' % part }} {% endfor -%} # publish-information eggs-directory = {{ eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }} offline = true [slap_connection] # Kept for backward compatiblity computer_id = ${slap-connection:computer-id} partition_id = ${slap-connection:partition-id} server_url = ${slap-connection:server-url} software_release_url = ${slap-connection:software-release-url} key_file = ${slap-connection:key-file} cert_file = ${slap-connection:cert-file} [slap-parameter] slave_instance_list = -frontend-quantity = 1 -frontend-type = single-default {%- endif %} slapos-master-software/software/apache-frontend/instance-output-schema.json 0000664 0000000 0000000 00000002432 12722051723 0027665 0 ustar 00root root 0000000 0000000 { "$schema": "http://json-schema.org/draft-04/schema#", "description": "Values returned by Apache Frontend instanciation", "properties": { "accepted-slave-amount": { "description": "Amount of Slaves allocated to the Instance which are deployed", "type": "integer" }, "slave-amount": { "description": "Total amount of Slaves allocated to the Instance (include blocked ones)", "type": "integer" }, "reject-slave-amount": { "description": "Rejected Amount of Slaves allocated to the Instance which are not deployed", "type": "integer" }, "rejected-slave-list": { "description": "List of slave instances references which are rejected", "type": "array" }, "domain": { "description": "Base domain used by the instance", "type": "string" }, "monitor-base-url": { "description": "Base url for monitor", "type": "string" }, "monitor-url": { "description": "Url of Monitor (opml)", "type": "string" }, "monitor-password": { "description": "Password to access the monitor", "type": "string" }, "monitor-user": { "description": "User to access the monitor", "type": "string" } }, "type": "object" } slapos-master-software/software/apache-frontend/instance-slave-apache-input-schema.json 0000664 0000000 0000000 00000010413 12722051723 0032011 0 ustar 00root root 0000000 0000000 { "type": "object", "$schema": "http://json-schema.org/draft-04/schema", "title": "Input Parameters", "properties": { "url": { "title": "Backend URL", "description": "Url of the backend", "type": "string", "pattern": "^(http|https|ftp)://" }, "custom_domain": { "title": "Custom Domain", "description": "Custom Domain to use for the website", "type": "string", "pattern": "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$" }, "server-alias": { "title": "Server Alias", "description": "Server Alias List separated by space", "type": "string", "default": "" }, "type": { "title": "Backend Type", "description": "Type of slave. If redirect, the slave will redirect to the given url. If zope, the rewrite rules will be compatible with Virtual Host Monster", "type": "string", "default": "", "enum": ["", "zope", "redirect"] }, "path": { "title": "Backend Path", "description": "Path to proxy to in the backend", "type": "string", "default": "" }, "default-path": { "title": "Default Path", "description": "Provide default path to redirect user to", "type": "string", "default": "" }, "ssl_crt": { "title": "SSL Certificate", "description": "SSL Certificate", "type": "string", "textarea": true, "default": "" }, "ssl_key": { "title": "SSL Key", "description": "SSL Key", "type": "string", "textarea": true, "default": "" }, "ssl_ca_crt": { "title": "SSL Certificate Authority's Certificate", "description": "SSL Key", "type": "string", "textarea": true, "default": "" }, "https-only": { "title": "HTTPS Only", "description": "If set to true, http request are redirect to https", "type": "string", "default": "false", "enum": ["false", "true"] }, "ssl-proxy-verify": { "title": "Verify Backend Certificates", "description": "If set to true, Backend Certificates are checked", "type": "string", "default": "false", "enum": ["false", "true"] }, "ssl_proxy_ca_crt": { "title": "SSL Backend Authority's Certificate", "description": "SSL Certificate Authority of the backen (to be used with ssl-proxy-verify)", "type": "string", "default": "" }, "enable_cache": { "title": "Enable Cache", "description": "If set to true, the cache is used", "type": "string", "default": "false", "enum": ["false", "true"] }, "disable-no-cache-request": { "title": "Disable 'no-cache' requests", "description": "If set to true, no-cache control headers will be disabled", "type": "string", "default": "false", "enum": ["false", "true"] }, "disable-via-header": { "title": "Disable 'Via' headers from cache", "description": "If set to true, via headers will be disabled", "type": "string", "default": "false", "enum": ["false", "true"] }, "prefer-gzip-encoding-to-backend": { "title": "Prefer gzip Encoding for Backend", "description": "If set to true, if a request is made with accept encoding 'gzip', only that one will be transferred to the backend", "type": "string", "default": "false", "enum": ["false", "true"] }, "disabled-cookie-list": { "title": "Disabled Cookies", "description": "List of Cookies separated by space that will not be sent to the backend", "type": "string", "default": "" }, "apache_custom_http": { "title": "HTTP configuration", "description": "Raw http configuration in python template format. Your site will be rejected if you use it without notification and approval of the frontend adminastrator", "default": "", "textarea": true, "type": "string" }, "apache_custom_https": { "title": "HTTPS configuration", "description": "Raw https configuration in python template format. Your site will be rejected if you use it without notification and approval of the frontend adminastrator", "default": "", "textarea": true, "type": "string" } } } slapos-master-software/software/apache-frontend/instance-slave-output-schema.json 0000664 0000000 0000000 00000001607 12722051723 0031000 0 ustar 00root root 0000000 0000000 { "$schema": "http://json-schema.org/draft-04/schema#", "description": "Values returned by Apache Frontend instanciation", "properties": { "replication_number": { "description": "Number of nodes the slave is replicated", "type": "integer" }, "domain": { "description": "Base domain used by the instance", "type": "string" }, "url": { "description": "Default URL provided", "type": "string" }, "site_url": { "description": "URL for HTTP access", "type": "string" }, "secure_access": { "description": "URL for HTTP access", "type": "string" }, "public-ipv4": { "description": "Public IPv4 to be included on DNS", "type": "string" }, "log-access-url": { "description": "List of URLs to access logs", "type": "array" } }, "type": "object" } slapos-master-software/software/apache-frontend/instance.cfg 0000664 0000000 0000000 00000003503 12722051723 0024657 0 ustar 00root root 0000000 0000000 [buildout] parts = dynamic-template-apache-replicate switch-softwaretype eggs-directory = ${buildout:eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory} offline = true [slap-parameters] recipe = slapos.cookbook:slapconfiguration computer = $${slap-connection:computer-id} partition = $${slap-connection:partition-id} url = $${slap-connection:server-url} key = $${slap-connection:key-file} cert = $${slap-connection:cert-file} [jinja2-template-base] recipe = slapos.recipe.template:jinja2 rendered = $${buildout:directory}/$${:filename} extra-context = context = import json_module json key eggs_directory buildout:eggs-directory key develop_eggs_directory buildout:develop-eggs-directory key slap_software_type slap-parameters:slap-software-type key slapparameter_dict slap-parameters:configuration key slave_instance_list slap-parameters:slave-instance-list $${:extra-context} [switch-softwaretype] recipe = slapos.cookbook:softwaretype default = $${dynamic-template-apache-replicate:rendered} RootSoftwareInstance = $${dynamic-template-apache-replicate:rendered} custom-personal = $${dynamic-template-apache-replicate:rendered} single-default = ${template-apache-frontend:output} single-custom-personal = ${template-apache-frontend:output} replicate = $${dynamic-template-apache-replicate:rendered} [dynamic-template-apache-replicate] < = jinja2-template-base template = ${template-apache-replicate:target} filename = instance-apache-replicate.cfg extensions = jinja2.ext.do extra-context = raw template_publish_slave_information ${template-replicate-publish-slave-information:target} # Must match the key id in [switch-softwaretype] which uses this section. raw software_type RootSoftwareInstance-default-custom-personal-replicate raw template_monitor ${monitor2-template:rendered} slapos-master-software/software/apache-frontend/software.cfg 0000664 0000000 0000000 00000001134 12722051723 0024703 0 ustar 00root root 0000000 0000000 [buildout] extends = common.cfg [versions] PyRSS2Gen = 1.1 apache-libcloud = 0.19.0 cns.recipe.symlink = 0.2.3 ecdsa = 0.13 gitdb = 0.6.4 plone.recipe.command = 1.1 pycrypto = 2.6.1 rdiff-backup = 1.0.5 slapos.recipe.template = 2.8 slapos.toolbox = 0.55 smmap = 0.9.0 # Required by: # slapos.toolbox==0.55 GitPython = 2.0.2 # Required by: # slapos.toolbox==0.55 atomize = 0.2.0 # Required by: # slapos.toolbox==0.55 feedparser = 5.2.1 # Required by: # slapos.toolbox==0.55 lockfile = 0.12.2 # Required by: # slapos.toolbox==0.55 paramiko = 2.0.0 # Required by: # slapos.toolbox==0.55 rpdb = 0.1.5 slapos-master-software/software/apache-frontend/software.cfg.json 0000664 0000000 0000000 00000002160 12722051723 0025653 0 ustar 00root root 0000000 0000000 { "name": "Apache Frontend", "description": "Apache Frontend", "serialisation": "xml", "software-type": { "custom-personal-slave": { "title": "Custom Personal (Slave)", "description": "Custom Personal", "request": "instance-slave-apache-input-schema.json", "response": "instance-output-schema.json", "index": 1, "software-type": "custom-personal", "shared": true }, "custom-personal": { "title": "Custom Personal", "description": "", "request": "instance-apache-input-schema.json", "response": "instance-output-schema.json", "index": 2 }, "default": { "title": "Default", "software-type": "default", "description": "Default", "request": "instance-slave-apache-input-schema.json", "response": "instance-output-schema.json", "index": 3 }, "default-slave": { "title": "Default (slave)", "software-type": "default", "description": "Default", "request": "instance-slave-apache-input-schema.json", "response": "instance-output-schema.json", "index": 3, "shared": true } } } slapos-master-software/software/apache-frontend/templates/ 0000775 0000000 0000000 00000000000 12722051723 0024367 5 ustar 00root root 0000000 0000000 slapos-master-software/software/apache-frontend/templates/000.conf.in 0000664 0000000 0000000 00000001034 12722051723 0026140 0 ustar 00root root 0000000 0000000