diff --git a/lib/historyKeeper.js b/lib/historyKeeper.js index dd80d0b53..03f31383b 100644 --- a/lib/historyKeeper.js +++ b/lib/historyKeeper.js @@ -63,12 +63,12 @@ module.exports.create = function (config, cb) { Log.verbose('HK_ID', 'History keeper ID: ' + Env.id); nThen(function (w) { - require('../storage/file').create(config, w(function (_store) { + require('./storage/file').create(config, w(function (_store) { config.store = _store; Env.store = _store; })); }).nThen(function (w) { - require("../storage/tasks").create(config, w(function (e, tasks) { + require("./storage/tasks").create(config, w(function (e, tasks) { if (e) { throw e; } diff --git a/lib/log.js b/lib/log.js index 7de6badb8..756da8734 100644 --- a/lib/log.js +++ b/lib/log.js @@ -1,5 +1,5 @@ /*jshint esversion: 6 */ -var Store = require("../storage/file"); +var Store = require("./storage/file"); var Logger = module.exports; diff --git a/lib/rpc.js b/lib/rpc.js index eb09ddcd0..b5c142af5 100644 --- a/lib/rpc.js +++ b/lib/rpc.js @@ -14,8 +14,8 @@ const Upload = require("./commands/upload"); var RPC = module.exports; -const Store = require("../storage/file"); -const BlobStore = require("../storage/blob"); +const Store = require("./storage/file"); +const BlobStore = require("./storage/blob"); const UNAUTHENTICATED_CALLS = { GET_FILE_SIZE: Pinning.getFileSize, diff --git a/storage/README.md b/lib/storage/README.md similarity index 100% rename from storage/README.md rename to lib/storage/README.md diff --git a/storage/blob.js b/lib/storage/blob.js similarity index 99% rename from storage/blob.js rename to lib/storage/blob.js index c9396d12a..006f5ca80 100644 --- a/storage/blob.js +++ b/lib/storage/blob.js @@ -6,7 +6,7 @@ var Path = require("path"); var BlobStore = module.exports; var nThen = require("nthen"); var Semaphore = require("saferphore"); -var Util = require("../lib/common-util"); +var Util = require("../common-util"); var isValidSafeKey = function (safeKey) { return typeof(safeKey) === 'string' && !/\//.test(safeKey) && safeKey.length === 44; diff --git a/storage/file.js b/lib/storage/file.js similarity index 99% rename from storage/file.js rename to lib/storage/file.js index 6162f4a8b..6b1577d80 100644 --- a/storage/file.js +++ b/lib/storage/file.js @@ -6,11 +6,11 @@ var Fse = require("fs-extra"); var Path = require("path"); var nThen = require("nthen"); var Semaphore = require("saferphore"); -var Util = require("../lib/common-util"); -var Meta = require("../lib/metadata"); -var Extras = require("../lib/hk-util"); +var Util = require("../common-util"); +var Meta = require("../metadata"); +var Extras = require("../hk-util"); -const Schedule = require("../lib/schedule"); +const Schedule = require("../schedule"); const Readline = require("readline"); const ToPull = require('stream-to-pull-stream'); const Pull = require('pull-stream'); diff --git a/storage/tasks.js b/lib/storage/tasks.js similarity index 100% rename from storage/tasks.js rename to lib/storage/tasks.js diff --git a/scripts/diagnose-archive-conflicts.js b/scripts/diagnose-archive-conflicts.js index 8617150fc..0e75f4abe 100644 --- a/scripts/diagnose-archive-conflicts.js +++ b/scripts/diagnose-archive-conflicts.js @@ -1,6 +1,6 @@ var nThen = require("nthen"); -var Store = require("../storage/file"); +var Store = require("../lib/storage/file"); var config = require("../lib/load-config"); var store; diff --git a/scripts/evict-inactive.js b/scripts/evict-inactive.js index e3419ffad..18730fd1e 100644 --- a/scripts/evict-inactive.js +++ b/scripts/evict-inactive.js @@ -1,7 +1,7 @@ var nThen = require("nthen"); -var Store = require("../storage/file"); -var BlobStore = require("../storage/blob"); +var Store = require("../lib/storage/file"); +var BlobStore = require("../lib/storage/blob"); var Pins = require("../lib/pins"); var config = require("../lib/load-config"); diff --git a/scripts/expire-channels.js b/scripts/expire-channels.js index 2479fc193..9151398d2 100644 --- a/scripts/expire-channels.js +++ b/scripts/expire-channels.js @@ -1,9 +1,9 @@ var nThen = require("nthen"); -var Tasks = require("../storage/tasks"); +var Tasks = require("../lib/storage/tasks"); var Logger = require("../lib/log"); var config = require("../lib/load-config"); -var FileStorage = require('../' + config.storage || './storage/file'); +var FileStorage = require('../lib/storage/file'); nThen(function (w) { Logger.create(config, w(function (_log) { diff --git a/scripts/migrations/migrate-tasks-v1.js b/scripts/migrations/migrate-tasks-v1.js index 365faeb4c..87807c74d 100644 --- a/scripts/migrations/migrate-tasks-v1.js +++ b/scripts/migrations/migrate-tasks-v1.js @@ -1,5 +1,5 @@ var nThen = require("nthen"); -var Tasks = require("../../storage/tasks"); +var Tasks = require("../../lib/storage/tasks"); var Logger = require("../../lib/log"); var config = require("../../lib/load-config"); @@ -7,7 +7,7 @@ var config = require("../../lib/load-config"); // this isn't strictly necessary for what we want to do // but the API requires it, and I don't feel like changing that // --ansuz -var FileStorage = require("../../" + (config.storage || "./storage/file")); +var FileStorage = require("../../lib/storage/file")); var tasks; nThen(function (w) { diff --git a/scripts/restore-archived.js b/scripts/restore-archived.js index a420e35e5..3f68b607e 100644 --- a/scripts/restore-archived.js +++ b/scripts/restore-archived.js @@ -1,6 +1,6 @@ var nThen = require("nthen"); -var Store = require("../storage/file"); +var Store = require("../lib/storage/file"); var config = require("../lib/load-config"); var store;