mirror of
https://github.com/yldio/copilot.git
synced 2024-11-10 21:30:06 +02:00
enable triton credentials from credentials.json
credentials can be set not only using ENV variables, but also with credentials.json (if it is found)
This commit is contained in:
parent
07351dde85
commit
8e832f9f03
@ -1,10 +1,4 @@
|
||||
const credentials = {
|
||||
url: process.env.SDC_URL,
|
||||
account: process.env.SDC_ACCOUNT,
|
||||
user: process.env.SDC_USER || '',
|
||||
keyId: process.env.SDC_KEY_ID,
|
||||
};
|
||||
|
||||
const credentials = require('../credentials');
|
||||
const auth = require('smartdc-auth');
|
||||
const cloudapi = require('triton/lib/cloudapi2');
|
||||
const bunyan = require('bunyan');
|
||||
|
14
cloudapi-graphql/src/credentials.js
Normal file
14
cloudapi-graphql/src/credentials.js
Normal file
@ -0,0 +1,14 @@
|
||||
const json = (() => {
|
||||
try {
|
||||
return require('../credentials.json');
|
||||
} catch (err) {
|
||||
return {};
|
||||
}
|
||||
})();
|
||||
|
||||
module.exports = {
|
||||
url: process.env.SDC_URL || json.url || '',
|
||||
account: process.env.SDC_ACCOUNT || json.account || '',
|
||||
user: process.env.SDC_USER || json.user || '',
|
||||
keyId: process.env.SDC_KEY_ID || json.keyId || ''
|
||||
};
|
Loading…
Reference in New Issue
Block a user