From 7fbae4169f7ce771726e47111f671b3862c000b2 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Fri, 11 Nov 2022 09:32:41 +0100 Subject: [PATCH 1/2] Add support for HTTP File Upload (cluster-only) This adds a docker volume to each server, configures each Openfire to use that volume as the backend storage for HTTP File Upload, and configures Openfire to use an endpoint _on the load balancer_ as the endpoint for all HTTP file upload web-interaction. Note that the httpfileupload plugin is not added in this commit (as its implementation is still being worked on). --- cluster/docker-compose-clustered.yml | 3 +++ cluster/sql/openfire.sql | 3 +++ cluster/start.sh | 2 ++ 3 files changed, 8 insertions(+) diff --git a/cluster/docker-compose-clustered.yml b/cluster/docker-compose-clustered.yml index 3124794..b209a1b 100644 --- a/cluster/docker-compose-clustered.yml +++ b/cluster/docker-compose-clustered.yml @@ -42,6 +42,7 @@ services: - ./_data/xmpp/1/conf:/var/lib/openfire/conf - ./_data/plugins:/opt/plugins - ../_common/wait-for-it.sh:/wait-for-it.sh + - ./_data/shared-httpfileupload-repo:/mnt/shared-httpfileupload-repo command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"] networks: openfire-clustered-net: @@ -68,6 +69,7 @@ services: - ./_data/xmpp/2/conf:/var/lib/openfire/conf - ./_data/plugins:/opt/plugins - ../_common/wait-for-it.sh:/wait-for-it.sh + - ./_data/shared-httpfileupload-repo:/mnt/shared-httpfileupload-repo command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"] networks: openfire-clustered-net: @@ -94,6 +96,7 @@ services: - ./_data/xmpp/3/conf:/var/lib/openfire/conf - ./_data/plugins:/opt/plugins - ../_common/wait-for-it.sh:/wait-for-it.sh + - ./_data/shared-httpfileupload-repo:/mnt/shared-httpfileupload-repo command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"] networks: openfire-clustered-net: diff --git a/cluster/sql/openfire.sql b/cluster/sql/openfire.sql index b60022e..1aee800 100644 --- a/cluster/sql/openfire.sql +++ b/cluster/sql/openfire.sql @@ -723,6 +723,9 @@ provider.securityAudit.className org.jivesoftware.openfire.security.DefaultSecur provider.user.className org.jivesoftware.openfire.user.DefaultUserProvider 0 \N passwordKey YJ1nKWyrMeGvTKu 0 \N update.lastCheck 1605956807055 0 \N +plugin.httpfileupload.fileRepo /mnt/shared-httpfileupload-repo 0 \N +plugin.httpfileupload.announcedWebPort 57070 0 \N +plugin.httpfileupload.announcedWebProtocol http 0 \N \. diff --git a/cluster/start.sh b/cluster/start.sh index 1ce1fcf..2f0ed4e 100755 --- a/cluster/start.sh +++ b/cluster/start.sh @@ -51,6 +51,8 @@ fi mkdir _data cp -r xmpp _data/ cp -r plugins _data/ +mkdir _data/shared-httpfileupload-repo +chmod 777 _data/shared-httpfileupload-repo "${COMPOSE_FILE_COMMAND[@]}" up -d || popd popd \ No newline at end of file From cafc07d1c6d95effe6b2830a95b2882d82f06fed Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Tue, 15 Nov 2022 17:10:31 +0100 Subject: [PATCH 2/2] Switch to 'per server' storage for HTTP File Upload This replaces functionality added in an earlier commit, that configured Openfire to use a shared volume to store uploaded content, and expose that through the load balancer. Instead, each Openfire server will now store its own data, and exposes it through a distinct URL. This depends on the fix for issue https://github.com/igniterealtime/openfire-httpFileUpload-plugin/issues/40 --- cluster/docker-compose-clustered.yml | 3 --- cluster/sql/openfire.sql | 3 --- cluster/xmpp/1/conf/openfire.xml | 9 +++++++++ cluster/xmpp/2/conf/openfire.xml | 9 +++++++++ cluster/xmpp/3/conf/openfire.xml | 9 +++++++++ 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/cluster/docker-compose-clustered.yml b/cluster/docker-compose-clustered.yml index b209a1b..3124794 100644 --- a/cluster/docker-compose-clustered.yml +++ b/cluster/docker-compose-clustered.yml @@ -42,7 +42,6 @@ services: - ./_data/xmpp/1/conf:/var/lib/openfire/conf - ./_data/plugins:/opt/plugins - ../_common/wait-for-it.sh:/wait-for-it.sh - - ./_data/shared-httpfileupload-repo:/mnt/shared-httpfileupload-repo command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"] networks: openfire-clustered-net: @@ -69,7 +68,6 @@ services: - ./_data/xmpp/2/conf:/var/lib/openfire/conf - ./_data/plugins:/opt/plugins - ../_common/wait-for-it.sh:/wait-for-it.sh - - ./_data/shared-httpfileupload-repo:/mnt/shared-httpfileupload-repo command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"] networks: openfire-clustered-net: @@ -96,7 +94,6 @@ services: - ./_data/xmpp/3/conf:/var/lib/openfire/conf - ./_data/plugins:/opt/plugins - ../_common/wait-for-it.sh:/wait-for-it.sh - - ./_data/shared-httpfileupload-repo:/mnt/shared-httpfileupload-repo command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"] networks: openfire-clustered-net: diff --git a/cluster/sql/openfire.sql b/cluster/sql/openfire.sql index 1aee800..b60022e 100644 --- a/cluster/sql/openfire.sql +++ b/cluster/sql/openfire.sql @@ -723,9 +723,6 @@ provider.securityAudit.className org.jivesoftware.openfire.security.DefaultSecur provider.user.className org.jivesoftware.openfire.user.DefaultUserProvider 0 \N passwordKey YJ1nKWyrMeGvTKu 0 \N update.lastCheck 1605956807055 0 \N -plugin.httpfileupload.fileRepo /mnt/shared-httpfileupload-repo 0 \N -plugin.httpfileupload.announcedWebPort 57070 0 \N -plugin.httpfileupload.announcedWebProtocol http 0 \N \. diff --git a/cluster/xmpp/1/conf/openfire.xml b/cluster/xmpp/1/conf/openfire.xml index 792d76f..a4d5bfe 100644 --- a/cluster/xmpp/1/conf/openfire.xml +++ b/cluster/xmpp/1/conf/openfire.xml @@ -64,4 +64,13 @@ true + + + + http + localhost + 7071 + + + diff --git a/cluster/xmpp/2/conf/openfire.xml b/cluster/xmpp/2/conf/openfire.xml index 0cb579c..c722e47 100644 --- a/cluster/xmpp/2/conf/openfire.xml +++ b/cluster/xmpp/2/conf/openfire.xml @@ -64,4 +64,13 @@ true + + + + http + localhost + 7072 + + + diff --git a/cluster/xmpp/3/conf/openfire.xml b/cluster/xmpp/3/conf/openfire.xml index 8e9fbfd..27d5a8f 100644 --- a/cluster/xmpp/3/conf/openfire.xml +++ b/cluster/xmpp/3/conf/openfire.xml @@ -64,4 +64,13 @@ true + + + + http + localhost + 7073 + + +