Skip to content

Commit

Permalink
Generate Secret keys properly and start services on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
James Allen committed Aug 19, 2014
1 parent 94ce0d3 commit c2ebfcc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package/upstart/sharelatex-template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
description "sharelatex-web"
author "ShareLaTeX <[email protected]>"

start on started mountall
start on (local-filesystems and net-device-up IFACE!=lo)
stop on shutdown

respawn
Expand Down

0 comments on commit c2ebfcc

Please sign in to comment.