Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Allow passing the secret in the helper script

  • Loading branch information...
commit fd6dc641a98b6e06411817543d2af9c3b249d376 1 parent 1ae7561
fredvd fredvd authored
9 README.rst
Source Rendered
@@ -177,6 +177,15 @@ So you can make a request without authentication, using the secret, like::
177 177
178 178 http://localhost:8080/@@munin.zope.plugins/zopethreads?secret=yoursecrethere
179 179
  180 +You can also pass in the secret in the munin helper script::
  181 +
  182 + [munin3]
  183 + recipe = zc.recipe.egg
  184 + eggs = munin.zope
  185 + scripts = munin=munin3
  186 + arguments = http_address='${instance2:http-address}', secret='mylittlesecret'
  187 +
  188 +
180 189 References
181 190 ----------
182 191
2  docs/HISTORY.txt
@@ -4,6 +4,8 @@ Changelog
4 4 1.4 (unreleased)
5 5 ----------------
6 6
  7 +- Allow passing the secret in the bin/munin script as well [fredvd]
  8 +
7 9 - Added testrunner for Plone 4.2 [fredvd]
8 10
9 11 - updated bootstrap.py for distribute compat. [fredvd]
9 src/munin/zope/plugins.py
@@ -60,13 +60,16 @@ def install(script, cmd, path, prefix=None, suffix=None):
60 60 print 'skipped existing %s' % target
61 61
62 62
63   -def run(ip_address='localhost', http_address=8080, port_base=0, user=None):
  63 +def run(ip_address='localhost', http_address=8080, port_base=0, user=None,
  64 + secret = None):
64 65 if 3 <= len(argv) <= 5 and argv[1] == 'install':
65 66 return install(*argv)
  67 + port = int(http_address) + int(port_base)
  68 + host = '%s:%d' % (ip_address, port)
66 69 if not 'URL' in environ:
67   - port = int(http_address) + int(port_base)
68   - host = '%s:%d' % (ip_address, port)
69 70 environ['URL'] = 'http://%s/@@munin.zope.plugins/%%s' % host
70 71 if not 'AUTH' in environ and user is not None:
71 72 environ['AUTH'] = user
  73 + if secret is not None:
  74 + environ['URL'] = 'http://%s/@@munin.zope.plugins/%%s?secret=%s' % (host, secret)
72 75 main()
6 test-4.2.cfg
@@ -27,3 +27,9 @@ parts +=
27 27 recipe = zc.recipe.egg
28 28 eggs = munin.zope
29 29 arguments = http_address=${instance:http-address}, user='${instance:user}'
  30 +
  31 +[munin2]
  32 +recipe = zc.recipe.egg
  33 +eggs = munin.zope
  34 +scripts = munin=munin2
  35 +arguments = http_address=${instance:http-address}, secret='changethisplz'

0 comments on commit fd6dc64

Please sign in to comment.
Something went wrong with that request. Please try again.