Skip to content

Commit

Permalink
Added IP calculation and display on dendro server bootup
Browse files Browse the repository at this point in the history
Added condition for calculating the b2drop address
  • Loading branch information
silvae86 committed Jan 23, 2018
1 parent 08a8361 commit ae56ece
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/bootup/init/start_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};
Expand Down
12 changes: 11 additions & 1 deletion src/kb/storage/storageB2Drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae56ece

Please sign in to comment.