Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
02fdc0ed79 Speak about kodi.script.hathoris and LibreELEC autostart 2025-04-26 22:41:33 +02:00
d47393fa48 Docker image ready
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-04-26 18:44:35 +02:00
42b795ae35 Add a quick start guide
All checks were successful
continuous-integration/drone/tag Build is passing
2025-04-26 18:06:00 +02:00
2b38d0d4b2 Deploy binaries on Github 2025-04-26 18:06:00 +02:00
b82316752d Deploy containers to Docker Hub 2025-04-26 12:27:10 +02:00
a592b310b1 Also build tag for amd64 and arm64
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-04-26 11:02:10 +02:00
5 changed files with 217 additions and 9 deletions

View file

@ -1,4 +1,4 @@
image: registry.nemunai.re/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
image: nemunaire/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
@ -6,16 +6,16 @@ tags:
{{/each}}
{{/if}}
manifests:
- image: registry.nemunai.re/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
- image: nemunaire/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
- image: registry.nemunai.re/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
- image: nemunaire/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: registry.nemunai.re/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
- image: nemunaire/hathoris:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux

View file

@ -71,11 +71,23 @@ steps:
event:
- tag
- name: github release
image: plugins/github-release:linux-arm
settings:
api_key:
from_secret: github_api_token
github_url: https://github.com
files:
- deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
- deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
when:
event:
- tag
- name: docker
image: plugins/docker:linux-arm
settings:
registry: registry.nemunai.re
repo: registry.nemunai.re/hathoris
repo: nemunaire/hathoris
auto_tag: true
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
dockerfile: Dockerfile-norebuild
@ -90,6 +102,142 @@ trigger:
- push
- tag
---
kind: pipeline
type: docker
name: build-amd64
platform:
os: linux
arch: amd64
workspace:
base: /go
path: src/git.nemunai.re/nemunaire/hathoris
steps:
- name: build front
image: node:21
commands:
- mkdir deploy
- cd ui
- npm install --network-timeout=100000
- npm run build
- name: build
image: golang:1-alpine
commands:
- apk --no-cache add alsa-lib-dev build-base git pkgconf
- go get -v -d
- go vet -v
- go build -v -ldflags '-w -X main.Version=${DRONE_BRANCH}-${DRONE_COMMIT} -X main.build=${DRONE_BUILD_NUMBER}' -o deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- ln deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} hathoris
- name: gitea release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_api_key
base_url: https://git.nemunai.re/
files:
- deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- name: github release
image: plugins/github-release
settings:
api_key:
from_secret: github_api_token
github_url: https://github.com
files:
- deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
when:
event:
- tag
- name: docker
image: plugins/docker
settings:
repo: nemunaire/hathoris
auto_tag: true
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
dockerfile: Dockerfile-norebuild
username:
from_secret: docker_username
password:
from_secret: docker_password
trigger:
event:
- tag
---
kind: pipeline
type: docker
name: build-arm64
platform:
os: linux
arch: arm64
workspace:
base: /go
path: src/git.nemunai.re/nemunaire/hathoris
steps:
- name: build front
image: node:21
commands:
- mkdir deploy
- cd ui
- npm install --network-timeout=100000
- npm run build
- name: build
image: golang:1-alpine
commands:
- apk --no-cache add alsa-lib-dev build-base git pkgconf
- go get -v -d
- go vet -v
- go build -v -ldflags '-w -X main.Version=${DRONE_BRANCH}-${DRONE_COMMIT} -X main.build=${DRONE_BUILD_NUMBER}' -o deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- ln deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} hathoris
- name: gitea release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_api_key
base_url: https://git.nemunai.re/
files:
- deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- name: github release
image: plugins/github-release
settings:
api_key:
from_secret: github_api_token
github_url: https://github.com
files:
- deploy/hathoris-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
when:
event:
- tag
- name: docker
image: plugins/docker
settings:
repo: nemunaire/hathoris
auto_tag: true
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
dockerfile: Dockerfile-norebuild
username:
from_secret: docker_username
password:
from_secret: docker_password
trigger:
event:
- tag
---
kind: pipeline
name: docker-manifest
@ -113,4 +261,6 @@ trigger:
- tag
depends_on:
- build-amd64
- build-arm64
- build-arm

