Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2019
    Posts
    2

    Managing routing for squeezebox server

    Hi

    I'm building a hassio addon for squeezebox server, which basically will run the squeezebox server in a docker container for home assistant home-assistant.io

    I've got a container up and running and can control my radios and serve my music files out, but there is some functionality within home assistant called ingress, that allows you to automatically create a menu item for an addon and it will handle the routing and reverse proxy to view that addon's UI within home assistant.

    One of the requirements is that I can route requests to a subfolder e.g. if my home assistant is running on www.myhome.com and the addons container is exposing itself internally say on port 192.168.1.1:9000, it will route to something like http://www.myhome.com/api/addons/adg...er/wizard.html

    So I'm not entirely sure of your architecture, but I guess you're using apache or nginx or something to serve squeezebox server, is there a way I can tell it to serve from a particular subdirectory ideally programmatically through an argument or something during install?

    The last thing is I'm seeing some logs regarding the db intialization and missing tables, is this normal or am I missing something?

    Code:
    dirsFor: Didn't find a match request: [scprefs]
    dirsFor: Didn't find a match request: [videos]
    dirsFor: Didn't find a match request: [pictures]
    [19-11-25 00:19:33.3374] main::init (387) Starting Logitech Media Server (v7.9.2, 1574315728, Thu Nov 21 07:14:22 CET 2019) perl 5.026001 - x86_64-linux-gnu-thread-multi
    [19-11-25 00:19:33.7696] Slim::Utils::SQLiteHelper::postConnect (374) Optimizing DB because of missing or empty sqlite_stat1 table
    [19-11-25 00:19:33.7841] Slim::Schema::forceCommit (2144) Warning: Trying to commit transactions before DB is initialized!
    [19-11-25 00:19:34.0382] Slim::Utils::SQLiteHelper::postConnect (374) Optimizing DB because of missing or empty sqlite_stat1 table
    [19-11-25 00:19:34.0527] Slim::Schema::forceCommit (2144) Warning: Trying to commit transactions before DB is initialized!
    [19-11-25 00:19:34.1282] main::checkDataSource (1107) Warning: Schema updated or no media found in the database, initiating scan.
    [19-11-25 00:19:34.5774] main::main (205) Starting Logitech Media Server scanner (v7.9.2, 1574315728, Thu Nov 21 07:14:22 CET 2019) perl 5.026001
    [19-11-25 00:19:34.7054] Slim::Schema::forceCommit (2144) Warning: Trying to commit transactions before DB is initialized!
    [19-11-25 00:19:34.7991] Slim::Music::Import::runImporter (511) Starting Slim::Media::MediaFolderScan scan
    [19-11-25 00:19:34.7993] Slim::Music::Import::endImporter (644) Completed Slim::Media::MediaFolderScan Scan in 0 seconds.
    [19-11-25 00:19:34.7999] Slim::Music::Import::runImporter (511) Starting Slim::Plugin::FullTextSearch::Plugin scan
    [19-11-25 00:19:34.8005] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (413) Starting fulltext index build
    [19-11-25 00:19:34.8006] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (417) Initialize fulltext table
    [19-11-25 00:19:34.8012] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (430) Create fulltext index for tracks
    [19-11-25 00:19:34.8434] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (440) Create fulltext index for albums
    [19-11-25 00:19:34.8439] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (449) Create fulltext index for contributors
    [19-11-25 00:19:34.8442] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (459) Create fulltext index for playlists
    [19-11-25 00:19:34.8460] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (494) Optimize fulltext index
    [19-11-25 00:19:34.8490] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (509) Fulltext index build done!
    [19-11-25 00:19:34.8492] Slim::Music::Import::endImporter (644) Completed Slim::Plugin::FullTextSearch::Plugin Scan in 0 seconds.
    [19-11-25 00:19:34.8498] Slim::Music::Artwork::precacheAllArtwork (637) Starting precacheArtwork for 0 albums
    [19-11-25 00:19:34.8499] Slim::Music::Import::endImporter (644) Completed precacheArtwork Scan in 0 seconds.
    [19-11-25 00:19:34.8501] Slim::Music::Import::runScanPostProcessing (435) Starting Database optimization.
    [19-11-25 00:19:34.8809] Slim::Music::Import::endImporter (644) Completed dbOptimize Scan in 0 seconds.
    [19-11-25 00:19:34.9020] Slim::Utils::SQLiteHelper::postConnect (374) Optimizing DB because of missing or empty sqlite_stat1 table
    [19-11-25 00:19:34.9160] Slim::Schema::forceCommit (2144) Warning: Trying to commit transactions before DB is initialized!
    I suppose a final thing, maybe overkill, but home assistant runs its own sqllite db, I wonder if you can pass a db connection in to avoid it creating its own db and use this instead?

    Many thanks

    Andy

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,422

    Managing routing for squeezebox server

    > One of the requirements is that I can route requests to a subfolder e.g.
    > if my home assistant is running on www.myhome.com and the addons
    > container is exposing itself internally say on port 192.168.1.1:9000, it
    > will route to something like
    > http://www.myhome.com/api/addons/adg...er/wizard.html


    That would be the reverse proxy's task to map that folder to LMS' root.

    > So I'm not entirely sure of your architecture, but I guess you're using
    > apache or nginx or something to serve squeezebox server, is there a way
    > I can tell it to serve from a particular subdirectory ideally
    > programmatically through an argument or something during install?


    It's neither Apache nor nginx, but LMS is running its very own web
    server. And no, that path can't easily be changed. But then, as I said,
    that should be the reverse proxy's job to do the mapping.

    > The last thing is I'm seeing some logs regarding the db intialization
    > and missing tables, is this normal or am I missing something?


    You should only see these as long as you don't have any music stored in
    your LMS library.

    > I suppose a final thing, maybe overkill, but home assistant runs its own
    > sqllite db, I wonder if you can pass a db connection in to avoid it
    > creating its own db and use this instead?


    Unlike MySQL and others SQLite is NOT a SQL server. It's file based.
    Every application needs to have direct access to the file. You wouldn't
    save anything trying to share it, as you wouldn't save running a server.

    --

    Michael

  3. #3
    Junior Member
    Join Date
    Nov 2019
    Posts
    2
    Thanks for the response, I'll see if I can set a proxy up inside my container, I guess I might need to run LMS behind a nginx in the container to control the routing.

    Agree on the other points.

    I've got an ubuntu base image at the moment, do you think it would possible to base off an alpine image, I'm not entirely sure on the dependencies?

    I also need to hand dealing with other architectures arm, etc but I'll get to that.

    Last thing... Do I need to worry about these:

    Code:
    dirsFor: Didn't find a match request: [scprefs]
    dirsFor: Didn't find a match request: [videos]
    dirsFor: Didn't find a match request: [pictures]
    Thanks again

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •