Massive multiplayer online puzzle.
- git v1.6.5+
- [Vagrant-only] Vagrant
- [Vagrant-only] maverick32 box added to Vagrant
- [AWS-only] Amazon Web Services account credentials
-
Clone the repository recursively to also get all submodules.
git clone --recursive https://github.com/muchmala/muchmala.git
-
Go inside the cloned directory and fire up Vagrant instance.
cd puzzle vagrant up
-
While you're waiting for the instance to finish provisioning, add a line to your
/etc/hosts
:33.33.33.15 muchmala.dev io1.muchmala.dev io2.muchmala.dev static.muchmala.dev
-
Once the provisioning is complete, SSH into your guest box.
vagrant ssh
-
Go to project directory.
cd /opt/muchmala
-
Install required node modules.
npm install
-
Install jake and stylus globally.
sudo npm install -g jake stylus
-
Generate and setup nginx, supervisor and other configs.
sudo jake install
-
Put some big image into project directory. Call it something like
puzzle.jpg
. -
Generate the first puzzle using that image.
bin/muchmala-covers bin/muchmala-puzzle -i puzzle.jpg
-
Finally, start all services.
sudo jake start
Vagrant is pre-configured to give your VM an IP address of 33.33.33.15.
During step 3 you assigned couple of domain names to that address,
so now you can check if Muchmala is running by opening http://muchmala.dev/
in your browser.
TODO: automate all this stuff.
-
Launch instance based on AMI
ami-cef405a7
(others weren't tested, but any Ubuntu 10.10+ should work). Don't forget to allow incoming connections to port 80 in EC2 security group settings. -
SSH into your EC2 instance.
-
Update packages info.
sudo apt-get update
-
Install git, ruby and rubygems.
sudo apt-get install -y git ruby1.8-dev rubygems
-
Install chef.
sudo gem install --version 0.9.16 chef --no-rdoc --no-ri
-
Create project directory and change it's owner/group to the current user.
sudo mkdir /opt/muchmala sudo chown $USER:$USER /opt/muchmala
-
Clone the project repository into project directory.
git clone --recursive https://github.com/muchmala/muchmala.git /opt/muchmala
-
Go into project directory and run chef-solo.
cd /opt/muchmala sudo /var/lib/gems/1.8/bin/chef-solo -c chef/solo.rb -j chef/node.json
-
Install required node modules.
npm install sudo npm install jake stylus -g
-
Create S3 bucket with the name like
static.muchmala.com
for JS/CSS/images, including puzzles images. -
Create
config.local.js
that should look like this:var config = exports; config.DEV = false; config.AWS_KEY = '<YOUR AWS KEY>'; config.AWS_SECRET = '<YOUR AWS SECRET>'; config.MAIN_DOMAIN = 'muchmala.com'; // hostname of your EC2 instance config.IO_HOST = 'io.muchmala.com'; // for now it's just an alias for muchmala.com config.IO_PORT = 80; // don't forget the port - it's important config.STATIC_HOST = 'static.muchmala.com.s3.amazonaws.com'; // your S3 bucket hostname (or it's CNAME alias) for static files config.STATIC_PORT = 80; // don't forget the port - it's important config.S3_BUCKET_STATIC = 'static.muchmala.com'; // your S3 bucket name for static files config.TWITTER_KEY = '<YOUR TWITTER KEY>'; config.TWITTER_SECRET = '<YOUR TWITTER SECRET>'; config.FACEBOOK_ID = '<YOUR FACEBOOK ID>'; config.FACEBOOK_SECRET = '<YOUR FACEBOOK SECRET>'; config.YAHOO_KEY = '<YOUR YAHOO KEY>'; config.YAHOO_SECRET = '<YOUR YAHOO SECRET>'; config.GOOGLE_KEY = '<YOUR GOOGLE KEY>'; config.GOOGLE_SECRET = '<YOUR GOOGLE SECRET>';
-
Put some big image into project directory. Call it something like
puzzle.jpg
. -
Generate the first puzzle using that image.
bin/muchmala-puzzle -i puzzle.jpg
-
Generate covers
bin/muchmala-covers
-
Generate production CSS/JS and upload them to S3, together with puzzle images.
jake static-upload
-
Start all services using (don't forget the colon at the end).
sudo jake start
You can now check if Muchmala is running by navigating to EC2's hostname in your browser.
(The MIT License)
Copyright (c) 2011 Serge Borbit <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.