Skip to content

Refactor into separate packages & add tests. (#4) #21

Refactor into separate packages & add tests. (#4)

Refactor into separate packages & add tests. (#4) #21

Workflow file for this run

name: Test systemd
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Build
run: go build -v
- name: Install go-mmproxy
run: |
sudo cp go-mmproxy /usr/bin/go-mmproxy
sudo mkdir /etc/go-mmproxy
echo 192.168.0.0/16 | sudo tee /etc/go-mmproxy/net-prefixes.txt
sudo cp go-mmproxy.service.example /etc/systemd/system/go-mmproxy.service
sudo systemctl daemon-reload
- name: Start go-mmproxy
run: sudo systemctl start go-mmproxy || sudo journalctl -xeu go-mmproxy.service
- name: Check go-mmproxy status
run: systemctl is-active go-mmproxy
- name: Replace listen address of go-mmproxy with a hostname
run: |
sudo sed -i 's/-l 0.0.0.0:1234/-l %H:1234/' /etc/systemd/system/go-mmproxy.service
sudo systemctl daemon-reload
- name: Restart go-mmproxy
run: sudo systemctl restart go-mmproxy || sudo journalctl -xeu go-mmproxy.service
- name: Check go-mmproxy status
run: systemctl is-active go-mmproxy