httpms

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2014 License: GPL-3.0 Imports: 1 Imported by: 0

README

Build Status

HTTP Media Server

A way to listen your music library everywhere. Once set up you won't need anything but a browser. HTTPMS will let you browse through and listen to your music over HTTP. Up until now I've had a really bad time listening to my music which is stored back home. I would create a mount over ftp, sshfs or something similar and point the local player to the mounted library. Every time it resulted in some upleasantries. Just imagine searching in a network mounted directory!

No more!

Requirements

If you want to install it from source (from here) you will need:

For the moment I do not plan to distribute it any other way.

Install

  1. Run go get https://github.com/ironsmile/httpms

  2. Start it with httpms

  3. Edit the config.json and add your library paths to the "library" field

Docker

Alternatively to installing everything in your environment you can use my docker image.

docker build -t ironsmile/httpms github.com/ironsmile/docker-httpms

It is ready for running or development.

Features

  • Uses jplayer to play your music so it will probably work in every browser
  • jplayer supports mp3, oga, wav, flac and m4a audio formats
  • Interface and media via HTTPS
  • HTTP Basic Authenticate
  • Playlists
  • Search by track name, artist or album
  • Download whole album in a zip file with one click

Configuration

HTTPS configuration is saved in a json file, different for every user in the system. Its location is as follows:

  • Linux or BSD: $HOME/.httpms/config.json
  • Windows: %APPDATA%\httpms\config.json

When started for the first time HTTPMS will create one for you. Here is an example:

{
    // Address and port on which HTTPMS will listen. It is in the form hostname[:port]
    // For exact explanation see the Addr field in the Go's net.http.Server
    // Make sure the user running HTTPMS have permission to bind on the specified
    // port number
    "listen": ":443",

    // true if you want to access HTTPMS over HTTPS or false for plain HTTP.
    // If set to true the "ssl_certificate" field must be configured as well.
    "ssl": true,

    // Provides the paths to the certificate and key files. Must be full paths, not
    // relatives. If "ssl" is false this can be left out.
    "ssl_certificate": {
        "crt": "/full/path/to/certificate/file.crt",
        "key": "/full/path/to/key/file.key"
    },

    // true if you want the server to require HTTP basic authentication. Credentials
    // are set by the 'authentication' field below.
    "basic_authenticate": true,
    
    // User and password for the HTTP basic authentication.
    "authentication": {
        "user": "example",
        "password": "example"
    },

    // An array with all the directories which will be scanned for media. They must be
    // full paths and formatted according to your OS. So for example a Windows path
    // have to be something like "D:\Media\Music".
    // As expected HTTPMS will need permission to read in the library folders.
    "libraries": [
        "/path/to/my/files",
        "/some/more/files/can/be/found/here"
    ]
}

List with all directives can be found in the configration wiki.

Daemon

HTTPMS comes with a separate daemonization binary. It is called httpms_daemon. You can find it in the httpms_daemon directory. Separate binary is required since Go's standar libraries fail miserably if you fork the main process. As far as I can tell when forking the notify library stops working along with the goroutine scheduler. The goroutine scheduler may work from time to time but it is by no means stable after forking. Note: You should always use the PID recorded in the pidfile for stopping httpms. Even if you use httpms_daemon.

Known Issues

  • Non-ASCII searches are case sensitive.

Documentation

Overview

A web interface to your media library.

This file is only here to make installing with go get easier. At the moment I don't see any other way to stash my source in the src directory instead of dumping it in the project root.

Directories

Path Synopsis
src
The Main function of HTTPMS.
The Main function of HTTPMS.
config
The module is resposible for finding, parsing and merging the HTTPMS user configuration with the default.
The module is resposible for finding, parsing and merging the HTTPMS user configuration with the default.
daemon
This package is resposible for making sure HTTPMS will run smoothly even after the calling terminal has been closed.
This package is resposible for making sure HTTPMS will run smoothly even after the calling terminal has been closed.
helpers
Contains few helpers functions which are used througout the project
Contains few helpers functions which are used througout the project
library
This module deals with the actual media library.
This module deals with the actual media library.
webserver
This module contains the webserver whcih deals with processing requests from the user, presenting him with the interface of the application.
This module contains the webserver whcih deals with processing requests from the user, presenting him with the interface of the application.

Jump to

Keyboard shortcuts

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