diff --git a/package-lock.json b/package-lock.json index 0d8b2067..7830d81a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9617,6 +9617,11 @@ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + }, "ip-regex": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.3.tgz", diff --git a/package.json b/package.json index d79c6f51..36a5a661 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,7 @@ "humanize": "0.0.9", "identicon.js": "^2.3.1", "install": "^0.10.2", + "ip": "^1.1.5", "it-optional": "^0.1.0", "jdbc": "^0.6.0", "jsdom": "^11.3.0", diff --git a/src/bootup/init/start_server.js b/src/bootup/init/start_server.js index 13c8ebfd..3e673d2e 100644 --- a/src/bootup/init/start_server.js +++ b/src/bootup/init/start_server.js @@ -24,7 +24,8 @@ const startServer = function (app, server, callback) server.listen(app.get("port"), function () { - Logger.log_boot_message("Dendro server listening on port " + app.get("port")); + var ip = require("ip"); + Logger.log_boot_message("Dendro server listening on " + ip.address() + ":" + app.get("port")); callback(null); }); }; diff --git a/src/kb/storage/storageB2Drop.js b/src/kb/storage/storageB2Drop.js index be490f8a..596964fd 100644 --- a/src/kb/storage/storageB2Drop.js +++ b/src/kb/storage/storageB2Drop.js @@ -37,7 +37,17 @@ class StorageB2Drop extends Storage _getB2DropPath (file) { const self = this; - return self.prefix + file.ddr.humanReadableURI; + if (typeof file === "string") + { + return self.prefix + file; + } + else if (file instanceof Object && !isNull(file.ddr)) + { + return self.prefix + file.ddr.humanReadableURI; + } + + Logger.log("error", "Unable to determine the B2drop path uri of resource " + self.uri); + return null; } open (callback)