Skip to content
Projekte

Über uns

Universal Linux multimedia remote. Transform any Linux system into a smart, controllable multimedia hub via simple REST API.

Design und Medien

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

odio

go-odio-api

The universal remote for your Linux multimedia server.

Release License CI Build Go Report Card GitHub Sponsors

MPRIS PulseAudio Bluetooth systemd Power Zeroconf SSE Events

Part of the odio project — full documentation.

Go htmx Tailwind CSS GitHub Actions Docker deb rpm

odio-api

A lightweight Go daemon exposing your Linux user session as one REST API: MPRIS players (Spotify, VLC, Firefox, MPD, Kodi…), PulseAudio/PipeWire, systemd user services, Bluetooth, power, remote controls. No root, pure Go, no system tweak.

Tested on Fedora 43 Gnome, Debian 13 KDE, Raspberry Pi OS 13 and OpenMediaVault 8, from the Raspberry Pi B to the Pi 5. Packages for amd64, arm64, armv7hf and armhf (ARMv6), multi-arch Docker image.

Quick start

curl -fsSL https://apt.odio.love/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/odio.gpg
echo "deb [signed-by=/usr/share/keyrings/odio.gpg] https://apt.odio.love stable main" | sudo tee /etc/apt/sources.list.d/odio.list
sudo apt update && sudo apt install odio-api

systemctl --user enable --now odio-api.service
curl http://localhost:8018/players

On a headless host, sudo loginctl enable-linger <user> keeps the user session alive without a login. RPM, Docker and source builds: installation.

Clients

odio web UI
  • Web UI at http://localhost:8018/ui, responsive, 100% local (more)
  • PWA, installable, switches between several nodes
  • odio-ha, the Home Assistant integration (HACS custom repository): global audio and each whitelisted service as media_player entities, MPRIS players in progress

Backends

systemd, Power, Input and Upgrade are off by default.

Backend What it does
MPRIS Auto-discovers players; playback, seek, volume, shuffle, loop, tracklist
PulseAudio Global, per-output and per-client volume/mute, default output, opt-in mono / network sink / LAN discovery. PipeWire via pipewire-pulse
systemd Whitelisted units: user units controllable, system units read-only
Bluetooth A2DP sink for phones, and connecting out to speakers/headphones
Power Reboot, power-off, pending-reboot flag
Input IR, GPIO, HDMI-CEC, Bluetooth and USB remotes mapped to actions
Upgrade Frontend for an external detector and upgrade unit, live progress
Zeroconf mDNS announce on the bound interfaces
Events SSE stream of every state change, GET /events

Some backends need system setup (groups, polkit, BlueZ): see each page.

Configuration

Read from --config <path>, ~/.config/odio-api/config.yaml, then /etc/odio-api/config.yaml. *.yaml files in a conf.d/ next to it are merged on top in alphabetical order. A disabled backend has no routes. Defaults are in share/config.yaml, every option on docs.odio.love.

bind: lo                 # or an interface, a list, or `all`; the UI needs `lo`
api:
  port: 8018
systemd:
  enabled: true
  user:
    - mpd.service
    - name: snapclient.service
      url: "http://<snapserver>:1780"
      open: panel        # tab (default), panel or self

API

Group Routes
Server GET /server
MPRIS GET /players, /players/{player}/{cover,tracklist}, POST /players/{player}/{play,pause,play_pause,stop,next,previous,seek,position,volume,loop,shuffle}, POST /players/{player}/tracklist/{add,goto,remove}
PulseAudio GET /audio, /audio/{server,clients,outputs,cookie,processing}, POST /audio/server/{mute,volume}, /audio/{clients,outputs}/{id}/{mute,volume}, /audio/outputs/{id}/default, /audio/processing/{feature}/{enable,disable}
systemd GET /services, POST /services/{scope}/{unit}/{start,stop,restart,enable,disable}
Bluetooth GET /bluetooth, /bluetooth/devices, POST /bluetooth/{power_up,power_down,pairing_mode,scan,scan/stop,connect,disconnect}
Power GET /power, POST /power/{power_off,reboot}
Input GET /input
Upgrade GET /upgrade, POST /upgrade/{check,start}
Events GET /events?backend=…&types=…&exclude=…

Security

There is no authentication: keep the API on localhost (the default bind) or a trusted LAN, never the Internet.

  • odio-api refuses to run as root.
  • systemd is off by default and manages only whitelisted units. Only user units can be changed; system units are read-only whatever D-Bus or polkit allow.
  • The input group lets any process of that user read every input device. odio-api itself opens only remotes (IR, gpio-keys, CEC, devices listed by name) and publishes only bound keys.
  • The Docker compose mounts everything read-only.

Development

Needs Go 1.24+ and Task.

go test -race ./...
task build              # CSS + binary, version from git describe
task build:all-arch     # cross-compile to dist/
task package:all        # deb + rpm via nfpm
task css:watch          # Tailwind watch mode

Tailwind has no ARMv6 build, so on Pi B/Zero task build downloads the prebuilt CSS from https://bobbywan.me/odio-css/ instead of compiling it. CSS is not committed.

Contributing

Early stage, expect bugs. Tell me what works on your setup and what doesn't, issues and PRs welcome on GitHub.

License

BSD 2-Clause, see LICENSE.

Ähnliche Projekte entdecken

Wird geladen…