Skip to content
Snippets Groups Projects
Commit 82b073b3 authored by Martin Jeppesen's avatar Martin Jeppesen
Browse files

Working implementation

parent 41d755ff
Branches
No related tags found
No related merge requests found
tex:
# image: sharelatex/sharelatex
build: /docker2/sharelatex
ports:
- "80:80"
# - "3000:3000"
# volumes:
# - /docker/sharelatex/dat:/var/lib/sharelatex
links:
- mongodb:db
- redis:red
environment:
- SHARELATEX_MONGO_URL=mongodb://db/sharelatex
- SHARELATEX_REDIS_HOST=red
- SHARELATEX_APP_NAME="eNote super Latex"
- SHARELATEX_NAV_TITLE="ShareLatex for 02402"
mongodb:
image: tutum/mongodb
expose:
- "27017"
- "28017"
# volumes:
# - /docker/sharelatex/mongodb:/var/lib/mongodb
# - /docker/sharelatex/mongolog:/var/log/mongodb
environment:
- AUTH=no
redis:
image: redis
expose:
- "6379"
FROM fedora:23
RUN ln -sf /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime && \
dnf -y update && \
dnf -y install git nodejs nodejs-grunt-cli npm make python time strace which \
texlive aspell aspell-en aspell-da \
unzip ImageMagick optipng zlib-devel && \
dnf clean all
RUN git clone https://github.com/sharelatex/sharelatex.git /var/www/sharelatex && \
rm -rf /var/www/sharelatex/.git
COPY setup*.sh /
RUN /setup1.sh
COPY config/services.js /var/www/sharelatex/config/
COPY config/package.json config/git-revision.js /var/www/
COPY config/settings.coffee /etc/sharelatex/
RUN dnf -y install net-tools
RUN /setup2.sh
RUN cd /var/www && npm install
RUN cd /var/www/sharelatex && npm install; grunt install
RUN cd /var/www && node git-revision > revisions.txt
RUN cd /var/www/sharelatex/web && grunt compile:minify
RUN cd /var/www/sharelatex/clsi && grunt compile:bin
ENV SHARELATEX_CONFIG /etc/sharelatex/settings.coffee
RUN dnf -y install supervisor
COPY supervisord.ini /etc/supervisord.d/
RUN dnf -y install nginx
COPY nginx.conf /etc/nginx/
COPY sharelatex.conf /etc/nginx/conf.d/
CMD ["/usr/bin/supervisord"]
var simple = require('simple-git');
var services = require('./sharelatex/config/services');
const fs = require('fs');
function print_latest(repoDir) {
git = simple(repoDir);
opt = [];
opt['max-count'] = 1;
git.log(opt, function(err, log) {
if (!err) {
console.log(repoDir + ',' + log.latest.hash);
}
})
}
for (id in services) {
service = services[id];
dirPath = __dirname + '/sharelatex/'+service.name;
if (fs.existsSync(dirPath)) {
print_latest(dirPath);
}
}
{
"name": "none",
"author": "none",
"description": "none",
"dependencies": {
"grunt": "^0.4.5",
"grunt-docker-io": "^0.7.0",
"simple-git": "^1.32.1",
"grunt-github-api": "^0.2.3"
}
}
module.exports =
[{
name: "web",
repo: "https://github.com/sharelatex/web-sharelatex.git",
version: "master"
}, {
name: "real-time",
repo: "https://github.com/sharelatex/real-time-sharelatex.git",
version: "master"
}, {
name: "document-updater",
repo: "https://github.com/sharelatex/document-updater-sharelatex.git",
version: "master"
}, {
name: "clsi",
repo: "https://github.com/sharelatex/clsi-sharelatex.git",
version: "master"
}, {
name: "filestore",
repo: "https://github.com/sharelatex/filestore-sharelatex.git",
version: "master"
}, {
name: "track-changes",
repo: "https://github.com/sharelatex/track-changes-sharelatex.git",
version: "master"
}, {
name: "docstore",
repo: "https://github.com/sharelatex/docstore-sharelatex.git",
version: "master"
}, {
name: "chat",
repo: "https://github.com/sharelatex/chat-sharelatex.git",
version: "master"
}, {
name: "tags",
repo: "https://github.com/sharelatex/tags-sharelatex.git",
version: "master"
}, {
name: "spelling",
repo: "https://github.com/sharelatex/spelling-sharelatex.git",
version: "master"
}]
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'
settings =
# 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://dockerhost/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 "dockerhost"
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")
template_files: Path.join(DATA_DIR, "template_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'
# The name this is used to describe your ShareLaTeX Installation
appName: process.env["SHARELATEX_APP_NAME"] or "ShareLaTeX (Community Edition)"
nav:
title: process.env["SHARELATEX_NAV_TITLE"] or process.env["SHARELATEX_APP_NAME"] or "ShareLaTeX Comunity Edition"
# The email address which users will be directed to as the main point of
# contact for this installation of ShareLaTeX.
adminEmail: process.env["SHARELATEX_ADMIN_EMAIL"] or "placeholder@example.com"
# If provided, a sessionSecret is used to sign cookies so that they cannot be
# spoofed. This is recommended.
security:
sessionSecret: process.env["SHARELATEX_SESSION_SECRET"] or "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: process.env["SHARELATEX_BEHIND_PROXY"] or false
# 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"
# templates:
# port: templatesPort = 3007
# 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}"
# templates:
# url: "http://localhost:#{templatesPort}"
#### OPTIONAL CONFIGERABLE SETTINGS
# 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
if process.env["SHARELATEX_EMAIL_FROM_ADDRESS"]
settings.email =
fromAddress: process.env["SHARELATEX_EMAIL_FROM_ADDRESS"]
replyTo: process.env["SHARELATEX_EMAIL_REPLY_TO"] or ""
parameters:
#AWS Creds
AWSAccessKeyID: process.env["SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID"]
AWSSecretKey: process.env["SHARELATEX_EMAIL_AWS_SES_SECRET_KEY"]
#SMTP Creds
host: process.env["SHARELATEX_EMAIL_SMTP_HOST"]
port: process.env["SHARELATEX_EMAIL_SMTP_PORT"],
secure: process.env["SHARELATEX_EMAIL_SMTP_SECURE"]
auth:
user: process.env["SHARELATEX_EMAIL_SMTP_USER"]
pass: process.env["SHARELATEX_EMAIL_SMTP_PASS"]
# Password Settings
# -----------
# These restrict the passwords users can use when registering
# opts are from http://antelle.github.io/passfield
if process.env["SHARELATEX_PASSWORD_VALIDATION_PATTERN"] or process.env["SHARELATEX_PASSWORD_VALIDATION_MIN_LENGTH"] or process.env["SHARELATEX_PASSWORD_VALIDATION_MAX_LENGTH"]
settings.passwordStrengthOptions =
pattern: process.env["SHARELATEX_PASSWORD_VALIDATION_PATTERN"] or "aA$3"
length: {min:process.env["SHARELATEX_PASSWORD_VALIDATION_MIN_LENGTH"] or 8, max: process.env["SHARELATEX_PASSWORD_VALIDATION_MAX_LENGTH"] or 50}
#######################
# ShareLaTeX Server Pro
#######################
# LDAP - SERVER PRO ONLY
# ----------
# Settings below use a working LDAP test server kindly provided by forumsys.com
# When testing with forumsys.com use username = einstein and password = password
if process.env["SHARELATEX_LDAP_HOST"]
settings.ldap =
host: process.env["SHARELATEX_LDAP_HOST"]
dn: process.env["SHARELATEX_LDAP_DN"]
baseSearch: process.env["SHARELATEX_LDAP_BASE_SEARCH"]
filter: process.env["SHARELATEX_LDAP_FILTER"]
failMessage: process.env["SHARELATEX_LDAP_FAIL_MESSAGE"] or 'LDAP User Fail'
fieldName: process.env["SHARELATEX_LDAP_FIELD_NAME"] or 'LDAP User'
placeholder: process.env["SHARELATEX_LDAP_PLACEHOLDER"] or 'LDAP User ID'
emailAtt: process.env["SHARELATEX_LDAP_EMAIL_ATT"] or 'mail'
anonymous: process.env["SHARELATEX_LDAP_ANONYMOUS"] or false
adminDN: process.env["SHARELATEX_LDAP_ADMIN_DN"]
adminPW: process.env["SHARELATEX_LDAP_ADMIN_PW"]
starttls: process.env["SHARELATEX_LDAP_TLS"] or false
tlsOptions:
rejectUnauthorized: process.env["SHARELATEX_LDAP_TLS_OPTS_REJECT_UNAUTH"] or false
ca: process.env["SHARELATEX_LDAP_TLS_OPTS_CA_PATH"] # e.g.'/etc/ldap/ca_certs.pem'
# Compiler
# --------
if process.env["DOCKER_IN_DOCKER"]
clsi:
commandRunner: "docker-runner-sharelatex"
docker:
image: "sharelatex-texlive"
env:
PATH: process.env["COMPILER_PATH"] or "/usr/local/texlive/2015/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
user: "tex"
# Templates
# ---------
if process.env["SHARELATEX_TEMPLATES_USER_ID"]
templates:
mountPointUrl: "/templates"
user_id: process.env["SHARELATEX_TEMPLATES_USER_ID"]
# 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
module.exports = settings
daemon off;
user nginx;
worker_processes auto;
pid /var/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";
client_max_body_size 50m;
# 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;
}
#!/usr/bin/bash
# Waiting for mongodb to startup
#until nc -z localhost 27017; do
# sleep 1
#done
export SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee
/usr/bin/node /var/www/sharelatex/chat/app.js >> /var/log/sharelatex/chat.log 2>&1 &
/usr/bin/node /var/www/sharelatex/clsi/app.js >> /var/log/sharelatex/clsi.log 2>&1 &
/usr/bin/node /var/www/sharelatex/docstore/app.js >> /var/log/sharelatex/docstore.log 2>&1 &
/usr/bin/node /var/www/sharelatex/document-updater/app.js >> /var/log/sharelatex/document-updater.log 2>&1 &
/usr/bin/node /var/www/sharelatex/filestore/app.js >> /var/log/sharelatex/filestore.log 2>&1 &
/usr/bin/node /var/www/sharelatex/real-time/app.js >> /var/log/sharelatex/real-time.log 2>&1 &
/usr/bin/node /var/www/sharelatex/spelling/app.js >> /var/log/sharelatex/spelling.log 2>&1 &
/usr/bin/node /var/www/sharelatex/tags/app.js >> /var/log/sharelatex/tags.log 2>&1 &
/usr/bin/node /var/www/sharelatex/track-changes/app.js >> /var/log/sharelatex/track-changes.log 2>&1 &
/usr/bin/node /var/www/sharelatex/web/app.js >> /var/log/sharelatex/web.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/chat/app.js >> /var/log/sharelatex/chat.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/clsi/app.js >> /var/log/sharelatex/clsi.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/docstore/app.js >> /var/log/sharelatex/docstore.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/document-updater/app.js >> /var/log/sharelatex/document-updater.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/filestore/app.js >> /var/log/sharelatex/filestore.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/real-time/app.js >> /var/log/sharelatex/real-time.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/spelling/app.js >> /var/log/sharelatex/spelling.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/tags/app.js >> /var/log/sharelatex/tags.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/track-changes/app.js >> /var/log/sharelatex/track-changes.log 2>&1 &
#exec /sbin/setuser sharelatex /usr/bin/node /var/www/sharelatex/web/app.js >> /var/log/sharelatex/web.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/chat/app.js >> /data/logs/chat.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/clsi/app.js >> /data/logs/clsi.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/docstore/app.js >> /data/logs/docstore.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/document-updater/app.js >> /data/logs/document-updater.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/filestore/app.js >> /data/logs/filestore.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/real-time/app.js >> /data/logs/real-time.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/spelling/app.js >> /data/logs/spelling.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/tags/app.js >> /data/logs/tags.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/track-changes/app.js >> /data/logs/track-changes.log 2>&1 &
#SHARELATEX_CONFIG=/etc/sharelatex/settings.coffee node /sharelatex/web/app.js >> /data/logs/web.log 2>&1
#cd /sharelatex && grunt migrate -v
#!/usr/bin/bash
adduser --system --home /var/www/sharelatex --no-create-home sharelatex
mkdir /var/log/sharelatex
mkdir /etc/sharelatex
mkdir -p /var/lib/sharelatex/data/user_files
mkdir -p /var/lib/sharelatex/data/compiles
mkdir -p /var/lib/sharelatex/data/cache
mkdir -p /var/lib/sharelatex/tmp/uploads
mkdir -p /var/lib/sharelatex/tmp/dumpFolder
chown sharelatex:sharelatex /var/log/sharelatex
chown -R sharelatex:sharelatex /var/lib/sharelatex
#!/usr/bin/bash
# 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
# See the bottom of http://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
echo "`route -n | awk '/UG[ \t]/{print $2}'` dockerhost" >> /etc/hosts
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://127.0.0.1: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://127.0.0.1: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/;
}
}
[supervisord]
nodaemon=true
[program:chat]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/chat/app.js >> /var/log/sharelatex/chat.log 2>&1"
[program:clsi]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/clsi/app.js >> /var/log/sharelatex/clsi.log 2>&1"
[program:docstore]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/docstore/app.js >> /var/log/sharelatex/docstore.log 2>&1"
[program:document-updater]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/document-updater/app.js >> /var/log/sharelatex/document-updater.log 2>&1"
[program:filestore]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/filestore/app.js /var/log/sharelatex/filestore.log 2>&1"
[program:real-time]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/real-time/app.js >> /var/log/sharelatex/real-time.log 2>&1"
[program:spelling]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/spelling/app.js >> /var/log/sharelatex/spelling.log 2>&1"
[program:tags]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/tags/app.js >> /var/log/sharelatex/tags.log 2>&1"
[program:track-changes]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/track-changes/app.js >> /var/log/sharelatex/track-changes.log 2>&1"
[program:web]
command=/bin/bash -c "/usr/bin/node /var/www/sharelatex/web/app.js >> /var/log/sharelatex/web.log 2>&1"
[program:nginx]
command=/usr/sbin/nginx
stdout_events_enabled=true
stderr_events_enabled=true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment