Migrate ejabberd uploads to mod_s3_upload and Garage

In addition to installing and configuring the new module, this also
enables public access to the S3 API via `bucket-name.s3.kosmos.org` as
well as Web access on `bucket-name.web.s3.kosmos.org` (when enabled).

Also includes some drive-by improvements to Chef attribute naming and
usage.

Co-authored-by: Greg Karékinian <greg@karekinian.com>
This commit is contained in:
Râu Cao
2023-10-10 17:55:55 +02:00
parent 832075dfb2
commit 65d71d6a73
25 changed files with 322 additions and 132 deletions

View File

@@ -77,7 +77,6 @@ listen:
request_handlers:
"/ws": ejabberd_http_ws
"/bosh": mod_bosh
"/upload": mod_http_upload
"/admin": ejabberd_web_admin
custom_headers:
"Access-Control-Allow-Origin": "*"
@@ -261,6 +260,22 @@ modules:
mod_stream_mgmt: {}
mod_s2s_dialback: {}
mod_http_api: {}
mod_muc_rtbl: {}
mod_s3_upload:
region: <%= @mod_s3_upload[:region] %>
bucket_url: <%= @mod_s3_upload[:bucket_url] %>
download_url: <%= @mod_s3_upload[:download_url] %>
access_key_id: <%= @mod_s3_upload[:key_id] %>
access_key_secret: <%= @mod_s3_upload[:secret_key] %>
max_size: 104857600
put_ttl: 600
set_public: true
service_name: 'S3 Upload'
access: local
hosts:
<% @hosts.each do |host| -%>
- "upload.<%= host[:name] %>"
<% end -%>
allow_contrib_modules: true

View File

@@ -21,5 +21,5 @@ host_config:
append_host_config:
"<%= @host[:name] %>":
<%= @host[:append_host_config].chomp %>
<%= @host[:append_host_config].chomp %>