
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
A command-line tool for populating environment variables.
gem install populate-env
Heroku apps can describe which environment variables they need via an app.json manifest:
{
"env": {
"BRAND_COLOUR": "smaragdine",
"AMAZING_WEB_SERVICES_TOKEN": {
"description": "A required token for interacting with Amazing Web Services."
},
"WEB_CONCURRENCY": {
"description": "The number of processes to run.",
"value": "5"
},
"LEATHER_SEATS": {
"description": "Optional flag to enable leather seats.",
"required": false
},
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
"generator": "secret"
}
},
"environments": {
"test": {
"AMAZING_WEB_SERVICES_TOKEN": "mock"
}
}
}
Given this file, running the following command will generate a .env
file:
$ populate-env heroku
BRAND_COLOUR: "smaragdine"
=> using default from app.json
AMAZING_WEB_SERVICES_TOKEN: "token-from-heroku-app"
=> using value from detected Heroku remote "dev"
WEB_CONCURRENCY: "5"
=> using default from app.json
LEATHER_SEATS: (skipped)
=> no value available
SECRET_TOKEN: "1d8505..."
=> generated secret (32 chars)
WEB_CONCURRENCY: "5"
=> using default from app.json
The resulting .env
file looks like this:
BRAND_COLOUR=smaragdine
# A required token for interacting with Amazing Web Services.
AMAZING_WEB_SERVICES_TOKEN=token-from-heroku-app
# The number of processes to run.
WEB_CONCURRENCY=5
# Optional flag to enable leather seats.
# LEATHER_SEATS=
# A secret key for verifying the integrity of signed cookies.
SECRET_TOKEN=1d8505fa8172fae3b17f5e57568406b8
Any required environment variable not currently in your ENV will be populated by trying each of the following:
app.json
generator: secret
)The command above is equivalent to the following options:
populate-env heroku \
--manifest app.json \
--manifest-environment production \
--destination .env \
--skip-local-env \
--heroku-config \
--generate-secrets \
--prompt-missing
If your project has a git remote with heroku.com
in the URL, populate-env
will detect it and use it to retrieve remote configuration. If you don't want
this behaviour, you can skip it with:
populate-env heroku --no-heroku-config
If you have multiple Heroku remotes or want to specify your Heroku app explicitly, you can use either:
populate-env heroku --heroku-remote staging # or
populate-env heroku --heroku-app spronking-wildebeest-42
For full options, run:
populate-env heroku --help
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To 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 tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/Aupajo/populate-env. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Populate::Env project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that populate-env 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.