2016-09-20, 00:27
(2016-09-09, 05:13)edru Wrote: So if anyone wants to set this up on their own, here are the full start to finish instructions. I made these after spending 2 hours pulling my hair out only to realize I was missing a python module. Primary thanks to @astro14 who had most of this put together in a small comment.
Feel free to share as needed or to add to any walkthrough/guide/even the opening post.
Install Prereqs:
sudo apt install apache2 apache2-utils libexpat1 ssl-cert python-pip libapache2-mod-wsgi git-core
Install requests python module:
sudo pip install requests
Sync repo to folder:
cd /var/www/html
sudo git clone https://github.com/m0ngr31/kodi-alexa.git
Modify Personal KODI info:
sudo nano /var/www/html/kodi-alexa/kodi.py
Modify the following entries to match your setup:
KODI_ADDRESS
KODI_PORT
KODI_USERNAME
KODI_PASSWORD
Enable SSL:
sudo a2enmod ssl
Create Certs: (if further help needed https://www.digitalocean.com/community/t...untu-14-04)
sudo mkdir /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 999 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
Modify SSL Conf File:
sudo nano /etc/apache2/sites-available/default-ssl.conf
Verify DocumentRoot and add path to WSGIScriptAlias:
DocumentRoot /var/www/html
WSGIScriptAlias /kodi-alexa /var/www/html/kodi-alexa/wsgi.py
Modify the SSLCertificate paths:
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
Exit and Save
Enable the Site:
sudo a2ensite default-ssl.conf
Restart Apache:
sudo service apache2 restart
Copy contents of SSL certificate for Amazon:
nano /etc/apache2/ssl/apache.crt
(copy everything in file)
Configure Amazon Developer Portal Skill:
Follow instructions here: https://github.com/m0ngr31/kodi-alexa for most configuration walk through. Mind you that the address you use will be different, and you will need to generate your show/movie/music lists (custom slots).
Set your IP as https://YOUR_ADDRESS/kodi-alexa
SSL: paste copied cert
Save - this should do it. Even started over and followed this guide to the T and it worked for me in minutes.
Not sure what I have done wrong but I get the following error: "The remote endpoint could not be called, or the response it returned was invalid."
I am able to go to HTTPS://MYURL/kodi-alexa which loads a blank page. If I try HTTPS://MYURL/kodi-alexa1 it 404s as you would expect. I have opened 443 through my router and it's forwarded to the correct local IP. I tried sudo chmod 777 wsgi.py just as a test but that didn't seem to help either. It's pretty clear that it's not talking to my local installation but I'm not sure why.
EDIT: I have a service running on port 80 but I don't think tha twould matter because all traffic should be over 443 correct?
I've done tcpdump 'port 443' and I see the inbound traffic coming to my HTTPS device but it's still not working. Not sure what the problem could be but it seems to be coming in fine and there is a handshake. I have the kodi.py configured correctly.