crossonic

package module
v0.0.0-...-ce70d39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

README

Crossonic Server

OpenSubsonic compatible music server with additional extensions for Crossonic.

Status

This project is in development. Expect bugs and missing features.

Not all OpenSubsonic endpoints have been implemented yet (status). This server implements all endpoints needed for the Crossonic app but may not work with other Subsonic media players.

Features

  • Full scan of media library (kind of slow currently)
  • Incremental library scan
  • ListenBrainz scrobbling
  • Multiple users
  • transcoding and caching
    • configurable with format= and maxBitRate= parameters
    • raw, mp3, opus, vorbis, aac
  • Fetch artist images from last.fm
  • Multiple artists, album artists, genres
  • Stores a unique ID in the metadata of all media files to preserve IDs when moving/renaming files on disk
  • Scrobbling including playback duration
  • Browse by tags
    • browsing by folders not supported
  • Favorites/rating
  • Lyrics
    • unsynced
    • synced
  • playlists
    • including user-changable playlist covers (not natively supported by OpenSubsonic)
  • SONOS casting (very buggy, not documented)
  • Serve Crossonic
  • Admin CLI
  • Admin web interface

Deploy with Docker

Create docker-compose.yml:

services:
  crossonic:
    image: ghcr.io/juho05/crossonic-server
    restart: unless-stopped
    environment:
      DB_USER: crossonic
      DB_PASSWORD: crossonic
      DB_HOST: db
      DB_PORT: 5432
      DB_NAME: crossonic
      # Base64 encoded string representing exactly 32 bytes.
      # Generate with: docker run --rm -it --entrypoint crossonic-admin ghcr.io/juho05/crossonic-server gen-encryption-key
      PASSWORD_ENCRYPTION_KEY: <key>
      # URL where crossonic-server is reachable
      BASE_URL: "https://crossonic.example.com"
    volumes:
      - "./cache:/cache"   # cache files
      - "./data:/data"     # cover art etc.
      - "./library:/music" # your music files
    ports:
      - "8080:8080"
    depends_on:
      - db
  db:
    image: postgres:16
    restart: unless-stopped
    volumes:
      - ./postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: crossonic
      POSTGRES_USER: crossonic
    healthcheck:
      test: ["CMD", "pg_isready -U crossonic"]
      interval: 30s
      timeout: 20s
      retries: 3

Run docker compose up -d in the same directory as the docker-compose.yml file.

Create user

To create a user use the following command from the directory of your docker-compose.yml file:

docker compose exec -it crossonic crossonic-admin user create <name> <password>

License

Copyright (c) 2024 Julian Hofmann

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerName        = "crossonic-server"
	Version    string = "dev"
)
View Source
var GenID func() string
View Source
var IDAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-~"
View Source
var IDRegex = regexp.MustCompile(fmt.Sprintf("^(tr)|(al)|(ar)|(pl)_[%s]{12}$", strings.ReplaceAll(IDAlphabet, "-", "\\-")))
View Source
var MigrationsFS fs.FS

Functions

func GenIDAlbum

func GenIDAlbum() string

func GenIDArtist

func GenIDArtist() string

func GenIDPlaylist

func GenIDPlaylist() string

func GenIDSong

func GenIDSong() string

Types

type IDType

type IDType string
const (
	IDTypeSong     IDType = "tr"
	IDTypeAlbum    IDType = "al"
	IDTypeArtist   IDType = "ar"
	IDTypePlaylist IDType = "pl"
)

func GetIDType

func GetIDType(id string) (IDType, bool)

Directories

Path Synopsis
cmd
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL