Speed up mass-chown
[discourse_docker.git] / templates / web.template.yml
index ab2522f2d2e4604f596564d611dce3dab9c1261d..e71ff7e82321b3cc70c2f1829ac70898590342fb 100644 (file)
@@ -24,22 +24,7 @@ params:
   upload_size: 10m
 
 run:
-  # see: https://www.imagemagick.org/discourse-server/viewtopic.php?f=4&t=29588
-  - replace:
-      filename: /usr/local/etc/ImageMagick-6/policy.xml
-      from: "<policymap>"
-      to: |
-        <policymap>
-          <policy domain="coder" rights="none" pattern="EPHEMERAL" />
-          <policy domain="coder" rights="none" pattern="URL" />
-          <policy domain="coder" rights="none" pattern="HTTPS" />
-          <policy domain="coder" rights="none" pattern="MVG" />
-          <policy domain="coder" rights="none" pattern="MSL" />
-          <policy domain="coder" rights="none" pattern="TEXT" />
-          <policy domain="coder" rights="none" pattern="SHOW" />
-          <policy domain="coder" rights="none" pattern="WIN" />
-          <policy domain="coder" rights="none" pattern="PLT" />
-
+  - exec: thpoff echo "thpoff is installed!"
   - exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
   - exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
   - exec: chown -R discourse /home/discourse
@@ -80,7 +65,7 @@ run:
         # postgres
         cd $home
         chown -R discourse:www-data /shared/log/rails
-        LD_PRELOAD=$RUBY_ALLOCATOR HOME=/home/discourse USER=discourse exec chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb
+        LD_PRELOAD=$RUBY_ALLOCATOR HOME=/home/discourse USER=discourse exec thpoff chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb
 
   - file:
      path: /etc/service/nginx/run
@@ -162,7 +147,7 @@ run:
       cmd:
         # ensure we are on latest bundler
         - gem update bundler
-        - chown -R discourse $home
+        - find $home ! -user discourse -exec chown discourse {} \+
 
   - exec:
       cd: $home