Closed a-waider closed 3 years ago
Hi there. Okay, that probably needs some enhancements to work. Could you share your docker setup (image used and startup options set [docker-compose file or whatever])? Then I could more easily get into debugging :)
I have given up on trying to use the Docker setup since long ago, because it caused a lot of unnecessary problems with MM²
Okay, here is the magic mirror part of my docker-compose file:
magic-mirror:
image: bastilimbach/docker-magicmirror
container_name: magic-mirror
restart: unless-stopped
ports: # Only temporary during authentication
- 8888:8888
expose:
- 80
volumes:
- ./magic_mirror/config:/opt/magic_mirror/config
- ./magic_mirror/css/custom.css:/opt/magic_mirror/css/custom.css
- ./magic_mirror/modules:/opt/magic_mirror/modules
environment:
TZ: Europe/Berlin
networks:
- web_proxy
I kinda got it to work, but it definetly needs some tweaks. I temporarily forwarded the port 8888 to the container. Then I forwarded the Redirect from the Spotify auth endpoint to the IP of my server where my Docker containers are running.
Maybe introduce another config variable (In the Magic Mirror config.js) to set the local IP to where the server is accessible?
Thank you for the config sharing.
Without looking any further into it I am currently thinking about optimizing the auth process a bit if there is no browser available. But this goes more into the direction of providing documentation for doing the auth process manually. Adding some kind of config variable is just more confusing than it will help I fear. And docker usage with MM² is still an edge case most of the times.
Nevertheless, I will try to setup a Pi with docker to use it for some testing on this matter.
For testing purposes you can just install docker on your main machine. Magic Mirror inside Docker is afaik server only mode.
But in my opinion it is pretty common not having physical access to magic mirror with mouse and keyboard. So it would be nice to have the callback url pointed directly to magic mirror.
So, I have done some major adjustments - also taking the time to upgrade / switch some outdated / discontinued npm packages. First testing is looking promising. Could you do me a favour and validate if these changes work for you?
Changes merged in current development branch: https://github.com/skuethe/MMM-Spotify/tree/development
I also added a lot of new documentation regarding the usage of custom callback URLs - specially for docker setups: https://github.com/skuethe/MMM-Spotify/tree/development#custom-callback
In short: the first_auth.js
process is now not failing if you have a custom callback URL configured inside your spotify.config.json
. It will print out the auth URL and wait 5mins for you to perform authentication and authorization to Spotify.
Yeah, seems good :)
Great, thanks. I will do some more testing on my side - especially with multi user setup and will then schedule the next release.
Hi there,
how do I connect my Spotify account without having connected any periphial (mouse, keyboard and screen) to my magic mirror? The problem is that I can't grant the access to my account because i can't interract with the browser opened by first-auth.js.
The log if it helps solving my issue.
My Magic Mirror2 in running in server only mode inside a docker container. So no browser support in there.