mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 04:26:35 +00:00
Add support to specify secrets in services
**What** - During function creation, accept an array of strings defining swarm secrets that are required for the service - Update docs - Add new guide on using the secrets capability - Add new sample function to highlight using environment variables - Update `ApiKeyProtected` sample function to utilize the new secrets capabilities **Why** - This allows secrets to remain encrypted at rest instead of being unencrypted in environment variables and yaml files. Fixes #285 Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
cc103ada94
commit
0fef825fb4
5
sample-functions/NodeHelloEnv/Dockerfile
Normal file
5
sample-functions/NodeHelloEnv/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM functions/nodebase:alpine-6.9.1
|
||||
|
||||
ENV NODE_ENV=dev
|
||||
|
||||
COPY handler.js .
|
3
sample-functions/NodeHelloEnv/build.sh
Executable file
3
sample-functions/NodeHelloEnv/build.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build --squash -t functions/nodehelloenv .
|
13
sample-functions/NodeHelloEnv/handler.js
Normal file
13
sample-functions/NodeHelloEnv/handler.js
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict"
|
||||
|
||||
let getStdin = require('get-stdin');
|
||||
|
||||
let handle = (req) => {
|
||||
console.log("Hello from a " + process.env.NODE_ENV + " machine")
|
||||
};
|
||||
|
||||
getStdin().then(val => {
|
||||
handle(val);
|
||||
}).catch(e => {
|
||||
console.error(e.stack);
|
||||
});
|
Reference in New Issue
Block a user