Dreamhost API

August 27th, 2006

Because I’m sick of dealing with Dreamhost’s mediocre panel, and because I wanted to be able to script my creation of web hosts, databases and subversion repositiories so that all my projects share the same basic layouts, I’ve created a screen-scraping interface to the Dreamhost panel.

It’s a Ruby app and to use it you’ll need to have Ruby 1.8 (probably) as well as rake and the ‘mechanize’ gem which does all the heavy lifting.

The documentation is sparse, but hey, this is ruby :) If you have any questions and especially suggestions for improvements, just fire me an email or leave a comment.

DOWNLOAD:
It’s available here:

Dreamhost Adapter - 0.1 Initial release

USAGE:

You should be able to do something like this:

rake create_repo USER=me PASS=secret SVN_HOST=https://svn.eyesopen.ca NAME=repo

other tasks are:

  • destroy_repo USER=me PASS=secret NAME=repo
  • create_host USER=me PASS=secret HOSTNAME= my.new.host DIRECTORY=/home/me/my.new.host
  • destroy_host USER=me PASS=secret HOSTNAME=my.old.host
  • create_db USER=me PASS=secret DB_NAME=database DB_HOST=db_server.foo.com
  • destroy_db USER=me PASS=secret DB_NAME=database

These tasks, like capistrano, all assume that you will be using one username / password combination which is the same as your login for dreamhost.

programming, Dreamhost | Comments | Trackback Jump to the top of this page

5 comments on “Dreamhost API”

  1. 01

    I agree, the lack of API sucks. Actually Dreamhost sucks period. The only reason i use it i because it’s dirt cheap.

    Chris Herberte at August 9th, 2007 around 9:39 pm
    Jump to the top of this page
  2. 02

    Meh. I don’t think it’s that bad. It’s up most of the time :) I don’t think I’d ever use it as a client host, but it’s fine to use as a subversion repo / staging area.

    grant.mcinnes at August 10th, 2007 around 7:57 pm
    Jump to the top of this page
  3. 03

    When I try to use this I get the error:

    undefined method `find_node’ for #

    #{RAILS_ROOT}/lib/dreamhost_adapter.rb:306:in `logged_in_already?’
    #{RAILS_ROOT}/lib/dreamhost_adapter.rb:88:in `login’

    Tony Spencer at August 24th, 2007 around 4:20 pm
    Jump to the top of this page
  4. 04

    Oh I see that mechanize has changed a lot since you created this great adapter. I modified it to work with the new mechanize and now its working great. I just wonder if there is a way to stay logged in. I’m afraid Dreamhost is going to lock my account if it sees too many logins.

    I tried putting my @dreamhost in session but mongrel didn’t like that.

    Tony Spencer at August 24th, 2007 around 5:10 pm
    Jump to the top of this page
  5. 05

    Really? I’m amazed its even *close* to working. Not only has mechanize been totally changed, but the Dreamhost panel was totally rewritten, so I assumed it would be totally dead by now! Are you still getting somewhere?

    grant.mcinnes at August 24th, 2007 around 11:00 pm
    Jump to the top of this page

Leave a Reply

  •  
  •  
  •  

You can keep track of new comments to this post with the comments feed.

Recently on Flickr

    mull - 21.jpgmull - 20.jpgmull - 19.jpgmull - 18.jpg

Recently Listened

Meta

The Carousell