README.md
1 <p align="center"><img width="500" src="https://github.com/sentriz/gonic/blob/master/.github/logo.png?raw=true"></p>
2 <h4 align="center">FLOSS alternative to <a href="http://www.subsonic.org/">subsonic</a>, supporting its many clients</h4>
3 <p align="center"><a href="http://hub.docker.com/r/sentriz/gonic"><img src="https://img.shields.io/docker/pulls/sentriz/gonic.svg"></a> <a href="https://microbadger.com/images/sentriz/gonic" title="Get your own image badge on microbadger.com"><img src="https://images.microbadger.com/badges/image/sentriz/gonic.svg"></a> <img src="https://img.shields.io/github/issues/sentriz/gonic.svg"> <img src="https://img.shields.io/github/issues-pr/sentriz/gonic.svg"></p>
4
5
6 ## features
7
8 - browsing by folder (keeping your full tree intact)
9 - browsing by tags (using [taglib](https://taglib.org/) - supports mp3, opus, flac, ape, m4a, wav, etc.)
10 - on-the-fly audio transcoding and caching (requires [ffmpeg](https://ffmpeg.org/)) (thank you [spijet](https://github.com/spijet/))
11 - pretty fast scanning (with my library of ~27k tracks, initial scan takes about 10m, and about 5s after incrementally)
12 - multiple users, each with their own transcoding preferences, playlists, top tracks, top artists, etc.
13 - [last.fm](https://www.last.fm/) scrobbling
14 - artist similarities and biographies from the last.fm api
15 - a web interface for configuration (set up last.fm, manage users, start scans, etc.)
16 - support for the [album-artist](https://mkoby.com/2007/02/18/artist-versus-album-artist/) tag, to not clutter your artist list with compilation album appearances
17 - written in [go](https://golang.org/), so lightweight and suitable for a raspberry pi, etc.
18 - newer salt and token auth
19 - tested on [dsub](https://f-droid.org/en/packages/github.daneren2005.dsub/), [jamstash](http://jamstash.com/), [sublime music](https://gitlab.com/sumner/sublime-music/), and [soundwaves](https://apps.apple.com/us/app/soundwaves/id736139596)
20
21
22## installation
23
24the default login is **admin**/**admin**.
25password can then be changed from the web interface
26
27```
28$ apt install build-essential git sqlite libtag1-dev ffmpeg # for debian like
29$ pacman -S base-devel git sqlite taglib ffmpeg # for arch like
30$ go get senan.xyz/g/gonic/cmd/gonic
31$ export PATH=$PATH:$HOME/go/bin
32$ gonic -h # or see "configuration options below"
33```
34
35**note:** unfortunately if you do this above, you'll be compiling gonic locally on your machine
36(if someone knows how I can statically link sqlite3 and taglib, please let me know so I can distribute static binaries)
37
38or else you can run in docker, available on dockerhub as `sentriz/gonic`
39
40```yaml
41# example docker-compose.yml
42
43version: '3'
44services:
45 gonic:
46 image: sentriz/gonic:latest
47 environment:
48 - TZ
49 # optionally, see env vars below
50 expose:
51 - 80
52 volumes:
53 - ./data:/data # gonic db etc
54 - /path/to/music:/music:ro # your music
55 - /path/to/cache:/cache # transcode cache dir
56```
57
58then start with `docker-compose up -d`
59
60## configuration options
61
62|env var|command line arg|description|
63|---|---|---|
64|`GONIC_MUSIC_PATH`|`-music-path`|path to your music collection|
65|`GONIC_CACHE_PATH`|`-cache-path`|**optional** path to store audio transcodes (*default* `/tmp/gonic_cache`)|
66|`GONIC_DB_PATH`|`-db-path`|**optional** path to database file|
67|`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`)|
68|`GONIC_PROXY_PREFIX`|`-proxy-prefix`|**optional** url path prefix to use if behind reverse proxy. eg `/gonic` (see example configs below)|
69|`GONIC_SCAN_INTERVAL`|`-scan-interval`|**optional** interval (in minutes) to check for new music (automatic scanning disabled if omitted)|
70
71## screenshots
72
73<p align="center">
74<p float="left">
75 <img width="400" src="https://github.com/sentriz/gonic/raw/master/.github/scrot_2.png">
76 <img width="400" src="https://github.com/sentriz/gonic/raw/master/.github/scrot_3.png">
77</p>
78</p>
79
80## example nginx config with `GONIC_PROXY_PREFIX`
81
82```nginx
83 location /gonic/ {
84 proxy_pass http://localhost:4747/;
85 # set "Secure" cookie if using HTTPS
86 proxy_cookie_path / "/; Secure";
87 # set "X-Forwarded-Host" header for last.fm connection callback
88 proxy_set_header X-Forwarded-Host $host;
89 }
90```
91