From 2f91f19a8d913ba8f1af75b0120cf53a3afbfa7e Mon Sep 17 00:00:00 2001 From: kev Date: Thu, 19 Dec 2019 04:09:05 +0800 Subject: [PATCH] update prosody --- prosody/README.md | 2 ++ prosody/arm/Dockerfile | 19 +++++++++++++++++++ prosody/arm/docker-compose.yml | 10 ++++++++++ prosody/data/etc/prosody.cfg.lua | 19 +++++++++++-------- prosody/docker-compose.yml | 3 +-- prosody/nginx.conf | 9 +++++++++ 6 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 prosody/arm/Dockerfile create mode 100644 prosody/arm/docker-compose.yml create mode 100644 prosody/nginx.conf diff --git a/prosody/README.md b/prosody/README.md index 6b55025..5263dae 100644 --- a/prosody/README.md +++ b/prosody/README.md @@ -18,6 +18,8 @@ $ docker-compose exec prosody bash >>> prosodyctl adduser admin@localhost Enter new password: ****** Retype new password: ****** +>>> prosodyctl register guest localhost ****** +>>> prosodyctl reload ``` [1]: https://prosody.im/ diff --git a/prosody/arm/Dockerfile b/prosody/arm/Dockerfile new file mode 100644 index 0000000..c74fa1f --- /dev/null +++ b/prosody/arm/Dockerfile @@ -0,0 +1,19 @@ +# +# Dockerfile for prosdoy +# + +FROM multiarch/debian-debootstrap:armhf-buster +MAINTAINER EasyPi Software Foundation + +RUN set -xe \ + && echo "deb http://packages.prosody.im/debian $(lsb_release -sc) main" | tee -a /etc/apt/sources.list \ + && wget https://prosody.im/files/prosody-debian-packages.key -O- | apt-key add - \ + && apt-get update \ + && apt-get install -y prosody \ + && rm -rf /var/lib/apt/lists/* + +EXPOSE 80 443 5222 5269 5347 5280 5281 + +USER prosody +ENV __FLUSH_LOG yes +CMD ["prosody"] diff --git a/prosody/arm/docker-compose.yml b/prosody/arm/docker-compose.yml new file mode 100644 index 0000000..67ed6a9 --- /dev/null +++ b/prosody/arm/docker-compose.yml @@ -0,0 +1,10 @@ +prosody: + image: easypi/prosody-arm + ports: + - "5222:5222" + - "5280:5280" + volumes: + - ./data/etc:/etc/prosody:ro + - ./data/log:/var/log/prosody:rw + - ./data/var:/var/lib/prosody:rw + restart: unless-stopped diff --git a/prosody/data/etc/prosody.cfg.lua b/prosody/data/etc/prosody.cfg.lua index 9fe1bb4..690413b 100644 --- a/prosody/data/etc/prosody.cfg.lua +++ b/prosody/data/etc/prosody.cfg.lua @@ -12,9 +12,12 @@ -- The only thing left to do is rename this file to remove the .dist ending, and fill in the -- blanks. Good luck, and happy Jabbering! -daemonize = false; +daemonize = false +pidfile = "/var/run/prosody/prosody.pid" -pidfile = "/var/run/prosody/prosody.pid"; +cross_domain_bosh = true +consider_bosh_secure = true +consider_websocket_secure = true ---------- Server-wide settings ---------- -- Settings in this section apply to the whole server and are the default settings @@ -24,11 +27,11 @@ pidfile = "/var/run/prosody/prosody.pid"; -- for the server. Note that you must create the accounts separately -- (see https://prosody.im/doc/creating_accounts for info) -- Example: admins = { "user1@example.com", "user2@example.net" } -admins = { } +admins = { "admin@localhost" } -- Enable use of libevent for better performance under high load -- For more information see: https://prosody.im/doc/libevent ---use_libevent = true +use_libevent = true -- Prosody will always look in its source directory for modules, but -- this option allows you to specify additional locations where Prosody @@ -65,16 +68,16 @@ modules_enabled = { "time"; -- Let others know the time here on this server "ping"; -- Replies to XMPP pings with pongs "register"; -- Allow users to register on this server using a client and change passwords - --"mam"; -- Store messages in an archive and allow users to access it - --"csi_simple"; -- Simple Mobile optimizations + "mam"; -- Store messages in an archive and allow users to access it + "csi_simple"; -- Simple Mobile optimizations -- Admin interfaces "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands --"admin_telnet"; -- Opens telnet console interface on localhost port 5582 -- HTTP modules - --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" - --"websocket"; -- XMPP over WebSockets + "bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" + "websocket"; -- XMPP over WebSockets --"http_files"; -- Serve static files from a directory over HTTP -- Other specific functionality diff --git a/prosody/docker-compose.yml b/prosody/docker-compose.yml index 159f25f..afa9c21 100644 --- a/prosody/docker-compose.yml +++ b/prosody/docker-compose.yml @@ -2,8 +2,7 @@ prosody: image: prosody/prosody ports: - "5222:5222" - - "5269:5269" - - "5347:5347" + - "5280:5280" volumes: - ./data/etc:/etc/prosody:ro - ./data/log:/var/log/prosody:rw diff --git a/prosody/nginx.conf b/prosody/nginx.conf new file mode 100644 index 0000000..04b107a --- /dev/null +++ b/prosody/nginx.conf @@ -0,0 +1,9 @@ +stream { + upstream backend { + server xmpp.example.com:5222; + } + server { + listen 5222; + proxy_pass backend:5222; + } +}