Giter VIP home page Giter VIP logo

gonic's Introduction

FLOSS alternative to subsonic, supporting its many clients

features

  • browsing by folder (keeping your full tree intact)
  • 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)
  • jukebox mode (thank you AlexKraak)
  • pretty fast scanning (with my library of ~27k tracks, initial scan takes about 10m, and about 5s after incrementally)
  • multiple users, each with their own transcoding preferences, playlists, top tracks, top artists, etc.
  • last.fm scrobbling
  • artist similarities and biographies from the last.fm api
  • 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.
  • newer salt and token auth
  • tested on dsub, jamstash, sublime music, and soundwaves

installation

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

...from source

$ apt install build-essential git sqlite libtag1-dev ffmpeg libasound-dev # for debian like
$ pacman -S base-devel git sqlite taglib ffmpeg alsa-lib                  # for arch like
$ go get go.senan.xyz/gonic/cmd/gonic
$ export PATH=$PATH:$HOME/go/bin
$ gonic -h # or see "configuration options below"

note: unfortunately if you do this above, you'll be compiling gonic locally on your machine (if someone knows how I can statically link sqlite3 and taglib, please let me know so I can distribute static binaries)

...with docker x86_64

the image is available on dockerhub as sentriz/gonic

# example docker-compose.yml

version: '2.4'
services:
  gonic:
    image: sentriz/gonic:latest
    environment:
    - TZ
    # optionally, see more env vars below
    expose:
    - 80
    volumes:
    - ./data:/data             # gonic db etc
    - /path/to/music:/music:ro # your music
    - /path/to/cache:/cache    # transcode cache dir

    # set the following two sections if you've enabled jukebox
    group_add:
    - audio
    devices:
    - /dev/snd:/dev/snd

then start with docker-compose up -d

...with docker arm / raspberry pi

please see ugeek/gonic

...with systemd

example by @IUCCA, tested on Ubuntu 18.04

  1. add a repository with the latest Version of golang and install the prerequisites
$ sudo add-apt-repository ppa:longsleep/golang-backports
$ sudo apt update && sudo apt upgrade
$ sudo apt install build-essential git sqlite libtag1-dev ffmpeg libasound-dev golang
  1. download and compile gonic in the home directory
$ go get go.senan.xyz/gonic/cmd/gonic
  1. add a gonic user and create a directory for the server
$ sudo mkdir -p /var/gonic/
$ sudo adduser --disabled-login --gecos "" gonic
$ sudo mv go/bin/gonic /var/gonic/
$ sudo wget https://raw.githubusercontent.com/sentriz/gonic/master/contrib/config -O /var/gonic/config
$ sudo chmod -R 750 /var/gonic/
$ sudo chown -R gonic:gonic /var/gonic/
  1. add your music-path to the config file
$ sudo nano /var/gonic/config
  1. setup systemd service
$ sudo wget https://raw.githubusercontent.com/sentriz/gonic/master/contrib/gonic.service -O /etc/systemd/system/gonic.service
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now gonic

...elsewhere

configuration options

env var command line arg description
GONIC_MUSIC_PATH -music-path path to your music collection
GONIC_CACHE_PATH -cache-path optional path to store audio transcodes (default /tmp/gonic_cache)
GONIC_DB_PATH -db-path optional path to database file
GONIC_LISTEN_ADDR -listen-addr optional host and port to listen on (eg. 0.0.0.0:4747, 127.0.0.1:4747) (default 0.0.0.0:4747)
GONIC_PROXY_PREFIX -proxy-prefix optional url path prefix to use if behind reverse proxy. eg /gonic (see example configs below)
GONIC_SCAN_INTERVAL -scan-interval optional interval (in minutes) to check for new music (automatic scanning disabled if omitted)
GONIC_JUKEBOX_ENABLED -jukebox-enabled optional whether the subsonic jukebox api should be enabled

screenshots

example nginx config with GONIC_PROXY_PREFIX

  location /gonic/ {
      proxy_pass http://localhost:4747/;
      # set "Secure" cookie if using HTTPS
      proxy_cookie_path / "/; Secure";
      # set "X-Forwarded-Host" header for last.fm connection callback
      proxy_set_header X-Forwarded-Host $host;
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.