Giter Site home page Giter Site logo

pimusicbox / mopidy-websettings Goto Github PK

View Code? Open in Web Editor NEW
32.0 7.0 12.0 147 KB

An easy to use Settings page for Mopidy and Pi MusicBox, editable in the browser

License: Apache License 2.0

Python 22.53% JavaScript 0.90% HTML 76.57%
mopidy mopidy-web-ext

mopidy-websettings's Introduction

********* This project is no longer maintained.*********

There will be no more releases and probably no more support from myself. The Pi 4 and Zero W 2 do not work with the last release and I don't know of any workarounds.

Potential alternative software (in no particular order):

Have a suggestion/recommendation? Open a PR.

Pi MusicBox

Pi MusicBox is the Swiss Army Knife of streaming music on the Raspberry Pi. With Pi MusicBox, you can create a cheap (Sonos-like) standalone streaming music player for Spotify and other online music services.

Maintainer Wanted

This project is outdated and requires more work than I am currently prepared to invest. If you are interested in becoming the maintainer then please get in touch.

Features

  • Headless audio player based on Mopidy. Just connect your speakers or headphones - no need for a monitor.
  • Quick and easy setup with no Linux knowledge required.
  • Stream music from Spotify, SoundCloud, Google Music and YouTube.
  • Listen to podcasts (with iTunes and Podder directories) as well as online radio (TuneIn, Dirble and Soma FM).
  • Play MP3/OGG/FLAC/AAC music from your SD card, USB drives and network shares.
  • Remote controllable with a choice of browser-interfaces or with an MPD-client (e.g. MPDroid for Android).
  • AirTunes/AirPlay and DLNA streaming from your smartphone, tablet or computer.
  • Support for all kinds of USB, HifiBerry and IQ Audio soundcards.
  • Wi-Fi support (WPA, Raspbian supported Wi-Fi adapters only)
  • Last.fm scrobbling.
  • Spotify Connect support.

Please note that Pi MusicBox does NOT currently support the Raspberry Pi 4.

Installation

  1. Download the latest release.
  2. Write the image to your SD card. See here for details.
  3. Customise the /boot/config/settings.ini file.
  4. Boot your Raspberry Pi and wait for PiMusicbox to start.
  5. Finish configuring the system using the web settings.

Creating an image

If you want to build an image from source, note that the current v0.7 image is an incremental update of v0.6 and can be generated as follows:

# 1. Install prerequisite packages (probably not an exhaustive list, sorry....)
sudo apt-get install git coreutils e2fsprogs zerofree util-linux qemu-user-static latexmk python-sphinx

# 2. Download and unzip very latest project source files (use master.zip for current release)
wget https://github.com/pimusicbox/pimusicbox/archive/develop.zip
unzip develop.zip && mv pimusicbox-develop src

# 3. Download and unzip base v0.6 image
wget https://github.com/pimusicbox/pimusicbox/releases/download/v0.6.0/pimusicbox-0.6.0.zip
unzip pimusicbox-0.6.0.zip && mv musicbox0.6.img musicbox.img

# 4. Enlarge image so there is free space to work in 
./src/makeimage.sh musicbox.img bigger

# 5. Run update script within base image (requires sudo).
./src/chroot.sh musicbox.img create_musicbox0.7.sh

# 6. Go have a cup of tea/coffee while you wait...

# 7. Shrink the image and other finishing touches
./src/makeimage.sh musicbox.img finalise

Project resources

License

Copyright 2013-2020 Wouter van Wijk and contributors.

Licensed under the Apache License, Version 2.0. See the file LICENSE for the full license text.

mopidy-websettings's People

Contributors

davisnt avatar kingosticks avatar pattyland avatar thelastproject avatar woutervanwijk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mopidy-websettings's Issues

Ability to set advanced WiFi options

I would like to propose two additional checkboxes for WiFi

  • Force WPA2-AES (for enhanced security)
  • Connect to network even if it is hidden (this is always enable currently)

Additionally I suggest always adding key_mgmt=WPA-PSK directive.

Force WPA2-AES (for enhanced security)

If enabled should add the following directives

proto=RSN
pairwise=CCMP
group=CCMP

Connect to network even if it is hidden

Should set directive scan_ssid to 1 if enabled and to 0 if disabled.

Remove "Resize filesystem" option

It's no longer beta and it's not useful for end users to play with it, just clutter. It will still be controllable via settings.ini.

Examples for Autoplay Url

Provide some examples and/or hints of how to make use of the Autoplay Url feature. Musicbox docs also needs something, could link to that.

Style the apply settings page

