2024-01-25 22:09:10 +01:00
|
|
|
[![maintained](https://img.shields.io/maintenance/yes/2024?style=flat-square)]()
|
|
|
|
![Gitea Release](https://img.shields.io/gitea/v/release/cccb/sanic?gitea_url=https%3A%2F%2Fgit.berlin.ccc.de&sort=semver&display_name=release&style=flat-square)
|
|
|
|
|
2023-10-16 19:05:11 +02:00
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
# 🦔 sanic
|
2023-10-16 18:39:08 +02:00
|
|
|
|
|
|
|
chaos music control inspired by [relaxx player][relaxx]
|
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
## ✨ Features
|
2023-10-16 18:39:08 +02:00
|
|
|
|
|
|
|
- mpd web gui
|
|
|
|
- search music
|
|
|
|
- organize playlists
|
|
|
|
- control current playback queue
|
|
|
|
- no authentication required to control music playback
|
2023-11-14 00:13:35 +01:00
|
|
|
- add playlists from internet radios (`*.m3u`, `*.pls`)
|
2024-01-22 13:10:30 +01:00
|
|
|
- add music from other sources like youtube (`youtube-dl`)
|
|
|
|
|
2024-04-06 19:14:43 +02:00
|
|
|
## 👩💻 Installation
|
2024-01-24 14:25:40 +01:00
|
|
|
|
|
|
|
### NixOS (flakes)
|
|
|
|
|
2024-01-24 14:37:54 +01:00
|
|
|
Example flake setup (untested):
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{
|
2024-04-06 18:57:43 +02:00
|
|
|
description = "Example Flake to install sanic on your host";
|
2024-01-29 22:22:40 +01:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
sanic = {
|
2024-04-06 18:57:43 +02:00
|
|
|
url = "git.berlin.ccc.de/cccb/sanic";
|
2024-01-29 22:22:40 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-01-24 14:37:54 +01:00
|
|
|
};
|
|
|
|
outputs = { self, nixpkgs, sanic }:
|
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
in
|
|
|
|
{
|
2024-04-06 18:57:43 +02:00
|
|
|
nixosConfigurations."myhostname".nixpkgs.lib.nixosSystem = {
|
|
|
|
inherit system;
|
|
|
|
modules = [
|
|
|
|
{ environment.systemPackages = [ sanic.packages.${system}.default ]; }
|
2024-01-24 14:37:54 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
2024-01-24 14:25:40 +01:00
|
|
|
|
2024-04-06 18:57:43 +02:00
|
|
|
### Arch Linux
|
2024-01-24 14:25:40 +01:00
|
|
|
|
2024-01-24 14:37:54 +01:00
|
|
|
Install from the AUR:
|
|
|
|
|
|
|
|
```
|
|
|
|
yay -S sanic
|
|
|
|
```
|
2024-01-24 14:25:40 +01:00
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
## 🛠️ Development
|
|
|
|
|
|
|
|
sanic is developed using [Nix][nix], but you can also just use the usual Golang tooling.
|
|
|
|
|
|
|
|
Run local [MPD][mpd] instance for testing with `make mpd`.
|
|
|
|
|
2024-01-23 12:18:27 +01:00
|
|
|
Update go depdendencies like this:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
go get -u # or `make update`
|
|
|
|
go mod tidy # or `make tidy`
|
2024-04-06 18:57:43 +02:00
|
|
|
gomod2nix # sync go deps with nix
|
2024-01-23 12:18:27 +01:00
|
|
|
```
|
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
### ❄️ w/ Nix
|
|
|
|
|
|
|
|
Enter development shell (also has [mpc][mpc] client installed for testing):
|
2023-10-16 18:39:08 +02:00
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
```shell
|
|
|
|
nix develop
|
|
|
|
```
|
2023-10-24 17:09:51 +02:00
|
|
|
|
2024-04-06 18:57:43 +02:00
|
|
|
Build sanic:
|
2023-10-24 17:09:51 +02:00
|
|
|
|
|
|
|
```shell
|
|
|
|
nix build
|
|
|
|
```
|
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
### 🐧 w/o Nix
|
|
|
|
|
|
|
|
Use these Make targets for convenience:
|
|
|
|
|
|
|
|
- `run`: Run project
|
|
|
|
- `build`: Compile project
|
|
|
|
- `tidy`: Add missing and remove unused modules
|
|
|
|
- `verify`: Verify dependencies have expected content
|
2024-01-24 13:28:54 +01:00
|
|
|
- `format`: Format go code
|
|
|
|
- `lint`: Run linter (staticcheck)
|
2024-01-22 13:10:30 +01:00
|
|
|
- `test`: Run tests
|
|
|
|
- `cert`: Create https certificate for local testing
|
|
|
|
|
|
|
|
### 🐳 Container
|
|
|
|
|
|
|
|
You can run sanic in a container. Use these Make targets for convenience:
|
|
|
|
|
|
|
|
- `build-container`: Build container image
|
|
|
|
- `run-container`: Run container image
|
|
|
|
|
|
|
|
## 🗺️ Architecture
|
2023-11-07 19:57:49 +01:00
|
|
|
|
2023-11-19 20:10:54 +01:00
|
|
|
[![Architecture](https://git.berlin.ccc.de/cccb/sanic/raw/branch/main/architecture.drawio.svg)](https://app.diagrams.net/?mode=git.berlin.ccc.de#Hcccb%2Fsanic%2Fmain%2Farchitecture.drawio.svg)
|
2023-11-07 19:57:49 +01:00
|
|
|
|
2023-10-16 18:39:08 +02:00
|
|
|
---
|
|
|
|
|
2024-01-22 13:10:30 +01:00
|
|
|
Made with ❤️ and ![golang logo][golang].
|
2023-10-16 18:39:08 +02:00
|
|
|
|
|
|
|
[relaxx]: http://relaxx.dirk-hoeschen.de/
|
2024-01-22 13:10:30 +01:00
|
|
|
[nix]: https://nixos.org/manual/nix/stable/
|
|
|
|
[golang]: https://go.dev/images/favicon-gopher.svg
|
|
|
|
[mpd]: https://musicpd.org/
|
|
|
|
[mpc]: https://www.musicpd.org/clients/mpc/
|