From 2646aa5eeec7da0b852174ee357e9a9c538dd350 Mon Sep 17 00:00:00 2001 From: "J. Elfring (x)" Date: Sat, 19 Dec 2020 14:34:21 +0100 Subject: [PATCH] PROSODY: Serve bootstrap4 and jquery by default --- prosody-0.11/Dockerfile | 17 +++++++++++++++++ prosody-0.11/assets/prosody.cfg.lua | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/prosody-0.11/Dockerfile b/prosody-0.11/Dockerfile index d4207e4..48197b5 100644 --- a/prosody-0.11/Dockerfile +++ b/prosody-0.11/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer "J. Elfring " RUN apk add --no-cache \ --update \ ca-certificates \ + curl \ libcrypto1.1 \ libidn \ lua5.2 \ @@ -58,9 +59,25 @@ RUN set -x \ && rm -f /usr/local/bin/busted \ && apk del .build-deps +## Some static files (e.g. for the invite module) +RUN mkdir /usr/local/var/lib/www \ + && mkdir -p /usr/local/var/lib/javascript/bootstrap4/css \ + && curl --silent --output /usr/local/var/lib/javascript/bootstrap4/css/bootstrap.min.css \ + "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" \ + && mkdir -p /usr/local/var/lib/javascript/bootstrap4/js \ + && curl --silent --output /usr/local/var/lib/javascript/bootstrap4/js/bootstrap.min.js \ + "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" \ + && mkdir -p /usr/local/var/lib/javascript/jquery \ + && curl --silent --output /usr/local/var/lib/javascript/jquery/jquery.min.js \ + "https://code.jquery.com/jquery-3.5.1.min.js" + +## Add Default config COPY ./assets/prosody.cfg.lua /usr/local/etc/prosody/prosody.cfg.lua RUN chown daemon:daemon /usr/local/var/lib/prosody + + + EXPOSE 5000 5222 5269 5347 5280 5281 VOLUME ["/usr/local/etc/prosody", "/usr/local/var/lib/prosody"] diff --git a/prosody-0.11/assets/prosody.cfg.lua b/prosody-0.11/assets/prosody.cfg.lua index 4bc5dfb..b8361ba 100644 --- a/prosody-0.11/assets/prosody.cfg.lua +++ b/prosody-0.11/assets/prosody.cfg.lua @@ -65,8 +65,9 @@ modules_enabled = { --"admin_telnet"; -- Opens telnet console interface on localhost port 5582 -- HTTP modules + "http_files"; -- Serve static files from a directory over HTTP + "http_libjs"; -- Serve static files from a directory over HTTP --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" - --"http_files"; -- Serve static files from a directory over HTTP -- Other specific functionality "watchregistrations"; -- Alert admins of registrations @@ -182,6 +183,9 @@ muc_log_by_default = true; -- Enable logging by default (can be disabled in room muc_log_all_rooms = false; -- set to true to force logging of all rooms max_history_messages = 20; +-- Common htp server for static files +http_files_dir = "/usr/local/var/lib/www"; +libjs_path = "/usr/local/var/lib/javascript"; ----------- Virtual hosts ----------- -- You need to add a VirtualHost entry for each domain you wish Prosody to serve.