-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edd9e25
commit 5e2eb5d
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build and deploy to ghcr.io | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
required: true | ||
description: 'Reason for running this workflow' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build: | ||
name: 'Build' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Build:checkout" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Build:qemu" | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: "Build:buildx" | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: "Build:login" | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 'Build:buildandpush' | ||
uses: docker/build-push-action@v3.0.0 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm/v7,linux/arm64 | ||
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.run_number }}-${{ github.sha }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# hadolint ignore=DL3008,SC2086,DL4006,SC2039 | ||
RUN set -x && \ | ||
TEMP_PACKAGES=() && \ | ||
KEPT_PACKAGES=() && \ | ||
# packages needed to install | ||
TEMP_PACKAGES+=(git) && \ | ||
# packages needed to build | ||
TEMP_PACKAGES+=(build-essential) && \ | ||
# install packages | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
"${KEPT_PACKAGES[@]}" \ | ||
"${TEMP_PACKAGES[@]}" && \ | ||
# Deploy rtlmuxer | ||
git clone https://github.com/rpatel3001/rtlmuxer.git /src/rtlmuxer && \ | ||
pushd /src/rtlmuxer && \ | ||
make && \ | ||
cp rtlmuxer /usr/local/bin && \ | ||
popd && \ | ||
# Clean up | ||
apt-get remove -y "${TEMP_PACKAGES[@]}" && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /src/* /tmp/* /var/lib/apt/lists/* | ||
|
||
COPY rootfs/ / | ||
|
||
ENV SRC_ADDR="" \ | ||
SRC_PORT="1234" \ | ||
SINK_ADDR="0.0.0.0" \ | ||
RW_SINK_PORT="7373" \ | ||
RO_SINK_PORT="7374" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,32 @@ | ||
# docker-rtlmuxer | ||
Proxy rtl_tcp compatible streams to allow for multiple clients. | ||
|
||
This container is a thin wrapper around [rpatel3001/rtlmuxer](https://github.com/rpatel3001/rtlmuxer), which is a slightly modified fork of [alexander-sholohov/rtlmuxer](https://github.com/alexander-sholohov/rtlmuxer). | ||
|
||
## Docker Compose Snippet | ||
|
||
``` | ||
rtlmuxer: | ||
container_name: rtlmuxer | ||
hostname: rtlmuxer | ||
image: ghcr.io/rpatel3001/docker-rtlmuxer | ||
restart: always | ||
ports: | ||
- 7373:7373 | ||
- 7374:7374 | ||
volumes: | ||
- /etc/timezone:/etc/timezone:ro | ||
- /etc/localtime:/etc/localtime:ro | ||
environment: | ||
- SRC_ADDR=x.x.x.x | ||
``` | ||
|
||
## Configuration options | ||
|
||
| Variable | Description | Default | | ||
|----------|-------------|---------| | ||
| `SRC_ADDR` | Address of the rtl_tcp source we are proxying. | Unset | | ||
| `SRC_PORT` | Port of the rtl_tcp source we are proxying. | 1234 | | ||
| `SINK_ADDR` | Address to bind for the proxied connections. | 0.0.0.0 | | ||
| `RW_SINK_PORT` | Port to bind for the read/write proxy connection. | 7373 | | ||
| `RO_SINK_PORT` | Port to bind for the read-only proxy connection. | 7374 | |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
rtlmuxer --src-address=$SRC_ADDR --src-port=$SRC_PORT --sink-bind-address=$SINK_ADDR --sink-bind-port-a=$RW_SINK_PORT --sink-bind-port-b=$RO_SINK_PORT 2>&1 | stdbuf -o0 awk '{print "[rtlmuxer] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' |