PREFACE
This guide is to tell you how to setup your own PRIVATE (or I suppose public…) SiriProxy server using the extremely well put-together “Three Little Pigs” proxy. It allows iPhone 4S’s and in the future iPad 3’s to feed Siri authentication keys/tokens to the server for other iOS devices to use. It also allows the use of SiriProxy plugins which allows for some advanced commands and very tech-savvy individuals to use Siri for things like home automation. We won’t get into that much of it, we just are trying to get iPhone 4 users up on Siri!
REQUIREMENTS
iPhone 4S (Or a friend/family member willing to help, even remotely).
iPhone 4 or 3GS running iOS 5.0.1 jailbroken. Save time by installing Spire on it now!
A dedicated, or VPS server running Ubuntu 11.10.
PuTTY, or a way to remotely access your server.
THANKS
First off, this guide is based on one written by Jeudi, but I had a ton of trouble with his. This guide is new, and contains some touch-ups and command changes, however a huge thanks to him for the original, or else I would have been totally flying blind with all the Ruby stuff that follows (even though that’s where I had the most trouble…) Also thanks to Jacob and James who were kind enough to feed me some keys during testing stages.
STEP 1 – SERVER SETUP
Get your server setup!
If you haven’t already, go ahead and install Ubuntu 11.10.
Install all available updates, this can usually be done while installing the OS even.
Once all that is set, be sure to update your root password if it’s a brand new server.
sudo passwd root
Once you’ve changed your root password login as root, if you’re using a server with a GUI, make sure you log in as “Other” and then put root as the username and the password you just created.
STEP 2 – INSTALL BASICS
Issue all the following commands, if you get errors for dnsmasq that’s ok, but you shouldn’t get any other errors at this point.
sudo apt-get update
sudo apt-get install -y nano
sudo apt-get install -y dnsmasq
sudo apt-get install -y build-essential
sudo apt-get install -y openssl
sudo apt-get install -y libreadline6
sudo apt-get install -y libreadline6-dev
sudo apt-get install -y curl
sudo apt-get install -y git-core
sudo apt-get install -y zlib1g
sudo apt-get install -y zlib1g-dev
sudo apt-get install -y libssl-dev
sudo apt-get install -y libyaml-dev
sudo apt-get install -y libsqlite3-0
sudo apt-get install -y sqlite3
sudo apt-get install -y libxml2-dev
sudo apt-get install -y libxslt-dev
sudo apt-get install -y autoconf
sudo apt-get install -y libc6-dev
sudo apt-get install -y ncurses-dev
sudo apt-get install -y automake
sudo apt-get install -y libtool
sudo apt-get install -y bison
sudo apt-get install -y subversion
sudo apt-get install -y gcc
sudo apt-get install -y g++
If you get a dnsmasq starting error.
sudo nano /etc/dnsmasq.conf
At around line 78, change
#user=
to
user=root
Sane and close by pressing CTRL+O then Enter then CTRL+X.
STEP 3 – INSTALL RUBY
Download & Install RVM
sudo apt-get install -y rvm
sudo bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Activate RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
Add RVM to your .bash_profile
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
If you’re using putty or remote terminal access, restart it now.
Next install Ruby 1.9.3
rvm install 1.9.3
If you get a rvm command not found error, try this…
ln -s /usr/local/rvm/bin/rvm /usr/bin/
and then retry the previous step.
Set RVM to use 1.9.3 by default.
rvm use 1.9.3 --default
STEP 4 – RUBY SETUP
Run the following commands.
rvm gem update
rvm gem update --system
Edit gemrc
nano ~/.gemrc
Add this line with a return at the end.
gem: --bindir /usr/local/bin --no-ri --no-rdoc
To save and close .gemrc, press CTRL+O then Enter then CTRL+X.
Install the following gems.
rvm gem install eventmachine - -with-ssl-dir=/usr/bin/openssl
rvm gem install httparty
rvm gem install rails
rvm gem install json
rvm gem install uuidtools
rvm gem install rake
rvm gem install bundler
rvm gem install CFPropertyList
STEP 5 – INSTALL WEB INTERFACE
Run the following commands.
sudo apt-get install -y libmysqlclient-dev
rvm gem install mysql
sudo apt-get install -y apache2
Test if your server is online by going to http://server.ip-or.hostname/
Next we need to get PHP ready.
sudo apt-get install -y php5
sudo apt-get install -y libapache2-mod-php5
Restart Apache
sudo /etc/init.d/apache2 restart
Install MySQL
sudo apt-get install -y mysql-server
Connect to MySQL
mysql -h localhost -u root -p
Create the required database
CREATE DATABASE siri;
Type exit to close the MySQL session.
Install phpMyAdmin
sudo apt-get install -y phpmyadmin
When it asks you which package to reconfigure automatically choose apache2, and answer yes to the second question.
This will also ask for your password three times.
Edit php.ini
sudo nano /etc/php5/apache2/php.ini
Change around line 932, find
; extension=msql.so
Change to
extension=msql.so
To save and close, press CTRL+O then Enter then CTRL+X.
Prepare phpMyAdmin
sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin
Then restart Apache
sudo /etc/init.d/apache2 restart
You can test by going to http://server.ip-or.hostname/phpmyadmin/
STEP 6 – INSTALL THREE LITTLE PIGS SIRIPROXY
Clone the git repo.
git clone https://github.com/jimmykane/The-Three-Little-Pigs-Siri-Proxy
Change your directory.
cd The-Three-Little-Pigs-Siri-Proxy
If you have a security alert, continue with yes.
Generate the SiriProxy gem.
rvm all do rake install
Make a .sirproxy directory.
mkdir ~/.siriproxy
Move the config.
cp ./config.example.yml ~/.siriproxy/config.yml
Set up your own config.
sudo nano ~/.siriproxy/config.yml
You’ll need to set your database password and change your.siri.proxy.server.com to your IP or hostname.
Save the file. CTRL+O then Enter then CTRL+X.
Edit openssl.cnf
sudo nano /etc/ssl/openssl.cnf
Around line 148, find this…
commonName = Common Name (eg, YOUR name)
commonName_max = 64
And directly below it, add this.
0.commonName = Common Name (eg, YOUR name)
0.commonName_default = guzzoni.apple.com
0.commonName_max = 64
1.commonName = Common Name (eg, YOUR name)
1.commonName_default = YOUR.IP.OR.HOSTNAME.HERE
1.commonName_max = 64
Close by pressing CTRL+O then Enter then CTRL+X.
Time to generate the certificate.
rvm all do siriproxy gencerts
Now you MUST install this ca.pem on the iPhone 4S and the iPhone 4/3GS that will be using Siri via Spire…
Email it to yourself, or you can put it on the web portion of your server for quick access via Mobile Safari.
sudo chmod -R 777 /var/www
cp /root/.siriproxy/ca.pem /var/www/ca.pem
With the above method your ca.pem is located at http://server.ip-or.hostname/ca.pem
Now we must bundle SiriProxy.
rvm all do siriproxy bundle
Then create the tables in the siri database.
rvm all do siriproxy gentables
STEP 7 – SETTING UP DNSMASQ
Setting up the dnsmasq.conf
sudo nano /etc/dnsmasq.conf
At around line 63, find the following
#address=double-click.net/127.0.0.1
Under it, add this…
address=/guzzoni.apple.com/YOUR.IP.OR.HOSTNAME
To close dnsmasq.conf, press CTRL+O then Enter then CTRL+X.
Then restart dnsmasq with the following.
sudo /etc/init.d/dnsmasq restart
STEP 8 – INSTALL WEB INTERFACE
We need to move some files, issue each of these commands.
cd
sudo chmod 777 /var/www
sudo cp -R The-Three-Little-Pigs-Siri-Proxy/webInterface/* /var/www/
sudo chmod -R 777 /var/www
Next we need to edit the config, if it gives an error ignore it for now.
nano /var/www/inc/config.inc.php
In this file, you’ll want to replace your hostname with your hostname or IP address, as well as set an admin username and password for the web interface. Be sure to update your MySQL password here as well to your root password!
Close the file by pressing CTRL+O then Enter then CTRL+X.
Now we test…
mv /var/www/index.html /var/www/index.html.bk
Head to http://server.ip-or.hostname/
You should see the Three Little Pigs interface!
STEP 9 – START SIRI PROXY
First let us make sure named isn’t interfering with dnsmasq.
sudo /etc/init.d/dnsmasq stop
sudo killall named
sudo /etc/init.d/dnsmasq start
Let’s start SiriProxy now…
cd ~/The-Three-Little-Pigs-Siri-Proxy
rvm all do siriproxy server
If you’d like a way for the server to restart on crash, launch via this method.
cd ~/The-Three-Little-Pigs-Siri-Proxy
./siriproxy-restarter
STEP 10 – Configure Phones
If your server is behind a firewall make sure you forward all the proper ports, including 53, 80, and 443 for the server!
Start with the iPhone 4S, make sure you installed that ca.pem from earlier, that we dumped to the web address. From there you’ll want to edit the DNS settings on your iPhone 4S that MUST be connected to (any) WiFi access point. Add your server IP address followed by a comma to the front of the DNS server list. This allows the proxy server to take requests for Siri (guzzoni.apple.com).
After that, have the 4S user use Siri, it should work fine, and it will feed it’s authentication key to the proxy. Be sure at least one iPhone 4S user is using that DNS server to feed a key to the server once every 24 hours!!!
Next just point Spire to your proxy, https://your.server.ip.or.hostname.com/. Use siri…
SOURCES
http://www.paradox-productions.net/
http://am3yrus.over-blog.com/article-installation-of-jimmykane-s-the-three-little-pigs-siri-proxy-on-ubuntu-11-10-vps-97476772.html
http://k2designlab.wordpress.com/2012/01/01/multi-process-siri-proxy-with-automatic-authentication-for-iphone-43gsipod-touch/
https://github.com/jimmykane/The-Three-Little-Pigs-Siri-Proxy
http://www.howtoforge.com/ubuntu_lamp_for_newbies
https://github.com/plamoni/SiriProxy/issues/145
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514214
http://www.ubuntugeek.com/screen-manages-multiple-sessions-on-one-terminal.html#more-1415
http://doc.ubuntu-fr.org/phpmyadmin
http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/
http://doc.ubuntu-fr.org/rubyonrails
http://www.liberiangeek.net/2011/03/login-root-ubuntu-11-04-natty-narwhal/
http://www.the-tech-tutorial.com/?p=1868
http://www..linuxquestions.org/questions/linux-software-2/ruby-rake-install-error-on-siriproxy-925111/
Looks like a pretty good and detailed guide, many people will need this!
Thanks WouterDS! And thanks for all your work on the Three Little Pigs proxy, without your work this guide wouldn’t be possible!
Fixed a few command issues where &’s were being formatted in the HTML way “& amp ;”.
This is a great guide. I see a few things I wish I had done during my install. Also may I suggest. If you have an iPhone 4s that is jb then just install spire( I k ow sounds crazy) but that will send all requests through the siriproxy virtually guaranteeing you always have a key. I have mi e and a few buddies setup this way. That way I always have keys and don’t have to mess with dnsmasq and changing stuff all the time. It just works
That’s a really great idea as well… I may have the 4S users I have feeding mine do that. I may pair that with the email notifications to create a mailing list that pushes out to all the 4S users so they’ll know if a key expired they should just use Siri again 😉
Also, it would be nice if chpwn came out with a package for 4S users that just allowed them to use a proxy address, so it didn’t have to download the huge external archive of files 😉
Now that is a great idea you had about the emails I’m going to do that too that way my users will know to push Siri again
I get this running. My 4s works, but not my iPad. Here is a log for the iPad:
[Info – iPhone] SSL completed for iPhone
[Info – SiriProxy] Created a connection!
[Info – SiriProxy] iPad2 Wifi Only connected
[Info – SiriProxy] Changed header to iphone4s]
[Key – SiriProxy] Keys available [1]
[Keys – SiriProy] Key [1] Loaded from Database for Validation Data
[Key – SiriProxy] Key with id[1] increased it’s keyload from [190] to [200]
[Info – SiriProxy] using saved sessionvalidationData
[Warning – SiriProxy] This device is Not setup!
[Info – iPhone] Received Object: LoadAssistant (group: com.apple.ace.system)
[Key – iPhone] Recieved Object Using: Key id [1] and Instance Keyload[200]
[Info – Forwarding object to Guzzoni] LoadAssistant
[Info – iPhone] Received Object: SetAssistantData (group: com.apple.ace.system)
[Key – iPhone] Recieved Object Using: Key id [1] and Instance Keyload[200]
[Info – Forwarding object to Guzzoni] SetAssistantData
[Info – Guzzoni] SSL completed for Guzzoni
[Info – SiriProxy] Active connections [6] Max connections [15]
What could the issue be?
[Warning – SiriProxy] This device is Not setup! It has to be something with that I’m thinking? Unfortunately I’m really not sure, if the 4S works and it captures the key (it looks like it did) and the spire proxy is set to https://your.dedicated.server.ip then everything should flow fine?
Yeah, the 4s works fine. Just not the iPad. I would think it would have to do with the No Setup thing. This was a clean install of Ubuntu 11.10. I dont get it
Corey, I am not to familiar with Ubuntu (or Linux). Looking at the guide on jimmykane’s site, I see he recommends rvmsudo. What is the difference in that and the command you recommend (rvm gem install). I can not get rvmsudo to work, I always get an error so I am just wondering….
[…] This is an edited guide from Corey DeGrandchamp at Techjawa to see the origianl article please go here: http://corey.degrandchamp.com/2012/02/01/guide-setup-working-siriproxy-three-little-pigs/ […]
I have installed by your guide and the iPhone 4s connects and sends the keys to the server. Server shows 1 active key. But my iPhone 4 will not connect. I get from siri “I am really sorry about this….” I have spire set up with the correct ip and have the ca.pem profile installed but it just will not connect. On the serve I see information flying by when i activate siri on the iPhone 4 but it just never connects to give me a response. Any ideas?
I made an installer for the TLP Siri Proxy Server
It should work on a fresh install of Ubuntu 11.10
http://www.mediafire.com/?ttielni23f542n6
Hey! Someone in my Facebook group shared this website with us so
I came to give it a look. I’m definitely enjoying the information. I’m
bookmarking and will be tweeting this to my followers!
Exceptional blog and amazing style and design.
I appreciate for the article. I have bookmark this blog.
unquestionably appreciate your web site but the truth is have got to look into the punctuation about several of this content. Quite a few will be filled using spelling troubles and that i to find the idea incredibly frustrating to tell the fact then again I most certainly will certainly keep coming back yet again.