
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
capistrano-env_config
Advanced tools
A tool for managing your environment variables across your cluster. The library
manipulates the system-wide environment variables by modifying the
/etc/environment
file.
cap env:list
– To list current environment configurationcap env:get[VARIABLE_NAME, VARIABLE_NAME, ...]
– To get the value of a list of variablescap env:unset[VARIABLE_NAME, VARIABLE_NAME, ...]
– To delete environment variablescap env:set[VARIABLE_NAME=VALUE, VARIABLE_NAME=VALUE, ...]
– To set environment variablescap env:sync
– To synchronise the environment configuration across serversIf you need to programatically manipulate the environment you can use the
Capistrano::EnvConfig::Environment
class like so:
require 'capistrano/env_config/environment'
environment = Capistrano::EnvConfig::Environment.new # Reads and loads /etc/environment from all servers
environment.list # Returns a hash of all environment variables
environment.get( 'VARIABLE' ) # Gets a variable by name
environment.set( 'VARIABLE', 'VALUE' ) # Sets a variable
environment.delete( 'VARIABLE' ) # Deletes a variable
environment.sync # Uploads current confifuration to all servers
By default capistrano sets and reads the /etc/environment
of all roles. This
behaviour can be changed by setting:
set :env_config_roles, [ :web, :app ]
The new
and sync
methods also accept an optional argument for specifying
roles explicitly (overriding the value set in :env_config_roles
):
environment.list( :app )
environment.sync( [ :web, :app ] )
Add the gem to your Gemfile
:
group :development do
gem 'capistrano-env_config'
end
And the following line to your Capfile
:
require 'capistrano/env_config'
In your server provisioning script, make sure the deploy user has write access
to the /etc/environment
file, which is used to store the configured variables.
The simplest way to do that would be to:
chown :deploy /etc/environment
chmod g+w /etc/environment
Copyright Itay Grudev (c) 2017.
This gem and all associated documentation is distributed under the terms of the GNU GPL v3 license.
FAQs
Unknown package
We found that capistrano-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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.