Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker instructions #165

Closed
vallard opened this issue May 18, 2021 · 5 comments
Closed

Docker instructions #165

vallard opened this issue May 18, 2021 · 5 comments

Comments

@vallard
Copy link

vallard commented May 18, 2021

Is your feature request related to a problem? Please describe.
I want to run this plugin in a mycroft docker environment.

Describe the solution you'd like
Thanks for the wonderful project, I would like to understand how I can modify where the credentials for spotify are accessed. When I run the auth.py tool it saves the credentials in ~/.config/spotipy/token.json and ~/.config/spotipy/auth. I'd like to change the app to find the credentials with a CREDENTIALS_DIR variable or something.

Describe alternatives you've considered

  • I could not run it in docker.
  • I could mount the entire home directory, but this isn't my favorite idea.

Additional context
I don't need any code to be modified, I'm happy if you just tell me how it could be done. I think I just modify the code in spotify.py and add an env variable to it. Any guidance would be appreciated!

@forslund
Copy link
Owner

Hi, the XDG_CONFIG_DIRS variable can be used to shift it to a location of your choice but that would affect the rest of mycroft (which will start using the XDG paths as well), your idea of an env variable is a good idea!

In auth.py you can probably change L21 to

auth_dir = os.environ.get('SPOTIFY_SKILL_CREDS_DIR') or BaseDirectory.save_config_path('spotipy')

You need to import os at the top somewhere and do a similar change in spotify.py on L69 to match.

Would love a PR for that, otherwise I can probably get time to add it this weekend.

@vallard
Copy link
Author

vallard commented May 20, 2021

yeah, I can work on it next weekend. (not this one) Will send a PR. Thank you!

@forslund
Copy link
Owner

forslund commented Aug 6, 2021

Hi @vallard, did you do any work on this already or should I tackle it?

@vallard
Copy link
Author

vallard commented Aug 6, 2021 via email

@forslund
Copy link
Owner

The addition has been merged and readme has been updated with brief info. Closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants