include instance version in Env

pull/1/head
ansuz 4 years ago
parent 87a52b67f5
commit 98c8d7086f

@ -10,6 +10,7 @@ const Core = require("./commands/core");
const Quota = require("./commands/quota");
const Util = require("./common-util");
const Package = require("../package.json");
var canonicalizeOrigin = function (s) {
if (typeof(s) === 'undefined') { return; }
@ -18,6 +19,8 @@ var canonicalizeOrigin = function (s) {
module.exports.create = function (config) {
const Env = {
version: Package.version,
httpUnsafeOrigin: canonicalizeOrigin(config.httpUnsafeOrigin),
httpSafeOrigin: canonicalizeOrigin(config.httpSafeOrigin),
removeDonateButton: config.removeDonateButton,

@ -4,7 +4,6 @@
var Express = require('express');
var Http = require('http');
var Fs = require('fs');
var Package = require('./package.json');
var Path = require("path");
var nThen = require("nthen");
var Util = require("./lib/common-util");
@ -243,7 +242,7 @@ var serveConfig = makeRouteCache(function (host) {
'var obj = ' + JSON.stringify({
requireConf: {
waitSeconds: 600,
urlArgs: 'ver=' + Package.version + cacheString(),
urlArgs: 'ver=' + Env.version + cacheString(),
},
removeDonateButton: (Env.removeDonateButton === true),
allowSubscriptions: (Env.allowSubscriptions === true),

Loading…
Cancel
Save