This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:focal | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV DEBCONF_NONINTERACTIVE_SEEN=true | |
| RUN apt-get update | |
| RUN apt-get install -y curl cargo git pkg-config libssl-dev clang | |
| RUN curl -s https://packagecloud.io/install/repositories/varnishcache/varnish71/script.deb.sh | bash | |
| RUN apt-get install -y varnish-dev | |
| RUN git clone https://github.com/gquintard/vmod_reqwest.git | |
| WORKDIR /vmod_reqwest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM debian:stretch-slim | |
| RUN apt update && \ | |
| echo > /etc/apt/sources.list.d/varnish.list deb https://packagecloud.io/varnishcache/varnish62/debian/ stretch main && \ | |
| echo >> /etc/apt/sources.list.d/varnish.list deb-src https://packagecloud.io/varnishcache/varnish62/debian/ stretch main && \ | |
| apt-get install devscripts dpkg-dev curl gnupg apt-transport-https -y && \ | |
| curl -L https://packagecloud.io/varnishcache/varnish62/gpgkey | apt-key add - && \ | |
| apt update && \ | |
| mkdir /tmp/workdir && \ | |
| cd /tmp/workdir && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM debian:stretch-slim | |
| RUN apt update && \ | |
| echo > /etc/apt/sources.list.d/varnish.list deb https://packagecloud.io/varnishcache/varnish62/debian/ stretch main && \ | |
| echo >> /etc/apt/sources.list.d/varnish.list deb-src https://packagecloud.io/varnishcache/varnish62/debian/ stretch main && \ | |
| apt-get install devscripts dpkg-dev curl gnupg apt-transport-https -y && \ | |
| curl -L https://packagecloud.io/varnishcache/varnish62/gpgkey | apt-key add - && \ | |
| apt update && \ | |
| mkdir /tmp/workdir && \ | |
| cd /tmp/workdir && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM debian:stretch-slim | |
| RUN apt update && \ | |
| echo > /etc/apt/sources.list.d/varnish.list deb https://packagecloud.io/varnishcache/varnish62/debian/ stretch main && \ | |
| echo >> /etc/apt/sources.list.d/varnish.list deb-src https://packagecloud.io/varnishcache/varnish62/debian/ stretch main && \ | |
| apt-get install devscripts dpkg-dev curl gnupg apt-transport-https -y && \ | |
| curl -L https://packagecloud.io/varnishcache/varnish62/gpgkey | apt-key add - && \ | |
| apt update && \ | |
| mkdir /tmp/workdir && \ | |
| cd /tmp/workdir && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vcl 4.0; /* don't mind that, that's the vcl version, not the varnish version*/ | |
| import std; | |
| backend api { | |
| .host = "192.168.1.123"; | |
| } | |
| backend api_limited { | |
| .host = "192.168.1.123"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| varnish: | |
| image: "varnish-img" | |
| hitch: | |
| image: "hitch-img" | |
| ports: | |
| - "1443:443" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # usage: token_checker.sh KEY [STRING....] | |
| key="$1" | |
| shift | |
| s= | |
| for i in "$@"; do | |
| s="$s$i" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "XFF test" | |
| server s1 {} -start | |
| varnish v1 -vcl+backend { | |
| sub vcl_recv { | |
| return (synth(200)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Test cookie vmod" | |
| server s1 { | |
| rxreq | |
| txresp -hdr "server: s1" -hdr "set-cookie: id=123;" | |
| rxreq | |
| txresp -hdr "server: s1" | |
| rxreq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "Test cookie vmod" | |
| server s1 { | |
| rxreq | |
| txresp -hdr "set-cookie: id=123;" | |
| rxreq | |
| expect req.http.cookie == "id=123;" | |
| txresp -hdr "server: s1" |
NewerOlder