sentriz/gonic

By sentriz

Updated about 2 months ago

music streaming server / free-software subsonic server API implementation

Image
9

1M+

free-software subsonic server API implementation, supporting its many clients

features

  • browsing by folder (keeping your full tree intact) see here
  • browsing by tags (using taglib - supports mp3, opus, flac, ape, m4a, wav, etc.)
  • on-the-fly audio transcoding and caching (requires ffmpeg) (thank you spijet)
  • subsonic jukebox mode, for gapless server-side audio playback instead of streaming (thank you lxea)
  • support for podcasts (thank you lxea)
  • pretty fast scanning (with my library of ~50k tracks, initial scan takes about 10m, and about 6s after incrementally)
  • multiple users, each with their own transcoding preferences, playlists, top tracks, top artists, etc.
  • last.fm scrobbling
  • listenbrainz scrobbling (thank you spezifisch, lxea)
  • artist similarities and biographies from the last.fm api
  • support for multi valued tags like albumartists and genres (see more)
  • a web interface for configuration (set up last.fm, manage users, start scans, etc.)
  • support for the album-artist tag, to not clutter your artist list with compilation album appearances
  • written in go, so lightweight and suitable for a raspberry pi, etc. (see ARM images below)
  • newer salt and token auth
  • tested on airsonic-refix, symfonium, dsub, jamstash, subsonic.el, sublime music, soundwaves, stmp, strawberry, and ultrasonic

installation

the default login is admin/admin.
password can then be changed from the web interface

...from source

https://github.com/sentriz/gonic/wiki/installation#from-source

...with docker

https://github.com/sentriz/gonic/wiki/installation#with-docker

...with systemd

https://github.com/sentriz/gonic/wiki/installation#with-systemd

...elsewhere

configuration options

env varcommand line argdescription
GONIC_MUSIC_PATH-music-pathpath to your music collection (see also multi-folder support below)
GONIC_PODCAST_PATH-podcast-pathpath to a podcasts directory
GONIC_PLAYLISTS_PATH-playlists-pathpath to new or existing directory with m3u files for subsonic playlists. items in the directory should be in the format <userid>/<name>.m3u. for example the admin user could have 1/my-playlist.m3u. gonic create and make changes to these playlists over the subsonic api.
GONIC_CACHE_PATH-cache-pathpath to store audio transcodes, covers, etc
GONIC_DB_PATH-db-pathoptional path to database file
GONIC_HTTP_LOG-http-logoptional http request logging, enabled by default
GONIC_LISTEN_ADDR-listen-addroptional host and port to listen on (eg. 0.0.0.0:4747, 127.0.0.1:4747) (default0.0.0.0:4747)
GONIC_TLS_CERT-tls-certoptional path to a TLS cert (enables HTTPS listening)
GONIC_TLS_KEY-tls-keyoptional path to a TLS key (enables HTTPS listening)
GONIC_PROXY_PREFIX-proxy-prefixoptional url path prefix to use if behind reverse proxy. eg /gonic (see example configs below)
GONIC_SCAN_INTERVAL-scan-intervaloptional interval (in minutes) to check for new music (automatic scanning disabled if omitted)
GONIC_SCAN_AT_START_ENABLED-scan-at-start-enabledoptional whether to perform an initial scan at startup
GONIC_SCAN_WATCHER_ENABLED-scan-watcher-enabledoptional whether to watch file system for new music and rescan
GONIC_JUKEBOX_ENABLED-jukebox-enabledoptional whether the subsonic jukebox api should be enabled
GONIC_JUKEBOX_MPV_EXTRA_ARGS-jukebox-mpv-extra-argsoptional extra command line arguments to pass to the jukebox mpv daemon
GONIC_PODCAST_PURGE_AGE-podcast-purge-ageoptional age (in days) to purge podcast episodes if not accessed
GONIC_EXCLUDE_PATTERN-exclude-patternoptional files matching this regex pattern will not be imported
GONIC_MULTI_VALUE_GENRE-multi-value-genreoptional setting for multi-valued genre tags when scanning (see more)
GONIC_MULTI_VALUE_ARTIST-multi-value-artistoptional setting for multi-valued artist tags when scanning (see more)
GONIC_MULTI_VALUE_ALBUM_ARTIST-multi-value-album-artistoptional setting for multi-valued album artist tags when scanning (see more)
GONIC_EXPVAR-expvaroptional enable the /debug/vars endpoint (exposes useful debugging attributes as well as database stats)

multi valued tags (v0.16+)

gonic can support potentially multi valued tags like genres and albumartists. in both cases gonic will individual entries in its database for each.

this means being able to click find album "X" under both "techno" and "house" for example. or finding the album "My Life in the Bush of Ghosts" under either "David Byrne" or "Brian Eno". it also means not cluttering up your artists list with "A & X", "A and Y", "A ft. Z", etc. you will only have A, X, Y, and Z.

the available modes are:

valuedesc
multigonic will explictly look for multi value fields in your audio metadata. software like musicbrainz picard or beets can set set these (soon)
delim <delim>gonic will look at your normal audio metadata fields like "genre" or "album_artist", but split them on a delimiter. for example you could set -multi-value-genre "delim ;" to split the single genre field on ";"
none (default)gonic will not attempt to do any multi value processing

screenshots

multiple folders support (v0.15+)

gonic supports multiple music folders. this can be handy if you have your music separated by albums, compilations, singles. or maybe 70s, 80s, 90s. whatever.

if you're running gonic with the command line, stack the -music-path arg

$ gonic -music-path /path/to/albums -music-path /path/to/compilations

if you're running gonic with ENV_VARS, or docker, try separate with a comma

GONIC_MUSIC_PATH=/path/to/albums,/path/to/compilations

if you're running gonic with the config file, you can repeat the music-path option

music-path /path/to/albums
music-path /path/to/compilations

after that, most subsonic clients should allow you to select which music folder to use. queries like show me "recently played compilations" or "recently added albums" are possible for example.

directory structure

when browsing by folder, any arbitrary and nested folder layout is supported, with the following caveats:

  • files from the same album must all be in the same folder
  • all files in a folder must be from the same album

please see here for more context

music
├── drum and bass
│   └── Photek
│       └── (1997) Modus Operandi
│           ├── 01.10 The Hidden Camera.flac
│           ├── 02.10 Smoke Rings.flac
│           ├── 03.10 Minotaur.flac
│           └── folder.jpg
└── experimental
    └── Alan Vega
        ├── (1980) Alan Vega
        │   ├── 01.08 Jukebox Babe.flac
        │   ├── 02.08 Fireball.flac
        │   ├── 03.08 Kung Foo Cowboy.flac
        │   └── folder.jpg
        └── (1990) Deuce Avenue
            ├── 01.13 Body Bop Jive.flac
            ├── 02.13 Sneaker Gun Fire.flac
            ├── 03.13 Jab Gee.flac
            └── folder.jpg

Docker Pull Command

docker pull sentriz/gonic