Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
--DEPRECATED--DEPRECATED--DEPRECATED--DEPRECATED--DEPRECATED--DEPRECATED-- -- -- -- This project relied on the Aspen stack. Heroku has EoL'd that stack -- -- effective Nov. 26 2012. This project will not be updated to newer -- -- stacks. Left here for historical purposes. -- -- -- -------------------------------------------------------------------------- ============================================================================ = Herofu - a simple file server made for Heroku - github.com/xunker/herofu = ============================================================================ Herofu is a sinatra/rack app that is designed to be an easily deployed static file server for Heroku's zero-provisioning app hosting service. Files are stored in database and are served in expected URL formats like "http://appname.heroku.com/files/file.html". Even though Herofu is designed for Heroku, it is nothing more than a rack- deployed sinatra app and can be used anywhere sinatra can run with database access. ============================== = DEPLOYING HEROFU ON HEROKU = ============================== 1) You'll need a git-clone of the code with a command like: "git clone email@example.com:xunker/herofu.git". That will create a new directory named 'herofu' with some files in it. 2) Go to this new directory and edit herofu.rb. Change the APPNAME, USERNAME and PASSWORD lines. APPNAME will be the subdomain this will live under. 3) Commit those changes: 'git commit -a -m "initial config"'. 4) Get a Heroku account. Get one at http://heroku.com/. 5) Install the Heroku gem installed on the machine you performed the git-clone on: "sudo gem install heroku". 6) Tell Heroku to make you a new app: "heroku create <APPNAME>" where APPNAME is the same as the APPNAME line in herofu.rb. 7) Deploy the app with git "git push heroku master". PROFIT!!) Visit http://APPNAME.heroku.com/admin to see if it worked. ========================================== = USING HEROFU TO UPLOAD AND SERVE FILES = ========================================== Assuming the deployment worked, go to http://APPNAME.heroku.com/admin and log in using the USERNAME and PASSWORD you set in herofu.rb. You should see "0 files stored" as well as a form with a file selection box and a text box. Click the 'browse' button on the file box and choose a file to upload. Optionally, choose the location of this file in herofu with the other text box. Click 'upload' The File should appear in the list below '1 files stored'. Clicking the filename link will take you to the file in question in a new window. This file can now be seen by the world. ============================= = RENAMING AND MOVING FILES = ============================= You can change where the file lives in the herofu app by clicking the 'edit' link next to a file. In the next page, you can change the filename and path with the text box provided. There are no real directories in herofu, so to place a file in a 'subdirectory' prefix the filename with '/dirname/". ================== = DELETING FILES = ================== On the main 'admin' page, click the 'delete' link next to a file. ============= = MORE INFO = ============= For local deployments (e.g. development environment) the mysql driver is used and on heroku deployments ('production') the postgres driver is used. Database tables are created automatically if they do not exist via an ActiveRecord Migration. Files are stored using ActiveRecord's :binary type which is a 'bytea' on postges or a 'BLOB' on mysql. Database configuration lives in config/database.yml should you want to change it. File storage and table creation has been tested with Mysql and Postgres. Home page at http://herofu.heroku.com/. Code at http://github.com/xunker/herofu/ Herofu is (C) 2009 by Matthew Nielsen, firstname.lastname@example.org Herofu is in no way condoned or affiliated with Heroku.com. We just like 'em.