Check whether HTTP Basic authentication is enabled or not. if basic authenticaiton is enabled, show github ribbon on your page.
All you have to do is to include the Gem
gem "basic_auth_mark"In config/environments/#{environment}.rb
Rails.application.configure do
# change ribbon position(default:right-top)
config.basic_auth_mark.position = 'left-bottom' # left-top/right-top/left-bottom/right-bottom
# change color(default: 880000)
config.basic_auth_mark.color = '0000aa'
# change markable ip addresses(default: all ip addresses)
config.basic_auth_mark.markable_ip_addresses = ['127.0.0.1']
endBug reports and pull requests are welcome on GitHub at https://github.com/g-ozawa/basic_auth_mark. 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.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the BasicAuthMark project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
- rack-dev-mark got a lot of inspiration from this gem
- github-fork-ribbon-css for github-ribbon-css
Copyright © 2019 Kazuki Ozawa.