Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Merge b94de1e into 949a91c
Browse files Browse the repository at this point in the history
  • Loading branch information
horazont committed Jan 29, 2023
2 parents 949a91c + b94de1e commit 3bf1626
Show file tree
Hide file tree
Showing 9 changed files with 281 additions and 14 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,31 @@ jobs:
strategy:
matrix:
python-version:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
test-type:
- e2e
e2e-software:
- prosody
e2e-version:
- '0.11'
- '0.12'

include:
# e2e-tests for non-default prosody will be run with the Python
# version available in debian stable
- python-version: '3.7'
test-type: e2e
e2e-software: ejabberd
e2e-version: '18.09'
- python-version: '3.7'
test-type: e2e
e2e-software: ejabberd
e2e-version: '19.08'
#- python-version: '3.9'
# test-type: e2e
# e2e-software: ejabberd
# e2e-version: '18.09'
#- python-version: '3.9'
# test-type: e2e
# e2e-software: ejabberd
# e2e-version: '19.08'
# plain unit test runs with most recent python version
- python-version: '3.9'
- python-version: '3.11'
test-type: unit
e2e-software: coveralls
e2e-version: latest
Expand Down
10 changes: 8 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,10 @@ def test_forwards_writes(self):
def test_rejects_deletes_by_default(self):
self.assertTrue(hasattr(self.obj.member, "attr"))

with self.assertRaisesRegex(AttributeError, "can't delete attribute"):
with self.assertRaisesRegex(
AttributeError,
r"(can't delete attribute|property of .* has no deleter)"
):
self.pp.__delete__(self.obj)

self.assertTrue(hasattr(self.obj.member, "attr"))
Expand All @@ -773,7 +776,10 @@ def test_rejects_writes_if_readonly(self):

pp = utils.proxy_property("member", "attr", readonly=True)

with self.assertRaisesRegex(AttributeError, "can't set attribute"):
with self.assertRaisesRegex(
AttributeError,
r"(can't set attribute|property of .* has no setter)"
):
pp.__set__(self.obj, unittest.mock.sentinel.value)

self.assertEqual(
Expand Down
14 changes: 14 additions & 0 deletions utils/prosody-cfg/0.12/0001-pubsub.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/plugins/mod_pubsub/mod_pubsub.lua Tue Apr 04 01:31:51 2017 +0200
+++ b/plugins/mod_pubsub/mod_pubsub.lua Tue Apr 04 20:58:01 2017 +0200
@@ -125,7 +125,10 @@
end);

