Runner: Merge development into master for release
[slapos.git] / software / unstable / mioga / instance-apacheperl.cfg
1 [buildout]
2 parts =
3   postgres-urlparse
4 #  apacheperl-promise
5   mioga-instance
6   cron-entry-crawler
7   sshkeys-dropbear
8   dropbear-server-add-authorized-key
9   sshkeys-authority
10   publish-connection-information
11
12 eggs-directory = ${buildout:eggs-directory}
13 develop-eggs-directory = ${buildout:develop-eggs-directory}
14 offline = true
15
16 [rootdirectory]
17 recipe = slapos.cookbook:mkdirectory
18 bin = $${buildout:directory}/bin
19 etc = $${buildout:directory}/etc
20 srv = $${buildout:directory}/srv
21 log = $${buildout:directory}/log
22 var = $${buildout:directory}/var
23 buildinst = $${buildout:directory}/buildinst
24
25 [basedirectory]
26 recipe = slapos.cookbook:mkdirectory
27 services = $${rootdirectory:etc}/run
28 promises = $${rootdirectory:etc}/promise
29 htdocs = $${rootdirectory:srv}/htdocs
30 cronstamps = $${rootdirectory:etc}/cronstamps/
31 cron-entries = $${rootdirectory:etc}/cron.d/
32 crontabs = $${rootdirectory:etc}/crontabs/
33 sshkeys = $${rootdirectory:srv}/sshkeys
34 ssh = $${rootdirectory:etc}/ssh
35
36 [cron-simplelogger]
37 recipe = slapos.cookbook:simplelogger
38 wrapper = $${rootdirectory:bin}/cron_simplelogger
39 log = $${rootdirectory:log}/crond.log
40
41 [cron]
42 recipe = slapos.cookbook:cron
43 dcrond-binary = ${dcron:location}/sbin/crond
44 cronstamps = $${basedirectory:cronstamps}
45 cron-entries = $${basedirectory:cron-entries}
46 crontabs = $${basedirectory:crontabs}
47 catcher = $${cron-simplelogger:wrapper}
48 binary = $${basedirectory:services}/crond
49
50 [cron-entry-crawler]
51 <= cron
52 recipe = slapos.cookbook:cron.d
53 name = logrotate
54 frequency = 23 50 * * *
55 command = $${mioga-instance:bin_dir}/crawl.sh
56
57 [apacheperl-promise]
58 recipe = slapos.cookbook:check_port_listening
59 path = $${basedirectory:promises}/httpd_promise
60 hostname = $${apacheperl-instance:ip}
61 port = $${apacheperl-instance:port}
62
63 [publish-connection-information]
64 recipe = slapos.cookbook:publish
65 direct_url = $${mioga-url:direct_url}
66 ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
67 url = $${request-frontend:connection-site_url}
68
69 # Request POSTGRES INSTANCE and parse its URL
70
71 [request-postgres]
72 <= slap-connection
73 recipe = slapos.cookbook:request
74 name = Postgres
75 software-url = $${slap-connection:software-release-url}
76 software-type = postgres
77 return = url
78 sla = computer_guid
79 sla-computer_guid = $${slap-connection:computer-id}
80
81 [postgres-urlparse]
82 recipe = slapos.cookbook:urlparse
83 url = $${request-postgres:connection-url}
84
85 [symlinks]
86 recipe = cns.recipe.symlink
87 symlink_target = $${rootdirectory:bin}
88 symlink_base = ${postgresql:location}/bin
89
90 # SSH SERVER
91
92 [sshkeys-directory]
93 recipe = slapos.cookbook:mkdirectory
94 requests = $${basedirectory:sshkeys}/requests/
95 keys = $${basedirectory:sshkeys}/keys/
96
97 [sshkeys-authority]
98 recipe = slapos.cookbook:sshkeys_authority
99 request-directory = $${sshkeys-directory:requests}
100 keys-directory = $${sshkeys-directory:keys}
101 wrapper = $${basedirectory:services}/sshkeys_authority
102 keygen-binary = ${dropbear:location}/bin/dropbearkey
103
104 [dropbear-server]
105 recipe = slapos.cookbook:dropbear
106 host = $${slap-network-information:global-ipv6}
107 port = 2222
108 home = $${basedirectory:ssh}
109 wrapper = $${rootdirectory:bin}/raw_sshd
110 shell = /bin/bash
111 rsa-keyfile = $${basedirectory:ssh}/server_key.rsa
112 dropbear-binary = ${dropbear:location}/sbin/dropbear
113
114 [sshkeys-dropbear]
115 <= sshkeys-authority
116 recipe = slapos.cookbook:sshkeys_authority.request
117 name = dropbear
118 type = rsa
119 executable = $${dropbear-server:wrapper}
120 public-key = $${dropbear-server:rsa-keyfile}.pub
121 private-key = $${dropbear-server:rsa-keyfile}
122 wrapper = $${basedirectory:services}/sshd
123
124 [dropbear-server-add-authorized-key]
125 <= dropbear-server
126 recipe = slapos.cookbook:dropbear.add_authorized_key
127 key = $${slap-parameter:authorized-key}
128
129 [slap-parameter]
130 # Default value if no ssh key is specified
131 authorized-key =
132
133 # IPv4 AND PORT 80 FRONTEND
134
135 [request-frontend]
136 <= slap-connection
137 recipe = slapos.cookbook:requestoptional
138 name = Frontend
139 # XXX We have hardcoded SR URL here.
140 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
141 slave = true
142 config = url
143 config-url = $${mioga-url:direct_url}
144 return = site_url
145
146 # MIOGA INSTANCE
147
148 [mioga-instance]
149 recipe = slapos.cookbook:mioga.instantiate
150 # mioga_compile_dir = ${template-apacheperl:compile-directory}
151 # Pity that the following line does not work. Or does it?
152 # mioga_compile_env = ${mioga:environment}
153 mioga_location = ${mioga:location}
154 mioga_buildinst = ${mioga:buildinst}
155 libxslt_bin = ${libxslt:location}/bin
156 libxml2_bin = ${libxml2:location}/bin
157 rsync_bin = ${rsync:location}/bin
158 var_directory = $${rootdirectory:var}
159 buildinst_directory = $${rootdirectory:buildinst}
160 instance_root = $${buildout:directory}
161 perl_bin = ${perl:location}/bin
162 postgres_bin = ${postgresql:location}/bin
163 htdocs = $${apacheperl-instance:htdocs}
164 db_host = $${postgres-urlparse:host}
165 db_port = $${postgres-urlparse:port}
166 db_dbname = $${postgres-urlparse:path}
167 db_username = $${postgres-urlparse:username}
168 db_password = $${postgres-urlparse:password}
169 public_ipv6 = $${slap-network-information:global-ipv6}
170 public_ipv6_port = 8080
171 private_ipv4 = $${slap-network-information:local-ipv4}
172 httpd_binary = ${apache-2.2:location}/bin/httpd
173 path = $${basedirectory:services}/apacheperl
174 htdocs = $${basedirectory:htdocs}
175 httpd_conf = $${rootdirectory:etc}/httpd.conf
176 pid_file = $${basedirectory:services}/apache.pid
177 lock_file = $${basedirectory:services}/apache.lock
178 dav_locks = $${buildout:directory}/var/dav_locks
179 services_dir = $${basedirectory:services}
180 error_log = $${rootdirectory:log}/error.log
181 access_log = $${rootdirectory:log}/access.log
182 bin_dir = $${rootdirectory:bin}
183 log_dir = $${rootdirectory:log}
184 site_perl = ${perl:siteprefix}
185
186 [mioga-url]
187 direct_url = http://[$${slap-network-information:global-ipv6}]:$${mioga-instance:public_ipv6_port}