Provides free temporary virtual machines using Digital Ocean for:
- New developers coming to C4EC need to experience clean development environments
- Diverse projects require clean environment to do follow along demos and test READMEs
- Quick testing of one off ideas
Use these instructions to setup a temporary* development environment of this project.
- Fork this repository
- Create a new Virtual Machine (1gb+ recommended) >> SSH in >> Run vms quick install:
- export GHUSER='AnthonyAstige' (Replace AnthonyAstige with your username)
curl -L -o- https://rawgit.com/codeforeauclaire/vms/master/bin/vmsquickinstall.sh | bash
- Run app
cd ~/vms
meteor
- Warning: The meteor dev environment is resource hungry. The first run will go especially slow (5+ minutes?) on a vms machine. After that it's expected to be okay for at least simple changes.
- Load http://{vms-ip}:3000 in your browser
- Edit a file >> see changes intantly in your browser
Note: vmsquickinstall.sh
doesn't insclude a settings.json
which is required for some app functionality. You can however work on some of the UI without worrying about that.
*For a permanent development environment we recommend you read the referenced script above to install locally.
- Copy a vmsquickinstall.sh script from another site (with similar stack if possible)
- Tear out junk you know you don't need
- Spin up a new machine using the production host of this vms site
- Edit your vmsquickinstall.sh to work better
- Run your vmsquickinstall.sh on the server using
IP= && scp -i ~/.ssh/vms_id_rsa vmsquickinstall.sh root@$IP:/root/ && ssh -i ~/.ssh/vms_id_rsa root@$IP /root/vmsquickinstall.sh
- Populate your vms server IP address
- Repeat steps 2-4 until vmsquickinstall.sh is smooth (ideally no human interation; just works)
- Update the site's README.md by copying another sites quick install instructions and tweaking as needed
- Install meteor (Follow instructions at https://www.meteor.com/install)
- cd to root folder of your clone
meteor npm install
- Copy
./settings/template.json
to somewhere private named something likesettings.json
- Get your Digital Ocean api token from https://cloud.digitalocean.com/settings/api/tokens
- Use
ssh-keygen -t rsa -f new
to create a pub/private key- Put the private key in your settings.json with "\n" strings in place of newlines
cat ./new | while read line; do echo -n "$line\\n"; done
- Put public key on Digital Ocean @ https://cloud.digitalocean.com/settings/security
- Which will give you the fingerprint
- Generate ppk using PuttyGen (Install & open PuttyGen on windows >> Load your private key >> save private key as new.ppk)
- Put the putty private key in your settings.json with "\n" strings in place of newlines
dos2unix ./new.ppk && cat ./new.ppk | while read line; do echo -n "$line\\n"; done
- Put the putty private key in your settings.json with "\n" strings in place of newlines
- Put the private key in your settings.json with "\n" strings in place of newlines
meteor --settings [Location of your settings file]
Digital Ocean limits the number of droplets per account to 10 by default. To mitigate this vms supports multiple api tokens. Be warned that Digital Ocean may not like if you setup more than 2 accounts with the same billing information, and you may have to verify later setup accounts. Steps to take for each account you setup:
- If you're using a gmail account, just add a +2, +3, ... to the end of your email for a unique registration address.
- Save your login somewhere smart like LastPass, test the save works
- Confirm your email address with link they send
- https://cloud.digitalocean.com/settings/profile >> Edit Profile >> Add Phone number (recovery)
- https://cloud.digitalocean.com/settings/billing >> Fill in
- https://cloud.digitalocean.com/settings/billing >> Set Billing Alerts
- https://cloud.digitalocean.com/settings/security >> Add the same public key (Confirm you have the same fingerprint in settings.json @ fingerprints)
- https://cloud.digitalocean.com/settings/api/tokens >> Generate New Token >> vms >> add to settings.json @ apitokens
When done setting up all config, be sure you test all the Digital Ocean accounts. It's easiest to manually modify code to do this. Search code for 'TOKEN-AND-FINGERPRINT-TESTER'.
Alternatively or additionally you may contact Digital Ocean support to request an increase in the number of Droplets they allow on your account. They granted me up to 20 with no problem on one account.
- Cleanup code
- Seperate out into multiple pages (flowrouter?)
- Move some of the About and maybe Other resources to other page(s)?
- Move Authentication to another page?
- Deal with bad public key uploading (errors from DO, display a useful message)
- Delete old public ssh keys uploaded to Digital Ocean
- If too many get there the API may paginate them when we list, which will break things
- Implement garbage collection like delete servers run every 10 minutes that deleted keys older than 5 minutes?
- Not perfect, but probably good enough. May get race condition errors if click wrong time, but uncommon.
- Implement garbage collection like delete servers run every 10 minutes that deleted keys older than 5 minutes?
- Give a retry button when stuck in an error'd state
- Cleanup UI
- Hide authenticate / adjust extras if your own public key is provided
- Public key may need to move to top level in ui then?
- Add a server info section?
- Add description to UI somewhere that 1gb machines last 1/2 the length as 512mb machines
- And to be curtious and only use 1gb machines when needed. Suggest use swap space in your quickvms scripts like in this one's?
- Indicate in ui the current machine size
- Make wait after server status is active another 10 seconds (sometimes can't ssh in right away)
- Add UI clear for select all on pre boxes when clicked
- Add hard throttling on max spin ups per unit of time (put values in settings.json)
- Auto generate a new server if timer is negative (Do destruct >> recreate cycle?)