From 0fa9e6cbb77936c42b2fa93306339fc85a8320fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 19 Jul 2019 12:47:42 +0200 Subject: [PATCH] Set the uploads dir inside of /opt/ejabberd instead of /var/www /var/www is intended for nginx/apache I have copied over the old directories manually on Andromeda before running this code Fixes #80 --- site-cookbooks/kosmos-ejabberd/metadata.rb | 2 +- site-cookbooks/kosmos-ejabberd/recipes/default.rb | 9 +-------- .../kosmos-ejabberd/templates/ejabberd.yml.erb | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/site-cookbooks/kosmos-ejabberd/metadata.rb b/site-cookbooks/kosmos-ejabberd/metadata.rb index bbd1886..23f0bc1 100644 --- a/site-cookbooks/kosmos-ejabberd/metadata.rb +++ b/site-cookbooks/kosmos-ejabberd/metadata.rb @@ -4,7 +4,7 @@ maintainer_email 'ops@kosmos.org' license 'MIT' description 'Installs/Configures kosmos-ejabberd' long_description 'Installs/Configures kosmos-ejabberd' -version '0.1.0' +version '0.1.1' chef_version '>= 12.14' if respond_to?(:chef_version) # The `issues_url` points to the location where issues for this cookbook are diff --git a/site-cookbooks/kosmos-ejabberd/recipes/default.rb b/site-cookbooks/kosmos-ejabberd/recipes/default.rb index 0d10cb2..0ba3276 100644 --- a/site-cookbooks/kosmos-ejabberd/recipes/default.rb +++ b/site-cookbooks/kosmos-ejabberd/recipes/default.rb @@ -111,14 +111,7 @@ end # Set permissions for the upload folders %w(xmpp.kosmos.org xmpp.5apps.com).each do |domain| - directory "/var/www/#{domain}" do - owner "ejabberd" - group "ejabberd" - mode 0750 - recursive true - end - - directory "/var/www/#{domain}/uploads" do + directory "/opt/ejabberd/uploads/#{domain}" do owner "ejabberd" group "ejabberd" mode 0750 diff --git a/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb b/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb index 7671a07..775ddba 100644 --- a/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb +++ b/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb @@ -208,7 +208,7 @@ modules: urls: ["mailto:abuse@@HOST@"] mod_bosh: {} mod_http_upload: - docroot: "/var/www/xmpp.@HOST@/uploads/" + docroot: "/opt/ejabberd/uploads/xmpp.@HOST@/" put_url: "https://xmpp.@HOST@:5443/upload" thumbnail: false # otherwise needs the identify command from ImageMagick installed mod_last: {}