Просмотр исходного кода

Merge branch 'master' of github.com:sharelatex/filestore-sharelatex

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Brian Gough 11 лет назад
Родитель
Сommit
c74356daeb

+ 1 - 0
services/filestore/.gitignore

@@ -56,6 +56,7 @@ test/unit/js/
 test/acceptence/js
 
 user_files/*
+template_files/*
 
 **.swp
 

+ 4 - 0
services/filestore/app.coffee

@@ -68,6 +68,10 @@ app.del "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileContro
 app.get  "/template/:template_id/v/:version/:format", keyBuilder.templateFileKey, fileController.getFile
 app.post "/template/:template_id/v/:version/:format", keyBuilder.templateFileKey, fileController.insertFile
 
+app.get "/heapdump", (req, res)->
+	require('heapdump').writeSnapshot '/tmp/' + Date.now() + '.filestore.heapsnapshot', (err, filename)->
+		res.send filename
+
 app.post "/shutdown", (req, res)->
 	appIsOk = false
 	res.send()

+ 1 - 0
services/filestore/config/settings.defaults.coffee

@@ -21,6 +21,7 @@ module.exports =
 			# Must contain full path, e.g. "/var/lib/sharelatex/data".
 			# This path must exist, not be tmpfs and be writable to by the user sharelatex is run as.
 			user_files: Path.resolve(__dirname + "/../user_files")
+			template_files: Path.resolve(__dirname + "/../template_files")
 		# if you are using S3, then fill in your S3 details below
 		# s3:
 		# 	key: ""

+ 13 - 12
services/filestore/package.json

@@ -7,22 +7,23 @@
     "url": "https://github.com/sharelatex/filestore-sharelatex.git"
   },
   "dependencies": {
-    "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
-    "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.0.0",
-    "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.0.0",
-    "request": "2.14.0",
-    "lynx": "0.0.11",
-    "grunt-mocha-test": "~0.8.2",
-    "knox": "~0.8.8",
-    "node-uuid": "~1.4.1",
-    "underscore": "~1.5.2",
+    "async": "~0.2.10",
+    "coffee-script": "~1.7.1",
     "express": "~3.4.8",
+    "grunt-mocha-test": "~0.8.2",
+    "heapdump": "^0.3.2",
+    "knox": "~0.9.1",
+    "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#master",
     "longjohn": "~0.2.2",
-    "async": "~0.2.10",
+    "lynx": "0.0.11",
+    "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#master",
+    "node-transloadit": "0.0.4",
+    "node-uuid": "~1.4.1",
     "pngcrush": "0.0.3",
+    "request": "2.14.0",
+    "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#master",
     "stream-buffers": "~0.2.5",
-    "node-transloadit": "0.0.4",
-    "coffee-script": "~1.7.1"
+    "underscore": "~1.5.2"
   },
   "devDependencies": {
     "sinon": "",

+ 0 - 0
services/filestore/template_files/.gitignore