instance-apacheperl.cfg 5.62 KB
Newer Older
1 2
[buildout]
parts =
Viktor Horvath's avatar
Viktor Horvath committed
3
  postgres-urlparse
4
#  apacheperl-promise
5
  mioga-instance
6
  cron-entry-crawler
7 8 9
  sshkeys-dropbear
  dropbear-server-add-authorized-key
  sshkeys-authority
10
  publish-connection-information
11 12 13 14 15 16 17

eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

[rootdirectory]
recipe = slapos.cookbook:mkdirectory
18
bin = $${buildout:directory}/bin
19 20 21
etc = $${buildout:directory}/etc
srv = $${buildout:directory}/srv
log = $${buildout:directory}/log
22 23
var = $${buildout:directory}/var
buildinst = $${buildout:directory}/buildinst
24 25 26 27 28 29

[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run
promises = $${rootdirectory:etc}/promise
htdocs = $${rootdirectory:srv}/htdocs
30 31 32
cronstamps = $${rootdirectory:etc}/cronstamps/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
33 34 35
sshkeys = $${rootdirectory:srv}/sshkeys
ssh = $${rootdirectory:etc}/ssh

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${rootdirectory:log}/crond.log

[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cronstamps = $${basedirectory:cronstamps}
cron-entries = $${basedirectory:cron-entries}
crontabs = $${basedirectory:crontabs}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond

[cron-entry-crawler]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 23 50 * * *
command = $${mioga-instance:bin_dir}/crawl.sh
56 57 58 59 60 61 62 63 64

[apacheperl-promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/httpd_promise
hostname = $${apacheperl-instance:ip}
port = $${apacheperl-instance:port}

[publish-connection-information]
recipe = slapos.cookbook:publish
Viktor Horvath's avatar
Viktor Horvath committed
65
direct_url = $${mioga-url:direct_url}
66
ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
Viktor Horvath's avatar
Viktor Horvath committed
67 68 69
url = $${request-frontend:connection-site_url}

# Request POSTGRES INSTANCE and parse its URL
Viktor Horvath's avatar
Viktor Horvath committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

[request-postgres]
<= slap-connection
recipe = slapos.cookbook:request
name = Postgres
software-url = $${slap-connection:software-release-url}
software-type = postgres
return = url
sla = computer_guid
sla-computer_guid = $${slap-connection:computer-id}

[postgres-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-postgres:connection-url}

[symlinks]
recipe = cns.recipe.symlink
symlink_target = $${rootdirectory:bin}
symlink_base = ${postgresql:location}/bin

Viktor Horvath's avatar
Viktor Horvath committed
90 91
# SSH SERVER

92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${basedirectory:sshkeys}/requests/
keys = $${basedirectory:sshkeys}/keys/

[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
keys-directory = $${sshkeys-directory:keys}
wrapper = $${basedirectory:services}/sshkeys_authority
keygen-binary = ${dropbear:location}/bin/dropbearkey

[dropbear-server]
recipe = slapos.cookbook:dropbear
host = $${slap-network-information:global-ipv6}
port = 2222
home = $${basedirectory:ssh}
wrapper = $${rootdirectory:bin}/raw_sshd
shell = /bin/bash
rsa-keyfile = $${basedirectory:ssh}/server_key.rsa
dropbear-binary = ${dropbear:location}/sbin/dropbear

[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = $${dropbear-server:wrapper}
public-key = $${dropbear-server:rsa-keyfile}.pub
private-key = $${dropbear-server:rsa-keyfile}
wrapper = $${basedirectory:services}/sshd

[dropbear-server-add-authorized-key]
<= dropbear-server
recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${slap-parameter:authorized-key}

[slap-parameter]
# Default value if no ssh key is specified
authorized-key =

Viktor Horvath's avatar
Viktor Horvath committed
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
# IPv4 AND PORT 80 FRONTEND

[request-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = $${mioga-url:direct_url}
return = site_url

# MIOGA INSTANCE

148 149
[mioga-instance]
recipe = slapos.cookbook:mioga.instantiate
150
# mioga_compile_dir = ${template-apacheperl:compile-directory}
151 152
# Pity that the following line does not work. Or does it?
# mioga_compile_env = ${mioga:environment}
153 154 155 156
mioga_location = ${mioga:location}
mioga_buildinst = ${mioga:buildinst}
libxslt_bin = ${libxslt:location}/bin
libxml2_bin = ${libxml2:location}/bin
157 158 159
rsync_bin = ${rsync:location}/bin
var_directory = $${rootdirectory:var}
buildinst_directory = $${rootdirectory:buildinst}
160 161 162
instance_root = $${buildout:directory}
perl_bin = ${perl:location}/bin
postgres_bin = ${postgresql:location}/bin
163 164 165 166 167 168
htdocs = $${apacheperl-instance:htdocs}
db_host = $${postgres-urlparse:host}
db_port = $${postgres-urlparse:port}
db_dbname = $${postgres-urlparse:path}
db_username = $${postgres-urlparse:username}
db_password = $${postgres-urlparse:password}
169 170 171 172 173 174 175 176 177
public_ipv6 = $${slap-network-information:global-ipv6}
public_ipv6_port = 8080
private_ipv4 = $${slap-network-information:local-ipv4}
httpd_binary = ${apache-2.2:location}/bin/httpd
path = $${basedirectory:services}/apacheperl
htdocs = $${basedirectory:htdocs}
httpd_conf = $${rootdirectory:etc}/httpd.conf
pid_file = $${basedirectory:services}/apache.pid
lock_file = $${basedirectory:services}/apache.lock
178
dav_locks = $${buildout:directory}/var/dav_locks
179
services_dir = $${basedirectory:services}
180 181
error_log = $${rootdirectory:log}/error.log
access_log = $${rootdirectory:log}/access.log
182 183
bin_dir = $${rootdirectory:bin}
log_dir = $${rootdirectory:log}
184
site_perl = ${perl:siteprefix}
Viktor Horvath's avatar
Viktor Horvath committed
185 186 187

[mioga-url]
direct_url = http://[$${slap-network-information:global-ipv6}]:$${mioga-instance:public_ipv6_port}