Skip to content

Instantly share code, notes, and snippets.

@elvisimprsntr
Created October 31, 2012 07:09
Show Gist options
  • Save elvisimprsntr/3985559 to your computer and use it in GitHub Desktop.
Save elvisimprsntr/3985559 to your computer and use it in GitHub Desktop.
SiriProxy running on Ubuntu Server 12.10
# $Header: /root/RCS/siriproxy-ubuntu-server.txt,v 1.6 2012/11/05 04:09:10 root Exp $
# $Log: siriproxy-ubuntu-server.txt,v $
# Revision 1.6 2012/11/05 04:09:10 root
# updated dns redirect
#
# Revision 1.5 2012/11/03 10:10:08 root
# moved root pw section again
#
# Revision 1.4 2012/11/02 08:55:23 root
# added step to remove user account
#
# Revision 1.3 2012/11/02 08:51:55 root
# moved steps for root pw
#
# Revision 1.2 2012/11/02 08:46:03 root
# added steps for setting root pw
#
# Revision 1.1 2012/10/31 07:04:38 root
# Initial revision
#
#
# DESCRIPTION: SiriProxy running on Ubuntu Server 12.10
# AUTHOR: elvisimprsntr
# CREDITS: This file is derived from plamoni's instructions for getting SiriProxy running on a Ubuntu 11 VM: https://gist.github.com/1428474
# PREREQUISITES: A VirtualBox VM configured with a bridged network adapter and a router running www.dd-wrt.com open source firmware.
# ASSUMPTIONS: This instruction assumes the reader already has some basic Linux command line and editor experience and are remotely logging in to the plug computer from a *NIX based computer. It is not a BASH script, but the commands and configuration file syntax are formatted to allow one to cut and paste into a terminal window or editor.
# Download and install VirtualBox on your host system: https://www.virtualbox.org
# Download Ubuntu Server 12.10 iso image: http://www.ubuntu.com
# Configure a new VM using defaults, except use a bridged network adapter
# Mount the iso image as a virtual CD.
# Start the VM and install Ubuntu Server with the defaults.
# Since I am running SiriProxy on a dedicated VM I am not concerned about installing and running everything as ROOT.
# Set the ROOT password from the user account
sudo passwd
# Log out and log back in as ROOT
# Remove the original user account if you wish
deluser
# Install some basics:
apt-get install samba ssh vim rcs unzip -y
# If you want to add or create SiriPorxy plugins that push custom pictures to Siri, then install APACHE
# NOTE: The defaults are fine. Your custom images need to reside in /var/www/
apt-get install apache2 -y
# Find out what address your router assigned to your VM.
ifconfig
# Edit the network settings to use a STATIC IP address.
# NOTE: To make it easy use the same settings your router assigned to your VM.
vim /etc/network/interfaces
# Comment out the DHCP entry. Make the STATIC entry look something like this:
# NOTE: Tweak the address for your STATIC IP address.
auto eth0
iface eth0 inet static
address 192.168.69.96
netmask 255.255.255.0
broadcast 192.168.69.255
network 192.168.69.0
gateway 192.168.69.1
dns-nameservers 8.8.8.8 8.8.4.4
# Reboot the VM
reboot
# Enable SAMBA support. Tweak the Share Definition section in the /etc/samba/smb.conf file.
# TIP: If you enable RW access you will be able to create folders and write to the VM from any client. Also make sure to disable GUEST access.
vim /etc/samba/smb.conf
# Add ROOT as a remote user.
# TIP: Use the same password as the root login to eliminate the need to remember another password.
smbpasswd –U root
# Restart SAMBA daemon:
stop smbd
start smbd
# You should now be able to access the VM file system from any client.
# In lieu of running DNSMASQ on the VM, I opted to use my router to perform a transparent DNS redirect.
# On a router running www.dd-wrt.com open source firmware, configure a DNS redirect from Apple Siri servers to the STATIC IP address of the SheevaPlug.
# NOTE: Tweak the address for your VM STATIC IP address.
# Services -> Additional DNSMasq Options
# iOS production Siri server
address=/guzzoni.apple.com/192.168.69.96
# iOS beta Siri server
address=/kryten.apple.com/192.168.69.96
# Here are the prerequisite dependancies that need to be installed. I listed them as separate lines to make it easier to add and comment out packages.
apt-get install ruby build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# Install RVM - This will take awhile.
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
# Set RVM path
[[ -s "/etc/profile.d/rvm.sh" ]] && . "/etc/profile.d/rvm.sh"
# Set the RVM path to be set up every time I log in
echo '[[ -s "/etc/profile.d/rvm.sh" ]] && . "/etc/profile.d/rvm.sh" # Load RVM function' >> ~/.bash_profile
# Install RUBY 1.9.3 -- This will take several minutes
rvm install 1.9.3
# Use RUBY 1.9.3 as the default (and current) version of ruby
rvm use 1.9.3 --default
# Clone the SiriProxy repo
git clone git://github.com/plamoni/SiriProxy.git
# Enter the SiriProxy directory
cd SiriProxy
# Make the .siriproxy directory in my home directory
mkdir ~/.siriproxy
# Copy the example config
cp ./config.example.yml ~/.siriproxy/config.yml
# Install SiriProxy -- Can take a minute or two
rake install
# Generate the certificates
siriproxy gencerts
# Install the certificate on the iPhone.
# On your *NIX machine use SCP to copy the certificate from the VM.
# Open a terminal window and use the following commands.
# NOTE: Tweak the address for your SheevaPlug STATIC IP address.
cd ~/Downloads
scp [email protected]:/root/.siriproxy/ca.pem .
# Attach this file to an email account you have access to on your iPhone.
# On the iPhone simply tap the file and follow the prompts to install.
# Bundle SiriProxy (this installs the plugins and whatnot)
siriproxy bundle
bundle install
# Start the server
siriproxy server
@elvisimprsntr
Copy link
Author

If you do not see SiriProxy responding check the following:

  1. You need to either configure your router to perform a transparent DNS redirect or install DNSMASQ and make the appropriate tweaks.
  2. Siri is known to leak over the cellular connection even when connected to Wifi. Turn off cellular data. Occasionally I've had to toggle airplane mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment