Prefix all configuration environment variables
The convention here is to prefix all Kredit related configuration variables with `KREDITS_`
This commit is contained in:
parent
cbbc6c359e
commit
afa67e5ac7
@ -181,23 +181,23 @@ module.exports = async function(robot, kredits) {
|
|||||||
// GitHub signup
|
// GitHub signup
|
||||||
//
|
//
|
||||||
|
|
||||||
if (process.env.GITHUB_KEY && process.env.GITHUB_SECRET) {
|
if (process.env.KREDITS_GITHUB_KEY && process.env.KREDITS_GITHUB_SECRET) {
|
||||||
const grantConfig = {
|
const grantConfig = {
|
||||||
defaults: {
|
defaults: {
|
||||||
protocol: (process.env.GRANT_PROTOCOL || "http"),
|
protocol: (process.env.KREDITS_GRANT_PROTOCOL || "http"),
|
||||||
host: (process.env.GRANT_HOST || 'localhost:8888'),
|
host: (process.env.KREDITS_GRANT_HOST || 'localhost:8888'),
|
||||||
transport: 'session',
|
transport: 'session',
|
||||||
response: 'tokens',
|
response: 'tokens',
|
||||||
path: '/kredits/signup'
|
path: '/kredits/signup'
|
||||||
},
|
},
|
||||||
github: {
|
github: {
|
||||||
key: process.env.GITHUB_KEY,
|
key: process.env.KREDITS_GITHUB_KEY,
|
||||||
secret: process.env.GITHUB_SECRET,
|
secret: process.env.KREDITS_GITHUB_SECRET,
|
||||||
callback: '/kredits/signup/github'
|
callback: '/kredits/signup/github'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
robot.router.use(session({ secret: process.env.SESSION_SECRET || 'grant' }));
|
robot.router.use(session({ secret: process.env.KREDITS_SESSION_SECRET || 'grant' }));
|
||||||
robot.router.use('/kredits/signup', grant(grantConfig));
|
robot.router.use('/kredits/signup', grant(grantConfig));
|
||||||
|
|
||||||
robot.router.get('/kredits/signup/github', async (req, res) => {
|
robot.router.get('/kredits/signup/github', async (req, res) => {
|
||||||
@ -266,6 +266,6 @@ module.exports = async function(robot, kredits) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
robot.logger.warning('[hubot-kredits] No GITHUB_KEY and GITHUB_SECRET configured for OAuth signup');
|
robot.logger.warning('[hubot-kredits] No KREDITS_GITHUB_KEY and KREDITS_GITHUB_SECRET configured for OAuth signup');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user