Skip to content

Commit

Permalink
github app details as env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Feb 24, 2016
1 parent 7a12f92 commit 41ea348
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .pm2.json
Expand Up @@ -5,7 +5,9 @@
"watch" : "dist/server/",
"env": {
"NODE_ENV": "production",
"SILEX_DEBUG": true
"SILEX_DEBUG": true,
"GITHUB_CLIENT_ID": "a173a2e4af98211d94c9",
"GITHUB_CLIENT_SECRET": "1fce6f8127611c44bafaa19c3843d890cbd479df"
}
}]
}
13 changes: 9 additions & 4 deletions dist/server/server.js
Expand Up @@ -95,7 +95,7 @@ else {
}

// ********************************
// config
// unifile server
// ********************************

// change www root
Expand All @@ -119,15 +119,20 @@ silexConfig.staticFolders.push(
}
);

// ********************************
// unifile server
// ********************************
// open pages if defined
if(silexConfig.openPages) {
silexConfig.openPages.ROOT = pathModule.resolve(__dirname, '../../open-pages/');
silexConfig.openPages.SQLLITE_FILE = pathModule.resolve(__dirname, '../../open-pages/websites.sql');
fs.mkdir(silexConfig.openPages.ROOT, null, function (error) {});
}

// github service
if(process.env.GITHUB_CLIENT_ID && process.env.GITHUB_CLIENT_SECRET) {
console.log(process.env.GITHUB_CLIENT_ID);
silexConfig.github.client_id = process.env.GITHUB_CLIENT_ID;
silexConfig.github.client_secret = process.env.GITHUB_CLIENT_SECRET;
}

// SSL certificate
try {
var privateKey = fs.readFileSync(process.env.SILEX_SSL_PRIVATE_KEY || __dirname + '/../../privatekey.pem').toString();
Expand Down

0 comments on commit 41ea348

Please sign in to comment.