Skip to content

Commit

Permalink
added ability to deploy to AWS with an empty server JWT
Browse files Browse the repository at this point in the history
  • Loading branch information
dejwakh committed Aug 2, 2021
1 parent de6468f commit 0562b3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions FjordSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Fjord App",
"server": {
"NAME": "Fjord-Server",
"JWT_KEY": "jqq247gjrhvariorrbgehtcwz5k0x0slmmxndnde",
"JWT_KEY": "",
"API_TOPICS": "stocks weather",
"SEC_PER_PULSE": "30"
},
Expand All @@ -18,7 +18,7 @@
"KAFKA_PASSWORD": "123",
"MEMBERS_COUNT": "1",
"CONCURRENT_PARTITIONS": "1",
"STARTING_DELAY_SEC": "60"
"STARTING_DELAY_SEC": "0"
}
]
}
6 changes: 3 additions & 3 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ function getSettings() {
try {
if (!s.server || typeof s.server !== 'object') throw new Error('Fjord settings -- missing server param')
if (!s.server.NAME) s.server.NAME = 'Server'
if (!s.server.JWT_KEY || typeof s.server.JWT_KEY !== 'string' || s.server.JWT_KEY.length < 20) throw new Error('Fjord settings -- missing or incorrect server JWT_KEY (must be string of at least 20 chars)')
if (!s.server.hasOwnProperty('JWT_KEY') || typeof s.server.JWT_KEY !== 'string') throw new Error('Fjord settings -- missing or incorrect server JWT_KEY (must be string)')
if (!s.server.SEC_PER_PULSE) s.server.SEC_PER_PULSE = '30'
console.log('2. Server params successfully loaded for ' + s.server.NAME);
console.log(' 2.1 Server API topics:' + s.server.API_TOPICS)

console.log(' 2.1 Server API topics: ' + s.server.API_TOPICS)
console.log(' 2.2 Server JWT_KEY: ' + (s.server.JWT_KEY.length > 0 ? s.server.JWT_KEY : '(none)'))
if (!s.consumerGroups || !Array.isArray(s.consumerGroups)) throw new Error('Fjord settings -- missing or incorrect consumerGroups param (must be an array)')
if (!s.consumerGroups.length) throw new Error('Fjord settings -- consumerGroups must contain at least one consumer group')
s.consumerGroups.forEach((c, idx) => {
Expand Down

0 comments on commit 0562b3d

Please sign in to comment.