Monitoring SR: Refactoring, fix and improve
[slapos.git] / software / monitor / instance.cfg
1 [buildout]
2
3 parts =
4   publish-connection-informations
5   cron
6   certificate-authority
7   cron-entry-monitor
8   cron-entry-rss
9   deploy-index
10   deploy-settings-cgi
11   deploy-status-cgi
12   deploy-status-history-cgi
13   setup-static-files
14   certificate-authority
15   zero-parameters
16   public-symlink
17   cgi-httpd-wrapper
18   cgi-httpd-graceful-wrapper
19   monitor-promise
20   monitor-instance-log-access
21   cron-rsync-logs
22   
23 extends = ${monitor-template:output}
24
25
26 eggs-directory = ${buildout:eggs-directory}
27 develop-eggs-directory = ${buildout:develop-eggs-directory}
28 offline = true
29
30 [cron-rsync-logs]
31 <= cron
32 recipe = slapos.cookbook:cron.d
33 name = rsync-logs
34 frequency = * * * * *
35 command = $${rsync-logs:rendered}
36
37 [rsync-logs]
38 recipe = slapos.recipe.template:jinja2
39 template = ${rsync-logs-script:output}
40 rendered = $${monitor-directory:bin}/rsync-logs.sh
41 mode = 0744
42 context =
43   key buildout_directory buildout:directory
44   raw rsync_binary ${rsync:location}/bin/rsync
45   key server_log_directory monitor-directory:server-log 
46
47 [pwgen]
48 recipe = slapos.cookbook:generate.password
49 user = admin
50 bytes = 16
51
52 [pwgen32]
53 recipe = slapos.cookbook:generate.password
54 user = admin
55 bytes = 16
56
57
58 [monitor-directory]
59 server-log = $${:private-directory}/server-log
60 cache = $${:var}/cache
61 mod-ssl = $${:cache}/httpd_mod_ssl
62
63 [slap-parameter]
64 private-hash = $${pwgen:passwd}$${pwgen32:passwd}
65 frontend-domain = 
66
67 [monitor-frontend]
68 <= slap-connection
69 recipe = slapos.cookbook:requestoptional
70 name = Monitor Frontend
71 # XXX We have hardcoded SR URL here.
72 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
73 slave = true
74 config = url domain
75 config-url = $${monitor-parameters:url}
76 config-domain = $${slap-parameter:frontend-domain}
77 return = site_url domain
78
79 [publish-connection-informations]
80 recipe = slapos.cookbook:publish
81 monitor_url = $${monitor-parameters:url}
82 server_log_url = $${:url}$${slap-parameter:private-hash}/ 
83 url = $${monitor-frontend:connection-site_url}
84
85 [monitor-httpd-configuration-file]
86 context =
87   section directory monitor-directory
88   section monitor_parameters monitor-parameters
89   section httpd_configuration monitor-httpd-configuration
90   section monitor_rewrite_rule monitor-rewrite-rule
91   key monitor_private_hash slap-parameter:private-hash