diff --git a/software/monitor/index.cgi.in b/software/monitor/index.cgi.in new file mode 100755 index 0000000000000000000000000000000000000000..a7e3416efc9e8683a4708f821766c1c667352e8f --- /dev/null +++ b/software/monitor/index.cgi.in @@ -0,0 +1,3 @@ +#!{{ extra_eggs_interpreter }} + +print "OK" diff --git a/software/monitor/instance.cfg b/software/monitor/instance.cfg index e8a0822efb7574e9c96ab2f5630387aa9ca541d7..9650ebb8a4675e4bd85d1f9fc756c85d0ce54ae1 100644 --- a/software/monitor/instance.cfg +++ b/software/monitor/instance.cfg @@ -60,5 +60,28 @@ rendered = $${monitor-directory:server-log}/dygraph-combined.js mode = 0644 context = +[pwgen] +recipe = slapos.cookbook:generate.password +user = admin +bytes = 16 + +[pwgen32] +recipe = slapos.cookbook:generate.password +user = admin +bytes = 16 + +[htpasswd-generate] +recipe = plone.recipe.command +output = $${monitor-parameters:htaccess-file} +long_passwd = $${pwgen:passwd}$${pwgen32:passwd} +update-command = $${:command} +command = + echo ${apache:location}/bin/htpasswd $${:output} $${pwgen:user} $${:long_passwd} + ${apache:location}/bin/htpasswd -cb $${:output} $${pwgen:user} $${:long_passwd} + [monitor-directory] server-log = $${:private-directory}/server-log + +[monitor-parameters] +url = https://$${pwgen:user}:$${htpasswd-generate:long_passwd}@[$${slap-parameters:ipv6-random}]:$${:port} + diff --git a/software/monitor/software.cfg b/software/monitor/software.cfg index 27441e1e83ea37b0cf848f664a8425823ac9cf34..df319fb6ec426c5eaf1e616bac5d4770cb95d854 100644 --- a/software/monitor/software.cfg +++ b/software/monitor/software.cfg @@ -15,9 +15,14 @@ parts = recipe = slapos.recipe.template url = ${:_profile_base_location_}/instance.cfg output = ${buildout:directory}/instance.cfg -md5sum = df01574007b7e9a05cf9a4eabe07e78c +md5sum = 68e146558156c0702344c83876b4daf8 mode = 0644 +# stupify index for now +[index] +url = ${:_profile_base_location_}/${:filename} +md5sum = 99ad2a7a9dbdae35e3d9aef352c4f0d5 + [rsync-logs-script] recipe = slapos.recipe.template url = ${:_profile_base_location_}/rsync-logs.sh.in