{"id":15288819,"url":"https://github.com/interdiscipline/lockup","last_synced_at":"2025-09-10T14:44:24.382Z","repository":{"id":41487470,"uuid":"9846374","full_name":"interdiscipline/lockup","owner":"interdiscipline","description":"Lockup Gem","archived":false,"fork":false,"pushed_at":"2024-08-31T00:34:42.000Z","size":178,"stargazers_count":119,"open_issues_count":12,"forks_count":37,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-26T23:09:16.162Z","etag":null,"topics":["codeword","gem","ruby-on-rails","secret","staging-server"],"latest_commit_sha":null,"homepage":"https://lockup.interdiscipline.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interdiscipline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-03T23:04:05.000Z","updated_at":"2024-11-07T08:52:31.000Z","dependencies_parsed_at":"2022-09-13T17:51:26.010Z","dependency_job_id":"4ff87e41-100f-4500-919e-4b0f5fdc34c0","html_url":"https://github.com/interdiscipline/lockup","commit_stats":{"total_commits":201,"total_committers":19,"mean_commits":"10.578947368421053","dds":0.736318407960199,"last_synced_commit":"72624656305e9c5f37aabd713ea8dfdab372f3d6"},"previous_names":["gblakeman/lockup"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interdiscipline%2Flockup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interdiscipline%2Flockup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interdiscipline%2Flockup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interdiscipline%2Flockup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interdiscipline","download_url":"https://codeload.github.com/interdiscipline/lockup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675440,"owners_count":21143763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeword","gem","ruby-on-rails","secret","staging-server"],"created_at":"2024-09-30T15:53:18.513Z","updated_at":"2025-04-13T06:42:10.185Z","avatar_url":"https://github.com/interdiscipline.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"\u003cimg src=\"http://lockup.interdiscipline.com/github_host/lockup_mark.png\" width=\"100\" height=\"134\" alt=\"Lockup Shield\" /\u003e\n\n# Lockup\n\n[![Gem Version](https://badge.fury.io/rb/lockup.svg)](http://badge.fury.io/rb/lockup) [![Build Status](https://travis-ci.com/gblakeman/lockup.svg?branch=master)](https://travis-ci.com/github/gblakeman/lockup)\n\nA simple gem to more elegantly place a staging server or other in-progress rails application behind a basic codeword. It’s easy to implement, share with clients/collaborators, and more beautiful than the typical password-protection sheet.\n\n_“Can I come into your fort?”_\n\n_“…what’s the codeword?”_\n\n(currently used in production with Rails 3.X, Rails 4.X, Rails 5.X, and Rails 6.X)\n\n[Demos and more information.](http://lockup.interdiscipline.com)\n\n## Installation\n\n1. Add this line to your application’s Gemfile:\n\n```ruby\ngem 'lockup'\n```\n\n2. Define a codeword (see Usage below).\n\n3. Mount the engine in your application’s routes file (usually first, for best results):\n\n```ruby\nmount Lockup::Engine, at: '/lockup'\n```\n\n## Usage\n\nTo set a codeword, define LOCKUP_CODEWORD in your environments/your_environment.rb file like so:\n\n```ruby\nENV['LOCKUP_CODEWORD'] = 'secret'\n```\n\nIf you think you might need a hint:\n\n```ruby\nENV['LOCKUP_HINT'] = 'Something that you do not tell everyone.'\n```\n\nIf you’re using Rails \u003e= 4.1 or Rails \u003e= 5.2, you can add your Lockup Codeword via Rails Secrets or Rails Credentials functionality in your `secrets.yml` or `credentials.yml.enc` file, respectively:\n\n```yml\nlockup_codeword: 'love'\nlockup_hint: 'Pepé Le Pew'\n```\n\nAlternately, Rails Credentials in \u003e= 5.2 may be organized under the `lockup` namespace:\n\n```yml\nlockup:\n  codeword: 'love'\n  hint: 'Pepé Le Pew'\n```\n\nIf you’re using [Figaro](https://github.com/laserlemon/figaro), set your Lockup codeword and hint (optional) in your application.yml file:\n\n```yml\nlockup_codeword: 'love'\nlockup_hint: 'Pepé Le Pew'\n```\n\n**Codewords are not case-sensitive, by design. Keep it simple.**\n\n## Advanced Usage\n\n### Use Lockup around a specific controller:\n\n1. Follow the installation instructions above.\n\n2. In your application_controller.rb file, add:\n\n```ruby\nskip_before_action :check_for_lockup, raise: false\n```\n\n4. In the controller(s) you would like to restrict:\n\n```ruby\nbefore_action :check_for_lockup\n```\n\n### Link it with no typing:\n\n    http://somedomain.com/or_path/?lockup_codeword=love\n\nThe visitor is redirected and the cookie is set without them ever seeing the Lockup splash page.\n\n(Lockup also makes a rudimentary attempt based on user agent to **block major search engine bots/crawlers** from following this link and indexing the site, just in case it ever gets out into the wild.)\n\n### Set a custom lifetime for cookie\n\nThe cookie set by Lockup defaults to 5 years. If you want to set a shorter amount of time, you can specify a number of weeks:\n\n```ruby\nENV['COOKIE_LIFETIME_IN_WEEKS'] = 4\n\ncookie_lifetime_in_weeks: 4\n```\n\n### Design Customization\n\nIf you would like to change the content or design of the lockup page, you can create the directories `app/views/layouts/lockup` and `app/views/lockup/lockup` and populate them with the default content from [here](https://github.com/gblakeman/lockup/tree/master/app/views), and then customize as desired.\n\n## Contribute\n\nPull requests are quite welcome.\n\n## Project Site (with Demo)\n\n[lockup.interdiscipline.com](https://lockup.interdiscipline.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterdiscipline%2Flockup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterdiscipline%2Flockup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterdiscipline%2Flockup/lists"}