From c23ea9f1cf4e90eab2eb1ad34385450a47fa109a Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 3 Feb 2016 14:56:11 +0000 Subject: [PATCH 1/9] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eac83edd43..ffda2e1dfb 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ the package name. ### Configuration Options -You can pass configuration options to ShareLaTeX as environment variables: +You can pass the core configuration options to ShareLaTeX as environment variables: ``` $ docker run -d \ @@ -167,6 +167,8 @@ configured correctly! * `SHARELATEX_SECURE_COOKIE`: Set this to something non-zero to use a secure cookie. Only use this if your ShareLaTeX instance is running behind a reverse proxy with SSL configured. +Other settings such as email setup need to be edited in the docker container at /etc/sharelatex/settings.coffee. We realise this is not an ideal solution and are working on a more streamlined settings file approach. + ### Creating and Managing users Uun the following command to create your first user and make them an admin: From 9ed593f22c52b8cf9800c314e8d8f911ed887f1e Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 9 Feb 2016 12:57:05 +0000 Subject: [PATCH 2/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ffda2e1dfb..93e330a74f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -ShareLaTeX Docker Image +ShareLaTeX Comunity Docker Image ======================= **Please read this entire file before installing ShareLaTeX via Docker. It's only From 08ea79a29f4683b5d42ded60c1b7bd9d1b16e3eb Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 8 Mar 2016 16:05:42 +0000 Subject: [PATCH 3/9] change localhost to 127.0.0.1 which should help with ipv6 --- nginx/sharelatex.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx/sharelatex.conf b/nginx/sharelatex.conf index e9d6566ffd..0111797967 100644 --- a/nginx/sharelatex.conf +++ b/nginx/sharelatex.conf @@ -5,7 +5,7 @@ server { set $static_path /var/www/sharelatex/web/public; location / { - proxy_pass http://localhost:3000; + proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; @@ -17,7 +17,7 @@ server { } location /socket.io { - proxy_pass http://localhost:3026; + proxy_pass http://127.0.0.1:3026; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; From 72e6fc60dabd1f1a1b9ef15883ae61af25f391ea Mon Sep 17 00:00:00 2001 From: Vincent von Hof Date: Wed, 20 Apr 2016 12:54:11 +0200 Subject: [PATCH 4/9] Fix a typo in README.md nothing here...moving on --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93e330a74f..af2b50a377 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -ShareLaTeX Comunity Docker Image +ShareLaTeX Community Docker Image ======================= **Please read this entire file before installing ShareLaTeX via Docker. It's only From d4331f84157846ff5840a116ca2cc20ca581a7c9 Mon Sep 17 00:00:00 2001 From: Henrique Santos Date: Wed, 20 Apr 2016 21:55:47 -0300 Subject: [PATCH 5/9] add support for grunt build --- Dockerfile | 11 +++++++++-- Gruntfile.coffee | 38 ++++++++++++++++++++++++++++++++++++++ git-revision.js | 22 ++++++++++++++++++++++ package.json | 11 +++++++++++ services.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 Gruntfile.coffee create mode 100644 git-revision.js create mode 100644 package.json create mode 100644 services.js diff --git a/Dockerfile b/Dockerfile index ff52a33198..7d813bd5d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,15 +14,22 @@ RUN adduser --system --group --home /var/www/sharelatex --no-create-home sharela # Install ShareLaTeX RUN apt-get install -y git python -RUN git clone -b release https://github.com/sharelatex/sharelatex.git /var/www/sharelatex -RUN cd /var/www/sharelatex && git pull origin release +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 + +ADD services.js /var/www/sharelatex/config/services.js +ADD package.json /var/www/package.json +ADD git-revision.js /var/www/git-revision.js +RUN cd /var/www && npm install + RUN cd /var/www/sharelatex; \ npm install; \ grunt install; + +RUN cd /var/www && node git-revision > revisions.txt # Minify js assets RUN cd /var/www/sharelatex/web; \ diff --git a/Gruntfile.coffee b/Gruntfile.coffee new file mode 100644 index 0000000000..0f1d222059 --- /dev/null +++ b/Gruntfile.coffee @@ -0,0 +1,38 @@ +services = require('./services') + +module.exports = (grunt) -> + + tag = grunt.option("tag") or 'latest' + repos = [] + for service in services + url = service.repo.split('/') + owner = url[3] + repo = url[4].replace('.git','') + repos.push "/repos/#{owner}/#{repo}/git/refs/heads/#{service.version}" + + grunt.initConfig + docker_io: + default_options: + options: + dockerFileLocation: '.' + buildName: 'sharelatex' + tag: grunt.option('tag') or 'latest' + push: grunt.option('push') or false + force: true + + github: + combinedRevisions: + options: + #oAuth: + # access_token: '' + concat: true + src: repos + dest: 'version/' + tag + '.json' + + grunt.loadNpmTasks 'grunt-docker-io' + grunt.loadNpmTasks 'grunt-github-api' + + grunt.registerTask 'build', ['docker_io', 'github'] + grunt.registerTask 'gitrev', ['github'] + + grunt.registerTask 'default', ['build'] diff --git a/git-revision.js b/git-revision.js new file mode 100644 index 0000000000..89359cea2e --- /dev/null +++ b/git-revision.js @@ -0,0 +1,22 @@ +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); + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000..329169d96d --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "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" + } +} diff --git a/services.js b/services.js new file mode 100644 index 0000000000..be4da8698a --- /dev/null +++ b/services.js @@ -0,0 +1,43 @@ +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" +}] From b43a58467c0c05ad355e140702752dba00d803e8 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 28 Apr 2016 12:01:30 +0100 Subject: [PATCH 6/9] recommend mongodb 3.x --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af2b50a377..e1a0c228b3 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ docker rm sharelatex ### Mongo and Redis -ShareLaTeX depends on [MongoDB](http://www.mongodb.org/) (must be 2.4 or later), and +ShareLaTeX depends on [MongoDB](http://www.mongodb.org/) (must be 2.4 or later, 3.x is recommended), and [Redis](http://redis.io/) (must be version 2.6.12 or later). These should be running on the host system. From f33ea044085a799a08d7c803e68861f7eb9fd491 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 20 Apr 2016 21:55:47 -0300 Subject: [PATCH 7/9] add support for grunt build --- Dockerfile | 11 +++++++++-- Gruntfile.coffee | 38 ++++++++++++++++++++++++++++++++++++++ git-revision.js | 22 ++++++++++++++++++++++ package.json | 11 +++++++++++ services.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 Gruntfile.coffee create mode 100644 git-revision.js create mode 100644 package.json create mode 100644 services.js diff --git a/Dockerfile b/Dockerfile index ff52a33198..7d813bd5d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,15 +14,22 @@ RUN adduser --system --group --home /var/www/sharelatex --no-create-home sharela # Install ShareLaTeX RUN apt-get install -y git python -RUN git clone -b release https://github.com/sharelatex/sharelatex.git /var/www/sharelatex -RUN cd /var/www/sharelatex && git pull origin release +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 + +ADD services.js /var/www/sharelatex/config/services.js +ADD package.json /var/www/package.json +ADD git-revision.js /var/www/git-revision.js +RUN cd /var/www && npm install + RUN cd /var/www/sharelatex; \ npm install; \ grunt install; + +RUN cd /var/www && node git-revision > revisions.txt # Minify js assets RUN cd /var/www/sharelatex/web; \ diff --git a/Gruntfile.coffee b/Gruntfile.coffee new file mode 100644 index 0000000000..0f1d222059 --- /dev/null +++ b/Gruntfile.coffee @@ -0,0 +1,38 @@ +services = require('./services') + +module.exports = (grunt) -> + + tag = grunt.option("tag") or 'latest' + repos = [] + for service in services + url = service.repo.split('/') + owner = url[3] + repo = url[4].replace('.git','') + repos.push "/repos/#{owner}/#{repo}/git/refs/heads/#{service.version}" + + grunt.initConfig + docker_io: + default_options: + options: + dockerFileLocation: '.' + buildName: 'sharelatex' + tag: grunt.option('tag') or 'latest' + push: grunt.option('push') or false + force: true + + github: + combinedRevisions: + options: + #oAuth: + # access_token: '' + concat: true + src: repos + dest: 'version/' + tag + '.json' + + grunt.loadNpmTasks 'grunt-docker-io' + grunt.loadNpmTasks 'grunt-github-api' + + grunt.registerTask 'build', ['docker_io', 'github'] + grunt.registerTask 'gitrev', ['github'] + + grunt.registerTask 'default', ['build'] diff --git a/git-revision.js b/git-revision.js new file mode 100644 index 0000000000..89359cea2e --- /dev/null +++ b/git-revision.js @@ -0,0 +1,22 @@ +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); + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000..329169d96d --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "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" + } +} diff --git a/services.js b/services.js new file mode 100644 index 0000000000..be4da8698a --- /dev/null +++ b/services.js @@ -0,0 +1,43 @@ +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" +}] From 9a5df51ea44fb7222b1a9af75c55c117eeaaed92 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 2 May 2016 23:55:53 +0000 Subject: [PATCH 8/9] add baseDir for Dockerfile --- Dockerfile | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d813bd5d5..2f9766efaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM phusion/baseimage:0.9.16 +ENV baseDir . + # Install Node.js and Grunt RUN curl -sL https://deb.nodesource.com/setup | sudo bash - RUN apt-get install -y build-essential nodejs @@ -20,9 +22,9 @@ RUN git clone https://github.com/sharelatex/sharelatex.git /var/www/sharelatex RUN apt-get install -y zlib1g-dev -ADD services.js /var/www/sharelatex/config/services.js -ADD package.json /var/www/package.json -ADD git-revision.js /var/www/git-revision.js +ADD ${baseDir}/services.js /var/www/sharelatex/config/services.js +ADD ${baseDir}/package.json /var/www/package.json +ADD ${baseDir}/git-revision.js /var/www/git-revision.js RUN cd /var/www && npm install RUN cd /var/www/sharelatex; \ @@ -39,11 +41,11 @@ RUN cd /var/www/sharelatex/web; \ run apt-get update 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 +ADD ${baseDir}/nginx/nginx.conf /etc/nginx/nginx.conf +ADD ${baseDir}/nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf RUN mkdir /etc/service/nginx -ADD runit/nginx.sh /etc/service/nginx/run +ADD ${baseDir}/runit/nginx.sh /etc/service/nginx/run # Set up ShareLaTeX services to run automatically on boot RUN mkdir /etc/service/chat-sharelatex; \ @@ -57,16 +59,16 @@ RUN mkdir /etc/service/chat-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 +ADD ${baseDir}/runit/chat-sharelatex.sh /etc/service/chat-sharelatex/run +ADD ${baseDir}/runit/clsi-sharelatex.sh /etc/service/clsi-sharelatex/run +ADD ${baseDir}/runit/docstore-sharelatex.sh /etc/service/docstore-sharelatex/run +ADD ${baseDir}/runit/document-updater-sharelatex.sh /etc/service/document-updater-sharelatex/run +ADD ${baseDir}/runit/filestore-sharelatex.sh /etc/service/filestore-sharelatex/run +ADD ${baseDir}/runit/real-time-sharelatex.sh /etc/service/real-time-sharelatex/run +ADD ${baseDir}/runit/spelling-sharelatex.sh /etc/service/spelling-sharelatex/run +ADD ${baseDir}/runit/tags-sharelatex.sh /etc/service/tags-sharelatex/run +ADD ${baseDir}/runit/track-changes-sharelatex.sh /etc/service/track-changes-sharelatex/run +ADD ${baseDir}/runit/web-sharelatex.sh /etc/service/web-sharelatex/run # Install TexLive RUN apt-get install -y wget @@ -93,14 +95,14 @@ RUN apt-get install -y unzip RUN apt-get install -y imagemagick optipng # 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 -ADD 00_set_docker_host_ipaddress.sh /etc/my_init.d/00_set_docker_host_ipaddress.sh -ADD 99_migrate.sh /etc/my_init.d/99_migrate.sh +ADD ${baseDir}/00_regen_sharelatex_secrets.sh /etc/my_init.d/00_regen_sharelatex_secrets.sh +ADD ${baseDir}/00_make_sharelatex_data_dirs.sh /etc/my_init.d/00_make_sharelatex_data_dirs.sh +ADD ${baseDir}/00_set_docker_host_ipaddress.sh /etc/my_init.d/00_set_docker_host_ipaddress.sh +ADD ${baseDir}/99_migrate.sh /etc/my_init.d/99_migrate.sh # Install ShareLaTeX settings file RUN mkdir /etc/sharelatex -ADD settings.coffee /etc/sharelatex/settings.coffee +ADD ${baseDir}/settings.coffee /etc/sharelatex/settings.coffee ENV SHARELATEX_CONFIG /etc/sharelatex/settings.coffee EXPOSE 80 From b4ae96facbfc5884d482695b5bb0f986a5cf594c Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Mon, 9 May 2016 16:08:51 +0100 Subject: [PATCH 9/9] recommend debian/ubuntu --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e1a0c228b3..5d6956d7f6 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ If you want to permanently remove ShareLaTeX from your docker containers: docker rm sharelatex ``` +### Operating systems +We recommend a debian based operating system such as Ubuntu for ShareLaTeX, this is what the software has been developed using and most people use when running ShareLaTeX. + ### Mongo and Redis ShareLaTeX depends on [MongoDB](http://www.mongodb.org/) (must be 2.4 or later, 3.x is recommended), and