Hosted hack environment

Growstuff offers hosted hack environments to any Growstuff developer who would find it easier to develop there rather than on their own machine. Maybe because their own machine is hard to set up with Rails, or because

Hack environments are hosted on hack.growstuff.org.

To get a hack environment, simply ask on the Mailing list or IRC, or contact one of the coaches for the current iteration, who can make it happen.

Setting up your hack environment
You will need to provide your SSH key (see that link for details) in order to login to the hack server.

To access the hack server:

ssh yourname@hack.growstuff.org

Copy the necessary ruby/rails stuff into your home directory:

# we need to write a script for this, which hasn't happened yet, sorry

Now follow the steps under Development pre-requisites and you should be good to go.

Running rails
Assuming you've checked out you growstuff repo from github, and want to see the Growstuff website in action, you can do that by running rails from the command line:

rails server -p NNNN

(where NNNN is a high-numbered port assigned to you).

Assigned ports
By default rails server runs on port 3000. We don’t want people stepping on each other’s toes, so we will assign a port number you should use if you have a hack account set up. Here is a list of people with hack accounts and their port numbers:

Pairing on the hack server
You can either have the driver SSH into the hack server and then share their local machine's screen using a graphical screen-sharing tool, or you can both SSH into the hack server and share one session using tmux.

Sysadmin notes
To set up a new hack environment:

Create account
sudo adduser USERNAME

Give them a decently unmemorable password. They won't be using it anyway, because we only allow ssh login, but still, it should be a good password. I use https://www.random.org/passwords/?num=5&len=8&format=html&rnd=new to generate them.

Fill in details -- only "Full name" is needed, and it needn't be their full wallet name, just what they're known by in the project.

Set up ssh key
The developer should have sent you their ssh public key. If not, point them at SSH and ask them to generate one and email it to you.

sudo su - USERNAME mkdir .ssh chmod 700 .ssh cat > .ssh/authorized_keys

Then paste their SSH public key, which they've previously sent you (right?). It should look something like this:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwv+hDZ19GnOZRfK....

Hit enter then ctrl-D to exit `cat`.

Then finally:

chmod 600 .ssh/authorized_keys

Assign a port for 'rails server'
Edit this wiki page (the section above) and add in the new developer's name and give them the next port number, sequentially.

Email them
Something like this (replacing CAPSLOCK items with the relevant info):


 * Hi!


 * Your hosted hack environment is now set up. Try 'ssh USERNAME@hack.growstuff.org' and let us know how it goes.


 * Your rails port is XXXX. Please see http://wiki.growstuff.org/index.php/Hosted_hack_environment for more info.


 * YOURNAME

And you're done!

TODO
If some keen sysadmin feels like it, it would be handy to automate the port number stuff for 'rails server'. I.e. set up something with environment variables or bash aliases or whatever, so that people don't need to know/remember their port number, they just run `rails server` and it DTRT.