Simple and elegant tool to communicate with Varnish over CLI
No Varnish packages required to be installed on control host - it means tool could be used even you have no permissions to install Varnish repository and packages to obtain official varnishadm
utility.
Just grab binary from GitHub Releases page and set executable bit or build it from sources (if you’re paranoid):
go get -u github.com/akuznecov/varnishadm-ninja
No need to have an access to file with secret key (typically, /etc/varnish/secret
). But still need to know it for authentication (see Usage).
Run from anywhere (only thing you need - network access to Varnish CLI terminal):
Almost of all varnishadm
commands could used with varnishadm-ninja
.
$ varnishadm-ninja -T ADDRESS:PORT -S SECRET <command> [<arguments> <flags>]
where:
-T ADDRESS:PORT
- Varnish instance connection parameters-S SECRET
- Varnish secret key for authentication<command>
- one of commands from https://varnish-cache.org/docs/trunk/reference/varnish-cli.html#commands[<arguments> <flags>]
- additional parameters for particular commandInvalidate cache for specific combination of domain and URL:
varnishadm-ninja -T lb01.foobar.intranet:35964 -S bd88ecbc-513c-494a-ab39-a8ca539de515 ban 'req.http.host == "www.example.com" && req.url ~ "^/funny/kittens/"'