This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

sails-hook-docker-secrets

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i sails-hook-docker-secrets

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

5.12 kB

Total Files

4

Last publish

Collaborators

  • pjlamb12