Makes your domain change easier
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
db
initializers
lib
media
public
tmp
views
.gitignore
Capfile
Gemfile
Gemfile.lock
README.textile
Rakefile
config.ru
director.rb

README.textile

Director

Director is a simple Sinatra application that makes it incredibly easy to track broken links.

Small History

I work at the R+D in Computer in Education at My University, and we have some applications hosted in some specific servers. We didn’t have a Top Level Domain for each application so we used one top level domains for our server and then just create SubURIs for the applications. But, one day, we had to migrate those applications to other servers and there’s the problem Director solves.

We had some of the applications in production, and some sites were already linking to our application. We not only didn’t want to lose that traffic, but we also wanted to know who was pointing at us, so we could (when possible) update the broken links.

I created Director for that. It will redirect the user (Using the 301 header response) to the new link and it will store the HTTP Referer for you. You can add a list of “Trusted Hosts” (which are the ones where you can actually update the broken link) and tell you that you can fix the problem

How it works

Imagine you had your application at myfirsthost.com and now it’s at mysecondhost.com. You just have to deploy Director at myfirsthost.com and chage the configuration file (which can be found at config/config.yml)

The config file should look like this

    production:
      db_filename: production.db
      redirect_url: "mysecondhost.com"
      admin_username: admin
      admin_password: mysupersecretpassword
      domains:
        - trusted_domain1.com
        - trusted_domain2.com
        - trusted_domain3.com

To check out the reports, you can go to

   myfirsthost.com/backstage

where myfirsthost.com is where your application was hosted.

Requirements

Director has some dependencies. You’ll need

  • Sinatra
  • Yaml Gem
  • DataMapper Core (dm-core)
  • DataMapper Timestamps (dm-timestamps)
  • DataMapper Migrations (dm-migrations)
  • DataMapper Aggregates (dm-aggregates)

You can use bundler’s magic and just run

   bundle install

I’ve also created a simple Rakefile that will install all the dependencies. So you’ll just run

   rake install_dependencies

Either way everything you need will be installed.

Default settings

Director uses Sqlite3 by default, so inside the dependencies I’ve added the do_sqlite3 and the dm-sqlite-adapter gems.

If you want to change the database adapter, you just need to change the lib/models.rb file and install the adapter you’ll use.

TODOs

  • Documentation
  • Capistrano & Passenger info

Nicolás Hock Isaza. nhocki@gmail.com