instance-backuped.cfg 6.58 KB
Newer Older
1 2 3 4 5 6 7 8
[buildout]

extends =
  ${template-apache-php:output}

parts =
  request-mariadb
  request-mariadb-pseudo-replicating
9
  request-apache-backup
10
  request-pull-backup-server
11
  request-pull-backup-server-apache
12 13 14 15 16 17 18 19 20 21
  url
  apache-php
  stunnel
  certificate-authority
  ca-stunnel
  logrotate
  logrotate-entry-apache
  logrotate-entry-stunnel
  cron
  cron-entry-logrotate
22 23
  dropbear-server
  sshkeys-authority
24
  dropbear-server-pbs-authorized-key
25
  logrotate-entry-equeue
Antoine Catton's avatar
Antoine Catton committed
26
  logfollower
27 28 29 30 31 32 33 34
  agent
  agent-wrapper
  watchdog

[uuid-generator]
recipe = slapos.cookbook:uuid
database = $${buildout:directory}/.uuid.db
uuids = mariadb-backup apache-backup
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78

[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
keys = $${directory: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

[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]
recipe = slapos.cookbook:dropbear
host = $${slap-network-information:global-ipv6}
port = 2222
home = $${directory:ssh}
wrapper = $${rootdirectory:bin}/raw_sshd
shell = $${rdiff-backup-server:wrapper}
rsa-keyfile = $${directory:ssh}/server_key.rsa
dropbear-binary = ${dropbear:location}/sbin/dropbear

[dropbear-server-pbs-authorized-key]
<= dropbear-server
recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${request-pull-backup-server:connection-ssh-key}

[rdiff-backup-server]
recipe = slapos.cookbook:pbs
client = false
path = $${directory:htdocs}
wrapper = $${rootdirectory:bin}/rdiffbackup-server
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
79

Antoine Catton's avatar
Antoine Catton committed
80 81 82 83 84 85 86 87 88 89 90
[logfollower]
recipe = slapos.cookbook:logfollower
binary = ${buildout:bin-directory}/wp-logfollower
wait-for-creation = true
rotated = true
regex = .+PHP Warning: +mysql_.+
url = $${agent-data:url}log/mariadb
wrapper = $${basedirectory:services}/logfollower
timeout = 120
file = $${apache-php:php-error-log}

91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
[agent-data]
host = $${slap-network-information:global-ipv6}
port = 8081
url = http://[$${:host}]:$${:port}/

[agent]
<= agent-data
   slap-connection
recipe = slapos.cookbook:agent
database = $${rootdirectory:srv}/agent.db
equeue-socket = $${equeue:socket}
callbacks-directory = $${directory:agent-callbacks}
wrapper = $${rootdirectory:bin}/agent
gunicorn = ${buildout:bin-directory}/gunicorn
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
config-file = $${rootdirectory:etc}/agent.py
Antoine Catton's avatar
Antoine Catton committed
108
type = apache-php
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
peers =
    $${request-pull-backup-server:connection-agent-url}
    $${request-mariadb:connection-agent-url}
    $${request-mariadb-pseudo-replicating:connection-agent-url}
    $${request-apache-backup:connection-agent-url}

[agent-wrapper]
recipe = slapos.cookbook:submanager
subcommand = $${agent:wrapper}
wrapper = $${basedirectory:services}/agent
pid-file = $${basedirectory:run}/agent.pid
binary = ${buildout:bin-directory}/submanager
config-files =
    $${agent:config-file}

[watchdog]
recipe = slapos.cookbook:watchdog
agent-url = $${agent-data:url}
wrapper = $${basedirectory:services}/watchdog
binary = ${buildout:bin-directory}/wp-watchdog
Antoine Catton's avatar
Antoine Catton committed
129 130 131 132
master-url = $${slap-connection:server-url}
cert-file = $${slap-connection:cert-file}
key-file = $${slap-connection:key-file}
software-release-url = $${slap-connection:software-release-url}
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150

[logrotate-entry-equeue]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = equeue
log = $${equeue:log}
frequency = daily
rotate-num = 30

[equeue]
recipe = slapos.cookbook:equeue
socket = $${basedirectory:run}/equeue.sock
log = $${basedirectory:log}/equeue.log
database = $${rootdirectory:srv}/equeue.db
wrapper = $${basedirectory:services}/equeue
equeue-binary = ${buildout:bin-directory}/equeue


151 152 153
[request-pull-backup-server]
<= slap-connection
recipe = slapos.cookbook:request
154
name = Pull Backup Server
155 156
software-url = $${slap-connection:software-release-url}
software-type = pull-backup
157 158 159
config = request-agent-url
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
return = ssh-key agent-url
160 161
slave = false

162
[request-mariadb]
163
software-type = mariadb-pbsready-export
164
config = authorized-key pbs-id request-agent-url
165
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
166 167 168
config-pbs-id = $${uuid-generator:uuid-mariadb-backup}
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
return = url agent-url
169 170 171 172

[request-mariadb-pseudo-replicating]
<= slap-connection
recipe = slapos.cookbook:request
173
name = MariaDB Backup
174
software-url = $${slap-connection:software-release-url}
175
software-type = mariadb-pbsready-import
176
config = authorized-key pbs-id request-agent-url
177
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
178 179 180 181
config-pbs-id = $${uuid-generator:uuid-mariadb-backup}
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
return = url agent-url
slave = false
182

183 184 185 186 187 188
[request-apache-backup]
<= slap-connection
recipe = slapos.cookbook:request
name = Apache Backup
software-url = $${slap-connection:software-release-url}
software-type = apache-backup
189 190
return = url agent-url
config = authorized-key pbs-id request-agent-url proxy-url
191
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
192 193
config-pbs-id = $${uuid-generator:uuid-apache-backup}
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
194
config-proxy-url = $${url:url}
195
return = url agent-url
196 197

[request-pull-backup-server-apache]
198
<= slap-connection
199
recipe = slapos.cookbook:request
200
name = Pull Backup Server pulling from main Apache
201
software-url = $${slap-connection:software-release-url}
202
software-type = pull-backup
203
slave = true
204
config = url id type request-agent-url authorized-key frequency name
205 206
config-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
config-id = $${uuid-generator:uuid-apache-backup}
207
config-type = pull
208 209 210
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
config-authorized-key = $${sshkeys-dropbear:public-key-value}
config-frequency = 0 * * * *
Antoine Catton's avatar
Antoine Catton committed
211
config-name = $${:name}
212
return = feed-url agent-url
213

214 215
[basedirectory]
agent = $${rootdirectory:etc}/agent/
216 217 218 219

[directory]
ssh = $${rootdirectory:etc}/ssh/
sshkeys = $${rootdirectory:srv}/sshkeys
220
agent-callbacks = $${basedirectory:agent}/callbacks/