
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
This gem helps out when your application depends on subdomain support and you don't want to modify you /etc/hosts
file all the time for your development
environment.
Gemfile
gem 'local-subdomain'
bundle install
LocalSubdomain
module into your application_controller.rb
(or the controllers that requires subdomain support)class ApplicationController < ActionController::Base
include LocalSubdomain
....
end
NOTE: Do not force the gem only to be included in the development
group. Because of the inclusion of the module LocalSubdomain
, you'll need to have the gem available in every environment.
The gem itself contains guards to only perform changes when the environment is development
, so no worries or check it out yourself:
By default the gem uses the domain lvh.me
with the port used, when running the rails server, but it is also possible to provide a custom redirect domain and port using the following ENV
variables:
ENV | Notes | EXAMPLE |
---|---|---|
SERVER_REDIRECT_PORT | The port number to redirect to | 5000 |
SERVER_REDIRECT_DOMAIN | The domain to redirect to | my.domain.tld |
Basically it does two things:
Rack::Handler
to make sure we bind to 0.0.0.0
instead of localhost
LocalSubdomain
module which executes a before_action
to redirect to http://lvh.me:<port>
(or the configured redirect domain and port)By default, this gem uses the domain http://lvh.me to handle our requests for our subdomain(s). Request to the domain lvh.me
redirects all requests to 127.0.0.1
.
This give's us the ability to browse to http://subsub.lvh.me:3000 and be handle request.subdomain
from our controllers.
Because we're going to use the external domain http://lvh.me which redirects to 127.0.0.1
we have to make our server not to bind to localhost
only.
This module includes a before_action
which will check if the request is served by http://lvh.me. If not it will redirect to the domain.
So when we browse to http://localhost:3000 it will redirect you to http://lvh.me:3000
I've tested the gem with:
FAQs
Unknown package
We found that local-subdomain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.