Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A web front end to a single dropbox folder. With optional basic authentication

branch: dan

This branch is 6 commits ahead and 3 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 public
Octocat-spinner-32 views
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 clock.rb
Octocat-spinner-32 config.ru
Octocat-spinner-32 droppy.rb
Octocat-spinner-32 droppy_box.rb
Octocat-spinner-32 x.rb
README.md

Droppy

A simple web app for watching a folder on dropbox and providing links to download what's in there.

Why

Dropbox has public folders, so why this? There's a few reasons:

  • You control it... it's your web, and everything that entails (like your own SSO?)
  • Auth baked in
  • Runs on the free heroku offer

Picture!

Pretty!

Setup

  1. Clone this repo locally: git clone https://github.com/kastner/droppy.git
  2. Make a new dropbox user (Optional, but a whole lot safer)
  3. Start an app in dropbox
    1. Create a new app here: dropbox.com/developers/apply
    2. Click "Create an App"
    3. Pick a unique app name (doesn't matter what it is)
    4. important pick "Full Dropbox" for Access Level
    5. Copy the KEY and SECRET
  4. Share one of your dropbox folders with this new user (It's a good idea to create a new one - by default, the app will use a folder named droppy)
  5. Run this app (see Install below)

Install

Locally

  1. gem install bundler
  2. gem install foreman
  3. bundle install
  4. create .env put these lines in:
    1. DROPBOX_KEY=key_from_before
    2. DROPBOX_SECRET=secret_from_before
  5. foreman start
  6. open http://localhost:5000 in the same browser you used to sign up the new dropbox account
  7. It will take you to dropbox, authorize the app. You will be redirected back and it will tell you the new DROPBOX_TOKEN
  8. put DROPBOX_TOKEN=that_token in your .env file
  9. restart foreman, and enjoy

On Heroku

  1. gem install heroku
  2. heroku create --stack cedar <whatever name you want>
  3. git push heroku master
  4. heroku config:add DROPBOX_KEY=app_key
  5. heroku config:add DROPBOX_SECRET=app_secret
  6. alternate method if you have it working locally, you can just do heroku config:add $(cat .env)
  7. heroku open
  8. It will take you to dropbox, authorize the app. You will be redirected back and it will tell you the new DROPBOX_TOKEN
  9. heroku config add DROPBOX_TOKEN=that_token

Adding Auth

Droppy supports HTTP Basic auth. To add it, just add the following two environment variables (to .env or heroku config:add):

AUTH_USERNAME=user
AUTH_PASSWORD=pass

Sending Email

So you want to alert someone when a new file is there?

Add these to the environment settings (either .env, or heroku config:add):

  • EMAIL_NOTIFY_LIST email address to send "to"
  • GMAIL_USER Gmail username (with @gmail.com, or whathaveyou)
  • GMAIL_PASS Gmail password
  • DROPPY_URL Web address for the email to link to

If you're doing this on Heroku, you then need to scale up the clock process:

heroku scale clock=1

It will warn you about billing your account. I'm not sure how much it will bill yet.

Debugging

if you need to use irb:

open('.env').read.each_line {|l| m=l.scan(/(.*)=(.*)/); ENV[m[0][0]]=m[0][1] }
Something went wrong with that request. Please try again.