stackathon
v1.0.0
Published
A command-line program for quickly building and deploying server and DNS configurations with Digital Ocean and Namecheap.
Downloads
4
Readme
Stackathon
Stackathon is a command-line program for io.js that walks users through the process of setting up and tearing down basic server stacks on Digital Ocean. It can also set simple DNS records for domains purchased from Namecheap. The program was designed with hackathons in mind so that participants can spend less time getting setup and more time hacking.
NOTE: This has been tested throughly on Mac OS X. It will probably work on any *nix system, but your milage may vary on Windows boxes.
Quickstart
Installation
Install the Stackathon module globally via NPM:
npm install stackathon -g
Get Your Credentials
Generate a new Digital Ocean API token with read and write access in your account settings page.
You will also need your Namecheap API token. And will have to whitelist your current IP address on that same page. Your IP address changes periodically, like when you connect to a new WiFi network, so you may have to do this more than once. If you don't know how to find your IP address, just ask Google.
Namecheap is not required to use Stackathon. If you do decide to use it, be sure to read the Setting DNS Records With Namecheap section below.
Build a Stack
To build a new stack just type:
stackathon
The first time you run it, Stackathon will ask for your API token(s) and check to make sure they are working. Stackathon will store your credentials so you won't have to enter them over and over again.
From there you can follow the instructions on the page and in minutes you will be ready to start hacking.
What Does Stackathon Do?
Stackathon manages the dirty work of setting up a new server enviornment, it keeps track of stacks it creates and cleans up after itself when you delete a stack it created. Stackathon only needs a few pieces of information to get started and suggests sensible defaults: type of stack to build, admin username, admin password, SSH port, domain and sub-domain (or a project name).
When you create a new stack, Stackathon:
- Generates a new set of SSH keys for your stack and stores them in the
~/.ssh
directory - Saves the public key for your stack in your Digital Ocean SSH keys
- Builds the flavor of Digital Ocean droplet your specify
- Logs into your droplet and sets up a new superuser account with the username and password you supplied
- Configures sshd on your droplet to use the port you specified, disables root login and allows your to login with your SSH keys
- Sets the A record for your domain to the IP address of your droplet (optional)
- Adds an entry to
~/.ssh/config
to allow you to SSH into your new stack with a single command
When you delete a stack, Stackathon:
- Deletes your stack from Digital Ocean
- Deletes the SSH key from Digital Ocean
- Deletes the SSH keys stored in
~/.ssh
- Removed the IP address and key signature for this stack from
~/.ssh/known_hosts
if present - Removes the entry from
~/.ssh/config
Setting DNS Records With Namecheap (optional)
Stackathon can automatically set the A record of a domain you have purchased from Namecheap to the IP address assigned to your new stack during deployment. To enable this functionality you will need to request API access from Namecheap in your account settings page.
It can take 24 hours for Namecheap to process your request and they may require that you have spent a certain amount of money with them. You can expidite a request by reaching out to their customer support team via live chat or ticketing system.
Security Note
Stackathon stores your API tokens and information about the stacks you have active in plain-text in a JSON file in your home directory ~/.stackathon
. You can purge your credentials from the JSON file by selecting the "Reset credentials" option from Stackathon's main menu. You can also invalidate your tokens from your Digital Ocean and Namecheap control panels if you accidently leave them on another computer.