Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d74a56f88 |
@@ -1,9 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## v1.3.2
|
|
||||||
|
|
||||||
* Added Firewall module with optional custom blacklist
|
|
||||||
|
|
||||||
## v1.3.1
|
## v1.3.1
|
||||||
|
|
||||||
* Added optional Firewall module for testing
|
* Added optional Firewall module for testing
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ RUN download-prosody-modules.bash \
|
|||||||
smacks `# stream management (XEP-0198)` \
|
smacks `# stream management (XEP-0198)` \
|
||||||
throttle_presence `# presence throttling in CSI` \
|
throttle_presence `# presence throttling in CSI` \
|
||||||
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)` \
|
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)` \
|
||||||
|
&& docker-prosody-module-pre-install.bash \
|
||||||
firewall `# anti-spam firewall` \
|
firewall `# anti-spam firewall` \
|
||||||
&& rm -rf "/usr/src/prosody-modules"
|
&& rm -rf "/usr/src/prosody-modules"
|
||||||
RUN echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf
|
RUN echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
plugin_paths = { "/usr/local/lib/prosody/custom-modules/" };
|
plugin_paths = { "/usr/local/lib/prosody/custom-modules/" };
|
||||||
|
|
||||||
-- table of enabled modules
|
-- table of enabled modules
|
||||||
-- local mods_enabled = {
|
local mods_enabled = {
|
||||||
modules_enabled = {
|
|
||||||
-- Generally required
|
-- Generally required
|
||||||
"roster"; -- Allow users to have a roster. Recommended ;)
|
"roster"; -- Allow users to have a roster. Recommended ;)
|
||||||
"saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
|
"saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
|
||||||
@@ -49,7 +48,19 @@ modules_enabled = {
|
|||||||
"server_contact_info"; -- This module lets you advertise various contact addresses for your XMPP service via XEP-0157.
|
"server_contact_info"; -- This module lets you advertise various contact addresses for your XMPP service via XEP-0157.
|
||||||
};
|
};
|
||||||
|
|
||||||
-- modules_enabled = mods_enabled;
|
local enabled = os.getenv("ENABLE_FIREWALL") or "false"
|
||||||
|
local spam_blocklist = os.getenv("SPAM_BLOCKLIST") and "/usr/local/etc/prosody/firewall/" .. os.getenv("SPAM_BLOCKLIST") or "module:scripts/spam-blocklists.pfw"
|
||||||
|
|
||||||
|
if(enabled == "true")
|
||||||
|
then
|
||||||
|
table.insert(mods_enabled, "firewall");
|
||||||
|
|
||||||
|
firewall_scripts = {
|
||||||
|
spam_blocklist;
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
modules_enabled = mods_enabled;
|
||||||
|
|
||||||
-- These modules are auto-loaded, but should you want
|
-- These modules are auto-loaded, but should you want
|
||||||
-- to disable them then uncomment them here:
|
-- to disable them then uncomment them here:
|
||||||
@@ -58,3 +69,4 @@ modules_disabled = {
|
|||||||
-- "c2s"; -- Handle client connections
|
-- "c2s"; -- Handle client connections
|
||||||
-- "s2s"; -- Handle server-to-server connections
|
-- "s2s"; -- Handle server-to-server connections
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,7 @@ for ext in $exts; do
|
|||||||
# Skip this if the modules should not be added to modules_enabled.
|
# Skip this if the modules should not be added to modules_enabled.
|
||||||
if [ "$ext" != "http_upload" ] && [ "$ext" != "vcard_muc" ] ; then
|
if [ "$ext" != "http_upload" ] && [ "$ext" != "vcard_muc" ] ; then
|
||||||
echo " - enabling within ${config}"
|
echo " - enabling within ${config}"
|
||||||
new_config=$(cat "${config}" | module="${ext}" perl -0pe 's/(modules_enabled[ ]*=[ ]*{[^}]*)};/$1\n\t"$ENV{module}";\n};/')
|
new_config=$(cat "${config}" | module="${ext}" perl -0pe 's/(mods_enabled[ ]*=[ ]*{[^}]*)};/$1\n\t"$ENV{module}";\n};/')
|
||||||
echo "${new_config}" > "${config}"
|
echo "${new_config}" > "${config}"
|
||||||
fi
|
fi
|
||||||
# firewall module configuration
|
|
||||||
if [ "$ext" == "firewall" ] ; then
|
|
||||||
echo " - setting up mod_${ext}"
|
|
||||||
new_config=$(cat "${config}" | echo -e "\nlocal spam_blocklist = os.getenv(\"SPAM_BLOCKLIST\") and \"/usr/local/etc/prosody/firewall/\" .. os.getenv(\"SPAM_BLOCKLIST\") or \"module:scripts/spam-blocklists.pfw\"\n\nfirewall_scripts = {\n\tspam_blocklist;\n};")
|
|
||||||
echo "${new_config}" >> "${config}"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source="/usr/src/prosody-modules"
|
||||||
|
target="/usr/local/lib/prosody/custom-modules"
|
||||||
|
|
||||||
|
cd ${source}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: $0 ext-name [ext-name ...]"
|
||||||
|
echo " ie: $0 carbons e2e_policy proxy65"
|
||||||
|
echo
|
||||||
|
echo 'Possible values for ext-name:'
|
||||||
|
find . -mindepth 1 -maxdepth 1 -type d | sort | sed s/\.\\/mod_//g | xargs
|
||||||
|
}
|
||||||
|
|
||||||
|
exts=
|
||||||
|
for ext; do
|
||||||
|
if [ -z "mod_$ext" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [ ! -d "mod_$ext" ]; then
|
||||||
|
echo >&2 "error: $PWD/mod_$ext does not exist"
|
||||||
|
echo >&2
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exts="$exts $ext"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$exts" ]; then
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for ext in $exts; do
|
||||||
|
echo "Installing mod_${ext}"
|
||||||
|
|
||||||
|
echo " - copying to ${target}"
|
||||||
|
cp -r "${source}/mod_${ext}" "${target}/"
|
||||||
|
|
||||||
|
done
|
||||||
@@ -2,16 +2,13 @@ bashtel.ru
|
|||||||
creep.im
|
creep.im
|
||||||
darkengine.biz
|
darkengine.biz
|
||||||
default.rs
|
default.rs
|
||||||
exploit.im
|
|
||||||
hiddenlizard.org
|
hiddenlizard.org
|
||||||
jabber.bitactive.com
|
jabber.bitactive.com
|
||||||
jabber.cd
|
jabber.cd
|
||||||
jabber.cz
|
|
||||||
jabber.freenet.de
|
jabber.freenet.de
|
||||||
jabber.ipredator.se
|
jabber.ipredator.se
|
||||||
jabber.npw.net
|
jabber.npw.net
|
||||||
jabber.sampo.ru
|
jabber.sampo.ru
|
||||||
jabbim.pl
|
|
||||||
labas.biz
|
labas.biz
|
||||||
otr.chat
|
otr.chat
|
||||||
paranoid.scarab.name
|
paranoid.scarab.name
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# Prosody XMPP Docker image
|
# Prosody XMPP Docker image
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
[](https://microbadger.com/images/sarasmiseth/prosody:latest)
|
||||||
|
[](https://microbadger.com/images/sarasmiseth/prosody:latest)
|
||||||
|
[](https://hub.docker.com/r/sarasmiseth/prosody/)
|
||||||
|
[](https://hub.docker.com/r/sarasmiseth/prosody/)
|
||||||
|
[](https://github.com/SaraSmiseth/prosody/issues)
|
||||||
|
[](https://github.com/SaraSmiseth/prosody/pulls)
|
||||||
|
|
||||||
This docker image forked from [SaraSmiseth](https://github.com/SaraSmiseth)'s [repository](https://github.com/SaraSmiseth/prosody) provides you with a configured [Prosody](https://prosody.im/) XMPP server. Includes the _prosody-migrator_ tool for data migrations between different database types and there is also an option to create a bridges between the XMPP server and the most popular messaging services like Telegram or Matrix, via [Matterbridge](https://github.com/42wim/matterbridge). The image is based on `debian:bookworm-slim`.
|
This docker image forked from [SaraSmiseth](https://github.com/SaraSmiseth)'s [repository](https://github.com/SaraSmiseth/prosody) provides you with a configured [Prosody](https://prosody.im/) XMPP server. Includes the _prosody-migrator_ tool for data migrations between different database types and there is also an option to create a bridges between the XMPP server and the most popular messaging services like Telegram or Matrix, via [Matterbridge](https://github.com/42wim/matterbridge). The image is based on `debian:bookworm-slim`.
|
||||||
The server was tested using the Android App [Conversations](https://conversations.im/) and the Desktop client [Gajim](https://gajim.org).
|
The server was tested using the Android App [Conversations](https://conversations.im/) and the Desktop client [Gajim](https://gajim.org).
|
||||||
Multiple [architectures](https://hub.docker.com/r/sarasmiseth/prosody/tags) are supported. I use it on my raspberry pi 4.
|
Multiple [architectures](https://hub.docker.com/r/sarasmiseth/prosody/tags) are supported. I use it on my raspberry pi 4.
|
||||||
@@ -45,7 +54,7 @@ While Conversations got everything set-up out-of-the-box, Gajim was used with th
|
|||||||
* Secure by default
|
* Secure by default
|
||||||
* SSL certificate required
|
* SSL certificate required
|
||||||
* End-to-end encryption required (using [OMEMO](https://conversations.im/omemo/) or [OTR](https://en.wikipedia.org/wiki/Off-the-Record_Messaging))
|
* End-to-end encryption required (using [OMEMO](https://conversations.im/omemo/) or [OTR](https://en.wikipedia.org/wiki/Off-the-Record_Messaging))
|
||||||
* Anti-spam filter (based on [Firewall](https://modules.prosody.im/mod_firewall) module)
|
* Anti-spam filter (based on the pre-installed [Firewall](https://modules.prosody.im/mod_firewall) module)
|
||||||
* Data storage
|
* Data storage
|
||||||
* SQLite message store
|
* SQLite message store
|
||||||
* Configured file upload and image sharing
|
* Configured file upload and image sharing
|
||||||
@@ -149,7 +158,7 @@ docker build -t prosody/xmpp .
|
|||||||
Next I recommend using a ```docker-compose.yml``` file:
|
Next I recommend using a ```docker-compose.yml``` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3.9'
|
version: '3.7'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
@@ -237,6 +246,7 @@ sudo chown 999:999 ./data
|
|||||||
| **SERVER_CONTACT_INFO_SECURITY** | A list of strings. Each string should be an URI. See [here](https://prosody.im/doc/modules/mod_server_contact_info). | *optional* | "xmpp:security@**DOMAIN**" |
|
| **SERVER_CONTACT_INFO_SECURITY** | A list of strings. Each string should be an URI. See [here](https://prosody.im/doc/modules/mod_server_contact_info). | *optional* | "xmpp:security@**DOMAIN**" |
|
||||||
| **SERVER_CONTACT_INFO_SUPPORT** | A list of strings. Each string should be an URI. See [here](https://prosody.im/doc/modules/mod_server_contact_info). | *optional* | "xmpp:support@**DOMAIN**" |
|
| **SERVER_CONTACT_INFO_SUPPORT** | A list of strings. Each string should be an URI. See [here](https://prosody.im/doc/modules/mod_server_contact_info). | *optional* | "xmpp:support@**DOMAIN**" |
|
||||||
| **PROSODY_ADMINS** | Specify who is an administrator. List of adresses. Eg. "me@example.com", "admin@example.net" | *optional* | "" |
|
| **PROSODY_ADMINS** | Specify who is an administrator. List of adresses. Eg. "me@example.com", "admin@example.net" | *optional* | "" |
|
||||||
|
| **ENABLE_FIREWALL** | Enable Firewall module | *optional* | false |
|
||||||
| **SPAM_BLOCKLIST** | Blacklist to use with Firewall module. Eg. "custom-blocklist.pfw" | *optional* | |
|
| **SPAM_BLOCKLIST** | Blacklist to use with Firewall module. Eg. "custom-blocklist.pfw" | *optional* | |
|
||||||
|
|
||||||
#### DNS
|
#### DNS
|
||||||
@@ -263,7 +273,7 @@ There is also ```docker-prosody-module-pre-install.bash``` which downloads the s
|
|||||||
If you need additional configuration just overwrite the respective _cfg.lua_ file or add new ones.
|
If you need additional configuration just overwrite the respective _cfg.lua_ file or add new ones.
|
||||||
|
|
||||||
#### Firewall module
|
#### Firewall module
|
||||||
By default, the Firewall module obtains the list of spamming used known domains through the CDN service provided by [cdn.jsdelivr.net](https://cdn.jsdelivr.net/) at https://cdn.jsdelivr.net/gh/jabberspam/blacklist/blacklist.txt , but additionally a custom blacklist can be used through the ```SPAM_BLOCKLIST``` environment variable.
|
Optionally, the Firewall module can be enabled through the ```ENABLE_FIREWALL``` environment variable. By default, the module obtains the list of spamming used known domains through the CDN service provided by [cdn.jsdelivr.net](https://cdn.jsdelivr.net/) at https://cdn.jsdelivr.net/gh/jabberspam/blacklist/blacklist.txt , but additionally a custom blacklist can be used through the ```SPAM_BLOCKLIST``` environment variable.
|
||||||
|
|
||||||
If you need more sophisticated rules, please refer to the module [documentation](https://modules.prosody.im/mod_firewall).
|
If you need more sophisticated rules, please refer to the module [documentation](https://modules.prosody.im/mod_firewall).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user