Devy Proxy

Forwards Devy skill requests from Alexa to the appropriate Devy client application.

Description

Proxies Devy intent requests from the Alexa service to the appropriate client application based on the user ID in the request. When a user registers their Alexa device, they are given an ID which is used during the installation of the client application to associate the Alexa device with a computer.

The proxy logs all traffic to a database running on the proxy server. This data will be used to analyze conversations.

Usage

The Devy proxy uses PM2 to daemonize the node application during deployment. See the pm2 cheatsheet for a list of commands you can use to manage the app.

To start the proxy, run

pm2 start devy-proxy

To stop the proxy, run

pm2 stop devy-proxy

Installation

  1. Install the Docker engine (tested with v1.12.1).
  2. Install Node.js (tested with v6.5.0).
    a. Allow node to bind to protected ports. For Linux, use sudo setcap cap_net_bind_service=ep /usr/local/bin/node, adjusting the path to the node binary.
  3. Install PM2 npm install pm2 -g (tested with v2.4.6). Note: if you get an EACCES error fix your npm permissions.
    a. Configure the PM2 startup script pm2 startup.
  4. Download the latest release from the Devy project page.
    a. Extract the proxy.zip and cd into the extracted directory.
    b. Create an ssl directory mkdir ssl and copy over your fullchain.pem and privkey.pem files generated by the Let's Encrypt cerbot.
    c. Create the .env file in the project root. Alternatively, skip to the next step which will generate a default version of the .env file.
    d. Run the deploy script npm deploy.

Generating SSL certificates with Let's Encrypt

Go to the cerbot webpage and select Software: none and System: . Follow the instructions for generating a certificate the built-in STANDALONE webserver. The important notes shown once the certificate has been generated will indicate its location.

Updating

To update the proxy, download the latest release zip and overwrite the previous version of the files. Restart the app pm2 restart devy-proxy.

FAQ

Port 443 is blocked. Can I choose a different port?
No. It is hard-coded in the app because the Alexa service will only send requests on port 443.

Can I use a self-signed certificate, or just disable SSL?
No. The Alexa service requires that its requests be sent securely using SSL certificates recognized by Amazon.