Layer 7 Proxy Firewall.
Warning: clone it and adapt for own use cases
This file is for sensitive variables (like keys, secrets and etc).
Make a copy of .env.example to .env
cp .env.example .env
... and define required variables
This file is for service specific non sensitive configs (like flags, addresses and etc).
After building and copying to /etc/proxy-firewall/proxy-firewall.conf
check for necessary parameters before starting as systemd service.
/usr/lib/systemd/system
mkdir -p /etc/proxy-firewall/bin
mkdir -p /etc/proxy-firewall/files
mkdir -p /etc/proxy-firewall/log
mkdir -p /etc/proxy-firewall/.cache
rm /etc/proxy-firewall/log/*
go build -o /etc/proxy-firewall/bin/proxy-firewall main.go
chmod +x /etc/proxy-firewall/bin/proxy-firewall
cp proxy-firewall.conf /etc/proxy-firewall/proxy-firewall.conf
cp .env /etc/proxy-firewall/.env
cp proxy-firewall.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl enable proxy-firewall
systemctl restart proxy-firewall
systemctl status proxy-firewall
# to cleanup previous deploy
systemctl stop proxy-firewall
systemctl disable proxy-firewall
pkill -f proxy-firewall