| .. | ||
| 0000_all_resolver | ||
| 0001_base_http_proxy | ||
| 0002_base_socks_proxy | ||
| 0003_base_tcp_stream | ||
| 0003_chain_tcp_stream | ||
| 0004_base_http_gateway | ||
| 0005_transparent_proxy | ||
| 0006_chain_http_proxy | ||
| 0007_chain_socks_proxy | ||
| 0008_base_user_auth | ||
| 0009_anonymous_user | ||
| 0010_escaper_direct_float | ||
| 0011_escaper_proxy_float | ||
| 0012_intelli_proxy | ||
| 0013_dynamic_user | ||
| 0014_escaper_failover | ||
| 0015_escaper_geoip | ||
| 0016_resolve_failover | ||
| 0020_audit_base | ||
| 0021_audit_icap_preview | ||
| 0022_audit_icap_no_preview | ||
| 0023_audit_user | ||
| 1000_worker_base | ||
| 1001_worker_sched | ||
| 1002_worker_listen | ||
| 1003_worker_multi_rt | ||
| .gitignore | ||
| dnsmasq.conf | ||
| docker_run.sh | ||
| fluent-bit.conf | ||
| g3fcgen.yaml | ||
| g3iploc.yaml | ||
| g3proxy.yaml | ||
| g3statsd.yaml | ||
| ip_location.csv | ||
| mkcert.sh | ||
| nginx.conf | ||
| README.md | ||
| run.sh | ||
| testcases.sh | ||
Setup for g3proxy coverage tests
Install Required Tools
We use the following tools in the coverage scripts:
docker
We use docker containers to run various target services, i.e. httpbin.
Install on Debian:
apt install docker.io
dnsmasq
We use dnsmasq to add local dns records, and also use it as the target dns server.
You have 2 choices to run dnsmasq:
-
NetworkManager Plugin
If you have enabled dnsmasq plugin in NetworkManager, then there is nothing to do. The conf directory will be /etc/NetworkManager/dnsmasq.d/.
-
Standalone dnsmasq Service
If not, you have to install dnsmasq as a standalone service. The conf directory will be /etc/dnsmasq.d/.
Install on Debian:
apt install dnsmasq
Setup local DNS
Save the following conf file to dnsmasq.d/g3proxy-ci.conf:
address=/httpbin.local/127.0.0.1
address=/g3proxy.local/127.0.0.1
Then restart NetworkManager or dnsmasq which should respawn the real dnsmasq process.
Run the Docker Containers
httpbin
docker run -p 127.0.0.1:80:80 -d --name httpbin kennethreitz/httpbin
vsftpd
mkdir /tmp/vsftpd
docker run -d -v /tmp/vsftpd:/home/vsftpd \
-p 127.0.0.1:20:20 \
-p 127.0.0.1:21:21 \
-p 127.0.0.1:47400-47470:47400-47470 \
-e FTP_USER=ftpuser \
-e FTP_PASS=ftppass \
-e PASV_ADDRESS=127.0.0.1 \
--name ftp \
-d bogem/ftp
influxdb
-
Run the container
docker pull influxdb:3-core docker run -p 127.0.0.1:8181:8181 --rm influxdb:3-core --node-id local --object-store=memory -
Create the auth token
curl -X POST http://127.0.0.1:8181/api/v3/configure/token/admin | jq ".token" -r -
Export the auth token as variable
INFLUXDB3_AUTH_TOKEN.
graphite
docker pull graphiteapp/graphite-statsd:latest
docker run -p 127.0.0.1:2003:2003 --rm graphiteapp/graphite-statsd