Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sails-hook-docker-secrets

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-hook-docker-secrets

Sails Hook to load docker secrets as a JSON object and to merge that into the sails.config object

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

sails-hook-docker-secrets

This is a Sails.js hook that loads Docker secrets, using @cloudreach/docker-secrets to load the secrets as a JSON object, and merges them into the sails.config object. It only works for secrets that are meant to add into the sails.config object, just like you would pass in config overrides as runtime variables. The secrets should be named as follows: sails_myAttr or sails_myAttr__mySubAttr.

To test this hook, you need to manually add a test secret to /run/secrets on your host machine:

sudo mkdir /run/
sudo mkdir /run/secrets
sudo vim /run/secrets/sails_testSecret

And in that file, place a single string that will be the value of that configuration key. The filename becomes the key, the contents of the file become the value.

If the file's name has a double underscore, that designates that the content to the right is a subattribute of the preceding section of the filename. So, for the secret stored at /run/secrets/sails_myAttr__mySubAttr, you will end with the following be appended to sails.config:

...
{
    myAttr: {
        mySubAttr: 'The value goes here'
    }
},
...

Any of the values that are read in here will overwrite anything else that was previously set on the sails.config object.

Don't worry if there are no secrets on your machine; the hook will still run but nothing will be merged into the sails.config object.

Keywords

FAQs

Package last updated on 16 Mar 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc