|
|
@ -11,25 +11,25 @@ var Fs = require("fs");
|
|
|
|
var Fse = require("fs-extra");
|
|
|
|
var Fse = require("fs-extra");
|
|
|
|
var Path = require("path");
|
|
|
|
var Path = require("path");
|
|
|
|
var Https = require("https");
|
|
|
|
var Https = require("https");
|
|
|
|
const Package = require('./package.json');
|
|
|
|
const Package = require('../package.json');
|
|
|
|
const Pinned = require('./scripts/pinned');
|
|
|
|
const Pinned = require('../scripts/pinned');
|
|
|
|
const Saferphore = require("saferphore");
|
|
|
|
const Saferphore = require("saferphore");
|
|
|
|
const nThen = require("nthen");
|
|
|
|
const nThen = require("nthen");
|
|
|
|
const getFolderSize = require("get-folder-size");
|
|
|
|
const getFolderSize = require("get-folder-size");
|
|
|
|
const Pins = require("./lib/pins");
|
|
|
|
const Pins = require("./pins");
|
|
|
|
const Meta = require("./lib/metadata");
|
|
|
|
const Meta = require("./metadata");
|
|
|
|
const WriteQueue = require("./lib/write-queue");
|
|
|
|
const WriteQueue = require("./write-queue");
|
|
|
|
const BatchRead = require("./lib/batch-read");
|
|
|
|
const BatchRead = require("./batch-read");
|
|
|
|
|
|
|
|
|
|
|
|
const Util = require("./lib/common-util");
|
|
|
|
const Util = require("./common-util");
|
|
|
|
const escapeKeyCharacters = Util.escapeKeyCharacters;
|
|
|
|
const escapeKeyCharacters = Util.escapeKeyCharacters;
|
|
|
|
const unescapeKeyCharacters = Util.unescapeKeyCharacters;
|
|
|
|
const unescapeKeyCharacters = Util.unescapeKeyCharacters;
|
|
|
|
const mkEvent = Util.mkEvent;
|
|
|
|
const mkEvent = Util.mkEvent;
|
|
|
|
|
|
|
|
|
|
|
|
var RPC = module.exports;
|
|
|
|
var RPC = module.exports;
|
|
|
|
|
|
|
|
|
|
|
|
var Store = require("./storage/file");
|
|
|
|
var Store = require("../storage/file");
|
|
|
|
var BlobStore = require("./storage/blob");
|
|
|
|
var BlobStore = require("../storage/blob");
|
|
|
|
|
|
|
|
|
|
|
|
var DEFAULT_LIMIT = 50 * 1024 * 1024;
|
|
|
|
var DEFAULT_LIMIT = 50 * 1024 * 1024;
|
|
|
|
var SESSION_EXPIRATION_TIME = 60 * 1000;
|
|
|
|
var SESSION_EXPIRATION_TIME = 60 * 1000;
|
|
|
@ -611,6 +611,9 @@ var updateLimits = function (Env, config, publicKey, cb /*:(?string, ?any[])=>vo
|
|
|
|
req.end(body);
|
|
|
|
req.end(body);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// XXX it's possible for this to respond before the server has had a chance
|
|
|
|
|
|
|
|
// to fetch the limits. Maybe we should respond with an error...
|
|
|
|
|
|
|
|
// or wait until we actually know the limits before responding
|
|
|
|
var getLimit = function (Env, publicKey, cb) {
|
|
|
|
var getLimit = function (Env, publicKey, cb) {
|
|
|
|
var unescapedKey = unescapeKeyCharacters(publicKey);
|
|
|
|
var unescapedKey = unescapeKeyCharacters(publicKey);
|
|
|
|
var limit = Env.limits[unescapedKey];
|
|
|
|
var limit = Env.limits[unescapedKey];
|
|
|
@ -1445,6 +1448,7 @@ RPC.create = function (config, cb) {
|
|
|
|
evPinnedPadsReady: mkEvent(true),
|
|
|
|
evPinnedPadsReady: mkEvent(true),
|
|
|
|
limits: {},
|
|
|
|
limits: {},
|
|
|
|
admins: [],
|
|
|
|
admins: [],
|
|
|
|
|
|
|
|
sessionExpirationInterval: undefined,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|