From 6c218c33f3a105830c6577391ffddee88cf26f63 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Wed, 11 Nov 2015 15:46:02 +0200 Subject: [PATCH 1/7] Refactor to use Meteor.settings.apiUmbrella --- server/methods/apiBackends.js | 2 +- server/methods/apiUmbrellaAdmins.js | 2 +- server/methods/apiUmbrellaWeb.js | 2 +- server/methods/settings.js | 2 +- server/methods/status.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/methods/apiBackends.js b/server/methods/apiBackends.js index 519ecad5c1..44a1baaea2 100644 --- a/server/methods/apiBackends.js +++ b/server/methods/apiBackends.js @@ -1,7 +1,7 @@ Meteor.methods({ "syncApiBackends":function () { // Check if API Umbrella settings are available - if (Meteor.settings.api_umbrella) { + if (Meteor.settings.apiUmbrella) { // Get API Backends from API Umbrella instance var response = apiUmbrellaWeb.adminApi.v1.apiBackends.getApiBackends(); var apiBackends = response.data.data; diff --git a/server/methods/apiUmbrellaAdmins.js b/server/methods/apiUmbrellaAdmins.js index af939fc1cd..3c5736f0f0 100644 --- a/server/methods/apiUmbrellaAdmins.js +++ b/server/methods/apiUmbrellaAdmins.js @@ -1,6 +1,6 @@ Meteor.methods({ "syncApiUmbrellaAdmins": function () { - if (Meteor.settings.api_umbrella) { + if (Meteor.settings.apiUmbrella) { // Get admin users from API Umbrella instance var response = apiUmbrellaWeb.adminApi.v1.adminUsers.getAdmins(); diff --git a/server/methods/apiUmbrellaWeb.js b/server/methods/apiUmbrellaWeb.js index 53243163f6..e6b3a13c25 100644 --- a/server/methods/apiUmbrellaWeb.js +++ b/server/methods/apiUmbrellaWeb.js @@ -1,6 +1,6 @@ Meteor.methods({ "syncApiUmbrellaUsers": function () { - if (Meteor.settings.api_umbrella) { + if (Meteor.settings.apiUmbrella) { // Get users from API Umbrella instance var response = apiUmbrellaWeb.adminApi.v1.apiUsers.getUsers(); diff --git a/server/methods/settings.js b/server/methods/settings.js index 6c8d2309af..9bedb3cb99 100644 --- a/server/methods/settings.js +++ b/server/methods/settings.js @@ -1,7 +1,7 @@ Meteor.methods({ 'getApiUmbrellaBaseUrl': function () { // Get base url from settings file - var apiUmbrellaBaseUrl = Meteor.settings.api_umbrella.base_url; + var apiUmbrellaBaseUrl = Meteor.settings.apiUmbrella.baseUrl; return apiUmbrellaBaseUrl; } diff --git a/server/methods/status.js b/server/methods/status.js index 28b69b71ee..42296a22e8 100644 --- a/server/methods/status.js +++ b/server/methods/status.js @@ -49,7 +49,7 @@ Meteor.methods({ try{ // initial host for API umbrella - var apiUmbrellaHost = Meteor.settings.api_umbrella.host; + var apiUmbrellaHost = Meteor.settings.apiUmbrella.host; // response object from API Umbrella GET request var apiUmbrellaResponse = Meteor.http.call("GET", apiUmbrellaHost); From 589e055a5bde1707ee0524d7cc11adc7fe9b9373 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Wed, 11 Nov 2015 15:46:23 +0200 Subject: [PATCH 2/7] Configure and initialize the apiUmbrellaWeb object --- server/startup.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/startup.js b/server/startup.js index f6482bdf80..b39a9e8ee1 100644 --- a/server/startup.js +++ b/server/startup.js @@ -1,4 +1,14 @@ Meteor.startup(function () { + // Create config object for API Umbrella Web interface + var config = { + baseUrl: Meteor.settings.apiUmbrella.baseUrl, + apiKey: Meteor.settings.apiUmbrella.apiKey, + authToken: Meteor.settings.apiUmbrella.authToken + }; + + // Create API Umbrella Web object for REST calls + apiUmbrellaWeb = new ApiUmbrellaWeb(config); + // Check if API Umbrella settings are available SyncedCron.add({ name: 'Sync API Umbrella Users and API Backends', From 2053575809ac6ae3424a2b9e1668e8cac00c00dc Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Wed, 11 Nov 2015 15:46:44 +0200 Subject: [PATCH 3/7] Upgrade to brylie:api-umbrella@1.0.0 --- .meteor/versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meteor/versions b/.meteor/versions index ecd1cba6e4..21f0d58f83 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -23,7 +23,7 @@ blaze-tools@1.0.4 boilerplate-generator@1.0.4 bruz:github-api@0.2.4_1 brylie:accounts-admin-ui@0.3.0 -brylie:api-umbrella@0.2.12 +brylie:api-umbrella@1.0.0 brylie:create-role-if-undefined@0.1.0 brylie:first-user-admin@0.1.9 brylie:leaflet-heat@0.1.0 From 4678d555f3755a3426021d1c6e04b9c54b0082ea Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Wed, 11 Nov 2015 15:49:03 +0200 Subject: [PATCH 4/7] Rename properties, remove unused --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 50ab6a57d3..13c613bac7 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,10 @@ Your `settings.json` file should have the following structure: "apinf": { "host": "https://example.com/" }, - "api_umbrella": { - "host": "https://example.com/" - "api_key": "xxx", - "auth_token": "xxx", - "base_url": "https://example.com/api-umbrella/" + "apiUmbrella": { + "apiKey": "xxx", + "authToken": "xxx", + "baseUrl": "https://example.com/api-umbrella/" }, "mail": { "username": "xxx", From 45be6ccd6054cd1d884597cb58948b1fbe7c7ca6 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Wed, 11 Nov 2015 15:56:55 +0200 Subject: [PATCH 5/7] Add host setting --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13c613bac7..80cf46dd02 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ Your `settings.json` file should have the following structure: "apiUmbrella": { "apiKey": "xxx", "authToken": "xxx", - "baseUrl": "https://example.com/api-umbrella/" + "baseUrl": "https://example.com/api-umbrella/", + "host": "https://example.com" }, "mail": { "username": "xxx", From bd3e1e71e213186b4ec77ca937565694939a2269 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Thu, 12 Nov 2015 14:00:33 +0200 Subject: [PATCH 6/7] Added example config.json --- config.json.example | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 config.json.example diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000000..29d5fd485e --- /dev/null +++ b/config.json.example @@ -0,0 +1,22 @@ +{ + "apinf": { + "host": "https://example.com/" + }, + "apiUmbrella": { + "apiKey": "xxx", + "authToken": "xxx", + "baseUrl": "https://example.com/api-umbrella/", + "host": "https://example.com" + }, + "mail": { + "username": "xxx", + "password": "xxx" + }, + "elasticsearch": { + "host": "http://example.com:14002/" + }, + "githubConfiguration": { + "clientId" : "xxx", + "secret" : "xxx" + } +} From 2b3f61d121d55a0b79831cb1471a98273a859702 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Tue, 17 Nov 2015 13:24:00 +0200 Subject: [PATCH 7/7] Update to brylie:api-umbrella 1.0.1 --- .meteor/versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meteor/versions b/.meteor/versions index 21f0d58f83..62befeed9c 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -23,7 +23,7 @@ blaze-tools@1.0.4 boilerplate-generator@1.0.4 bruz:github-api@0.2.4_1 brylie:accounts-admin-ui@0.3.0 -brylie:api-umbrella@1.0.0 +brylie:api-umbrella@1.0.1 brylie:create-role-if-undefined@0.1.0 brylie:first-user-admin@0.1.9 brylie:leaflet-heat@0.1.0