~nicoco/slidge-prosody-dev

b7563add635c970430fed84b6acfca6f62afda58 — nicoco 11 months ago
Initial commit
3 files changed, 100 insertions(+), 0 deletions(-)

A .build.yml
A Dockerfile
A prosody.cfg.lua
A  => .build.yml +21 -0
@@ 1,21 @@
image: alpine/3.17
packages:
  - docker
  - docker-cli-buildx
secrets:
  - 173244e1-c233-43de-969f-65965c5487e1
tasks:
  - set-project: |
      echo PROJECT=$(ls ~) >> ~/.buildenv
  - setup-docker1: |
      sudo service docker start
      sudo addgroup build docker
  - setup-docker2: |
      while ! test -e /var/run/docker.sock; do sleep 1; done
      docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
      docker buildx create --use
  - build: |
      cd $PROJECT
      docker buildx build . \
        --tag docker.io/nicocool84/slidge-prosody-dev:latest \
        --push

A  => Dockerfile +17 -0
@@ 1,17 @@
# prosody container for dev
FROM docker.io/library/debian:stable AS prosody

RUN apt-get update -y && apt-get install -y --no-install-recommends extrepo && extrepo enable prosody
RUN apt-get update -y && apt-get install -y --no-install-recommends lua5.2 liblua5.2-dev luarocks prosody lua-unbound

RUN prosodyctl install --server=https://modules.prosody.im/rocks/ mod_privilege
RUN prosodyctl install --server=https://modules.prosody.im/rocks/ mod_conversejs

RUN mkdir -p /var/run/prosody && chown prosody:prosody /var/run/prosody
RUN prosodyctl register test localhost password

COPY ./prosody.cfg.lua /etc/prosody/prosody.cfg.lua

USER prosody

ENTRYPOINT ["prosody", "-F"]

A  => prosody.cfg.lua +62 -0
@@ 1,62 @@
-- A prosody config file suited for the development of slidge gateways

daemonize = false;
admins = { "test@localhost" }

modules_enabled = {
    "roster"; -- Allow users to have a roster. Recommended ;)
    "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
    "tls"; -- Add support for secure TLS on c2s/s2s connections
    "dialback"; -- s2s dialback support
    "disco"; -- Service discovery
    "carbons"; -- Keep multiple clients in sync
    "pep"; -- Enables users to publish their avatar, mood, activity, playing music and more
    "private"; -- Private XML storage (for room bookmarks, etc.)
    "blocklist"; -- Allow users to block communications with other users
    "vcard4"; -- User profiles (stored in PEP)
    "vcard_legacy"; -- Conversion between legacy vCard and PEP Avatar, vcard
    "limits"; -- Enable bandwidth limiting for XMPP connections
    "version"; -- Replies to server version requests
    "uptime"; -- Report how long server has been running
    "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
    "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
    "bookmarks"; -- Conversion between different bookmarks formats
    "privilege";
}

allow_registration = true
c2s_require_encryption = false
s2s_require_encryption = false
s2s_secure_auth = true

pidfile = "/var/run/prosody/prosody.pid"

authentication = "internal_hashed"

archive_expires_after = "1w"

log = {
    {levels = {min = "debug"}, to = "console"};
}

certificates = "certs"

local _privileges = {
    roster = "both";
    message = "outgoing";
    iq = { ["http://jabber.org/protocol/pubsub"] = "both"; };
 }

VirtualHost "localhost"
  privileged_entities = { ["slidge.localhost"] = _privileges }

Component "slidge.localhost"
  component_secret = "secret"
  modules_enabled = {"privilege"}

plugin_server = "https://modules.prosody.im/rocks/"
installer_plugin_path = "/usr/local/lib/prosody/"
http_file_share_daily_quota = 1024*1024*1024