It currently does not match the rest of the UI, it could do with a face lift. Maybe it could also automatically redirect to the main page when Mopidy comes back online.

Only show settings for installed extensions

Settings are show for all the hardcoded extensions in settingsspec.ini. It would be nice if they could only be shown for those extensions actually installed on the system. It should be possible to get the list of installed extensions from the registry.

Https jquery or local library

Hi,

Because websettings use http to link jquery library I can't do a reverse proxy using httpS.
Its no big deal but maybe you should include the library in the next release.

Also if you can point me to a way to proxy websettings (and musibox) in a subdirectory i d like that (eg localhost/admin/mopidy/settings)

"And make sure the http extension is working"

Hi

Which http extensiopn are you talking about here? The default web server is working for me if that is the one you mention. Other wise all I get is "500: Internal Server Error"

Can't connect (404 Not Found?)

Hey there,

I'm running Mopidy on a Ubuntu Desktop 17.10 system which has the IP of 10.0.0.211 on my local network... when I visit http://10.0.0.211:6680/settings... It just spews out 404: Not Found. I've tried running $ pip install Mopidy-WebSettings as both my local user and as root and had no luck in it showing up. Latest log of pip install is:

$ pip install Mopidy-WebSettings
Collecting Mopidy-WebSettings
  Downloading Mopidy_WebSettings-0.2.0-py2.py3-none-any.whl
Collecting Jinja2>=2.7 (from Mopidy-WebSettings)
  Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB)
    100% |████████████████████████████████| 133kB 1.6MB/s 
Collecting ConfigObj>=4.0.0 (from Mopidy-WebSettings)
  Downloading configobj-5.0.6.tar.gz
Requirement already satisfied: Mopidy>=0.19 in /usr/lib/python2.7/dist-packages (from Mopidy-WebSettings)
Requirement already satisfied: Pykka>=1.1 in /usr/lib/python2.7/dist-packages (from Mopidy-WebSettings)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from Mopidy-WebSettings)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.7->Mopidy-WebSettings)
  Downloading MarkupSafe-1.0.tar.gz
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from ConfigObj>=4.0.0->Mopidy-WebSettings)
Building wheels for collected packages: ConfigObj, MarkupSafe
  Running setup.py bdist_wheel for ConfigObj ... done
  Stored in directory: /root/.cache/pip/wheels/87/76/48/1564f8466fbd36402af5ac4972ffb56a6ef7f143892ef57fe5
  Running setup.py bdist_wheel for MarkupSafe ... done
  Stored in directory: /root/.cache/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
Successfully built ConfigObj MarkupSafe
Installing collected packages: MarkupSafe, Jinja2, ConfigObj, Mopidy-WebSettings
Successfully installed ConfigObj-5.0.6 Jinja2-2.10 MarkupSafe-1.0 Mopidy-WebSettings-0.2.0

And Mopidy log is:

2017-11-10 15:42:31,690 INFO [676:MainThread] mopidy.__main__: Starting Mopidy 2.1.0
2017-11-10 15:42:32,449 INFO [676:MainThread] mopidy.config: Loading config from builtin defaults
2017-11-10 15:42:32,486 INFO [676:MainThread] mopidy.config: Loading config from /etc/mopidy/mopidy.conf
2017-11-10 15:42:32,529 INFO [676:MainThread] mopidy.config: Loading config from command line options
2017-11-10 15:42:33,854 INFO [676:MainThread] mopidy.__main__: Enabled extensions: spotify, mpd, http, stream, m3u, softwaremixer, file, local
2017-11-10 15:42:33,854 INFO [676:MainThread] mopidy.__main__: Disabled extensions: none
2017-11-10 15:42:37,259 INFO [676:MainThread] mopidy.commands: Starting Mopidy mixer: SoftwareMixer
2017-11-10 15:42:37,260 INFO [676:MainThread] mopidy.commands: Starting Mopidy audio
2017-11-10 15:42:37,261 INFO [676:MainThread] mopidy.commands: Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend, SpotifyBackend
2017-11-10 15:42:37,303 INFO [676:MainThread] mopidy.local.json: No local library metadata cache found at /var/lib/mopidy/local/library.json.gz. Please run `mopidy local scan` to$
2017-11-10 15:42:37,303 INFO [676:MainThread] mopidy.local.library: Loaded 0 local tracks using json
2017-11-10 15:42:37,330 INFO [676:Audio-2] mopidy.audio.actor: Audio output set to "autoaudiosink"
2017-11-10 15:42:37,526 INFO [676:MainThread] mopidy.commands: Starting Mopidy core
2017-11-10 15:42:37,588 INFO [676:SpotifyEventLoop] spotify.session: Spotify logged in
2017-11-10 15:42:37,589 INFO [676:SpotifyEventLoop] mopidy_spotify.backend: Logged in to Spotify in offline mode
2017-11-10 15:42:38,111 INFO [676:MainThread] mopidy.commands: Starting Mopidy frontends: MpdFrontend, HttpFrontend
2017-11-10 15:42:38,112 INFO [676:MainThread] mopidy.mpd.actor: MPD server running at [::ffff:127.0.0.1]:6600
2017-11-10 15:42:38,115 INFO [676:MainThread] mopidy.commands: Starting GLib mainloop
2017-11-10 15:42:38,116 INFO [676:HttpFrontend-14] mopidy.http.actor: HTTP server running at [::ffff:10.0.0.211]:6680
2017-11-10 15:42:38,366 INFO [676:SpotifyEventLoop] mopidy_spotify.backend: Logged in to Spotify in online mode
2017-11-10 15:50:51,393 WARNING [676:HttpServer] tornado.access: 404 GET /settings (10.0.0.210) 0.36ms
2017-11-10 15:50:51,795 WARNING [676:HttpServer] tornado.access: 404 GET /settings/ (10.0.0.210) 0.34ms
2017-11-10 15:50:55,177 WARNING [676:HttpServer] tornado.access: 404 GET /settings (10.0.0.210) 0.35ms

