From ff3c813c7c310c4786b36a5d16e8cc1af775c968 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 19 Aug 2014 11:24:55 +0100 Subject: [PATCH] Generate Secret keys properly and start services on boot --- server-ce/Gruntfile.coffee | 6 +++--- server-ce/Vagrantfile | 1 + server-ce/package/upstart/sharelatex-template | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server-ce/Gruntfile.coffee b/server-ce/Gruntfile.coffee index f12ab9bb3a..fbb9d489af 100644 --- a/server-ce/Gruntfile.coffee +++ b/server-ce/Gruntfile.coffee @@ -415,9 +415,9 @@ module.exports = (grunt) -> after_install_script = """ #!/bin/sh - # Create random secret keys - sed -i "s/CRYPTO_RANDOM/$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 64 | head -n 1)/" /etc/sharelatex/settings.coffee - sed -i "s/CRYPTO_RANDOM/$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 64 | head -n 1)/" /etc/sharelatex/settings.coffee + # Create random secret keys (twice, once for http auth pass, once for cookie secret). + sed -i "0,/CRYPTO_RANDOM/s/CRYPTO_RANDOM/$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 64 | head -n 1)/" /etc/sharelatex/settings.coffee + sed -i "0,/CRYPTO_RANDOM/s/CRYPTO_RANDOM/$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 64 | head -n 1)/" /etc/sharelatex/settings.coffee sudo adduser --system --group --home /var/www/sharelatex --no-create-home sharelatex diff --git a/server-ce/Vagrantfile b/server-ce/Vagrantfile index d46e3a9d6e..63ddd3b205 100644 --- a/server-ce/Vagrantfile +++ b/server-ce/Vagrantfile @@ -9,6 +9,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.network :forwarded_port, guest: 3000, host: 3000 + config.vm.network :forwarded_port, guest: 80, host: 8080 config.ssh.forward_agent = true diff --git a/server-ce/package/upstart/sharelatex-template b/server-ce/package/upstart/sharelatex-template index 15a0e37683..14af9ccd5a 100644 --- a/server-ce/package/upstart/sharelatex-template +++ b/server-ce/package/upstart/sharelatex-template @@ -1,7 +1,7 @@ description "sharelatex-web" author "ShareLaTeX " -start on started mountall +start on (local-filesystems and net-device-up IFACE!=lo) stop on shutdown respawn