local admin_aff = module:get_option_string("default_admin_affiliation", "owner");
-local function get_affiliation(jid)
+local function get_affiliation(jid, node, action)
+ if action == "create" then
+ return "owner";
+ end
local bare_jid = jid_bare(jid);
if bare_jid == module.host or usermanager.is_admin(bare_jid, module.host) then
return admin_aff;
23 changes: 23 additions & 0 deletions utils/prosody-cfg/0.12/certs/localhost.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-----BEGIN CERTIFICATE-----
MIID7DCCAtSgAwIBAgIJAI8C/rGQ8PCRMA0GCSqGSIb3DQEBCwUAMG0xCzAJBgNV
BAYTAkdCMRMwEQYDVQQKDApQcm9zb2R5IElNMSswKQYDVQQLDCJodHRwOi8vcHJv
c29keS5pbS9kb2MvY2VydGlmaWNhdGVzMRwwGgYDVQQDDBNFeGFtcGxlIGNlcnRp
ZmljYXRlMCAXDTE3MTAxNDE3MjMwMFoYDzIxMTcwOTIwMTcyMzAwWjBtMQswCQYD
VQQGEwJHQjETMBEGA1UECgwKUHJvc29keSBJTTErMCkGA1UECwwiaHR0cDovL3By
b3NvZHkuaW0vZG9jL2NlcnRpZmljYXRlczEcMBoGA1UEAwwTRXhhbXBsZSBjZXJ0
aWZpY2F0ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOgmcIsbIhJO
TM8ItgOprXRwP1GE3H93azuhUVz76+53hyY+IxpF24/LgjAJR02O9CLP298eO2BV
NO0In0LZ/VbITHao9iQCtVRQBLUnhkw8I7PCQY2rroqsOYOOYl2U4P03bcMF+tpG
o5YsxOBOdNsgVLCn/LhfzdBycbkXpQfL6k9Y4BmWXoCB84TuL7aqrHk8tbeSfJ7t
4BgMXLUd4XdhF7Mz1v9PAZJ7gx1w5BLiDfXlwoNl/QDTUkw4PhANFrtF3ggbjI+6
5TKiOS3dysS3eVWEnlPjzIsjN9CrMELFcdwKmMgkkLRoxExWJKM4TzXyc5w/b7iW
Ir+gQgjFMN8CAwEAAaOBjDCBiTAMBgNVHRMEBTADAQH/MHkGA1UdEQRyMHCCCWxv
Y2FsaG9zdKAkBggrBgEFBQcIB6AYFhZfeG1wcC1jbGllbnQubG9jYWxob3N0oCQG
CCsGAQUFBwgHoBgWFl94bXBwLXNlcnZlci5sb2NhbGhvc3SgFwYIKwYBBQUHCAWg
CwwJbG9jYWxob3N0MA0GCSqGSIb3DQEBCwUAA4IBAQDAf6cV69dFUn1DwwLE4uR+
QVhNi9rOM9/kjlPNgFDCC35mz0mr2FF+yeKRP+BVdqeDrcjBMioCodRtHmJ5y6Na
caTXbFaZlP4jVzyo+nxq4g6znn9gNKB6q0Ry6ps/+g388IQQnaVr3WuBr5rEGzZ8
g/ioWb2LBa5wMJ2/xjnw4Q6Z7mtS9dhEDDvwAaq7pBHMUCZNwbaabc4D8lAlqKPq
KyKqrbVSjkofI7YwzLIGUAUtaBnV0adHlxQ3aZjYth6HkkEMcRBEX0NG7spYAGFX
LXeHz5troPTdc85T2W5qEjOzPNGrl+jLCkWGEhvtYctPqHQaOJKZ4YL6c1hGE7WR
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions utils/prosody-cfg/0.12/certs/localhost.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA6CZwixsiEk5Mzwi2A6mtdHA/UYTcf3drO6FRXPvr7neHJj4j
GkXbj8uCMAlHTY70Is/b3x47YFU07QifQtn9VshMdqj2JAK1VFAEtSeGTDwjs8JB
jauuiqw5g45iXZTg/TdtwwX62kajlizE4E502yBUsKf8uF/N0HJxuRelB8vqT1jg
G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mYc+pW
ldhL8CLik9mSx/oizvuT566XDwnBRhv4IXDqPRl6ivgBvuVJ9KZXm2/DCfoC5HpW
1FdaHWDycVIl/NBttpygaLbtoS75HVJaZTiOQIKd+mfEp0sUgNRIk4IugYORC6CF
kn9uomUCgYBEpDU3CgIYPXmGip/RPLm+gQPFBKB71f5O2jxqHJZ0CorV13W/FS+g
8om0w2U293z3zjVdiIk9cc+qEEoihn5/iT3i5sud/oo6ns2p//eoDrGk8dMDu9pn
fo78Z9y/PtsQVbLi0mSpbGbmh57/H3cHiIOGgs7G7brWcIO0zu8/uw==
-----END RSA PRIVATE KEY-----
9 changes: 9 additions & 0 deletions utils/prosody-cfg/0.12/e2etest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[global]
provisioner=aioxmpp.e2etest.provision.AnonymousProvisioner

[aioxmpp.e2etest.provision.AnonymousProvisioner]
host=localhost
pin_store=.travis-pinstore.json
pin_type=0
block_features={"localhost": ["http://jabber.org/protocol/pubsub#*"]}
quirks=["https://zombofant.net/xmlns/aioxmpp/e2etest/quirks#no-adhoc-ping"]
3 changes: 3 additions & 0 deletions utils/prosody-cfg/0.12/link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
modules_dir="$1"
ln -s "$modules_dir/mod_http_upload" plugins/
3 changes: 3 additions & 0 deletions utils/prosody-cfg/0.12/patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd /usr/lib/prosody/modules/
patch -p2 < /etc/prosody/0001-pubsub.patch
183 changes: 183 additions & 0 deletions utils/prosody-cfg/0.12/prosody.cfg.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
-- Prosody Example Configuration File
--
-- Information on configuring Prosody can be found on our
-- website at http://prosody.im/doc/configure
--
-- Tip: You can check that the syntax of this file is correct
-- when you have finished by running: prosodyctl check config
-- If there are any errors, it will let you know what and where
-- they are, otherwise it will keep quiet.
--
-- 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!

plugin_paths = {
"/etc/prosody/plugins"
}

---------- Server-wide settings ----------
-- Settings in this section apply to the whole server and are the default settings
-- for any virtual hosts

