|
3 weeks ago | |
---|---|---|
cmd | 3 weeks ago | |
devloop | 3 weeks ago | |
ui | 3 weeks ago | |
.gitignore | 2 months ago | |
Dockerfile | 3 weeks ago | |
Makefile | 3 weeks ago | |
README.en.md | 3 weeks ago | |
README.md | 3 weeks ago | |
docker-compose.yml | 3 weeks ago | |
docker.go | 3 weeks ago | |
go.mod | 3 weeks ago | |
go.sum | 3 weeks ago | |
lines_ring.go | 2 months ago | |
lines_ring_test.go | 2 months ago | |
process.go | 3 weeks ago | |
radio.go | 3 weeks ago | |
runnable.go | 3 weeks ago | |
systemd.go | 3 weeks ago |
README.en.md
Broadcast
Control the execution of a program via web interface.
Description
broadcast
is a simple web application to control another executable program. There are
3 methods to do so:
- directly, specifying the binary absolute path and all command line options
- via a systemd unit, specifying the
-systemd
flag (and optionally the-systemd-as-user
flag, to signal that the unit is a user one) - controlling an already existing docker container (note: it has to be already
exinsting -although it can be paused- and have a name with the
--name
option)
The program exposes a web interface, defaulting on 0.0.0.0:8080
, that can be specified
using the -addr
parameter.
Examples
For the sake of testing, this repository includes a simple program that prints a string every second: echo. We will use it in the following examples.
1. directly
broadcast /path/to/echo
2. systemd unit
Assuming an already existing unit named echo.service
broadcast -systemd -systemd-as-user echo.service
3. docker container
Assuming there already exists a docker container, started for example with
docker run --name echo --rm -ti echo
broadcast -docker echo
Develop
The project includes a Makefile
to ease some tasks. It is possible to
begin a developing session, first building the needed images with
make dev-build
It is then possible to launch a docker compose stack with
make dev
In order to build the artifacts (output to bin/) (note that libsystemd-dev
is a prerequisite)
make build
License
GPL-v3 or following.