#xmpp

app xmpp-http-upload

A simple external http upload server for XMPP / Jabber

8 releases

Uses new Rust 2024

0.6.0 Mar 5, 2026
0.5.2 Jan 13, 2025
0.5.1 Aug 14, 2024
0.4.2 Jul 27, 2024
0.3.2 Apr 15, 2024

#1088 in Network programming

MIT license

55KB
1.5K SLoC

About

A light external HTTP upload server for XMPP user upload, compatible with prosody and ejabberd configurations. It currently covers the following features:

  • Block mime types
  • Remove files when they exceed a time delta
  • Logging traffic
  • Saves metadata in a small database (depends on the chosen backend)
  • Switch between implementation versions
  • Run the server as an own daemon

Prerequisites

A Python installation of at least version 3.0. A Rust installation of version 1.70 or higher.

Optionally (correspondingly for each backend):

  • SQLite (default in config)
  • PostgreSQL

Automatic Installation

This will install automatically system-wide for you, but you need to set the log path to match your configuration in install.py, otherwise you can still create/remove the directory yourself. You should build beforehand using cargo build --release or use the --compile CLI flag to automatically compile. Depending on your setup you might need to set the environment vars PREFIX and ETC_PREFIX.

Note:
If you cross-compile, you need to set the COMPILE_TARGET with the build target of rustc in the script to use the automatic installation. See Cross-Compile.

Clone the repository using git:

git clone https://gitlab.com/nyovaya/xmpp-http-upload

Enter the directory

cd xmpp-http-upload

Run to install:

# ./install.py install

If you want to uninstall:

# ./install.py uninstall

Starting the service

Systemd

Start the service:

# systemctl start xmpp-http-upload

Stop the service:

# systemctl stop xmpp-http-upload

OpenRC

Start service:

# service xmpp-http-upload start

Stop service:

# service xmpp-http-upload stop

Manually Daemonized

Run as root:

# /usr/bin/xmpp-http-upload -c [CONFIG FILE]

And to kill the process:

kill prep xmpp-http-upload

XMPP Setup

This depends on your XMPP server software and should be looked up in the corresponding documentation.

Prosody

See the following website, how the configuration works in Prosody.

Ejabberd

Use the following lines in your Ejabberd config file:

mod_http_upload:
  put_url: "https://your-upload-url.here"
  external_secret: "secret"

Note

Dont forget to properly remap the url in your reverse proxy, otherwise you might run into 404/403/503 requests. For lightpd see: mod_proxy under proxy.header.

Dependencies

~6–10MB
~188K SLoC