Giter Site home page Giter Site logo

resque-web's Introduction

resque-web

Gem Version Build Status Dependency Status Code Climate Coverage Status

A Rails-based frontend to the Resque job queue system. This provides a similar interface to the existing Sinatra application that comes bundled with Resque, but deploys like a Rails application and leverages Rails conventions for factoring things like controllers, helpers, and views.

NOTICE

Note this is NOT the old sinatra interface that comes with Resque 1-x. This is a new project based on rails. If you have any issues with old web server, please file an issue on the resque project. Note that the sinatra web interface will be gone in Resque 2.0 and this is meant to be the replacement.

More documentation coming soon!

Starting

Resque web is built as a rails engine.

Add it to your gemfile.

gem 'resque-web', require: 'resque_web'

Mount it in your config/routes.rb.

require "resque_web"

MyApp::Application.routes.draw do
  mount ResqueWeb::Engine => "/resque_web"
end

If you need a non-default resque server, use this environment variable.

RAILS_RESQUE_REDIS=123.x.0.456:6712

Security

You almost certainly want to limit access when using resque-web in production. Using routes constraints is one way to achieve this:

# config/routes.rb

resque_web_constraint = lambda { |request| request.remote_ip == '127.0.0.1' }
constraints resque_web_constraint do
  mount ResqueWeb::Engine => "/resque_web"
end

Another example of a route constraint using the current user when using Devise or another warden based authentication system:

# config/routes.rb
resque_web_constraint = lambda do |request|
  current_user = request.env['warden'].user
  current_user.present? && current_user.respond_to?(:is_admin?) && current_user.is_admin?
end

constraints resque_web_constraint do
  mount ResqueWeb::Engine => "/resque_web"
end

HTTP Basic Authentication

HTTP Basic Authentication is supported out of the box. Simply set the environment variables RESQUE_WEB_HTTP_BASIC_AUTH_USER and RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD to turn it on. If you're using Resque with Heroku run heroku config:set RESQUE_WEB_HTTP_BASIC_AUTH_USER=user RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD=secret to get ResqueWeb secured.

Plugins

In the past with the sinatra app it was fairly simple to just monkey-patch the server to add more functionality/tabs. With this rails version you have to write an engine under a specific namespace. Read more in PLUGINS.md.

Screenshot

Screenshot

resque-web's People

Contributors

tarcieri avatar mcfiredrill avatar marciotrindade avatar dwilkie avatar avnercohen avatar grk avatar nickmerwin avatar steveklabnik avatar gabceb avatar begriffs avatar kpshek avatar martynovs avatar blom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.