Hoping you have any idea of whats going wrong?..

Technical issue: default values for booleans are ignored

When a definition like the following is added to settingsspec.ini:

wifi_scan_ssid = "boolean(default=true)"

Websettings does not show the setting as enabled by default if the value is not present in config_file. In such case setting is wrongly displayed as disabled by default.

Multiline config options not supported

I'm getting this error message, which makes no sense to me.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1467, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_websettings/__init__.py", line 96, in get
    configValue = iniconfig.get(item, {}).get(subitem, None)
UnboundLocalError: local variable 'iniconfig' referenced before assignment

Originally posted by @gmkey in #26 (comment)

Show the actual config that is in use.

Currently the only settings that are shown are those in the config file. If a setting is not specified in the config file because it is the default then it is not shown. Be nicer to display the actual config that is in use.

Add option to restart Mopidy service

It may be useful to have an option available to restart the Mopidy service to deal with situations where the actor dies unexpectedly (e.g. due to a misbehaving backend extension).

This would be quicker than having to do a full reboot, and easier than having to log in to the terminal to issue the command manually.

It probably means just adding WebServiceRestartRequestHandler that does service mopidy restart, similar to

class WebRebootRequestHandler(tornado.web.RequestHandler):
def initialize(self, core):
self.core = core
def post(self):
logger.info('Halting system')
os.system("sudo shutdown -r now")
os.system("shutdown -r now")
?

Pip install gives build Error

When I run "pip3 install Mopidy-WebSettings" It gives me the following error:

Downloading/unpacking Mopidy-WebSettings
  Downloading Mopidy_WebSettings-0.1.4.2-py2.py3-none-any.whl
Downloading/unpacking Jinja2>=2.7 (from Mopidy-WebSettings)
  Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB): 263kB downloaded
Requirement already satisfied (use --upgrade to upgrade): ConfigObj>=4.0.0 in /usr/local/lib/python3.4/dist-packages (from Mopidy-WebSettings)
Requirement already satisfied (use --upgrade to upgrade): Mopidy>=0.19 in /usr/local/lib/python3.4/dist-packages (from Mopidy-WebSettings)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python3/dist-packages (from Mopidy-WebSettings)
Requirement already satisfied (use --upgrade to upgrade): Pykka>=1.1 in /usr/local/lib/python3.4/dist-packages (from Mopidy-WebSettings)
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /usr/lib/python3/dist-packages (from Jinja2>=2.7->Mopidy-WebSettings)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python3/dist-packages (from ConfigObj>=4.0.0->Mopidy-WebSettings)
Installing collected packages: Mopidy-WebSettings, Jinja2
*** Error compiling '/tmp/pip-build-kmjwa0kd/Mopidy-WebSettings/mopidy_websettings/__init__.py'...
  File "/tmp/pip-build-kmjwa0kd/Mopidy-WebSettings/mopidy_websettings/__init__.py", line 74
    except (ConfigObjError, IOError), e:
                                    ^
SyntaxError: invalid syntax

Successfully installed Mopidy-WebSettings Jinja2
Cleaning up...

Show extension version and notify of new versions

it would be really nice if you could somehow get the versions of all the installed extensions and and then have a notification when a newer version is available. I'm not too sure how feasible this is, particularly for extensions installed via APT. The new version of mopify (webclient) has this feature but just for updating itself.

