Add support for HTTP traffic on port 11371 (HKP protocol) #64
Workflow file for this run
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
| name: Integration Tests | |
| on: | |
| pull_request: | |
| workflow_call: | |
| jobs: | |
| integration-test: | |
| name: Run Integration Tests | |
| runs-on: [ self-hosted, linux, x64, jammy, large ] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Build aproxy Snap | |
| id: snapcraft-build | |
| uses: snapcore/action-build@v1 | |
| - name: Upload aproxy Snap | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: snap | |
| path: aproxy*.snap | |
| - name: Install aproxy Snap | |
| run: | | |
| sudo snap install --dangerous aproxy_*_amd64.snap | |
| - name: Show aproxy Configuration | |
| run: | | |
| sudo snap get aproxy | |
| - name: Configure aproxy | |
| run: | | |
| sudo nft -f - << EOF | |
| define default-ip = $(ip route get $(ip route show 0.0.0.0/0 | grep -oP 'via \K\S+') | grep -oP 'src \K\S+') | |
| define private-ips = { 10.0.0.0/8, 127.0.0.1/8, 172.16.0.0/12, 192.168.0.0/16 } | |
| define aproxy-port = $(sudo snap get aproxy listen | cut -d ":" -f 2) | |
| table ip aproxy | |
| flush table ip aproxy | |
| table ip aproxy { | |
| chain prerouting { | |
| type nat hook prerouting priority dstnat; policy accept; | |
| ip daddr != \$private-ips tcp dport { 80, 443, 11371 } counter dnat to \$default-ip:\$aproxy-port | |
| } | |
| chain output { | |
| type nat hook output priority -100; policy accept; | |
| ip daddr != \$private-ips tcp dport { 80, 443, 11371 } counter dnat to \$default-ip:\$aproxy-port | |
| } | |
| } | |
| EOF | |
| - name: Test HTTP | |
| run: | | |
| curl --noproxy "*" http://example.com -svS -o /dev/null | |
| - name: Test HTTPS | |
| run: | | |
| curl --noproxy "*" https://example.com -svS -o /dev/null | |
| - name: Test HKP | |
| run: | | |
| curl -v -x http://${{ env.EGRESS_PROXY }} http://keyserver.ubuntu.com:11371 | |
| gpg -v --keyserver hkp://keyserver.ubuntu.com --recv-keys E1DE584A8CCA52DC29550F18ABAC58F075A17EFA | |
| - name: Test Access Logs | |
| run: | | |
| sudo snap logs aproxy.aproxy | grep -Fq "example.com:80" | |
| sudo snap logs aproxy.aproxy | grep -Fq "example.com:443" | |
| sudo snap logs aproxy.aproxy | grep -Fq "keyserver.ubuntu.com:11371" | |
| - name: Show Access Logs | |
| if: failure() | |
| run: | | |
| sudo snap logs aproxy.aproxy -n=all |