Commit e4db4d3b authored by Julien Muchembled's avatar Julien Muchembled Committed by Matevz Golob

fixup! Some clean-up in the monitor stack and its use in ERP5

Commit b96cdf9c didn't propagate
correctly the monitor password from the root partition to subpartitions.
parent 6614f3ed
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
# not need these here). # not need these here).
[monitor2-template] [monitor2-template]
filename = instance-monitor.cfg.jinja2.in filename = instance-monitor.cfg.jinja2.in
md5sum = e713bc55b68e3102f20902abc9f34f4b md5sum = c0856969ea372d49ab60ba07b3bf2a51
...@@ -97,7 +97,7 @@ parameter-file-path = ${monitor-instance-parameter:configuration-file-path} ...@@ -97,7 +97,7 @@ parameter-file-path = ${monitor-instance-parameter:configuration-file-path}
parameter-list = parameter-list =
raw monitor-user ${monitor-instance-parameter:username} raw monitor-user ${monitor-instance-parameter:username}
htpasswd monitor-password ${monitor-htpasswd:storage-path} ${monitor-instance-parameter:username} ${httpd-monitor-htpasswd:htpasswd-path} htpasswd monitor-password ${httpd-monitor-htpasswd:password-file} ${monitor-instance-parameter:username} ${httpd-monitor-htpasswd:htpasswd-path}
file min-free-disk-MB ${promise-check-free-disk-space:config-threshold-file} file min-free-disk-MB ${promise-check-free-disk-space:config-threshold-file}
${monitor-instance-parameter:instance-configuration} ${monitor-instance-parameter:instance-configuration}
# htpasswd entry: htpasswd key password-file username htpasswd-file # htpasswd entry: htpasswd key password-file username htpasswd-file
...@@ -142,18 +142,18 @@ wrapper-path = ${directory:scripts}/${:name} ...@@ -142,18 +142,18 @@ wrapper-path = ${directory:scripts}/${:name}
[monitor-htpasswd] [monitor-htpasswd]
recipe = slapos.cookbook:generate.password recipe = slapos.cookbook:generate.password
storage-path = ${directory:etc}/.monitor_pwd storage-path = ${directory:etc}/.monitor_pwd
bytes = 8
[httpd-monitor-htpasswd] [httpd-monitor-htpasswd]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
password-file = ${directory:etc}/.monitor_pwd
htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd
# Keep multiple lines as password can end with newline char.
command = command =
if [ ! -s "${:htpasswd-path}" ]; then echo "${monitor-instance-parameter:password}" >${:password-file}
{{ apache_location }}/bin/htpasswd -cb ${:htpasswd-path} ${monitor-instance-parameter:username} ${monitor-instance-parameter:password} [ -s "${:htpasswd-path}" ] ||
fi {{ apache_location }}/bin/htpasswd -ci ${:htpasswd-path} "${monitor-instance-parameter:username}" <${:password-file}
update-command = ${:command} update-command =
[ -s "${:password-file}" ] || ${:command}
[monitor-symlink] [monitor-symlink]
recipe = cns.recipe.symlink recipe = cns.recipe.symlink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment