Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
handsomefencer-environment
Advanced tools
Obscure your environment files in source control, expose them for deploys.
Add this line to your application's Gemfile:
gem 'handsomefencer-environment'
And then execute:
$ bundle
Or install it yourself as:
$ gem install handsomefencer-environment
Create a .env directory at the root of your app. In it, place any environment files you'd like to obfuscate in source control:
.env/development.env .env/staging.env .env/production.env
Or you can namespace them like so:
.env/production/database.env
If you aren't using Rails, or don't otherwise already have a config directory, go ahead and create one because we're going to generate a deploy.key to put inside it:
$ mkdir config
Then write a ruby script at the root of your project called obfuscate_env.rb and put code like this inside:
require 'handsomefencer/environment'
cipher = Handsomefencer::Environment::Crypto.new
cipher.obfuscate
Now you should be able to run the script like so:
$ ruby obfuscate_env.rb
You should now have a config/deploy.key file as well as an encoded version of each .env file in your .env directory. For example:
.env/development.env .env/development.env.enc
You may wish to confirm that the deploy key and the .env files have been added to your .gitignore, and also that they are not still cached in your repo.
Next, write a ruby script at the root of your project called expose_env.rb and put code like this inside:
require 'handsomefencer/environment'
cipher = Handsomefencer::Environment::Crypto.new
cipher.expose
Once your code is on the deploy server, you can either create a deploy key with the correct key inside, or set it as a DEPLOY_KEY environment variable. Then you can expose the variables with:
$ ruby expose_env.rb
After checking out the repo, run bundle
to install dependencies. There are some issues with the test_helper loading that I don't understand at the moment, but the tests will run automatically and correctly when saved, after running bundle exec guard
.
Bug reports and pull requests are welcome on GitHub at https://github.com/schadenfred/handsomefencer-environment.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that handsomefencer-environment 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.