{"id":19186814,"url":"https://github.com/notus-sh/rack-address_munging","last_synced_at":"2025-05-08T01:25:10.436Z","repository":{"id":30476915,"uuid":"124899583","full_name":"notus-sh/rack-address_munging","owner":"notus-sh","description":"Rack middleware for automatic address munging","archived":false,"fork":false,"pushed_at":"2025-03-10T22:27:12.000Z","size":63,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T02:04:23.308Z","etag":null,"topics":["middleware","rack","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notus-sh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"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},"funding":{"open_collective":"notus-sh"}},"created_at":"2018-03-12T14:13:32.000Z","updated_at":"2025-02-20T20:55:59.000Z","dependencies_parsed_at":"2025-01-06T22:29:49.001Z","dependency_job_id":"fbabeb2f-9807-4307-90dc-6411ce9165fd","html_url":"https://github.com/notus-sh/rack-address_munging","commit_stats":{"total_commits":51,"total_committers":3,"mean_commits":17.0,"dds":"0.23529411764705888","last_synced_commit":"4b93e6209f2a3a60dae28171f456ce834183f67e"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Frack-address_munging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Frack-address_munging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Frack-address_munging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notus-sh%2Frack-address_munging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notus-sh","download_url":"https://codeload.github.com/notus-sh/rack-address_munging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252980050,"owners_count":21835160,"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":["middleware","rack","ruby"],"created_at":"2024-11-09T11:16:49.184Z","updated_at":"2025-05-08T01:25:10.411Z","avatar_url":"https://github.com/notus-sh.png","language":"Ruby","funding_links":["https://opencollective.com/notus-sh"],"categories":[],"sub_categories":[],"readme":"# Rack::AddressMunging\n\n[![Unit tests](https://github.com/notus-sh/rack-address_munging/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/notus-sh/rack-address_munging/actions/workflows/unit-tests.yml)\n[![Gem Version](https://badge.fury.io/rb/rack-address_munging.svg)](https://badge.fury.io/rb/rack-address_munging)\n\n`Rack::AddressMunging` is a Rack middleware for automatic [e-mail addresses munging](https://en.wikipedia.org/wiki/Address_munging).\n\nOnce added to your middleware stack, `Rack::AddressMunging` will parse the body of any HTML response and mung it to obfuscate email addresses, in hope to prevent spambots to collect them too easily.\n\n## Installation\n\n`Rack::AddressMunging` is distributed as a gem and available on [rubygems.org](https://rubygems.org/gems/rack-address_munging) so you can add it to your `Gemfile` or install it manually with:\n\n```ruby\ngem install rack-address_munging\n```\n\n## Usage\n\nTo use the middleware with it's default configuration, just drop it in your middleware stack:\n\n```ruby\n# In config.ru or wherever your stack is defined\nrequire 'rack/address_munging'\n\nuse Rack::AddressMunging\n```\n\nIf you want to use another munging strategy, precise it as an argument:\n\n```ruby\n# In a Rails initializer\nrequire 'rack/address_munging'\n\nmodule YourRailsAppName\n  class Application\n    config.middleware.use Rack::AddressMunging, strategy: :hex\n  end\nend\n```\n\n## Supported Strategies\n\n### `:Hex`\n\nReplace email addresses and mailto href attributes values with an hexadecimal entities alternative.\n\n    Input:  email@example.com\n    Output: \u0026#101;\u0026#109;\u0026#97;\u0026#105;\u0026#108;\u0026#64;\u0026#101;\u0026#120;\u0026#97;\u0026#109;\u0026#112;\u0026#108;\u0026#101;\u0026#46;\u0026#99;\u0026#111;\u0026#109;\n\n`:Hex` is the default strategy.\n\n### `:Rot13JS`\n\nReplace email addresses and full mailto links with a `\u003cscript\u003e` tag that will print it back into the page, based on a [ROT13](https://en.wikipedia.org/wiki/ROT13) version.\n\n    Input:  email@example.com\n    Output: \u003cscript type=\"text/javascript\"\u003edocument.write(\"rznvy(at)rknzcyr.pbz\".replace(/(at)/, '@').replace(/[a-z]/gi,function(c){return String.fromCharCode((c\u003c=\"Z\"?90:122)\u003e=(c=c.charCodeAt(0)+13)?c:c-26);});))\u003c/script\u003e\n\nFor more informations about the exact behavior of each strategy, please refer to the [strategies specs data](https://github.com/notus-sh/rack-address_munging/blob/master/spec/data/strategy.yml).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at \u003chttps://github.com/notus-sh/rack-address_munging\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotus-sh%2Frack-address_munging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotus-sh%2Frack-address_munging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotus-sh%2Frack-address_munging/lists"}