View file

@ -20,7 +20,11 @@ RUN go get && go generate && go build -ldflags="-s -w"
FROM alpine:3.18
ENV HATHORIS_BIND=:8080
EXPOSE 8080
CMD ["/srv/hathoris"]
ENTRYPOINT ["/srv/hathoris"]
WORKDIR /var/lib/hathoris
RUN mkdir /var/lib/hathoris; apk --no-cache add alsa-utils pulseaudio-utils mpv yt-dlp
COPY --from=build /go/src/git.nemunai.re/nemunaire/hathoris/hathoris /srv/hathoris

View file

@ -1,6 +1,10 @@
FROM alpine:3.18
ENV HATHORIS_BIND=:8080
EXPOSE 8080
CMD ["/srv/hathoris"]
ENTRYPOINT ["/srv/hathoris"]
WORKDIR /var/lib/hathoris
RUN mkdir /var/lib/hathoris; apk --no-cache add alsa-utils pulseaudio-utils mpv yt-dlp
COPY hathoris /srv/hathoris

View file

@ -47,8 +47,47 @@ Hathoris is compatible with any Linux distribution that has PulseAudio. It also
### Quick Installation Guide
TODO: Add a quick installation guide.
#### With Docker
[Prepare a configuration for optional virtual inputs](#audio-sources) (like radios, streaming sources), create the file at `~/.config/hathoris/settings.json`.
```
docker run -p 8080:8080 \
--device /dev/snd \
-e PULSE_SERVER=unix:/run/pulse/native \
-v ${XDG_RUNTIME_DIR}/pulse/native:/run/pulse/native \
-v ~/.config/pulse/cookie:/root/.config/pulse/cookie \
-v ~/.config/hathoris:/var/lib/hathoris \
nemunaire/hathoris:1
```
⚠️ Please note that if your host is directly reachable on the Internet, it will be accessible to anyone who can reach this port. It is recommended to use a reverse proxy and/or configure proper firewall rules to secure your setup.
#### Without Docker
1. Install dependancies.
- On Debian/Ubuntu/Raspbian/armbian/...: `sudo apt install alsa-utils pulseaudio-utils mpv yt-dlp`
- On Alpine: `sudo apk add alsa-utils pulseaudio-utils mpv yt-dlp`
- On ArchLinux/Manjaro: `sudo pacman -S alsa-utils pulseaudio mpv yt-dlp`
2. Download the [latest release binary for your architecture](https://github.com/nemunaire/hathoris/releases/latest); choose between ARMv6 (Raspberry Pi Zero), ARMv7 (Voltastreams, Raspberry Pi 2+), ARM64 (Raspberry Pi Zero 2 and 3+ **with 64 bits OS**).
3. Give execution permissions: `chmod +x hathoris-linux-armv7`
4. (optional) [Prepare a configuration for optional virtual inputs](#audio-sources) (like radios, streaming sources)
The file is called `settings.json`, it is expected to be in the directory where you execute `hathoris`. It can be overwrited by adding a command line argument like `-settings-file /etc/hathoris/settings.json`.
5. Launch the binary: `./hathoris -bind :8080`
6. The interface will be available on the port 8080 from anywhere on your local network.
From your local machine, it'll be on <http://localhost:8080/>
⚠️ Please note that if your host is directly reachable on the Internet, it will be accessible to anyone who can reach this port. It is recommended to use a reverse proxy and/or configure proper firewall rules to secure your setup.
Enjoy!
### Build the Project
@ -242,6 +281,17 @@ curl http://127.0.0.1:8080/api/mixer'
]
```
#### With Kodi
An companion script is available to control hathoris directly from Kodi:
<https://git.nemunai.re/nemunaire/kodi.script.hathoris>
You can also create a script to automaticaly enable your Kodi input when it lauches.
Eg. for LibreELEC, append in `~/.config/autostart.sh`:
```
curl 'http://192.168.0.42:8080/api/sources/spdif/enable' -X POST
```
## Compatible Hardware