Skip to content

Commit eba1d3d

Browse files
authored
Merge pull request #482 from pryv/release/1.8.1-open
Release/1.8.1 open
2 parents 3b5fe8c + 7867db6 commit eba1d3d

File tree

29 files changed

+83
-78
lines changed

29 files changed

+83
-78
lines changed

components/api-server/bin/migrate

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Binary for launching the db migration process.
44

55
const { getApplication } = require('api-server/src/application');
6-
const bluebird = require('bluebird');
76
const { getLogger, getConfig } = require('@pryv/boiler');
87
let logger;
98

@@ -40,9 +39,9 @@ let logger;
4039
logger.error(e, e);
4140
process.exit(1);
4241
});
43-
})()
42+
})();
4443

45-
async function connectAndMigrate(app) {
44+
async function connectAndMigrate (app) {
4645
logger.info('Connecting to storage...');
4746
await app.storageLayer.waitForConnection();
4847

components/api-server/bin/nightly

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
// Binary for nightly tasks setup.
3+
// Binary for nightly tasks setup.
44

55
const { getApplication } = require('api-server/src/application');
66
const { getLogger } = require('@pryv/boiler');
@@ -10,7 +10,7 @@ const { getUsersRepository } = require('business/src/users/repository');
1010
(async () => {
1111
// Load settings asynchronously because we have to fetch
1212
// some values from register via an http-get request.
13-
13+
1414
// Construct application
1515
const app = getApplication();
1616
await app.initiate();
@@ -20,15 +20,13 @@ const { getUsersRepository } = require('business/src/users/repository');
2020
const storage = require('../../storage');
2121
const storageLayer = app.storageLayer;
2222
const storageSize = new storage.Size(
23-
[ storageLayer.accesses,
24-
storageLayer.followedSlices,
25-
storageLayer.profile ],
26-
[ storageLayer.eventFiles ]
23+
[storageLayer.accesses, storageLayer.followedSlices, storageLayer.profile],
24+
[storageLayer.eventFiles]
2725
);
2826

29-
// This bit is useful to trace down promise rejections that aren't caught.
27+
// This bit is useful to trace down promise rejections that aren't caught.
3028
process.on('unhandledRejection', (reason, promise) => {
31-
logger.warn('Unhandled promise rejection:', promise, 'reason:', reason.stack || reason);
29+
logger.warn('Unhandled promise rejection:', promise, 'reason:', reason.stack || reason);
3230
});
3331
process.on('exit', function () {
3432
logger.info('Service stopped.');
@@ -52,11 +50,11 @@ const { getUsersRepository } = require('business/src/users/repository');
5250
/**
5351
* Standalone script to perform nightly tasks (such as updating storage sizes for all users).
5452
*/
55-
async function runNightlyTasks(storageLayer, storageSize) {
53+
async function runNightlyTasks (storageLayer, storageSize) {
5654
logger.info('Starting update of storage size');
5755

5856
// Retrieve all existing users
59-
const usersRepository = await getUsersRepository();
57+
const usersRepository = await getUsersRepository();
6058
const users = await usersRepository.getAll();
6159

6260
// Compute storage size used by each user
@@ -68,6 +66,6 @@ async function runNightlyTasks(storageLayer, storageSize) {
6866
user.username + '" ' + '(' + user.id + '): ' + err);
6967
}
7068
}
71-
69+
7270
logger.info(users.length + ' users updated.');
7371
}

components/api-server/bin/server

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
#!/usr/bin/env node
22

3-
// Binary for launching the api-server process.
3+
// Binary for launching the api-server process.
44

55
const Server = require('../src/server');
66
const { getApplication } = require('api-server/src/application');
77

88
const loadCommonMeta = require('../src/methods/helpers/setCommonMeta').loadSettings;
99

10-
const { getConfig, getLogger } = require('@pryv/boiler');
10+
const { getLogger } = require('@pryv/boiler');
1111
const logger = getLogger('serverRoot');
1212

1313
(async () => {
14-
const config = await getConfig();
1514
loadCommonMeta({}); // load settings to common meta
16-
15+
1716
// Construct application
1817
const app = getApplication();
1918
await app.initiate();
@@ -27,7 +26,7 @@ const logger = getLogger('serverRoot');
2726
});
2827

2928
// Start the server
30-
const server = new Server();
29+
const server = new Server();
3130
await server.start();
3231
})()
3332
.then(() => logger.info('Startup sequence complete, Server is running. mode: [' + process.env.NODE_ENV + ']'))

components/api-server/config/default-config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ reporting:
1313
http:
1414
ip: '127.0.0.1'
1515
port: 3000
16-
16+
1717

1818
database:
1919
engine: 'mongodb' # set to sqlite for poc sqlite storage for events
2020
authUser: ''
2121
authPassword: ''
22-
host: 'localhost'
22+
host: '127.0.0.1'
2323
port: 27017
2424
name: 'pryv-node'
2525
connectTimeoutMS: 60000
@@ -46,7 +46,7 @@ customExtensions:
4646

4747
axonMessaging:
4848
enabled: false
49-
host: 'localhost'
49+
host: '127.0.0.1'
5050
port: 4000
5151
pubConnectInsteadOfBind: false
5252

components/api-server/config/development-config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ auth:
1616
serviceInfoUrl: file://test/service-info.json
1717
services:
1818
email:
19-
enabled:
19+
enabled:
2020
welcome: false
2121
resetPassword: false
2222
register:
@@ -31,11 +31,11 @@ openSource:
3131
isActive: false
3232
dnsLess:
3333
isActive: true
34-
publicUrl: http://localhost:3000/
34+
publicUrl: http://127.0.0.1:3000/
3535
custom:
3636
systemStreams:
3737
account:
38-
-
38+
-
3939
isIndexed: true
4040
isUnique: true
4141
isShown: true
@@ -45,7 +45,7 @@ custom:
4545
id: email
4646
isRequiredInValidation: true
4747
other:
48-
-
48+
-
4949
isShown: true
5050
isEditable: true
5151
type: my-custom-stream/string
@@ -60,4 +60,4 @@ backwardCompatibility:
6060
prefix:
6161
isActive: false
6262
trace:
63-
enable: true
63+
enable: true

components/api-server/config/production-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ http:
66
database:
77
authUser: api-server
88
authPassword: OVERRIDE ME
9-
host: localhost
9+
host: 127.0.0.1
1010
port: 27017
1111
name: pryv-node
1212
eventFiles:

components/api-server/config/test-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
welcomeTemplate: welcome-email
2222
resetPasswordTemplate: reset-password"
2323
register:
24-
url: http://localhost:5123
24+
url: http://127.0.0.1:5123
2525
key: test-system-key
2626
axonMessaging:
2727
enabled: true
@@ -40,7 +40,7 @@ openSource:
4040
isActive: false
4141
dnsLess:
4242
isActive: false
43-
publicUrl: http://localhost:3000/
43+
publicUrl: http://127.0.0.1:3000/
4444
influxdb:
4545
host: 127.0.0.1
4646
port: 8086

components/api-server/src/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class Application {
213213
require('./routes/auth/register')(this.expressApp, this);
214214
if (this.isOpenSource) {
215215
require('www')(this.expressApp, this);
216-
require('register')(this.expressApp, this);
216+
await require('register')(this.expressApp, this);
217217
}
218218

219219
require('./routes/system')(this.expressApp, this);

components/api-server/src/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Server {
191191
}
192192
const reportingSettings = this.config.get('reporting');
193193
const templateVersion = reportingSettings.templateVersion;
194-
const reportingUrl = process.env.NODE_ENV === 'test' ? 'http://localhost:4001' : null;
194+
const reportingUrl = process.env.NODE_ENV === 'test' ? 'http://127.0.0.1:4001' : null;
195195
const licenseName = reportingSettings.licenseName;
196196
const role = 'api-server';
197197
const mylog = function (str) {

components/api-server/test/methods/helpers/mailing.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Mailing helper methods', () => {
2525
it('[HGVD] should throw an error if mailing method is invalid', () => {
2626
const emailSettings = {
2727
method: 'invalid',
28-
url: 'https://localhost:9000/sendmail',
28+
url: 'https://127.0.0.1:9000/sendmail',
2929
key: 'v3ryStrongK3y'
3030
};
3131

@@ -36,7 +36,7 @@ describe('Mailing helper methods', () => {
3636

3737
it('[OKQ2] should throw an error if mailing method is missing', () => {
3838
const emailSettings = {
39-
url: 'https://localhost:9000/sendmail',
39+
url: 'https://127.0.0.1:9000/sendmail',
4040
key: 'v3ryStrongK3y'
4141
};
4242

@@ -91,7 +91,7 @@ describe('Mailing helper methods', () => {
9191
});
9292

9393
describe('using Microservice', () => {
94-
const baseURL = 'https://localhost:9000/sendmail/';
94+
const baseURL = 'https://127.0.0.1:9000/sendmail/';
9595
const path = '/' + template + '/' + lang;
9696
const emailSettings = {
9797
method: 'microservice',

0 commit comments

Comments
 (0)