Merge remote-tracking branch 'origin/erp5-luke' into erp5
[slapos.git] / stack / lamp / instance-apache-backup.cfg
1 [buildout]
2
3 parts =
4   urls
5   apache-proxy
6   logrotate
7   logrotate-entry-apache
8   cron
9   cron-entry-logrotate
10   sshkeys-authority
11   sshkeys-dropbear
12   dropbear-server
13   dropbear-server-pbs-authorized-key
14
15 eggs-directory = ${buildout:eggs-directory}
16 develop-eggs-directory = ${buildout:develop-eggs-directory}
17 offline = true
18
19 [urls]
20 recipe = slapos.cookbook:publish
21 url = http://[$${apache-proxy:ip}]:$${apache-proxy:port}/
22 ssh-public-key = $${sshkeys-dropbear:public-key-value}
23 ssh-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
24
25 [apache-proxy]
26 recipe = slapos.cookbook:apacheproxy
27 url = $${slap-parameter:proxy-url}
28 pid-file = $${basedirectory:run}/apache.pid
29 lock-file = $${basedirectory:run}/apache.lock
30 ip = $${slap-network-information:global-ipv6}
31 port = 8080
32 error-log = $${directory:httpd-log}/error.log
33 access-log = $${directory:httpd-log}/access.log
34 httpd-conf = $${rootdirectory:etc}/apache.conf
35 wrapper = $${basedirectory:services}/apache
36
37 promise = $${basedirectory:promises}/apache
38
39 httpd-binary = ${apache:location}/bin/httpd
40
41 [sshkeys-directory]
42 recipe = slapos.cookbook:mkdirectory
43 requests = $${directory:sshkeys}/requests/
44 keys = $${directory:sshkeys}/keys/
45
46 [sshkeys-authority]
47 recipe = slapos.cookbook:sshkeys_authority
48 request-directory = $${sshkeys-directory:requests}
49 keys-directory = $${sshkeys-directory:keys}
50 wrapper = $${basedirectory:services}/sshkeys_authority
51 keygen-binary = ${dropbear:location}/bin/dropbearkey
52
53 [sshkeys-dropbear]
54 <= sshkeys-authority
55 recipe = slapos.cookbook:sshkeys_authority.request
56 name = dropbear
57 type = rsa
58 executable = $${dropbear-server:wrapper}
59 public-key = $${dropbear-server:rsa-keyfile}.pub
60 private-key = $${dropbear-server:rsa-keyfile}
61 wrapper = $${basedirectory:services}/sshd
62
63 [dropbear-server]
64 recipe = slapos.cookbook:dropbear
65 host = $${slap-network-information:global-ipv6}
66 port = 2222
67 home = $${directory:ssh}
68 wrapper = $${rootdirectory:bin}/raw_sshd
69 shell = $${rdiff-backup-server:wrapper}
70 rsa-keyfile = $${directory:ssh}/server_key.rsa
71 dropbear-binary = ${dropbear:location}/sbin/dropbear
72
73 [dropbear-server-pbs-authorized-key]
74 <= dropbear-server
75 recipe = slapos.cookbook:dropbear.add_authorized_key
76 key = $${slap-parameter:authorized-key}
77
78 [rdiff-backup-server]
79 recipe = slapos.cookbook:pbs
80 client = false
81 path = $${directory:htdocs}
82 wrapper = $${rootdirectory:bin}/rdiffbackup-server
83 rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
84
85 [logrotate]
86 recipe = slapos.cookbook:logrotate
87 # Binaries
88 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
89 gzip-binary = ${gzip:location}/bin/gzip
90 gunzip-binary = ${gzip:location}/bin/gunzip
91 # Directories
92 wrapper = $${rootdirectory:bin}/logrotate
93 conf = $${rootdirectory:etc}/logrotate.conf
94 logrotate-entries = $${directory:logrotate-entries}
95 backup = $${directory:logrotate-backup}
96 state-file = $${rootdirectory:srv}/logrotate.status
97
98 [logrotate-entry-apache]
99 <= logrotate
100 recipe = slapos.cookbook:logrotate.d
101 name = apache
102 log = $${apache-proxy:error-log} $${apache-proxy:access-log}
103 frequency = daily
104 rotate-num = 30
105 sharedscripts = true
106 notifempty = true
107 create = true
108
109 [cron]
110 recipe = slapos.cookbook:cron
111 dcrond-binary = ${dcron:location}/sbin/crond
112 cron-entries = $${directory:cron-entries}
113 crontabs = $${directory:crontabs}
114 cronstamps = $${directory:cronstamps}
115 catcher = $${cron-simplelogger:wrapper}
116 binary = $${basedirectory:services}/crond
117
118 [cron-simplelogger]
119 recipe = slapos.cookbook:simplelogger
120 wrapper = $${rootdirectory:bin}/cron_simplelogger
121 log = $${basedirectory:log}/crond.log
122
123 [cron-entry-logrotate]
124 <= cron
125 recipe = slapos.cookbook:cron.d
126 name = logrotate
127 frequency = 0 0 * * *
128 command = $${logrotate:wrapper}
129
130 [rootdirectory]
131 recipe = slapos.cookbook:mkdirectory
132 etc = $${buildout:directory}/etc/
133 var = $${buildout:directory}/var/
134 srv = $${buildout:directory}/srv/
135 bin = $${buildout:directory}/bin/
136 tmp = $${buildout:directory}/tmp/
137
138 [basedirectory]
139 recipe = slapos.cookbook:mkdirectory
140 log = $${rootdirectory:var}/log/
141 services = $${rootdirectory:etc}/run/
142 run = $${rootdirectory:var}/run/
143 backup = $${rootdirectory:srv}/backup/
144 promises = $${rootdirectory:etc}/promise/
145
146 [directory]
147 recipe = slapos.cookbook:mkdirectory
148 htdocs = $${rootdirectory:srv}/www/
149 logrotate-entries = $${rootdirectory:etc}/logrotate.d/
150 logrotate-backup = $${basedirectory:backup}/logrotate/
151 cronstamps = $${rootdirectory:etc}/cronstamps/
152 cron-entries = $${rootdirectory:etc}/cron.d/
153 crontabs = $${rootdirectory:etc}/crontabs/
154 ssh = $${rootdirectory:etc}/ssh/
155 sshkeys = $${rootdirectory:srv}/sshkeys
156 httpd-log = $${basedirectory:log}/apache/