Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3861f209d4 | ||
|
|
6fa59321c0 | ||
|
|
5e5ab8681a | ||
|
|
fc0ef6de28 | ||
|
|
b2eb145a6f |
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v 1.3.5
|
||||||
|
|
||||||
|
* Added `prosodyctl check config` result to server test.
|
||||||
|
* A few minor tweaks.
|
||||||
|
* Move defaults to config files
|
||||||
|
|
||||||
## v 1.3.4
|
## v 1.3.4
|
||||||
|
|
||||||
* Migration from Docker to Podman.
|
* Migration from Docker to Podman.
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ RUN buildDeps='gcc git libc6-dev libidn2-dev liblua5.2-dev libsqlite3-dev libssl
|
|||||||
&& luarocks install luadbi \
|
&& luarocks install luadbi \
|
||||||
`#&& luarocks install luadbi-mysql MYSQL_INCDIR=/usr/include/mariadb/` \
|
`#&& luarocks install luadbi-mysql MYSQL_INCDIR=/usr/include/mariadb/` \
|
||||||
&& luarocks install luadbi-sqlite3 \
|
&& luarocks install luadbi-sqlite3 \
|
||||||
# && luarocks install stringy \
|
&& luarocks install stringy \
|
||||||
\
|
\
|
||||||
&& apt-get purge -y --auto-remove $buildDeps
|
&& apt-get purge -y --auto-remove $buildDeps
|
||||||
|
|
||||||
|
|||||||
@@ -35,14 +35,13 @@ modules_enabled = {
|
|||||||
|
|
||||||
-- HTTP modules
|
-- HTTP modules
|
||||||
"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
|
"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
|
||||||
"websocket"; -- Enable mod_websocket
|
|
||||||
--"http_files"; -- Serve static files from a directory over HTTP
|
--"http_files"; -- Serve static files from a directory over HTTP
|
||||||
|
|
||||||
-- Other specific functionality
|
-- Other specific functionality
|
||||||
"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
|
"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
|
||||||
--"groups"; -- Shared roster support
|
--"groups"; -- Shared roster support
|
||||||
"announce"; -- Send announcement to all online users
|
"announce"; -- Send announcement to all online users
|
||||||
"welcome"; -- Welcome users who register accounts
|
--"welcome"; -- Welcome users who register accounts
|
||||||
--"watchregistrations"; -- Alert admins of registrations
|
--"watchregistrations"; -- Alert admins of registrations
|
||||||
--"motd"; -- Send a message to users when they log in
|
--"motd"; -- Send a message to users when they log in
|
||||||
--"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
|
--"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
local function _split(s, sep)
|
local stringy = require "stringy"
|
||||||
if not s then return nil; end
|
|
||||||
sep = sep or ",";
|
e2e_policy_chat = os.getenv("E2E_POLICY_CHAT") or "required"
|
||||||
local parts = {};
|
e2e_policy_muc = os.getenv("E2E_POLICY_MUC") or "required"
|
||||||
for part in s:gmatch("[^"..sep.."]+") do
|
|
||||||
parts[#parts+1] = part;
|
local whitelist = os.getenv("E2E_POLICY_WHITELIST") or ""
|
||||||
end
|
e2e_policy_whitelist = stringy.split(whitelist, ", ")
|
||||||
return parts;
|
|
||||||
end
|
|
||||||
|
|
||||||
e2e_policy_chat = os.getenv("E2E_POLICY_CHAT")
|
|
||||||
e2e_policy_muc = os.getenv("E2E_POLICY_MUC")
|
|
||||||
e2e_policy_whitelist = _split(os.getenv("E2E_POLICY_WHITELIST"), ", ")
|
|
||||||
e2e_policy_message_optional_chat = "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for conversations on this server."
|
e2e_policy_message_optional_chat = "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for conversations on this server."
|
||||||
e2e_policy_message_required_chat = "For security reasons, OMEMO, OTR or PGP encryption is required for conversations on this server."
|
e2e_policy_message_required_chat = "For security reasons, OMEMO, OTR or PGP encryption is required for conversations on this server."
|
||||||
e2e_policy_message_optional_muc = "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for MUC on this server."
|
e2e_policy_message_optional_muc = "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for MUC on this server."
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
local stringy = require "stringy"
|
||||||
local function _split(s, sep)
|
local function _split(s, sep)
|
||||||
if not s then return nil; end
|
if not s then return nil; end
|
||||||
sep = sep or ",";
|
sep = sep or ",";
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
local domain = os.getenv("DOMAIN")
|
local domain = os.getenv("DOMAIN")
|
||||||
local domain_http_upload = os.getenv("DOMAIN_HTTP_UPLOAD")
|
local domain_http_upload = os.getenv("DOMAIN_HTTP_UPLOAD") or "upload." .. domain
|
||||||
local domain_muc = os.getenv("DOMAIN_MUC")
|
local domain_muc = os.getenv("DOMAIN_MUC") or "conference." .. domain
|
||||||
local domain_proxy = os.getenv("DOMAIN_PROXY")
|
local domain_proxy = os.getenv("DOMAIN_PROXY") or "proxy." .. domain
|
||||||
local domain_pubsub = os.getenv("DOMAIN_PUBSUB")
|
local domain_pubsub = os.getenv("DOMAIN_PUBSUB") or "pubsub." .. domain
|
||||||
|
|
||||||
-- XEP-0368: SRV records for XMPP over TLS
|
-- XEP-0368: SRV records for XMPP over TLS
|
||||||
-- https://compliance.conversations.im/test/xep0368/
|
-- https://compliance.conversations.im/test/xep0368/
|
||||||
legacy_ssl_ssl = {
|
c2s_direct_tls_ssl = {
|
||||||
certificate = "certs/" .. domain .. "/fullchain.pem";
|
certificate = "certs/" .. domain .. "/fullchain.pem";
|
||||||
key = "certs/" .. domain .. "/privkey.pem";
|
key = "certs/" .. domain .. "/privkey.pem";
|
||||||
}
|
}
|
||||||
legacy_ssl_ports = { 5223 }
|
c2s_direct_tls_ports = { 5223 }
|
||||||
|
|
||||||
-- https://prosody.im/doc/certificates#service_certificates
|
-- https://prosody.im/doc/certificates#service_certificates
|
||||||
-- https://prosody.im/doc/ports#ssl_configuration
|
-- https://prosody.im/doc/ports#ssl_configuration
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
dir="/usr/src/prosody-modules"
|
dir="/usr/src/prosody-modules"
|
||||||
#dir="/usr/local/lib/prosody/custom-modules"
|
|
||||||
mkdir -p "${dir}"
|
mkdir -p "${dir}"
|
||||||
wget https://hg.prosody.im/prosody-modules/archive/tip.tar.gz
|
wget https://hg.prosody.im/prosody-modules/archive/233691533318.tar.gz -O tip.tar.gz
|
||||||
|
#wget https://hg.prosody.im/prosody-modules/archive/tip.tar.gz
|
||||||
tar -xzf tip.tar.gz -C "${dir}" --strip-components=1
|
tar -xzf tip.tar.gz -C "${dir}" --strip-components=1
|
||||||
rm tip.tar.gz
|
rm tip.tar.gz
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ ShowJoinPart=false
|
|||||||
###################################################################
|
###################################################################
|
||||||
[telegram]
|
[telegram]
|
||||||
[telegram.chat_xmppBot]
|
[telegram.chat_xmppBot]
|
||||||
Token="434963xxx:AAHRbJAw9oN30b9KdjWacnyYyHS22r05xxx" #token berriket_xmppBot
|
Token="123456789:ABCdefGhIJKlmNoPQRsTUVwxYZ" #token berriket_xmppBot
|
||||||
MessageFormat="HTMLNick"
|
MessageFormat="HTMLNick"
|
||||||
EditDisable=false
|
EditDisable=false
|
||||||
EditSuffix=" (edited)"
|
EditSuffix=" (edited)"
|
||||||
@@ -49,6 +49,6 @@ enable=true
|
|||||||
|
|
||||||
[[gateway.inout]]
|
[[gateway.inout]]
|
||||||
account="telegram.chat_xmppBot"
|
account="telegram.chat_xmppBot"
|
||||||
#channel="-241666435" #Telegram xmpp_test taldearen ID-a
|
#channel="-10012112121212" #Telegram xmpp_test taldearen ID-a
|
||||||
channel="-1001617641xxx"
|
channel="-10012112121212"
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export ALLOW_REGISTRATION=${ALLOW_REGISTRATION:-true}
|
|
||||||
export DOMAIN_HTTP_UPLOAD=${DOMAIN_HTTP_UPLOAD:-"upload.$DOMAIN"}
|
|
||||||
export DOMAIN_MUC=${DOMAIN_MUC:-"conference.$DOMAIN"}
|
|
||||||
export DOMAIN_PROXY=${DOMAIN_PROXY:-"proxy.$DOMAIN"}
|
|
||||||
export DOMAIN_PUBSUB=${DOMAIN_PUBSUB:-"pubsub.$DOMAIN"}
|
|
||||||
export DB_DRIVER=${DB_DRIVER:-"SQLite3"}
|
|
||||||
export DB_DATABASE=${DB_DATABASE:-"prosody.sqlite"}
|
|
||||||
export E2E_POLICY_CHAT=${E2E_POLICY_CHAT:-"required"}
|
|
||||||
export E2E_POLICY_MUC=${E2E_POLICY_MUC:-"required"}
|
|
||||||
export E2E_POLICY_WHITELIST=${E2E_POLICY_WHITELIST:-""}
|
|
||||||
export LOG_LEVEL=${LOG_LEVEL:-"info"}
|
|
||||||
export C2S_REQUIRE_ENCRYPTION=${C2S_REQUIRE_ENCRYPTION:-true}
|
|
||||||
export S2S_REQUIRE_ENCRYPTION=${S2S_REQUIRE_ENCRYPTION:-true}
|
|
||||||
export S2S_SECURE_AUTH=${S2S_SECURE_AUTH:-true}
|
|
||||||
export SERVER_CONTACT_INFO_ABUSE=${SERVER_CONTACT_INFO_ABUSE:-"xmpp:abuse@$DOMAIN"}
|
|
||||||
export SERVER_CONTACT_INFO_ADMIN=${SERVER_CONTACT_INFO_ADMIN:-"xmpp:admin@$DOMAIN"}
|
|
||||||
export SERVER_CONTACT_INFO_FEEDBACK=${SERVER_CONTACT_INFO_FEEDBACK:-"xmpp:feedback@$DOMAIN"}
|
|
||||||
export SERVER_CONTACT_INFO_SALES=${SERVER_CONTACT_INFO_SALES:-"xmpp:sales@$DOMAIN"}
|
|
||||||
export SERVER_CONTACT_INFO_SECURITY=${SERVER_CONTACT_INFO_SECURITY:-"xmpp:security@$DOMAIN"}
|
|
||||||
export SERVER_CONTACT_INFO_SUPPORT=${SERVER_CONTACT_INFO_SUPPORT:-"xmpp:support@$DOMAIN"}
|
|
||||||
export PROSODY_ADMINS=${PROSODY_ADMINS:-""}
|
|
||||||
|
|
||||||
if [[ "$1" != "prosody" ]]; then
|
if [[ "$1" != "prosody" ]]; then
|
||||||
exec prosodyctl $*
|
exec prosodyctl $*
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
+9
-16
@@ -1,25 +1,18 @@
|
|||||||
-- see example config at https://hg.prosody.im/0.12/file/tip/prosody.cfg.lua.dist
|
-- see example config at https://hg.prosody.im/-1.9/file/0.9.10/prosody.cfg.lua.dist
|
||||||
-- easily extendable by putting into different config files within conf.d folder
|
-- easily extendable by putting into different config files within conf.d folder
|
||||||
|
|
||||||
local function _split(s, sep)
|
local stringy = require "stringy"
|
||||||
if not s then return nil; end
|
|
||||||
sep = sep or ",";
|
|
||||||
local parts = {};
|
|
||||||
for part in s:gmatch("[^"..sep.."]+") do
|
|
||||||
parts[#parts+1] = part;
|
|
||||||
end
|
|
||||||
return parts;
|
|
||||||
end
|
|
||||||
|
|
||||||
admins = _split(os.getenv("PROSODY_ADMINS"), ", ");
|
local prosody_admins = os.getenv("PROSODY_ADMINS") or "";
|
||||||
|
admins = stringy.split(prosody_admins, ", ");
|
||||||
|
|
||||||
pidfile = "/var/run/prosody/prosody.pid"
|
pidfile = "/var/run/prosody/prosody.pid"
|
||||||
|
|
||||||
allow_registration = os.getenv("ALLOW_REGISTRATION");
|
allow_registration = os.getenv("ALLOW_REGISTRATION") or "true";
|
||||||
|
|
||||||
c2s_require_encryption = os.getenv("C2S_REQUIRE_ENCRYPTION");
|
c2s_require_encryption = os.getenv("C2S_REQUIRE_ENCRYPTION") or "true";
|
||||||
s2s_require_encryption = os.getenv("S2S_REQUIRE_ENCRYPTION");
|
s2s_require_encryption = os.getenv("S2S_REQUIRE_ENCRYPTION") or "true";
|
||||||
s2s_secure_auth = os.getenv("S2S_SECURE_AUTH");
|
s2s_secure_auth = os.getenv("S2S_SECURE_AUTH") or "true";
|
||||||
|
|
||||||
authentication = os.getenv("AUTHENTICATION") or "internal_hashed";
|
authentication = os.getenv("AUTHENTICATION") or "internal_hashed";
|
||||||
|
|
||||||
@@ -34,7 +27,7 @@ ldap_mode = os.getenv("LDAP_MODE") or "bind";
|
|||||||
ldap_admin_filter = os.getenv("LDAP_ADMIN_FILTER") or "";
|
ldap_admin_filter = os.getenv("LDAP_ADMIN_FILTER") or "";
|
||||||
|
|
||||||
log = {
|
log = {
|
||||||
{levels = {min = os.getenv("LOG_LEVEL")}, to = "console"};
|
{levels = {min = os.getenv("LOG_LEVEL") or "info"}, to = "console"};
|
||||||
};
|
};
|
||||||
|
|
||||||
Include "conf.d/*.cfg.lua";
|
Include "conf.d/*.cfg.lua";
|
||||||
|
|||||||
Submodule
+1
Submodule tests/bats/bats-assert added at 697471b7a8
Submodule
+1
Submodule tests/bats/bats-core added at ae4b94d7cc
Submodule
+1
Submodule tests/bats/bats-support added at 0954abb992
@@ -1,5 +1,3 @@
|
|||||||
version: "3.9"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
prosody:
|
prosody:
|
||||||
image: prosody
|
image: prosody
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
aioxmpp==0.13.3
|
aioxmpp==0.13.3
|
||||||
pip-chill==1.0.3
|
pip-chill==1.0.1
|
||||||
pytest-asyncio==0.21.0
|
pytest-asyncio==0.21.0
|
||||||
pytz==2023.3
|
pytz==2022.7.1
|
||||||
|
|||||||
+22
-13
@@ -19,7 +19,7 @@ registerTestUser() {
|
|||||||
local userName="$1"
|
local userName="$1"
|
||||||
local containerName="$2"
|
local containerName="$2"
|
||||||
echo "Registering TestUser '$userName' in container '$containerName'"
|
echo "Registering TestUser '$userName' in container '$containerName'"
|
||||||
sudo docker compose exec "$containerName" /bin/bash -c "/entrypoint.bash register $userName example.com 12345678"
|
sudo docker compose exec "$containerName" /bin/bash -c "prosodyctl register $userName example.com 12345678"
|
||||||
}
|
}
|
||||||
|
|
||||||
registerTestUsers() {
|
registerTestUsers() {
|
||||||
@@ -32,8 +32,7 @@ registerTestUsers() {
|
|||||||
|
|
||||||
runTests() {
|
runTests() {
|
||||||
local containerName="$1"
|
local containerName="$1"
|
||||||
python --version \
|
python3 --version \
|
||||||
&& python3 --version \
|
|
||||||
&& python3 -m venv venv \
|
&& python3 -m venv venv \
|
||||||
&& source venv/bin/activate \
|
&& source venv/bin/activate \
|
||||||
&& python --version \
|
&& python --version \
|
||||||
@@ -42,12 +41,19 @@ runTests() {
|
|||||||
&& pytest \
|
&& pytest \
|
||||||
&& deactivate \
|
&& deactivate \
|
||||||
&& sleep 5 \
|
&& sleep 5 \
|
||||||
&& sudo docker-compose logs "$containerName" \
|
&& sudo docker compose logs "$containerName" \
|
||||||
&& export batsContainerName="$containerName" \
|
&& export batsContainerName="$containerName" \
|
||||||
&& ./bats/bats-core/bin/bats tests.bats \
|
&& ./bats/bats-core/bin/bats tests.bats \
|
||||||
&& ./bats/bats-core/bin/bats tests-"$containerName".bats
|
&& ./bats/bats-core/bin/bats tests-"$containerName".bats
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkConfig() {
|
||||||
|
local containerName="$1"
|
||||||
|
sudo docker compose up -d "$containerName"
|
||||||
|
sudo docker compose exec -T "$containerName" prosodyctl check config || true
|
||||||
|
sudo docker compose down
|
||||||
|
}
|
||||||
|
|
||||||
generateCert "example.com"
|
generateCert "example.com"
|
||||||
generateCert "conference.example.com"
|
generateCert "conference.example.com"
|
||||||
generateCert "proxy.example.com"
|
generateCert "proxy.example.com"
|
||||||
@@ -56,22 +62,25 @@ generateCert "upload.example.com"
|
|||||||
|
|
||||||
# Run tests for first container with postgres
|
# Run tests for first container with postgres
|
||||||
# Start postgres first and wait for 10 seconds before starting prosody.
|
# Start postgres first and wait for 10 seconds before starting prosody.
|
||||||
sudo docker-compose down
|
sudo docker compose down
|
||||||
sudo docker-compose up -d postgres
|
sudo docker compose up -d postgres
|
||||||
sleep 10
|
sleep 10
|
||||||
sudo docker-compose up -d prosody_postgres
|
sudo docker compose up -d prosody_postgres
|
||||||
|
|
||||||
registerTestUsers prosody_postgres
|
registerTestUsers prosody_postgres
|
||||||
runTests prosody_postgres
|
runTests prosody_postgres
|
||||||
sudo docker-compose down
|
sudo docker compose down
|
||||||
|
|
||||||
# Run tests for second container with SQLite
|
# Run tests for second container with SQLite
|
||||||
sudo docker-compose up -d prosody
|
sudo docker compose up -d prosody
|
||||||
|
sleep 5
|
||||||
registerTestUsers prosody
|
registerTestUsers prosody
|
||||||
runTests prosody
|
runTests prosody
|
||||||
sudo docker-compose down
|
sudo docker compose down
|
||||||
|
|
||||||
# Run tests for prosody with ldap
|
# Run tests for prosody with ldap
|
||||||
sudo docker-compose up -d prosody_ldap
|
sudo docker compose up -d prosody_ldap
|
||||||
runTests prosody_ldap
|
runTests prosody_ldap
|
||||||
sudo docker-compose down
|
sudo docker compose down
|
||||||
|
|
||||||
|
# Check server config
|
||||||
|
checkConfig prosody
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ load 'bats/bats-support/load'
|
|||||||
load 'bats/bats-assert/load'
|
load 'bats/bats-assert/load'
|
||||||
|
|
||||||
@test "Should use sqlite" {
|
@test "Should use sqlite" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Connecting to \[SQLite3\] \/usr\/local\/var\/lib\/prosody\/prosody\.sqlite\.\.\.\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Connecting to \[SQLite3\] \/usr\/local\/var\/lib\/prosody\/prosody\.sqlite\.\.\.\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ load 'bats/bats-support/load'
|
|||||||
load 'bats/bats-assert/load'
|
load 'bats/bats-assert/load'
|
||||||
|
|
||||||
@test "Should use sqlite" {
|
@test "Should use sqlite" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Connecting to \[SQLite3\] \/usr\/local\/var\/lib\/prosody\/prosody\.sqlite\.\.\.\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Connecting to \[SQLite3\] \/usr\/local\/var\/lib\/prosody\/prosody\.sqlite\.\.\.\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should use ldap" {
|
@test "Should use ldap" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Host 'example.com' now set to use user provider 'ldap'\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Host 'example.com' now set to use user provider 'ldap'\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ load 'bats/bats-support/load'
|
|||||||
load 'bats/bats-assert/load'
|
load 'bats/bats-assert/load'
|
||||||
|
|
||||||
@test "Should use postgres" {
|
@test "Should use postgres" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Connecting to \[PostgreSQL\] prosody\.\.\.\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Connecting to \[PostgreSQL\] prosody\.\.\.\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-15
@@ -4,85 +4,95 @@ load 'bats/bats-support/load'
|
|||||||
load 'bats/bats-assert/load'
|
load 'bats/bats-assert/load'
|
||||||
|
|
||||||
@test "Should send 5 messages" {
|
@test "Should send 5 messages" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Received\[c2s\]: <message\" | wc -l"
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Received\[c2s\]: <message\" | wc -l"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "5"
|
assert_output "5"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should select certificate for example.com" {
|
@test "Should select certificate for example.com" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \" example.com:tls\" | wc -l"
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Certificates loaded\" | grep \" example.com:tls\" | wc -l"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "1"
|
assert_output "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should select certificate for conference.example.com" {
|
@test "Should select certificate for conference.example.com" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"conference.example.com:tls\" | wc -l"
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"conference.example.com:tls\" | wc -l"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "1"
|
assert_output "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should select certificate for proxy.example.com" {
|
@test "Should select certificate for proxy.example.com" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"proxy.example.com:tls\" | wc -l"
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"proxy.example.com:tls\" | wc -l"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "1"
|
assert_output "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should select certificate for pubsub.example.com" {
|
@test "Should select certificate for pubsub.example.com" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"pubsub.example.com:tls\" | wc -l"
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"pubsub.example.com:tls\" | wc -l"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "1"
|
assert_output "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should select certificate for upload.example.com" {
|
@test "Should select certificate for upload.example.com" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"upload.example.com:tls\" | wc -l"
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"upload.example.com:tls\" | wc -l"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "1"
|
assert_output "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should log error for user with wrong password" {
|
@test "Should log error for user with wrong password" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Session closed by remote with error: undefined-condition (user intervention: authentication failed: authentication aborted by user)\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Session closed by remote with error: undefined-condition (user intervention: authentication failed: authentication aborted by user)\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should activate s2s" {
|
@test "Should activate s2s" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 's2s' on (\[::\]:5269|\[\*\]:5269), (\[::\]:5269|\[\*\]:5269)\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Activated service 's2s' on (\[::\]:5269|\[\*\]:5269), (\[::\]:5269|\[\*\]:5269)\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should activate c2s" {
|
@test "Should activate c2s" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'c2s' on (\[::\]:5222|\[\*\]:5222), (\[::\]:5222|\[\*\]:5222)\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Activated service 'c2s' on (\[::\]:5222|\[\*\]:5222), (\[::\]:5222|\[\*\]:5222)\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should activate legacy_ssl" {
|
@test "Should activate c2s_direct_tls" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'legacy_ssl' on (\[::\]:5223|\[\*\]:5223), (\[::\]:5223|\[\*\]:5223)\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Activated service 'c2s_direct_tls' on (\[::\]:5223|\[\*\]:5223), (\[::\]:5223|\[\*\]:5223)\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should activate proxy65" {
|
@test "Should activate proxy65" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'proxy65' on (\[::\]:5000|\[\*\]:5000), (\[::\]:5000|\[\*\]:5000)\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Activated service 'proxy65' on (\[::\]:5000|\[\*\]:5000), (\[::\]:5000|\[\*\]:5000)\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should activate https" {
|
@test "Should activate https" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'https' on (\[::\]:5281|\[\*\]:5281), (\[::\]:5281|\[\*\]:5281)\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"Activated service 'https' on (\[::\]:5281|\[\*\]:5281), (\[::\]:5281|\[\*\]:5281)\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should load module cloud_notify" {
|
@test "Should load module cloud_notify" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"example.com:cloud_notify.*info.*Module loaded\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"example.com:cloud_notify.*info.*Module loaded\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Should show upload URL" {
|
@test "Should show upload URL" {
|
||||||
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Serving 'file_share' at https:\/\/upload.example.com:5281\/file_share\""
|
run bash -c "sudo docker compose logs $batsContainerName | grep \"Serving 'file_share' at https:\/\/upload.example.com:5281\/file_share\""
|
||||||
assert_success
|
assert_success
|
||||||
assert_output
|
assert_output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "Should not use deprecated config" {
|
||||||
|
run bash -c "sudo docker compose exec $batsContainerName /bin/bash -c \"/entrypoint.bash check\" | grep 'deprecated' -A 3"
|
||||||
|
assert_failure
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Should not have warnings in log" {
|
||||||
|
run bash -c "sudo docker compose logs $batsContainerName | grep -E \"warn\""
|
||||||
|
assert_failure
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user