Giter Site home page Giter Site logo

Comments (20)

bobboau avatar bobboau commented on July 18, 2024

At this point in time user name/password support is not implemented, though it is high on my list of things to do. I was actually just thinking about it this morning, so it'll probably be the next thing I work on. However, I have had some competition for my time come up recently so It may or may not be soon coming.

Of course if someone submits a pull request before I get around to it I'll accept that, though it would require adding support to the underlying MPD.js library as well as changes to Bragi.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

The PHP part I might be able to do, but I'm very new to JS in general. I'll take a look at it at least.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

PHP? this is an entirely client side application, everything's Javascript. Aside from the websocket adapter dependency and MPD it's self.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

Oh, this is embarassing. I was playing with a PHP one right before I commented here and was still stuck there, in my head. Yeah, I'll still take a look at it and see if I can actually see what's going on with the JS.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

No worries.
I've actually decided to procrastinate on things I'm supposed to be doing tonight, and am working on this right now, I might have it somewhat done by morning.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

Sweet. I looked mpd.js over and it's a little over my JS experience, so I'm gonna stay away from it.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

I have pushed a very rough early implementation of authorization, if you have an instance that needs a password you should be prompted for it and it should reconnect within a few seconds and everything should work from that point on.

the user experience is a bit suboptimal, but I was mostly focusing on getting it working at all first. think I'm going to add a config option so it doesn't rely on error handling if you know ahead of time that you need a password. thought about having the option of putting the password in the config, but that would sort of defeat the purpose of a password. also going to work on remembering cross session/through reloads so you only need to enter it once.

think I'm going to throw a alert message up any time an auth error happens on the selected instance and other than that, have a password field in the instance UI.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

ok, just pushed a bunch of UI improvements, this might be done (or I might have just introduced a bunch of bugs). let me know what you think :)

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

Sweet, I'll give it a go when I get home from work in a few hours. Thanks man. I might try my hand at modifying some of the UI stuff later as I use it more and sending a few PRs.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

Running it and I'm seeing no options for putting in password and I'm also not being prompted for it, either. It's running fine if I'm just looking to see what the server is playing, but nothing happens when I try to change songs or modify the playlist (obviously, since that would require password). Is there a way to enable logging or debug mode?

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

oh, I bet you only have one instance don't you? did all my testing with two and didn't think of that, the place where you enter a password doesn't show up if you only have one instance. OK, so I need to prompt in that case. Try adding a 'needs_auth:true' to your config (see the readme section about making a custom config.js)

I just disabled logging by default because it caused a bit of a slowdown. if you go to the init function in UI.js and right after it sets up the client, it you add client.enableLogging(); you should get a bunch of info about what's going on.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

or pull what I just pushed, which should prompt you when ever there is a password rejected and you only have one instance.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

Ah, it definitely prompts now. That's working. And it worked on actually navigating and sending commands once. Now it just doesn't. Completely ignores everything after the password prompt as if it never prompted or sent password.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

Tried to enable logging, but got client not defined in JS console. Probably throwing that line in the wrong place. I've been throwing it in after the CONFIG.clients foreach block. Like I said, I'm a JS idiot.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

do it inside the foreach block.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

It does take a few seconds to re-authorize.

I'm not able to replicate this, what browser/platform are you using?

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024

chromium/Arch - Client
debian - Server

Logging working now, thanks for pointing that out. D'oh!

Okay, so after re-enabling logging, it worked the first time GREAT. I then exited the tab and reloaded the page. No longer working no matter how many times I load the page. In the console, I'm seeing it send the password, but after that, no matter what I do, nothing else appears. Not sure if there should be any more output in the console, even if it is getting denied.

from bragi-mpd.

KittyKatt avatar KittyKatt commented on July 18, 2024
MPD Client: sending: "noidle
command_list_ok_begin
next
idle
command_list_end
"
MPD Client: recived: "OK"
MPD Client: recived: "ACK [4@0] {next} you don't have permission for "next""
MPD Client: ***ERROR*** ACK [4@0] {next} you don't have permission for "next"
MPD Client: sending: "noidle
command_list_ok_begin
password **************
idle
command_list_end
"
MPD Client: recived: "list_OK"

For reference on what the non-working console output looks like

Gotta sleep. I'll look at this again once more after I wake up and before work.

from bragi-mpd.

bobboau avatar bobboau commented on July 18, 2024

do you have some default permissions? like is it set up to allow anonymous reading but needs a password to change anything?

also I mainly use Chrome, if you are using firefox or something let me know, it might be a browser specific bug.

from bragi-mpd.

davidchisnall avatar davidchisnall commented on July 18, 2024

Entering a password doesn't work in Safari / Mobile Safari (though it works fine in Firefox). It appears that the events are delivered too fast, so it keeps trying to reconnect and refuses to accept input.

from bragi-mpd.

Related Issues (6)

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.