From bc35c3349f2a5c4f69565aff58c86ffd388d3ffc Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 12 Apr 2018 17:24:51 +0200 Subject: [PATCH 1/4] set content-type headers for the 404 page --- server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index a7830cbaf..1ff289f64 100644 --- a/server.js +++ b/server.js @@ -188,6 +188,7 @@ var custom_four04_path = Path.resolve(__dirname + '/customize/404.html'); var send404 = function (res, path) { if (!path && path !== four04_path) { path = four04_path; } Fs.exists(path, function (exists) { + res.setHeader('Content-Type', 'text/html; charset=utf-8'); if (exists) { return Fs.createReadStream(path).pipe(res); } send404(res); }); @@ -250,4 +251,4 @@ var nt = nThen(function (w) { if (config.debugReplName) { require('replify')({ name: config.debugReplName, app: debuggableStore }); -} \ No newline at end of file +} From 2897a14869dd73152e784e938b66bf430f41372c Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Fri, 13 Apr 2018 17:49:17 +0200 Subject: [PATCH 2/4] Expose the datastore as an http endpoint --- server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.js b/server.js index 1ff289f64..aac8d7513 100644 --- a/server.js +++ b/server.js @@ -123,6 +123,9 @@ app.get(mainPagePattern, Express.static(__dirname + '/customize.dist')); app.use("/blob", Express.static(Path.join(__dirname, (config.blobPath || './blob')), { maxAge: DEV_MODE? "0d": "365d" })); +app.use("/datastore", Express.static(Path.join(__dirname, (config.filePath || './datastore')), { + maxAge: "0d" +})); app.use("/customize", Express.static(__dirname + '/customize')); app.use("/customize", Express.static(__dirname + '/customize.dist')); From 3c2d61ff4276b0743108ebcc539cb5217b10bd89 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Fri, 13 Apr 2018 18:14:01 +0200 Subject: [PATCH 3/4] Add to the nginx documentation the location datastore block --- docs/example.nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index d56920bf5..44b12ade8 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -75,6 +75,12 @@ server { } location ^~ /blob/ { + add_header Cache-Control max-age=31536000; + try_files $uri =404; + } + + location ^~ /datastore/ { + add_header Cache-Control max-age=0; try_files $uri =404; } From d6504e4610a2bf7cd7c2adb6710724adcbd8b853 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 18 Apr 2018 14:02:49 +0200 Subject: [PATCH 4/4] Upgrade chainpad --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index e2763ccfd..809fd5323 100644 --- a/bower.json +++ b/bower.json @@ -31,7 +31,7 @@ "hyperjson": "~1.4.0", "chainpad-crypto": "^0.1.8", "chainpad-listmap": "^0.5.0", - "chainpad": "^5.0.0", + "chainpad": "^5.1.0", "chainpad-netflux": "^0.7.0", "file-saver": "1.3.1", "alertifyjs": "1.0.11",