Merge branch 'master' into slaprunner-paas
[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   plot-html
23   dygraph-js
24   
25 extends = ${monitor-template:output}
26
27
28 eggs-directory = ${buildout:eggs-directory}
29 develop-eggs-directory = ${buildout:develop-eggs-directory}
30 offline = true
31
32 [cron-rsync-logs]
33 <= cron
34 recipe = slapos.cookbook:cron.d
35 name = rsync-logs
36 frequency = * * * * *
37 command = $${rsync-logs:rendered}
38
39 [rsync-logs]
40 recipe = slapos.recipe.template:jinja2
41 template = ${rsync-logs-script:output}
42 rendered = $${monitor-directory:bin}/rsync-logs.sh
43 mode = 0744
44 context =
45   key buildout_directory buildout:directory
46   raw rsync_binary ${rsync:location}/bin/rsync
47   key server_log_directory monitor-directory:server-log 
48
49 [plot-html]
50 recipe = slapos.recipe.template:jinja2
51 template = ${template-plot-html:output}
52 rendered = $${monitor-directory:server-log}/plot.html
53 mode = 0644
54 context =
55
56 [dygraph-js]
57 recipe = slapos.recipe.template:jinja2
58 template = ${template-dygraph-js:output}
59 rendered = $${monitor-directory:server-log}/dygraph-combined.js
60 mode = 0644
61 context =
62
63 [pwgen]
64 recipe = slapos.cookbook:generate.password
65 user = admin
66 bytes = 16
67
68 [pwgen32]
69 recipe = slapos.cookbook:generate.password
70 user = admin
71 bytes = 16
72
73 [htpasswd-generate]
74 recipe = plone.recipe.command
75 output = $${monitor-parameters:htaccess-file}
76 long_passwd = $${pwgen:passwd}$${pwgen32:passwd} 
77 update-command = $${:command}
78 command =
79   echo ${apache:location}/bin/htpasswd $${:output} $${pwgen:user} $${:long_passwd}
80   ${apache:location}/bin/htpasswd -cb $${:output} $${pwgen:user} $${:long_passwd}
81
82 [monitor-directory]
83 server-log = $${:private-directory}/server-log
84
85 [monitor-parameters]
86 url = https://$${pwgen:user}:$${htpasswd-generate:long_passwd}@[$${slap-parameters:ipv6-random}]:$${:port}
87