{"id":14969816,"url":"https://github.com/dankimio/codeword","last_synced_at":"2026-02-17T14:01:24.033Z","repository":{"id":59152225,"uuid":"229585641","full_name":"dankimio/codeword","owner":"dankimio","description":"Place a staging server behind a codeword.","archived":false,"fork":false,"pushed_at":"2025-09-25T14:58:05.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T23:44:53.844Z","etag":null,"topics":["rails","ruby","security","staging"],"latest_commit_sha":null,"homepage":"","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/dankimio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-12-22T15:05:11.000Z","updated_at":"2025-09-25T14:58:08.000Z","dependencies_parsed_at":"2024-07-11T01:05:05.173Z","dependency_job_id":"e5ad0149-e723-4f34-98c7-b3582635117c","html_url":"https://github.com/dankimio/codeword","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dankimio/codeword","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankimio%2Fcodeword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankimio%2Fcodeword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankimio%2Fcodeword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankimio%2Fcodeword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankimio","download_url":"https://codeload.github.com/dankimio/codeword/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankimio%2Fcodeword/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29546746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T13:00:00.370Z","status":"ssl_error","status_checked_at":"2026-02-17T12:57:14.072Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["rails","ruby","security","staging"],"created_at":"2024-09-24T13:42:26.404Z","updated_at":"2026-02-17T14:01:24.006Z","avatar_url":"https://github.com/dankimio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codeword\n\nA simple gem to more elegantly place a staging server or other in-progress Ruby on 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![Screenshot](./screenshot.png)\n\n## Installation\n\n1. Add this line to your application’s Gemfile:\n\n```ruby\ngem 'codeword'\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\n# config/routes.rb\nmount Codeword::Engine, at: '/codeword'\n```\n\n4. Include the `Codeword::Authentication` module in your application_controller.rb file and check for codeword:\n\n```ruby\n# app/controllers/application_controller.rb\nclass ApplicationController \u003c ActionController::Base\n  include Codeword::Authentication\n\n  before_action :require_codeword!\nend\n```\n\n5. Skip the check for codeword in the controller(s) you would like to allow:\n\n```ruby\nclass APIController \u003c ApplicationController\n  skip_before_action :require_codeword!\nend\n```\n\n## Usage\n\nTo set a codeword, define CODEWORD in your environments/your_environment.rb file like so:\n\n```ruby\nENV['CODEWORD'] = 'secret'\n```\n\nIf you think you might need a hint:\n\n```ruby\nENV['CODEWORD_HINT'] = 'Something that you do not tell everyone.'\n```\n\nYou can add your codeword via Rails credentials in your `credentials.yml.enc` file (`$ bin/rails credentials:edit`):\n\n```yml\ncodeword:\n  codeword: \"love\"\n  hint: \"Pepé Le Pew\"\n  cookie_lifetime_in_weeks: 4\n```\n\n**Codewords are not case-sensitive, by design. Keep it simple.**\n\n## Advanced Usage\n\n### Use Codeword 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 :require_codeword!, raise: false\n```\n\n4. In the controller(s) you would like to restrict:\n\n```ruby\nbefore_action :require_codeword!\n```\n\n### Link it with no typing:\n\n    http://somedomain.com/or_path/?codeword=love\n\nThe visitor is redirected and the cookie is set without them ever seeing the Codeword splash page.\n\n(Codeword 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 Codeword 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 codeword page, you can create the directories `app/views/layouts/codeword` and `app/views/codeword/codeword` and populate them with the default content from [here](https://github.com/dankimio/codeword/tree/main/app/views), and then customize as desired.\n\n## Development\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Acknowledgements\n\nCodeword is a fork of [lockup](https://github.com/interdiscipline/lockup).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankimio%2Fcodeword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankimio%2Fcodeword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankimio%2Fcodeword/lists"}