This commit is contained in:
Henry Oswald 2016-11-03 15:13:41 +00:00
commit a5c4efd052
5 changed files with 41 additions and 36 deletions

View file

@ -1,3 +1,4 @@
coffee = require("coffee-script")
fs = require "fs" fs = require "fs"
spawn = require("child_process").spawn spawn = require("child_process").spawn
exec = require("child_process").exec exec = require("child_process").exec
@ -20,7 +21,6 @@ module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-concurrent' grunt.loadNpmTasks 'grunt-concurrent'
grunt.loadNpmTasks "grunt-contrib-coffee" grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-shell" grunt.loadNpmTasks "grunt-shell"
require('load-grunt-config')(grunt)
execute = {} execute = {}
@ -240,3 +240,7 @@ module.exports = (grunt) ->
throw new Error("Can not connect to redis") throw new Error("Can not connect to redis")
return callback(err) return callback(err)
rclient.on 'error', errorHandler rclient.on 'error', errorHandler
require('load-grunt-config')(grunt)

View file

@ -3,7 +3,7 @@ module.exports =
[{ [{
name: "web", name: "web",
repo: "https://github.com/sharelatex/web-sharelatex.git", repo: "https://github.com/sharelatex/web-sharelatex.git",
version: "master" version: "ha-docker"
}, { }, {
name: "real-time", name: "real-time",
repo: "https://github.com/sharelatex/real-time-sharelatex.git", repo: "https://github.com/sharelatex/real-time-sharelatex.git",

View file

@ -18,31 +18,31 @@ services:
environment: environment:
SHARELATEX_MONGO_URL: mongodb://mongo/sharelatex SHARELATEX_MONGO_URL: mongodb://mongo/sharelatex
SHARELATEX_REDIS_HOST: redis SHARELATEX_REDIS_HOST: redis
SHARELATEX_APP_NAME: 'Our ShareLaTeX' SHARELATEX_APP_NAME: Our ShareLaTeX
#Set for SSL via nginx-proxy #Set for SSL via nginx-proxy
#VIRTUAL_HOST: 103.112.212.22 #VIRTUAL_HOST: 103.112.212.22
# SHARELATEX_SITE_URL: "http://sharelatex.mydomain.com" # SHARELATEX_SITE_URL: http://sharelatex.mydomain.com
# SHARELATEX_NAV_TITLE: "Our ShareLaTeX Instance" # SHARELATEX_NAV_TITLE: Our ShareLaTeX Instance
# SHARELATEX_HEADER_IMAGE_URL: "http://somewhere.com/mylogo.png" # SHARELATEX_HEADER_IMAGE_URL: http://somewhere.com/mylogo.png
# SHARELATEX_ADMIN_EMAIL: "support@it.com" # SHARELATEX_ADMIN_EMAIL: support@it.com
# SHARELATEX_LEFT_FOOTER: '[{"text": "Powered by <a href=\"https://www.sharelatex.com\">ShareLaTeX</a> 2016"},{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]' # SHARELATEX_LEFT_FOOTER: '[{"text": "Powered by <a href=\"https://www.sharelatex.com\">ShareLaTeX</a> 2016"},{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]'
# SHARELATEX_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]' # SHARELATEX_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]'
# SHARELATEX_EMAIL_FROM_ADDRESS: "team@sharelatex.com" # SHARELATEX_EMAIL_FROM_ADDRESS: "team@sharelatex.com"
# SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID: "" # SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID:
# SHARELATEX_EMAIL_AWS_SES_SECRET_KEY: "" # SHARELATEX_EMAIL_AWS_SES_SECRET_KEY:
# SHARELATEX_EMAIL_SMTP_HOST: "smtp.mydomain.com" # SHARELATEX_EMAIL_SMTP_HOST: smtp.mydomain.com
# SHARELATEX_EMAIL_SMTP_PORT: 587 # SHARELATEX_EMAIL_SMTP_PORT: 587
# SHARELATEX_EMAIL_SMTP_SECURE: 'false' # SHARELATEX_EMAIL_SMTP_SECURE: false
# SHARELATEX_EMAIL_SMTP_USER: "" # SHARELATEX_EMAIL_SMTP_USER:
# SHARELATEX_EMAIL_SMTP_PASS: "" # SHARELATEX_EMAIL_SMTP_PASS:
# SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH: 'true' # SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH: true
# SHARELATEX_EMAIL_SMTP_IGNORE_TLS: 'false' # SHARELATEX_EMAIL_SMTP_IGNORE_TLS: false
# SHARELATEX_CUSTOM_EMAIL_FOOTER:"<div>This system is run by department x </div>" # SHARELATEX_CUSTOM_EMAIL_FOOTER:"<div>This system is run by department x </div>"
################ ################

View file

@ -1,24 +1,24 @@
require("coffee-script") # require("coffee-script")
fs = require("fs") # fs = require("fs")
_ = require("underscore") # _ = require("underscore")
if not process.argv[2] # if not process.argv[2]
console.log "Usage: coffee project_size.coffee user_files_path" # console.log "Usage: coffee project_size.coffee user_files_path"
else # else
dirPath = process.argv[2] # dirPath = process.argv[2]
if not fs.lstatSync(dirPath).isDirectory() # if not fs.lstatSync(dirPath).isDirectory()
console.log dirPath + " directory not exist" # console.log dirPath + " directory not exist"
else # else
fs.readdir dirPath, (err, files)-> # fs.readdir dirPath, (err, files)->
projects = [] # projects = []
files.forEach (file)-> # files.forEach (file)->
project_id = file.split("_")[0] # project_id = file.split("_")[0]
if !projects[project_id] # if !projects[project_id]
projects[project_id] = 0 # projects[project_id] = 0
projects[project_id] += fs.lstatSync(dirPath+"/"+file).size # projects[project_id] += fs.lstatSync(dirPath+"/"+file).size
ids = _.keys projects # ids = _.keys projects
console.log "project \t size" # console.log "project \t size"
ids.forEach (id)-> # ids.forEach (id)->
console.log id + "\t" + projects[id] # console.log id + "\t" + projects[id]

View file

@ -4,6 +4,7 @@
"description": "An online collaborative LaTeX editor", "description": "An online collaborative LaTeX editor",
"dependencies": { "dependencies": {
"async": "^0.9.0", "async": "^0.9.0",
"coffee-script": "^1.11.1",
"east": "0.5.1", "east": "0.5.1",
"east-mongo": "^0.1.2", "east-mongo": "^0.1.2",
"grunt-shell": "^1.1.1", "grunt-shell": "^1.1.1",