0.0
No commit activity in last 3 years
No release in over 3 years
Monzenbarai is simple Rack middleware that allows you to easily put your app in maintenance mode
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.16
~> 10.0
>= 0
 Project Readme

Monzenbarai

Monzenbarai is simple Rack middleware that allows you to easily put your app in maintenance mode.

Installation

Add this line to your application's Gemfile:

gem 'monzenbarai'

And then execute:

$ bundle

Or install it yourself as:

$ gem install monzenbarai

Usage

Make config file.

Monzenbarai.configure do |config|
  config.expel = lambda do |env|
    return false if env['PATH_INFO'] == '/allowed'
    true
  end
  
  config.trigger_file = 'path/to/trigger_file'
end

If expel block returns true, Monzenbarai renders maintenance page.
By default, expel always returns only true.

env argument is Rack environment.

Add Monzenbarai middleware

use Monzenbarai # Sinatra
config.middleware.use Monzenbarai # Rails

Start maintenance mode

Execute monzenbarai start path/to/config_file command.
This command makes trigger_file. Monzenbarai keep maintenance mode during trigger_file exists.

End maintenance mode

Execute monzenbarai end path/to/config_file command. This command removes trigger_file.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/takuan-oishii/monzenbarai.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.