spotify connect

How do i set this up? When i enable it it doesn't do much.

Mopidy-Websettings does not appear to be recognised as installed

I am running Mopidy on a Raspberry Pi 3B+ as a service. I installed Mopidy-Websettings using pip install Mopidy-WebSettings and the installation appears successful.
pip list confirms that it is installed (Amongst other things):

Mopidy (2.2.2)
Mopidy-AudioAddict (0.2.7)
Mopidy-Mopify (1.6.1)
Mopidy-MusicBox-Webclient (2.5.0)
Mopidy-SoundCloud (2.1.0)
Mopidy-Spotify (3.1.0)
Mopidy-Spotify-Tunigo (1.0.0)
Mopidy-WebSettings (0.2.3)
Mopidy-Youtube (2.0.2)

In the config file (/etc/mopidy/mopidy.conf) here is how I have configured websettings:

[websettings]
enabled = true
musicbox = false
config_file = /etc/mopidy/mopidy.conf

But the extension doesn't show up when I go to http://natspi3musicbox.local:6680/. If I run sudo mopidyctl local scan I get the following output:

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf local scan" as user mopidy
INFO     Starting Mopidy 2.2.2
INFO     Loading config from builtin defaults
INFO     Loading config from /etc/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Enabled extensions: mopify, spotify, http, stream, spotify_tunigo, softwaremixer, file, musicbox_webclient, local, soundcloud
INFO     Disabled extensions: mpd, m3u
INFO     Found 187 files in media_dir.
INFO     Checking 123 tracks from library.
INFO     Removing 0 missing tracks.
INFO     Found 14 tracks which need to be updated.
INFO     Scanning...

What I'm interested in here is the following:

INFO     Enabled extensions: mopify, spotify, http, stream, spotify_tunigo, softwaremixer, file, musicbox_webclient, local, soundcloud
INFO     Disabled extensions: mpd, m3u

Since it doesn't appear to recognise websettings as either enabled or disabled. Is this a problem with my config file?
This is similar to #26, but in their output of sudo mopidyctl local scan they get websettings listed as an enabled extension so I have filed it as a separate issue.
Thanks in advance for your time.

Include jquery

Please just include the library I don't want to connect and depend on jquery.com

Mopidy wont find Websettings Frontend

Mopidy wont find Websettings Frontend. I have entered that:

[websettings]
enabled = true
musicbox = false
config_file = /etc/mopidy/mopidy.conf

in both config files the be sure. But no success.
Thats my log:

pi@raspberrypi:~/Schreibtisch $ sudo systemctl status mopidy
● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-05-21 17:55:18 CEST; 7min ago
  Process: 3602 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 3599 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 3605 (mopidy)
   CGroup: /system.slice/mopidy.service
           └─3605 /usr/bin/python /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Mai 21 17:55:22 raspberrypi mopidy[3605]: INFO     Loaded 874 local tracks using sqlite
Mai 21 17:55:22 raspberrypi mopidy[3605]: INFO     Logged in to Spotify in offline mode
Mai 21 17:55:22 raspberrypi mopidy[3605]: INFO     Logged in to SoundCloud as "TEST User"
Mai 21 17:55:22 raspberrypi mopidy[3605]: INFO     Starting Mopidy core
Mai 21 17:55:23 raspberrypi mopidy[3605]: INFO     Starting Mopidy frontends: IrisFrontend, MpdFrontend, HttpFrontend
Mai 21 17:55:23 raspberrypi mopidy[3605]: INFO     Starting Iris 3.37.1
Mai 21 17:55:23 raspberrypi mopidy[3605]: INFO     MPD server running at [::ffff:127.0.0.1]:6600
Mai 21 17:55:23 raspberrypi mopidy[3605]: INFO     Starting GLib mainloop
Mai 21 17:55:23 raspberrypi mopidy[3605]: INFO     HTTP server running at [::]:6680
Mai 21 17:55:23 raspberrypi mopidy[3605]: INFO     Logged in to Spotify in online mode

Thanks for help

Ability to set timezone

Purpose

This is required by Mopidy-AlarmClock integration (pimusicbox/pimusicbox#270).

Proposed solution

In web interface

  • Take list of timezones from folder /usr/share/zoneinfo/ (may be there is better way to get list of timezones from OS)
  • Store selected timezone in .ini file

In /opt/musicbox/startup.sh

  • Read selected timezone from .ini file
  • Ensure that /usr/share/zoneinfo/$TIMEZONE is a file
  • echo $TIMEZONE > /etc/timezone
  • rm -f /etc/localtime
  • cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime

The code snippet is untested.

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.