stevenleeg / geemusic

A bridge between Google Music and Amazon's Alexa
GNU General Public License v3.0
664 stars 181 forks source link

Thanks, works great! 2 minor setup things #164

Open twuttke opened 6 years ago

twuttke commented 6 years ago

I installed on to a fresh Ubuntu 16.04 LTS. While it did come python 3.5.2, it defaults to python 2.7.12, so when I run

virtualenv .venv

it didn't seem like it was virtualizing the python3 environment.

I did this instead, and it seemed to work better:

virtualenv .venv -p `which python3`

Also, when I got to the part about using foreman, I didn't really want to install ruby and all that stuff just to start a process. What I really wanted was a simple way to add a service description to start at boot time. Ubuntu >= 15 uses systemd, so this worked:

Create a file

sudo vim /etc/systemd/system/geemusic.service

And fill it with something like this (replace myusername, and any other paths that look wrong)

[Unit]
Description=Geemusic Service
After=network.target

[Service]
Type=simple
User=myusername
EnvironmentFile=/home/myusername/geemusic/.env
WorkingDirectory=/home/myusername/geemusic/
ExecStart=/home/myusername/geemusic/.venv/bin/python3 /home/myusername/geemusic/server.py
Restart=on-abort

[Install]
WantedBy=multi-user.target

Then, run these

sudo systemctl enable geemusic.service
sudo systemctl daemon-reload
sudo systemctl start geemusic.service

Anyway, thanks again. Feel free to use or ignore any of these suggestions. I'm no expert, so there is likely better ways to do it than what I did.

-- Tom

~ ~

DavidRGriswold commented 6 years ago

Big thumbs up to this! Adding this to the docs could be very helpful. I initially set up a docker container but after finding this it is a much better solution with less overhead and setup time.

The app works great.

funkho commented 6 years ago

This was very helpful for me as well. Thanks for this.

crow-ua commented 6 years ago

@twuttke Works for me as well, but it spawns a server via http protocol. Is it possible to spin up https without foreman as well?

twuttke commented 6 years ago

Not sure if you can do https directly like that or not. I was already running an apache2 instance for my general purpose external facing HTTPS server on that box. I use a free cert got from letsencrypt. I proxypass any requests to /alexa to the local http server on port 4000. My config snippet looks like this:

` <VirtualHost *:443> ProxyPass /alexa http://127.0.0.1:4000/alexa ProxyPassReverse /alexa http://127.0.0.1:4000/alexa

SSLCertificateFile /etc/letsencrypt/live/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf `