Explorar o código

Initial Dockerfile image build

James Allen %!s(int64=11) %!d(string=hai) anos
achega
97ea2b6aa1

+ 21 - 0
server-ce/00_make_sharelatex_data_dirs.sh

@@ -0,0 +1,21 @@
+#!/bin/sh
+mkdir -p /var/lib/sharelatex/data
+chown sharelatex:sharelatex /var/lib/sharelatex/data
+
+mkdir -p /var/lib/sharelatex/data/user_files
+chown sharelatex:sharelatex /var/lib/sharelatex/data/user_files
+
+mkdir -p /var/lib/sharelatex/data/compiles
+chown sharelatex:sharelatex /var/lib/sharelatex/data/compiles
+
+mkdir -p /var/lib/sharelatex/data/cache
+chown sharelatex:sharelatex /var/lib/sharelatex/data/cache
+
+mkdir -p /var/lib/sharelatex/tmp
+chown sharelatex:sharelatex /var/lib/sharelatex/tmp
+
+mkdir -p /var/lib/sharelatex/tmp/uploads
+chown sharelatex:sharelatex /var/lib/sharelatex/tmp/uploads
+
+mkdir -p /var/lib/sharelatex/tmp/dumpFolder
+chown sharelatex:sharelatex /var/lib/sharelatex/tmp/dumpFolder

+ 7 - 0
server-ce/00_regen_sharelatex_secrets.sh

@@ -0,0 +1,7 @@
+#!/bin/sh
+# Create random secret keys (twice, once for http auth pass, once for cookie secret).
+CRYPTO_RANDOM=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -d '\n+/')
+sed -i "0,/CRYPTO_RANDOM/s/CRYPTO_RANDOM/$CRYPTO_RANDOM/" /etc/sharelatex/settings.coffee
+
+CRYPTO_RANDOM=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -d '\n+/')
+sed -i "0,/CRYPTO_RANDOM/s/CRYPTO_RANDOM/$CRYPTO_RANDOM/" /etc/sharelatex/settings.coffee

+ 81 - 0
server-ce/Dockerfile

@@ -0,0 +1,81 @@
+FROM phusion/baseimage:0.9.16
+
+RUN curl -sL https://deb.nodesource.com/setup | sudo bash -
+RUN apt-get install -y build-essential nodejs
+
+RUN npm install -g grunt-cli
+
+# Set up sharelatex user and home directory
+RUN adduser --system --group --home /var/www/sharelatex --no-create-home sharelatex; \
+	mkdir -p /var/lib/sharelatex; \
+	chown sharelatex:sharelatex /var/lib/sharelatex; \
+	mkdir -p /var/log/sharelatex; \
+	chown sharelatex:sharelatex /var/log/sharelatex;
+
+RUN apt-get install -y git python
+RUN git clone https://github.com/sharelatex/sharelatex.git /var/www/sharelatex
+
+# zlib1g-dev is needed to compile the synctex binaries in the CLSI during `grunt install`.
+RUN apt-get install -y zlib1g-dev
+
+RUN cd /var/www/sharelatex; \
+	npm install; \
+	grunt install;
+	
+# Minify js assets
+RUN cd /var/www/sharelatex/web; \
+	grunt compile:minify;
+	
+RUN apt-get install -y nginx;
+RUN rm /etc/nginx/sites-enabled/default
+ADD nginx/nginx.conf /etc/nginx/nginx.conf
+ADD nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf
+
+RUN mkdir /etc/service/nginx
+ADD runit/nginx.sh /etc/service/nginx/run
+		
+RUN mkdir /etc/service/chat-sharelatex; \
+	mkdir /etc/service/clsi-sharelatex; \
+	mkdir /etc/service/docstore-sharelatex; \
+	mkdir /etc/service/document-updater-sharelatex; \
+	mkdir /etc/service/filestore-sharelatex; \
+	mkdir /etc/service/real-time-sharelatex; \
+	mkdir /etc/service/spelling-sharelatex; \
+	mkdir /etc/service/tags-sharelatex; \
+	mkdir /etc/service/track-changes-sharelatex; \
+	mkdir /etc/service/web-sharelatex; 
+
+ADD runit/chat-sharelatex.sh             /etc/service/chat-sharelatex/run
+ADD runit/clsi-sharelatex.sh             /etc/service/clsi-sharelatex/run
+ADD runit/docstore-sharelatex.sh         /etc/service/docstore-sharelatex/run
+ADD runit/document-updater-sharelatex.sh /etc/service/document-updater-sharelatex/run
+ADD runit/filestore-sharelatex.sh        /etc/service/filestore-sharelatex/run
+ADD runit/real-time-sharelatex.sh        /etc/service/real-time-sharelatex/run
+ADD runit/spelling-sharelatex.sh         /etc/service/spelling-sharelatex/run
+ADD runit/tags-sharelatex.sh             /etc/service/tags-sharelatex/run
+ADD runit/track-changes-sharelatex.sh    /etc/service/track-changes-sharelatex/run
+ADD runit/web-sharelatex.sh              /etc/service/web-sharelatex/run
+
+RUN mkdir /etc/sharelatex
+ADD settings.coffee /etc/sharelatex/settings.coffee
+
+# phusion/baseimage init script
+ADD 00_regen_sharelatex_secrets.sh  /etc/my_init.d/00_regen_sharelatex_secrets.sh
+ADD 00_make_sharelatex_data_dirs.sh /etc/my_init.d/00_make_sharelatex_data_dirs.sh
+
+# TexLive
+RUN apt-get install -y wget
+RUN wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz; \
+	mkdir /install-tl-unx; \
+	tar -xvf install-tl-unx.tar.gz -C /install-tl-unx --strip-components=1
+
+RUN echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile; \
+	/install-tl-unx/install-tl -profile /install-tl-unx/texlive.profile
+
+ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/texlive/2014/bin/x86_64-linux/
+RUN tlmgr install latexmk
+
+# Aspell
+RUN apt-get install -y aspell aspell-en aspell-af aspell-am aspell-ar aspell-ar-large aspell-bg aspell-bn aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-de-alt aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-gu aspell-he aspell-hi aspell-hr aspell-hsb aspell-hu aspell-hy aspell-id aspell-is aspell-it aspell-kk aspell-kn aspell-ku aspell-lt aspell-lv aspell-ml aspell-mr aspell-nl aspell-no aspell-nr aspell-ns aspell-or aspell-pa aspell-pl aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-ss aspell-st aspell-sv aspell-ta aspell-te aspell-tl aspell-tn aspell-ts aspell-uk aspell-uz aspell-xh aspell-zu 
+
+ENTRYPOINT ["/sbin/my_init"]

+ 70 - 0
server-ce/README.md

@@ -0,0 +1,70 @@
+ShareLaTeX Docker Image
+=======================
+
+*THIS IS A WORK IN PROGRESS AND THESE INSTRUCTIONS DO NOT WORK YET!*
+
+The recommended way to install and run ShareLaTeX Community Edition is via Docker:
+
+```
+$ docker run -d -v /sharelatex-data:/var/lib/sharelatex --net=host --name=sharelatex sharelatex/sharelatex
+```
+
+This will download the ShareLaTeX image and start it running in the background.
+
+**Which port does it listen on?**.
+
+### Mongo and Redis
+
+The `--net=host` option to docker will allow the ShareLaTeX container to access
+ports on the local system. By default it looks for an instance of
+[MongoDB](http://www.mongodb.org/) (must be version 2.4 or later) running on port 27017, and
+[Redis](http://redis.io/) (must be version 2.6.12 or later) running on port 6379. These are the default ports for
+a standard installation of MongoDB and Redis.
+
+### Persisting and backing up data
+
+The `-v /sharelatex-data:/var/lib/sharelatex` option in the `run` command tells Docker to mount the local
+directory `/sharelatex-data` in the container at `/var/lib/sharelatex`. This is
+where ShareLaTeX will store user uploaded files, and allows you to make external backups
+of these files, as well as persist them between updates to the ShareLaTeX image.
+
+### LaTeX environment
+
+To save bandwidth, the ShareLaTeX image only comes with a minimal install of 
+TeXLive. To upgrade to a complete TeXLive installation, run the following command:
+
+```
+$ docker exec sharelatex tlmgr install scheme-full
+```
+
+Or you can install packages manually as you need by replacing `scheme-full` by 
+the package name
+
+### Configuration Options
+
+You can pass configuration options to ShareLaTeX as environment variables:
+
+```
+$ docker run -d \
+	-v /sharelatex-data:/var/lib/sharelatex \
+	--net=host \
+	--name=sharelatex \
+	--env SHARELATEX_MONGO_URL=mongodb://my.mongo.host/sharelatex \
+	sharelatex/sharelatex
+```
+
+The available configuration parameters are:
+
+* `SHARELATEX_SITE_URL`: Where your instance of ShareLaTeX is publically available.
+This is used in public links, and when connecting over websockets, so much be
+configured correctly!
+* `SHARELATEX_MONGO_URL`: The URL of the Mongo database to use
+* `SHARELATEX_REDIS_HOST`: The host name of the Redis instance to use
+* `SHARELATEX_REDIS_PORT`: The port of the Redis instance to use
+* `SHARELATEX_REDIS_PASS`: The password to use when connecting to Redis (if applicable)
+* `SHARELATEX_SECURE_COOKIE`: Set this to something non-zero to use a secure cookie.
+  This requires that your ShareLaTeX instance is running behind SSL.
+
+### Upgrading from older versions
+
+*TODO: Just stop container, remove 'sharelatex' tag, and run with the new version.*

+ 74 - 0
server-ce/nginx/nginx.conf

@@ -0,0 +1,74 @@
+daemon off;
+user www-data;
+worker_processes 4;
+pid /run/nginx.pid;
+
+events {
+	worker_connections 768;
+	# multi_accept on;
+}
+
+http {
+
+	##
+	# Basic Settings
+	##
+
+	sendfile on;
+	tcp_nopush on;
+	tcp_nodelay on;
+	keepalive_timeout 65;
+	types_hash_max_size 2048;
+	# server_tokens off;
+
+	# server_names_hash_bucket_size 64;
+	# server_name_in_redirect off;
+
+	include /etc/nginx/mime.types;
+	default_type application/octet-stream;
+
+	##
+	# Logging Settings
+	##
+
+	access_log /var/log/nginx/access.log;
+	error_log /var/log/nginx/error.log;
+
+	##
+	# Gzip Settings
+	##
+
+	gzip on;
+	gzip_disable "msie6";
+
+	# gzip_vary on;
+	# gzip_proxied any;
+	# gzip_comp_level 6;
+	# gzip_buffers 16 8k;
+	# gzip_http_version 1.1;
+	# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
+
+	##
+	# nginx-naxsi config
+	##
+	# Uncomment it if you installed nginx-naxsi
+	##
+
+	#include /etc/nginx/naxsi_core.rules;
+
+	##
+	# nginx-passenger config
+	##
+	# Uncomment it if you installed nginx-passenger
+	##
+	
+	#passenger_root /usr;
+	#passenger_ruby /usr/bin/ruby;
+
+	##
+	# Virtual Host Configs
+	##
+
+	include /etc/nginx/conf.d/*.conf;
+	include /etc/nginx/sites-enabled/*;
+}

+ 45 - 0
server-ce/nginx/sharelatex.conf

@@ -0,0 +1,45 @@
+server {
+	listen         80;
+	server_name    _; # Catch all, see http://nginx.org/en/docs/http/server_names.html
+
+	set $static_path /var/www/sharelatex/web/public;
+
+	location / {
+		proxy_pass http://localhost:3000;
+		proxy_http_version 1.1;
+		proxy_set_header Upgrade $http_upgrade;
+		proxy_set_header Connection "upgrade";
+		proxy_set_header X-Forwarded-Host $host;
+		proxy_set_header X-Forwarded-Proto $scheme;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_read_timeout 3m;
+		proxy_send_timeout 3m;
+	}
+	
+	location /socket.io {
+		proxy_pass http://localhost:3026;
+		proxy_http_version 1.1;
+		proxy_set_header Upgrade $http_upgrade;
+		proxy_set_header Connection "upgrade";
+		proxy_set_header X-Forwarded-Host $host;
+		proxy_set_header X-Forwarded-Proto $scheme;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_read_timeout 3m;
+		proxy_send_timeout 3m;
+	}
+
+	location /stylesheets {
+		expires 1y;
+		root $static_path/;
+	}
+
+	location /minjs {
+		expires 1y;
+		root $static_path/;
+	}
+
+	location /img {
+		expires 1y;
+		root $static_path/;
+	}
+}

+ 3 - 0
server-ce/runit/chat-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/chat/app.js >> /var/log/sharelatex/chat.log 2>&1

+ 3 - 0
server-ce/runit/clsi-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/clsi/app.js >> /var/log/sharelatex/clsi.log 2>&1

+ 3 - 0
server-ce/runit/docstore-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/docstore/app.js >> /var/log/sharelatex/docstore.log 2>&1

+ 3 - 0
server-ce/runit/document-updater-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/document-updater/app.js >> /var/log/sharelatex/document-updater.log 2>&1

+ 3 - 0
server-ce/runit/filestore-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/filestore/app.js >> /var/log/sharelatex/filestore.log 2>&1

+ 2 - 0
server-ce/runit/nginx.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+exec nginx

+ 3 - 0
server-ce/runit/real-time-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/real-time/app.js >> /var/log/sharelatex/real-time.log 2>&1

+ 3 - 0
server-ce/runit/spelling-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/spelling/app.js >> /var/log/sharelatex/spelling.log 2>&1

+ 3 - 0
server-ce/runit/tags-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/tags/app.js >> /var/log/sharelatex/tags.log 2>&1

+ 3 - 0
server-ce/runit/track-changes-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/track-changes/app.js >> /var/log/sharelatex/track-changes.log 2>&1

+ 3 - 0
server-ce/runit/web-sharelatex.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
+exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/web/app.js >> /var/log/sharelatex/web.log 2>&1

+ 422 - 0
server-ce/settings.coffee

@@ -0,0 +1,422 @@
+Path = require('path')
+
+# These credentials are used for authenticating api requests
+# between services that may need to go over public channels
+httpAuthUser = "sharelatex"
+httpAuthPass = "CRYPTO_RANDOM" # Randomly generated for you
+httpAuthUsers = {}
+httpAuthUsers[httpAuthUser] = httpAuthPass
+
+DATA_DIR = '/var/lib/sharelatex/data'
+TMP_DIR = '/var/lib/sharelatex/tmp'
+
+module.exports =
+	# Databases
+	# ---------
+
+	# ShareLaTeX's main persistant data store is MongoDB (http://www.mongodb.org/)
+	# Documentation about the URL connection string format can be found at:
+	#
+	#    http://docs.mongodb.org/manual/reference/connection-string/
+	# 
+	# The following works out of the box with Mongo's default settings:
+	mongo:
+		url : process.env["SHARELATEX_MONGO_URL"] or 'mongodb://127.0.0.1/sharelatex'
+
+	# Redis is used in ShareLaTeX for high volume queries, like real-time
+	# editing, and session management.
+	#
+	# The following config will work with Redis's default settings:
+	redis:
+		web: redisConfig =
+			host: process.env["SHARELATEX_REDIS_HOST"] or "localhost"
+			port: process.env["SHARELATEX_REDIS_PORT"] or "6379"
+			password: process.env["SHARELATEX_REDIS_PASS"] or ""
+		fairy: redisConfig
+
+	# The compile server (the clsi) uses a SQL database to cache files and
+	# meta-data. sqllite is the default, and the load is low enough that this will
+	# be fine in production (we use sqllite at sharelatex.com).
+	#
+	# If you want to configure a different database, see the Sequelize documentation
+	# for available options:
+	#
+	#    https://github.com/sequelize/sequelize/wiki/API-Reference-Sequelize#example-usage
+	#
+	mysql:
+		clsi:
+			database: "clsi"
+			username: "clsi"
+			password: ""
+			dialect: "sqlite"
+			storage: Path.join(DATA_DIR, "db.sqlite")
+
+	# File storage
+	# ------------
+
+	# ShareLaTeX can store binary files like images either locally or in Amazon
+	# S3. The default is locally:
+	filestore:
+		backend: "fs"	
+		stores:
+			user_files: Path.join(DATA_DIR, "user_files")
+			
+	# To use Amazon S3 as a storage backend, comment out the above config, and
+	# uncomment the following, filling in your key, secret, and bucket name:
+	#
+	# filestore:
+	# 	backend: "s3"
+	# 	stores:
+	# 		user_files: "BUCKET_NAME"
+	# 	s3:
+	# 		key: "AWS_KEY"
+	# 		secret: "AWS_SECRET"
+	# 		
+
+	# Local disk caching
+	# ------------------
+	path:
+		# If we ever need to write something to disk (e.g. incoming requests
+		# that need processing but may be too big for memory), then write
+		# them to disk here:
+		dumpFolder:   Path.join(TMP_DIR, "dumpFolder")
+		# Where to write uploads before they are processed
+		uploadFolder: Path.join(TMP_DIR, "uploads")
+		# Where to write the project to disk before running LaTeX on it
+		compilesDir:  Path.join(DATA_DIR, "compiles")
+		# Where to cache downloaded URLs for the CLSI
+		clsiCacheDir: Path.join(DATA_DIR, "cache")
+
+	# Server Config
+	# -------------
+
+	# Where your instance of ShareLaTeX can be found publicly. This is used
+	# when emails are sent out and in generated links:
+	siteUrl: siteUrl = process.env["SHARELATEX_SITE_URL"] or 'http://localhost:3000'
+	
+	# The websocket layer of ShareLaTeX runs as separate service.
+	# When running locally or in development, you can point the client to this
+	# service directly. If you are running behind a reverse proxy (Nginx, etc)
+	# then websocketsUrl should be the same as siteUrl, with your reverse
+	# proxy responible for sending websocket traffic to the websocket service
+	# rather than connecting directly.
+	websocketsUrl: siteUrl
+	
+	# If provided, a sessionSecret is used to sign cookies so that they cannot be
+	# spoofed. This is recommended.
+	security:
+		sessionSecret: "CRYPTO_RANDOM" # This was randomly generated for you
+
+	# These credentials are used for authenticating api requests
+	# between services that may need to go over public channels
+	httpAuthUsers: httpAuthUsers
+	
+	# Should javascript assets be served minified or not. Note that you will
+	# need to run `grunt compile:minify` within the web-sharelatex directory
+	# to generate these.
+	useMinifiedJs: true
+
+	# Should static assets be sent with a header to tell the browser to cache
+	# them. This should be false in development where changes are being made,
+	# but should be set to true in production.
+	cacheStaticAssets: true
+
+	# If you are running ShareLaTeX over https, set this to true to send the
+	# cookie with a secure flag (recommended).
+	secureCookie: process.env["SHARELATEX_SECURE_COOKIE"]?
+	
+	# If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
+	# then set this to true to allow it to correctly detect the forwarded IP
+	# address and http/https protocol information.
+	behindProxy: true
+
+	# Sending Email
+	# -------------
+	#
+	# You must configure a mail server to be able to send invite emails from
+	# ShareLaTeX. The config settings are passed to nodemailer. See the nodemailer
+	# documentation for available options:
+	#
+	#     http://www.nodemailer.com/docs/transports
+	#
+	# email:
+	#	fromAddress: ""
+	#	replyTo: ""
+	#	transport: "SES"
+	#	parameters:
+	#		AWSAccessKeyID: ""
+	#		AWSSecretKey: ""
+
+	# Spell Check Languages
+	# ---------------------
+	#
+	# You must have the corresponding aspell dictionary installed to 
+	# be able to use a language. Run `grunt check:aspell` to check which
+	# dictionaries you have installed. These should be set for the `code` for
+	# each language.
+	languages: [{
+		"code":"en",
+		"name":"English (American)"
+		},{
+		"code":"en_GB",
+		"name":"English (British)"
+		},{
+		"code":"af",
+		"name":"Africaans"
+		},{
+		"code":"am",
+		"name":"Amharic"
+		},{
+		"code":"ar",
+		"name":"Arabic"
+		},{
+		"code":"hy",
+		"name":"Armenian"
+		},{
+		"code":"gl",
+		"name":"Galician"
+		},{
+		"code":"eu",
+		"name":"Basque"
+		},{
+		"code":"bn",
+		"name":"Bengali"
+		},{
+		"code":"br",
+		"name":"Breton"
+		},{
+		"code":"bg",
+		"name":"Bulgarian"
+		},{
+		"code":"ca",
+		"name":"Catalan"
+		},{
+		"code":"hr",
+		"name":"Croatian"
+		},{
+		"code":"cs",
+		"name":"Czech"
+		},{
+		"code":"da",
+		"name":"Danish"
+		},{
+		"code":"nl",
+		"name":"Dutch"
+		},{
+		"code":"eo",
+		"name":"Esperanto"
+		},{
+		"code":"et",
+		"name":"Estonian"
+		},{
+		"code":"fo",
+		"name":"Faroese"
+		},{
+		"code":"fr",
+		"name":"French"
+		},{
+		"code":"de",
+		"name":"German"
+		},{
+		"code":"el",
+		"name":"Greek"
+		},{
+		"code":"gu",
+		"name":"Gujarati"
+		},{
+		"code":"he",
+		"name":"Hebrew"
+		},{
+		"code":"hi",
+		"name":"Hindi"
+		},{
+		"code":"hu",
+		"name":"Hungarian"
+		},{
+		"code":"is",
+		"name":"Icelandic"
+		},{
+		"code":"id",
+		"name":"Indonesian"
+		},{
+		"code":"ga",
+		"name":"Irish"
+		},{
+		"code":"it",
+		"name":"Italian"
+		},{
+		"code":"kn",
+		"name":"Kannada"
+		},{
+		"code":"kk",
+		"name":"Kazakh"
+		},{
+		"code":"ku",
+		"name":"Kurdish"
+		},{
+		"code":"lv",
+		"name":"Latvian"
+		},{
+		"code":"lt",
+		"name":"Lithuanian"
+		},{
+		"code":"ml",
+		"name":"Malayalam"
+		},{
+		"code":"mr",
+		"name":"Marathi"
+		},{
+		"code":"nr",
+		"name":"Ndebele"
+		},{
+		"code":"ns",
+		"name":"Northern Sotho"
+		},{
+		"code":"no",
+		"name":"Norwegian"
+		},{
+		"code":"or",
+		"name":"Oriya"
+		},{
+		"code":"fa",
+		"name":"Persian"
+		},{
+		"code":"pl",
+		"name":"Polish"
+		},{
+		"code":"pt_BR",
+		"name":"Portuguese (Brazilian)"
+		},{
+		"code":"pt_PT",
+		"name":"Portuguese (European)"
+		},{
+		"code":"pa",
+		"name":"Punjabi"
+		},{
+		"code":"ro",
+		"name":"Romanian"
+		},{
+		"code":"ru",
+		"name":"Russian"
+		},{
+		"code":"sk",
+		"name":"Slovak"
+		},{
+		"code":"sl",
+		"name":"Slovenian"
+		},{
+		"code":"st",
+		"name":"Southern Sotho"
+		},{
+		"code":"es",
+		"name":"Spanish"
+		},{
+		"code":"ss",
+		"name":"Swazi"
+		},{
+		"code":"sv",
+		"name":"Swedish"
+		},{
+		"code":"tl",
+		"name":"Tagalog"
+		},{
+		"code":"ta",
+		"name":"Tamil"
+		},{
+		"code":"te",
+		"name":"Telugu"
+		},{
+		"code":"ts",
+		"name":"Tsonga"
+		},{
+		"code":"tn",
+		"name":"Tswana"
+		},{
+		"code":"uk",
+		"name":"Ukrainian"
+		},{
+		"code":"hsb",
+		"name":"Upper Sorbian"
+		},{
+		"code":"uz",
+		"name":"Uzbek"
+		},{
+		"code":"cy",
+		"name":"Welsh"
+		},{
+		"code":"xh",
+		"name":"Xhosa"
+		},{
+		"code":"zu",
+		"name":"Zulu"
+		}
+	]
+	
+	# Service locations
+	# -----------------
+
+	# ShareLaTeX is comprised of many small services, which each expose
+	# an HTTP API running on a different port. Generally you
+	# can leave these as they are unless you have some other services
+	# running which conflict, or want to run the web process on port 80.
+	# internal:
+	# 	web:
+	# 		port: webPort = 3000
+	# 		host: "localhost"
+	# 	documentupdater:
+	# 		port: docUpdaterPort = 3003
+	# 		host: "localhost"
+	# 	filestore:
+	# 		port: filestorePort = 3009
+	# 		host: "localhost"
+	# 	chat:
+	# 		port: chatPort = 3010
+	# 		host: "localhost"
+	# 	tags:
+	# 		port: tagsPort = 3012
+	# 		host: "localhost"
+	# 	clsi:
+	# 		port: clsiPort = 3013
+	# 		host: "localhost"
+	# 	trackchanges:
+	# 		port: trackchangesPort = 3015
+	# 		host: "localhost"
+	# 	docstore:
+	# 		port: docstorePort = 3016
+	# 		host: "localhost"
+	# 	spelling:
+	# 		port: spellingPort = 3005
+	# 		host: "localhost"
+
+	# If you change the above config, or run some services on remote servers,
+	# you need to tell the other services where to find them:
+	apis:
+		web:
+			url: "http://localhost:3000"
+			user: httpAuthUser
+			pass: httpAuthPass
+	# 	documentupdater:
+	# 		url : "http://localhost:#{docUpdaterPort}"
+	# 	clsi:
+	# 		url: "http://localhost:#{clsiPort}"
+	# 	filestore:
+	# 		url: "http://localhost:#{filestorePort}"
+	# 	trackchanges:
+	# 		url: "http://localhost:#{trackchangesPort}"
+	# 	docstore:
+	# 		url: "http://localhost:#{docstorePort}"
+	# 	tags:
+	# 		url: "http://localhost:#{tagsPort}"
+	# 	spelling:
+	# 		url: "http://localhost:#{spellingPort}"
+	# 	chat:
+	# 		url: "http://localhost:#{chatPort}"
+	
+
+# With lots of incoming and outgoing HTTP connections to different services,
+# sometimes long running, it is a good idea to increase the default number
+# of sockets that Node will hold open.
+http = require('http')
+http.globalAgent.maxSockets = 300
+https = require('https')
+https.globalAgent.maxSockets = 300