-- This is a (by default, empty) list of accounts that are admins
-- for the server. Note that you must create the accounts separately
-- (see http://prosody.im/doc/creating_accounts for info)
-- Example: admins = { "user1@example.com", "user2@example.net" }
admins = { }

-- Enable use of libevent for better performance under high load
-- For more information see: http://prosody.im/doc/libevent
--use_libevent = true

-- This is the list of modules Prosody will load on startup.
-- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
-- Documentation on modules can be found at: http://prosody.im/doc/modules
modules_enabled = {

-- Generally required
"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

-- Not essential, but recommended
"private"; -- Private XML storage (for room bookmarks, etc.)
"vcard"; -- Allow users to set vCards

-- These are commented by default as they have a performance impact
"blocklist"; -- Allow users to block communications with other users
--"compression"; -- Stream compression

-- Nice to have
"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

-- 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"
--"http_files"; -- Serve static files from a directory over HTTP

-- Other specific functionality
--"groups"; -- Shared roster support
--"announce"; -- Send announcement to all online users
--"welcome"; -- Welcome users who register accounts
--"watchregistrations"; -- Alert admins of registrations
--"motd"; -- Send a message to users when they log in
--"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
"pep";
}

-- These modules are auto-loaded, but should you want
-- to disable them then uncomment them here:
modules_disabled = {
-- "offline"; -- Store offline messages
-- "c2s"; -- Handle client connections
-- "s2s"; -- Handle server-to-server connections
-- "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
}

-- Disable account creation by default, for security
-- For more information see http://prosody.im/doc/creating_accounts
allow_registration = false

-- These are the SSL/TLS-related settings. If you don't want
-- to use SSL/TLS, you may comment or remove this
ssl = {
key = "certs/localhost.key";
certificate = "certs/localhost.crt";
}

-- Force clients to use encrypted connections? This option will
-- prevent clients from authenticating unless they are using encryption.

c2s_require_encryption = true

-- Force certificate authentication for server-to-server connections?
-- This provides ideal security, but requires servers you communicate
-- with to support encryption AND present valid, trusted certificates.
-- NOTE: Your version of LuaSec must support certificate verification!
-- For more information see http://prosody.im/doc/s2s#security

s2s_secure_auth = false

-- Many servers don't support encryption or have invalid or self-signed
-- certificates. You can list domains here that will not be required to
-- authenticate using certificates. They will be authenticated using DNS.

--s2s_insecure_domains = { "gmail.com" }

-- Even if you leave s2s_secure_auth disabled, you can still require valid
-- certificates for some domains by specifying a list here.

--s2s_secure_domains = { "jabber.org" }

-- Select the authentication backend to use. The 'internal' providers
-- use Prosody's configured data storage to store the authentication data.
-- To allow Prosody to offer secure authentication mechanisms to clients, the
-- default provider stores passwords in plaintext. If you do not trust your
-- server please see http://prosody.im/doc/modules/mod_auth_internal_hashed
-- for information about using the hashed backend.

authentication = "anonymous"
-- authentication = "internal_plain"

-- Select the storage backend to use. By default Prosody uses flat files
-- in its configured data directory, but it also supports more backends
-- through modules. An "sql" backend is included by default, but requires
-- additional dependencies. See http://prosody.im/doc/storage for more info.

storage = "memory" -- Default is "internal"

-- For the "sql" backend, you can uncomment *one* of the below to configure:
--sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
--sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
--sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }

-- Logging configuration
-- For advanced logging see http://prosody.im/doc/logging
log = {
-- "*syslog"; -- Uncomment this for logging to syslog
debug = "*console"; -- Log to the console, useful for debugging with daemonize=false
}

----------- Virtual hosts -----------
-- You need to add a VirtualHost entry for each domain you wish Prosody to serve.
-- Settings under each VirtualHost entry apply *only* to that host.

VirtualHost "localhost"
Component "muc.localhost" "muc"
modules_enabled = {
"muc_mam";
}
Component "pubsub.localhost" "pubsub"
default_unowned_affiliation = "owner"
Component "upload.localhost" "http_upload"
http_upload_path = "/tmp"


------ Components ------
-- You can specify components to add hosts that provide special services,
-- like multi-user conferences, and transports.
-- For more information on components, see http://prosody.im/doc/components

---Set up a MUC (multi-user chat) room server on conference.example.com:
--Component "conference.example.com" "muc"

-- Set up a SOCKS5 bytestream proxy for server-proxied file transfers:
--Component "proxy.example.com" "proxy65"

---Set up an external component (default component port is 5347)
--
-- External components allow adding various services, such as gateways/
-- transports to other networks like ICQ, MSN and Yahoo. For more info
-- see: http://prosody.im/doc/components#adding_an_external_component
--
--Component "gateway.example.com"
-- component_secret = "password"

0 comments on commit 3bf1626

Please sign in to comment.