shift enable brotli to boot, it is more correct there
authorSam <sam.saffron@gmail.com>
Tue, 7 Jun 2016 08:24:17 +0000 (18:24 +1000)
committerSam <sam.saffron@gmail.com>
Tue, 7 Jun 2016 08:24:17 +0000 (18:24 +1000)
templates/web.template.yml

index f6aa060bdde3be5c21db2c1c3c46177fa819f14e..fdd8de820aec487b0aca7528b36c3b3933213f7d 100644 (file)
@@ -50,6 +50,13 @@ run:
         # find DISCOURSE_ env vars, strip the leader, lowercase the key
         /usr/local/bin/ruby -e 'ENV.each{|k,v| puts "#{$1.downcase} = #{v}" if k =~ /^DISCOURSE_(.*)/}' > $conf
 
+  - file:
+     path: /etc/runit/1.d/enable-brotli
+     chmod: "+x"
+     contents: |
+        #!/bin/bash
+        [ ! -z "$COMPRESS_BROTLI" ] && sed -i "s/. brotli/  brotli/" /etc/nginx/conf.d/discourse.conf || sed -i "s/. brotli/# brotli/" /etc/nginx/conf.d/discourse.conf
+
   - file:
      path: /etc/runit/1.d/ensure-web-nginx-read
      chmod: "+x"
@@ -118,7 +125,6 @@ run:
         - "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf"
         - "rm /etc/nginx/sites-enabled/default"
         - "mkdir -p /var/nginx/cache"
-        - '/bin/bash -c ''([ ! -z "$COMPRESS_BROTLI"] && sed -i "s/# brotli/brotli/" /etc/nginx/conf.d/discourse.conf) || exit 0'''
 
   - replace:
       filename: /etc/nginx/nginx.conf