Skip to content

Setting up a demo site

jpmckinney edited this page Feb 23, 2013 · 7 revisions

Brief instructions to get a demo site up quickly for your jurisdiction, in your language, with your public bodies, and without major security issues.

TODO: Remove default public bodies

Launch an EC2 instance

From mySociety's EC2 AMI guide

Assumes you already have an EC2:

  • account
  • key pair
  • security group that opens ports 22 and 80

For a production website, you need to open port 25 for email.

  • Login to your AWS EC2 Console
  • Click "Launch Instance"
  • Click "Continue" to use the Classic Wizard
  • Click the "Community AMIs" tab
  • Select "64-bit" in the "Viewing:" select list and search for "ami-4d0ebc24"
  • Click "Select" once the AMI is found
  • Select your "Instance Type:" (medium is recommended for performance)
  • Click "Continue" repeatedly
  • Click "Launch"

You should be able to access your website at e.g. ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com.

Create an administrative user

From mySociety's installation guide

  • Go to http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com/en/profile/sign_in and sign up

  • Check your email and confirm your account

  • Go to http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com/admin?emergency=1

  • Login with username adminxxxx and password passwordx

  • Go to http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com/en/admin/user/edit/3

  • Change "Admin level" to none and click "Save"

  • Go to http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com/en/admin/user/list

  • Click on the name of the user you created, click "Edit", change "Admin level" to super and click "Save"

  • Secure the emergency username and password:

      sed -i "s/adminxxxx/`openssl rand -base64 32`/" config/general.yml
      sed -i "s/passwordx/`openssl rand -base64 32`/" config/general.yml
      ./script/rails-post-deploy
    

Upload a list of public bodies

  • Go to http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com/en/admin/body/import_csv

The lowercase, accentless versions of the names of public bodies must be unique.

Hide default requests

  • Go to http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com/en/admin/request/list
  • Click on each request
  • Check the "Not a valid FOI request" radio button
  • Click "Hide request"

Localization

  • Add translations on Transifex

  • Install the Transifex client:

      sudo apt-get update
      sudo apt-get install python-setuptools
      sudo easy_install --upgrade transifex-client
    
  • Create a Transifex configuration file and download the translations (replace LOCALE below):

      sudo su - alaveteli
      cd $HOME
      tx init --host https://www.transifex.net
      cd $HOME/alaveteli
      tx pull -a -f
      bundle exec rake gettext:store_model_attributes
      bundle exec rake gettext:find
      sed -i 's/ es/ LOCALE/' config/general.yml
      ./script/rails-post-deploy
    

Additional documentation:

Note: tx init is run outside the Alaveteli directory to avoid overwriting .tx/config.

Next Steps

  • Use the stable version of Alaveteli:

      ssh -i /path/to/keypair.pem [email protected]
      sudo su - alaveteli
      cd $HOME
      git checkout master
      git pull
      ./script/rails-post-deploy
    

Additional documentation:

Clone this wiki locally