Skip to content

Commit

Permalink
Try setting haddr in the port 80 forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Jul 23, 2024
1 parent c6df05f commit 00ebee9
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 77 deletions.
154 changes: 77 additions & 77 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,88 +5,88 @@ on:
workflow_run:
workflows: [ Sanity checks ]
types: [ completed ]
branches: [ main ]
branches: [ main, fix-example-test ]
workflow_dispatch:

jobs:
deps:
strategy:
matrix:
distro: [ "alpine:latest", "ubuntu:latest", "debian:latest", "archlinux:latest" ]
arch: [ amd64, i386 ]
runs-on: ubuntu-latest
container:
image: ${{ matrix.distro }}
steps:
- name: Install essentials
run: |
if [ "${{ matrix.distro }}" = "alpine:latest" ]; then
apk add python3
elif [ "${{ matrix.distro }}" = "archlinux:latest" ]; then
pacman -Sy
pacman -S --noconfirm python
else
apt-get update
apt-get install --yes --no-install-recommends python3
fi
- name: Check out repository code
uses: actions/checkout@v4

- name: Install dependencies
run: ./openbsd deps --install --arch=${{ matrix.arch }}

base:
needs:
- deps
strategy:
matrix:
version: [ 7.3, 7.4, 7.5 ]
arch: [ amd64, i386 ]
runs-on: ubuntu-latest
container:
image: alpine:latest
env:
OPENBSD_CACHE: /tmp/cache
WORKDIR: /${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
steps:
- name: Install essentials
run: apk add bash python3 tar

- name: Check out repository code
uses: actions/checkout@v4

- name: Install dependencies
run: ./openbsd deps --install --arch=${{ matrix.arch }}

- name: Cache OpenBSD files
id: cache-openbsd
uses: actions/cache@v4
with:
path: ${{ env.OPENBSD_CACHE }}
key: openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
restore-keys: |
openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
openbsd-${{ matrix.version }}-${{ matrix.arch }}
openbsd-${{ matrix.version }}
openbsd
- name: Run test
run: tests/base -v ${{ matrix.version }} -a ${{ matrix.arch }}

- name: Keep artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-${{ matrix.version }}-${{ matrix.arch }}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
retention-days: 3
path: |
/${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}/**/*
!/**/*.img
# deps:
# strategy:
# matrix:
# distro: [ "alpine:latest", "ubuntu:latest", "debian:latest", "archlinux:latest" ]
# arch: [ amd64, i386 ]
# runs-on: ubuntu-latest
# container:
# image: ${{ matrix.distro }}
# steps:
# - name: Install essentials
# run: |
# if [ "${{ matrix.distro }}" = "alpine:latest" ]; then
# apk add python3
# elif [ "${{ matrix.distro }}" = "archlinux:latest" ]; then
# pacman -Sy
# pacman -S --noconfirm python
# else
# apt-get update
# apt-get install --yes --no-install-recommends python3
# fi
#
# - name: Check out repository code
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: ./openbsd deps --install --arch=${{ matrix.arch }}
#
# base:
# needs:
# - deps
# strategy:
# matrix:
# version: [ 7.3, 7.4, 7.5 ]
# arch: [ amd64, i386 ]
# runs-on: ubuntu-latest
# container:
# image: alpine:latest
# env:
# OPENBSD_CACHE: /tmp/cache
# WORKDIR: /${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
# steps:
# - name: Install essentials
# run: apk add bash python3 tar
#
# - name: Check out repository code
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: ./openbsd deps --install --arch=${{ matrix.arch }}
#
# - name: Cache OpenBSD files
# id: cache-openbsd
# uses: actions/cache@v4
# with:
# path: ${{ env.OPENBSD_CACHE }}
# key: openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
# restore-keys: |
# openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
# openbsd-${{ matrix.version }}-${{ matrix.arch }}
# openbsd-${{ matrix.version }}
# openbsd
#
# - name: Run test
# run: tests/base -v ${{ matrix.version }} -a ${{ matrix.arch }}
#
# - name: Keep artifacts
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: ${{ github.job }}-${{ matrix.version }}-${{ matrix.arch }}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
# retention-days: 3
# path: |
# /${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}/**/*
# !/**/*.img

example:
needs:
- base
# needs:
# - base
strategy:
matrix:
version: [ 7.5 ]
Expand Down
1 change: 1 addition & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dst = "/etc/rc.d/echoip"
sshd.port = 21230

[[run.hostfwd.tcp]]
haddr = "localhost"
hport = 8000
gport = 80
```
Expand Down
1 change: 1 addition & 0 deletions example/openbsd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ dst = "/etc/rc.d/echoip"
sshd.port = 21230

[[run.hostfwd.tcp]]
haddr = "localhost"
hport = 8000
gport = 80

Expand Down
1 change: 1 addition & 0 deletions example/parts/30.run.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
sshd.port = 21230

[[run.hostfwd.tcp]]
haddr = "localhost"
hport = 8000
gport = 80

0 comments on commit 00ebee9

Please sign in to comment.