Skip to content

Commit

Permalink
support environment-variables for authentication and port configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
am-jo-zt committed Nov 22, 2017
1 parent e509f68 commit b6c8c87
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .env.template
@@ -0,0 +1,4 @@
export USERNAME=
export PASSWORD=
export DOMAIN=
export PORT=
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/.env
/.sass-cache/
/node_modules/
/iisnode/
Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -142,6 +142,14 @@ There are three main directories in the `ui-react/src/` folder:
};
```

* Alternatively, username, password and domain can be set as environment variable

```bash
export USERNAME=svcacct_email@domain.com
export PASSWORD=password
export DOMAIN=domain.com
```

* In `/ui-react/src/config/flightboard.config.js`, manage your customizations:

```javascript
Expand Down
6 changes: 3 additions & 3 deletions config/auth.js
Expand Up @@ -2,10 +2,10 @@
module.exports = {
// this user MUST have full access to all the room accounts
'exchange' : {
'username' : 'SVCACCT_EMAIL@DOMAIN.COM',
'password' : 'PASSWORD',
'username' : process.env.USERNAME || 'SVCACCT_EMAIL@DOMAIN.COM',
'password' : process.env.PASSWORD || 'PASSWORD',
'uri' : 'https://outlook.office365.com/EWS/Exchange.asmx'
},
// Ex: CONTOSO.COM, Contoso.com, Contoso.co.uk, etc.
'domain' : 'DOMAIN.COM'
'domain' : process.env.DOMAIN || 'DOMAIN.COM'
};
2 changes: 1 addition & 1 deletion server.js
Expand Up @@ -14,7 +14,7 @@ require('./app/routes.js')(app);

// launch ======================================================================
//const port = process.env.PORT || 3001;
const port = 8080;
const port = process.env.PORT || 8080;
var theserver = app.listen(port, function(){
// call controller functions -------------------------------------------------
var io = require('socket.io').listen(theserver);
Expand Down

0 comments on commit b6c8c87

Please sign in to comment.