resque-web

a Rails-based web interface to Resque

  • 所有者: resque/resque-web
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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 RAILS_RESQUE_REDIS is set in ENV and is not the empty string, this gem will set Resque.redis equal to ENV['RAILS_RESQUE_REDIS'] in an initializer.

If you need to set a password for your redis server, use this env variable.

RAILS_RESQUE_REDIS_PASSWORD=secure_pass

For info on configuring Resque itself (and accepted values of Resque.redis) see the Configuration section of the Resque README.

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.

Existing plugins

Screenshot

Screenshot

Developing

We use Appraisal to test gem across multiple rails version.

To run tests locally you need to install generic dependencies and dependencies for each appraisal version by running:

bundle install
appraisal install

And then you can use following command for testing lib with latest rails version 5.0:

appraisal rails50 rake test

If you want to run tests for all rails version like Travis do check out this library: (WWTD)[https://github.com/grosser/wwtd].

主要指标

概览
名称与所有者resque/resque-web
主编程语言Ruby
编程语言Ruby (语言数: 6)
平台
许可证
所有者活动
创建于2013-03-15 16:58:14
推送于2023-11-28 14:29:46
最后一次提交2020-08-27 12:30:05
发布数12
最新版本名称v0.0.12 (发布于 2017-09-27 10:12:45)
第一版名称v0.0.1 (发布于 2013-08-27 16:16:46)
用户参与
星数238
关注者数15
派生数167
提交数338
已启用问题?
问题数76
打开的问题数30
拉请求数59
打开的拉请求数14
关闭的拉请求数23
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?