Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Simple configuration management with environment variables.
Inspired by how Heroku uses environment variables for configs, EnvConfig is a no-magic gem for defining configs in yaml, and loading them into environment variables.
Install the gem, and initialize the configuation yaml and configuration loader.
gem install env_config
# if using Rails
rake env_config:init
# otherwise
env_config init
First we define the configs we want in a yaml file:
# Each key value pair in this file will be read by EnvConfig and set to an
# environment variable. If an environment variable already exists, then it is
# not overridden by default. See EnvConfig.configure for more options.
# shared variables
common: &common
env_config1: 'config1_value'
env_config2: <%= "you can use erb" %>
# environment specifc variables
development:
<<: *common
env_config1: 'config1_override'
test:
<<: *common
# If your app is deployed on Heroku, then production Heroku values will
# override these settings because existing variables are not overridden by
# default. See also: http://devcenter.heroku.com/articles/config-vars
production:
<<: *common
Then in config/initializers/env_config.rb
EnvConfig.configure do |config|
# yaml to read default config variables
config.config_path = 'config/application.yml'
# Whether to override a variable that's already defined in an environment
# variable. Keep to false if using Heroku.
config.override_env = false
# Namespace config values
# For example, to namespace by platform and rails environment
#
# config.namespace_by = "{RbConfig::CONFIG['host_os']}/#{Rails.env}"
#
# Then in your config/application.yml, you can nest your config by the
# namepaces.
#
# darwin11.0.0:
# development:
# var_name: "mac development specific value"
#
config.namespace_by = Rails.env
# Delimiter to split namespaces by when finding scoped config
config.namespace_delimiter = '/'
end
# This actually sets the variables into ENV
EnvConfig.set!
From here, you can access any of your variables via ENV:
ENV['my_config_name']
FAQs
Unknown package
We found that env_config 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.