PROJECT_MOVED -> https://lab.nexedi.com/nexedi/slapos
[slapos.git] / software / html5ide / instance-html5ide.cfg
1 [buildout]
2 parts =
3   httpd-launcher
4   httpd-graceful
5   httpd-dav-htaccess
6   httpd-make-dummy-index-html
7   promise-httpd-ipv6
8   publish-connection-information
9
10 ## Monitoring part
11 ###Parts to add for monitoring
12   certificate-authority
13   cron-entry-monitor
14   cron-entry-rss
15   deploy-index
16   deploy-settings-cgi
17   deploy-status-cgi
18   deploy-status-history-cgi
19   setup-static-files
20   zero-parameters
21   public-symlink
22   cgi-httpd-wrapper
23   cgi-httpd-graceful-wrapper
24   monitor-promise
25   monitor-instance-log-access
26 ## Monitor for apache
27
28 extends = ${monitor-template:output}
29
30 eggs-directory = ${buildout:eggs-directory}
31 develop-eggs-directory = ${buildout:develop-eggs-directory}
32 offline = true
33
34 # Create all needed directories
35 [directory]
36 recipe = slapos.cookbook:mkdirectory
37 etc = $${buildout:directory}/etc/
38 var = $${buildout:directory}/var/
39 srv = $${buildout:directory}/srv
40 bin = $${buildout:directory}/bin/
41 tmp = $${buildout:directory}/tmp/
42
43 service = $${:etc}/service/
44 etc-run = $${:etc}/run/
45 log = $${:var}/log/
46 run = $${:var}/run/
47 backup = $${:srv}/backup/
48 promise = $${:etc}/promise/
49
50 # Jinja Common
51
52 [jinja2-template-base]
53 recipe = slapos.recipe.template:jinja2
54 rendered = $${buildout:directory}/$${:filename}
55 extra-context =
56 context =
57     import json_module json
58     key eggs_directory buildout:eggs-directory
59     key develop_eggs_directory buildout:develop-eggs-directory
60     key slap_software_type instance-parameter:slap-software-type
61     key slapparameter_dict instance-parameter:configuration
62     section directory directory
63     $${:extra-context}
64
65 ###########################
66 # Apache configuration
67 #
68
69 [apache-directory]
70 recipe = slapos.cookbook:mkdirectory
71 www = $${directory:srv}/www
72 dav = $${directory:srv}/dav
73 slave-configuration = $${directory:etc}/apache-slave-conf.d/
74 ssl = $${directory:etc}/ssl
75
76 [apache-configuration]
77 httpd-launcher = $${directory:service}/httpd
78 httpd-graceful = $${directory:etc-run}/httpd-graceful
79 frontend-configuration = $${directory:etc}/httpd.conf
80 access-log = $${directory:log}/httpd-access.log
81 error-log = $${directory:log}/httpd-error.log
82 pid-file = $${directory:run}/httpd.pid
83 httpd-graceful-command = kill -USR1 $(cat $${:pid-file})
84
85 # Configuration
86 [httpd-parameter]
87 path_pid = $${directory:run}/httpd.pid
88 global_ip = $${slap-network-information:global-ipv6}
89 global_port = 6666
90 path_error_log = $${apache-configuration:error-log}
91 path_access_log = $${apache-configuration:access-log}
92 key_file = $${ca-httpd:key-file}
93 cert_file = $${ca-httpd:cert-file}
94 document_root = $${apache-directory:www}
95 dav_lock = $${directory:var}/DavLock
96 dav_home = $${apache-directory:dav}
97 htpassword_path = $${directory:etc}/.htpasswd
98 etc_dir = $${directory:etc}
99 var_dir = $${directory:var}
100
101 [httpd-conf]
102 recipe = slapos.recipe.template:jinja2
103 template = ${template_httpd_conf:location}/${template_httpd_conf:filename}
104 rendered = $${apache-configuration:frontend-configuration}
105 context =
106     section parameter httpd-parameter
107
108 # Htaccess for dav storage
109 [httpd-dav-htaccess]
110 recipe = plone.recipe.command
111 stop-on-error = true
112 htaccess-path = $${httpd-parameter:htpassword_path}
113 command = ${apache:location}/bin/htpasswd -cb $${:htaccess-path} $${:user} $${:password}
114 user = admin
115 password = admin
116
117 # Launcher and Graceful
118 [httpd-launcher]
119 recipe = slapos.cookbook:wrapper
120 apache-executable = ${apache:location}/bin/httpd
121 wrapper-path = $${apache-configuration:httpd-launcher}
122 command-line = $${:apache-executable} -f $${httpd-conf:rendered} -DFOREGROUND
123
124 [httpd-graceful]
125 recipe = slapos.recipe.template:jinja2
126 template = ${template-wrapper:output}
127 rendered = $${apache-configuration:httpd-graceful}
128 mode = 0700
129 context =
130     key content apache-configuration:httpd-graceful-command
131
132 # Create Dummu index.html
133 [httpd-make-dummy-index-html]
134 recipe = plone.recipe.command
135 command = if [ ! -f $${httpd-parameter:document_root}/index.html ]; then echo "Hello World!!!" > $${httpd-parameter:document_root}/index.html ; fi
136
137 # Promise
138 [promise-httpd-ipv6]
139 recipe = slapos.cookbook:check_port_listening
140 path = $${directory:promise}/httpd_ipv6
141 hostname = $${httpd-parameter:global_ip}
142 port = $${httpd-parameter:global_port}
143
144 ###########################
145 # Certificate Authority
146 #
147
148 [cadirectory]
149 recipe = slapos.cookbook:mkdirectory
150 ca-dir = $${directory:srv}/ssl
151 requests = $${:ca-dir}/requests/
152 private = $${:ca-dir}/private/
153 certs = $${:ca-dir}/certs/
154 newcerts = $${:ca-dir}/newcerts/
155 crl = $${:ca-dir}/crl/
156
157 [certificate-authority]
158 recipe = slapos.cookbook:certificate_authority
159 openssl-binary = ${openssl:location}/bin/openssl
160 ca-dir = $${cadirectory:ca-dir}
161 requests-directory = $${cadirectory:requests}
162 wrapper = $${directory:service}/certificate_authority
163 ca-private = $${cadirectory:private}
164 ca-certs = $${cadirectory:certs}
165 ca-newcerts = $${cadirectory:newcerts}
166 ca-crl = $${cadirectory:crl}
167
168 [ca-httpd]
169 <= certificate-authority
170 recipe = slapos.cookbook:certificate_authority.request
171 key-file = $${cadirectory:certs}/httpd.key
172 cert-file = $${cadirectory:certs}/httpd.crt
173 executable = $${directory:service}/ca-certificate
174 wrapper = $${directory:service}/ca-certificate
175 # Put domain name
176 name = example.com
177
178 ###########################
179 # Monitor Part
180 #
181
182 [publish-connection-information]
183 recipe = slapos.cookbook:publish
184 server_url = https://[$${httpd-parameter:global_ip}]:$${httpd-parameter:global_port}