pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/py-sydent



Module Name:    pkgsrc
Committed By:   manu
Date:           Tue Aug 29 14:15:01 UTC 2023

Added Files:
        pkgsrc/www/py-sydent: DESCR Makefile PLIST distinfo
        pkgsrc/www/py-sydent/files: sydent.conf sydent.sh
        pkgsrc/www/py-sydent/patches: patch-sydent_http_httpclient.py
            patch-sydent_http_httpsclient.py patch-sydent_http_httpserver.py
            patch-sydent_sydent.py patch-sydent_threepid_bind.py

Log Message:
Added www/py-sydent version 2.5.6

Sydent is an identity server for the Matrix communications protocol.
It allows Matrix users to prove that they own an email address or
phone number, and allows _other_ Matrix users to look them up using
that email address or phone number.

Imported from wip/py-sydent, contributed by kethzer.dr%gmail.com@localhost


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/www/py-sydent/DESCR \
    pkgsrc/www/py-sydent/Makefile pkgsrc/www/py-sydent/PLIST \
    pkgsrc/www/py-sydent/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/www/py-sydent/files/sydent.conf \
    pkgsrc/www/py-sydent/files/sydent.sh
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/www/py-sydent/patches/patch-sydent_http_httpclient.py \
    pkgsrc/www/py-sydent/patches/patch-sydent_http_httpsclient.py \
    pkgsrc/www/py-sydent/patches/patch-sydent_http_httpserver.py \
    pkgsrc/www/py-sydent/patches/patch-sydent_sydent.py \
    pkgsrc/www/py-sydent/patches/patch-sydent_threepid_bind.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/www/py-sydent/DESCR
diff -u /dev/null pkgsrc/www/py-sydent/DESCR:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/DESCR  Tue Aug 29 14:15:01 2023
@@ -0,0 +1,4 @@
+Sydent is an identity server for the Matrix communications protocol.
+It allows Matrix users to prove that they own an email address or
+phone number, and allows _other_ Matrix users to look them up using
+that email address or phone number.
Index: pkgsrc/www/py-sydent/Makefile
diff -u /dev/null pkgsrc/www/py-sydent/Makefile:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/Makefile       Tue Aug 29 14:15:01 2023
@@ -0,0 +1,75 @@
+# $NetBSD: Makefile,v 1.1 2023/08/29 14:15:01 manu Exp $
+
+DISTNAME=      py-sydent-2.5.6
+EGG_NAME=      SynapseIdentityServer-0.1
+PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/py-//}
+CATEGORIES=    www
+GITHUB_PROJECT=        sydent
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=matrix-org/}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
+GITHUB_TAG=    3d3ac5ab802ad91bbecfc0cd6a50bdd31875c1fe
+
+MAINTAINER=    kethzer.dr%gmail.com@localhost
+HOMEPAGE=      https://github.com/matrix-org/
+COMMENT=       Matrix Identity Servers
+LICENSE=       apache-2.0
+
+DEPENDS+=      ${PYPKGPREFIX}-daemonize>=2.4.7:../../devel/py-daemonize
+DEPENDS+=      ${PYPKGPREFIX}-phonenumbers-[0-9]*:../../textproc/py-phonenumbers
+DEPENDS+=      ${PYPKGPREFIX}-setuptools_trial-[0-9]*:../../devel/py-setuptools_trial
+DEPENDS+=      ${PYPKGPREFIX}-signedjson-[0-9]*:../../security/py-signedjson
+DEPENDS+=      ${PYPKGPREFIX}-twisted-[0-9]*:../../net/py-twisted
+DEPENDS+=      ${PYPKGPREFIX}-unpaddedbase64-[0-9]*:../../devel/py-unpaddedbase64
+DEPENDS+=      ${PYPKGPREFIX}-asn1-[0-9]*:../../security/py-asn1
+DEPENDS+=      ${PYPKGPREFIX}-libnacl-[0-9]*:../../security/py-libnacl
+DEPENDS+=      ${PYPKGPREFIX}-nacl-[0-9]*:../../security/py-nacl
+DEPENDS+=      ${PYPKGPREFIX}-service_identity-[0-9]*:../../security/py-service_identity
+
+PYTHON_VERSIONED_DEPENDENCIES+=        setuptools
+
+WRKSRC=                ${WRKDIR}/sydent-3d3ac5ab802ad91bbecfc0cd6a50bdd31875c1fe
+#USE_LANGUAGES=        # none
+
+# Avoid the pyNN- prefix in config, doc, and so on.
+HUMAN_PKGNAME= sydent
+
+.include "../../mk/bsd.prefs.mk"
+
+SYDENT_USER?=                  sydent
+SYDENT_GROUP?=                 ${SYDENT_USER}
+SYDENT_DATA?=                  ${VARBASE}/db/${HUMAN_PKGNAME}
+BUILD_DEFS+=                   SYDENT_USER SYDENT_GROUP SYDENT_DATA VARBASE
+
+OWN_DIRS_PERMS+=       ${SYDENT_DATA} ${SYDENT_USER} ${SYDENT_GROUP} 0770
+
+PKG_USERS_VARS=                        SYDENT_USER
+PKG_GROUPS_VARS=               SYDENT_GROUP
+PKG_GROUPS=                    ${SYDENT_GROUP}
+PKG_USERS=                     ${SYDENT_USER}:${SYDENT_GROUP}
+PKG_GECOS.${SYDENT_USER}=      Sydent daemon user
+PKG_HOME.${SYDENT_USER}=       ${SYDENT_DATA}
+PKG_SHELL.${SYDENT_USER}=      ${NOLOGIN}
+
+RCD_SCRIPTS=   sydent
+
+FILES_SUBST+=  SYDENT_DATA=${SYDENT_DATA:Q}
+FILES_SUBST+=  SYDENT_USER=${SYDENT_USER:Q}
+FILES_SUBST+=  SYDENT_GROUP=${SYDENT_GROUP:Q}
+FILES_SUBST+=  PYTHONBIN=${PYTHONBIN:Q}
+
+EGDIR=         ${PREFIX}/share/examples/${HUMAN_PKGNAME}
+CONF_FILES_PERMS+=     ${EGDIR}/sydent.conf ${PKG_SYSCONFDIR}/sydent.conf \
+                       ${SYDENT_USER} ${SYDENT_GROUP} 0755
+INSTALLATION_DIRS+=    ${EGDIR}
+
+post-configure:
+       ${SED} -e "s|@SYDENT_DATA@|${SYDENT_DATA}|" \
+           ${FILESDIR}/sydent.conf > ${WRKSRC}/sydent.conf
+
+post-install:
+       ${INSTALL_DATA} ${WRKSRC}/sydent.conf ${DESTDIR}${EGDIR}
+
+.include "../../lang/python/application.mk"
+.include "../../lang/python/egg.mk"
+.include "../../lang/python/versioned_dependencies.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/www/py-sydent/PLIST
diff -u /dev/null pkgsrc/www/py-sydent/PLIST:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/PLIST  Tue Aug 29 14:15:01 2023
@@ -0,0 +1,130 @@
+@comment $NetBSD: PLIST,v 1.1 2023/08/29 14:15:01 manu Exp $
+${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
+${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
+${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/requires.txt
+${PYSITELIB}/${EGG_INFODIR}/top_level.txt
+${PYSITELIB}/sydent/__init__.py
+${PYSITELIB}/sydent/__init__.pyc
+${PYSITELIB}/sydent/__init__.pyo
+${PYSITELIB}/sydent/db/__init__.py
+${PYSITELIB}/sydent/db/__init__.pyc
+${PYSITELIB}/sydent/db/__init__.pyo
+${PYSITELIB}/sydent/db/invite_tokens.py
+${PYSITELIB}/sydent/db/invite_tokens.pyc
+${PYSITELIB}/sydent/db/invite_tokens.pyo
+${PYSITELIB}/sydent/db/peers.py
+${PYSITELIB}/sydent/db/peers.pyc
+${PYSITELIB}/sydent/db/peers.pyo
+${PYSITELIB}/sydent/db/sqlitedb.py
+${PYSITELIB}/sydent/db/sqlitedb.pyc
+${PYSITELIB}/sydent/db/sqlitedb.pyo
+${PYSITELIB}/sydent/db/threepid_associations.py
+${PYSITELIB}/sydent/db/threepid_associations.pyc
+${PYSITELIB}/sydent/db/threepid_associations.pyo
+${PYSITELIB}/sydent/db/valsession.py
+${PYSITELIB}/sydent/db/valsession.pyc
+${PYSITELIB}/sydent/db/valsession.pyo
+${PYSITELIB}/sydent/http/__init__.py
+${PYSITELIB}/sydent/http/__init__.pyc
+${PYSITELIB}/sydent/http/__init__.pyo
+${PYSITELIB}/sydent/http/httpclient.py
+${PYSITELIB}/sydent/http/httpclient.pyc
+${PYSITELIB}/sydent/http/httpclient.pyo
+${PYSITELIB}/sydent/http/httpcommon.py
+${PYSITELIB}/sydent/http/httpcommon.pyc
+${PYSITELIB}/sydent/http/httpcommon.pyo
+${PYSITELIB}/sydent/http/httpsclient.py
+${PYSITELIB}/sydent/http/httpsclient.pyc
+${PYSITELIB}/sydent/http/httpsclient.pyo
+${PYSITELIB}/sydent/http/httpserver.py
+${PYSITELIB}/sydent/http/httpserver.pyc
+${PYSITELIB}/sydent/http/httpserver.pyo
+${PYSITELIB}/sydent/http/servlets/__init__.py
+${PYSITELIB}/sydent/http/servlets/__init__.pyc
+${PYSITELIB}/sydent/http/servlets/__init__.pyo
+${PYSITELIB}/sydent/http/servlets/blindlysignstuffservlet.py
+${PYSITELIB}/sydent/http/servlets/blindlysignstuffservlet.pyc
+${PYSITELIB}/sydent/http/servlets/blindlysignstuffservlet.pyo
+${PYSITELIB}/sydent/http/servlets/bulklookupservlet.py
+${PYSITELIB}/sydent/http/servlets/bulklookupservlet.pyc
+${PYSITELIB}/sydent/http/servlets/bulklookupservlet.pyo
+${PYSITELIB}/sydent/http/servlets/emailservlet.py
+${PYSITELIB}/sydent/http/servlets/emailservlet.pyc
+${PYSITELIB}/sydent/http/servlets/emailservlet.pyo
+${PYSITELIB}/sydent/http/servlets/getvalidated3pidservlet.py
+${PYSITELIB}/sydent/http/servlets/getvalidated3pidservlet.pyc
+${PYSITELIB}/sydent/http/servlets/getvalidated3pidservlet.pyo
+${PYSITELIB}/sydent/http/servlets/lookupservlet.py
+${PYSITELIB}/sydent/http/servlets/lookupservlet.pyc
+${PYSITELIB}/sydent/http/servlets/lookupservlet.pyo
+${PYSITELIB}/sydent/http/servlets/msisdnservlet.py
+${PYSITELIB}/sydent/http/servlets/msisdnservlet.pyc
+${PYSITELIB}/sydent/http/servlets/msisdnservlet.pyo
+${PYSITELIB}/sydent/http/servlets/pubkeyservlets.py
+${PYSITELIB}/sydent/http/servlets/pubkeyservlets.pyc
+${PYSITELIB}/sydent/http/servlets/pubkeyservlets.pyo
+${PYSITELIB}/sydent/http/servlets/replication.py
+${PYSITELIB}/sydent/http/servlets/replication.pyc
+${PYSITELIB}/sydent/http/servlets/replication.pyo
+${PYSITELIB}/sydent/http/servlets/store_invite_servlet.py
+${PYSITELIB}/sydent/http/servlets/store_invite_servlet.pyc
+${PYSITELIB}/sydent/http/servlets/store_invite_servlet.pyo
+${PYSITELIB}/sydent/http/servlets/threepidbindservlet.py
+${PYSITELIB}/sydent/http/servlets/threepidbindservlet.pyc
+${PYSITELIB}/sydent/http/servlets/threepidbindservlet.pyo
+${PYSITELIB}/sydent/replication/__init__.py
+${PYSITELIB}/sydent/replication/__init__.pyc
+${PYSITELIB}/sydent/replication/__init__.pyo
+${PYSITELIB}/sydent/replication/peer.py
+${PYSITELIB}/sydent/replication/peer.pyc
+${PYSITELIB}/sydent/replication/peer.pyo
+${PYSITELIB}/sydent/replication/pusher.py
+${PYSITELIB}/sydent/replication/pusher.pyc
+${PYSITELIB}/sydent/replication/pusher.pyo
+${PYSITELIB}/sydent/sign/__init__.py
+${PYSITELIB}/sydent/sign/__init__.pyc
+${PYSITELIB}/sydent/sign/__init__.pyo
+${PYSITELIB}/sydent/sign/ed25519.py
+${PYSITELIB}/sydent/sign/ed25519.pyc
+${PYSITELIB}/sydent/sign/ed25519.pyo
+${PYSITELIB}/sydent/sms/__init__.py
+${PYSITELIB}/sydent/sms/__init__.pyc
+${PYSITELIB}/sydent/sms/__init__.pyo
+${PYSITELIB}/sydent/sms/openmarket.py
+${PYSITELIB}/sydent/sms/openmarket.pyc
+${PYSITELIB}/sydent/sms/openmarket.pyo
+${PYSITELIB}/sydent/sydent.py
+${PYSITELIB}/sydent/sydent.pyc
+${PYSITELIB}/sydent/sydent.pyo
+${PYSITELIB}/sydent/threepid/__init__.py
+${PYSITELIB}/sydent/threepid/__init__.pyc
+${PYSITELIB}/sydent/threepid/__init__.pyo
+${PYSITELIB}/sydent/threepid/assocsigner.py
+${PYSITELIB}/sydent/threepid/assocsigner.pyc
+${PYSITELIB}/sydent/threepid/assocsigner.pyo
+${PYSITELIB}/sydent/threepid/bind.py
+${PYSITELIB}/sydent/threepid/bind.pyc
+${PYSITELIB}/sydent/threepid/bind.pyo
+${PYSITELIB}/sydent/util/__init__.py
+${PYSITELIB}/sydent/util/__init__.pyc
+${PYSITELIB}/sydent/util/__init__.pyo
+${PYSITELIB}/sydent/util/emailutils.py
+${PYSITELIB}/sydent/util/emailutils.pyc
+${PYSITELIB}/sydent/util/emailutils.pyo
+${PYSITELIB}/sydent/util/tokenutils.py
+${PYSITELIB}/sydent/util/tokenutils.pyc
+${PYSITELIB}/sydent/util/tokenutils.pyo
+${PYSITELIB}/sydent/validators/__init__.py
+${PYSITELIB}/sydent/validators/__init__.pyc
+${PYSITELIB}/sydent/validators/__init__.pyo
+${PYSITELIB}/sydent/validators/common.py
+${PYSITELIB}/sydent/validators/common.pyc
+${PYSITELIB}/sydent/validators/common.pyo
+${PYSITELIB}/sydent/validators/emailvalidator.py
+${PYSITELIB}/sydent/validators/emailvalidator.pyc
+${PYSITELIB}/sydent/validators/emailvalidator.pyo
+${PYSITELIB}/sydent/validators/msisdnvalidator.py
+${PYSITELIB}/sydent/validators/msisdnvalidator.pyc
+${PYSITELIB}/sydent/validators/msisdnvalidator.pyo
+share/examples/sydent/sydent.conf
Index: pkgsrc/www/py-sydent/distinfo
diff -u /dev/null pkgsrc/www/py-sydent/distinfo:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/distinfo       Tue Aug 29 14:15:01 2023
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2023/08/29 14:15:01 manu Exp $
+
+BLAKE2s (py-sydent-2.5.6-3d3ac5ab802ad91bbecfc0cd6a50bdd31875c1fe.tar.gz) = 443ea0d26ff9dc97fa87b7a97c2fbec6c3899656fe86be0311d6fa9b899e8eeb
+SHA512 (py-sydent-2.5.6-3d3ac5ab802ad91bbecfc0cd6a50bdd31875c1fe.tar.gz) = 
85ffd69123915cc6ac2c65f0c9dc881671eab8f94e2e6befd1e71aa4d6be6b8d64673ca35d6a5afd4b1ce364b40cfd65f97aeeb6533bd80cc00b0480007d396a
+Size (py-sydent-2.5.6-3d3ac5ab802ad91bbecfc0cd6a50bdd31875c1fe.tar.gz) = 33392 bytes
+SHA1 (patch-sydent_http_httpclient.py) = 88d1868ed2e01a1acbcbe645c71f47bfe8828c77
+SHA1 (patch-sydent_http_httpsclient.py) = f03f4a4979378471aef26cbc60959210fd973f3c
+SHA1 (patch-sydent_http_httpserver.py) = d48078dfe78c6f73d1f333614eae5dad2a2a80a7
+SHA1 (patch-sydent_sydent.py) = 750d37fe7d8c9c83ba848a5aca86b437aa7a4b17
+SHA1 (patch-sydent_threepid_bind.py) = af10434734d82a8af3e5904868d8a3f3aa892d11

Index: pkgsrc/www/py-sydent/files/sydent.conf
diff -u /dev/null pkgsrc/www/py-sydent/files/sydent.conf:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/files/sydent.conf      Tue Aug 29 14:15:01 2023
@@ -0,0 +1,38 @@
+[DEFAULT]
+server.name = 
+log.path = @SYDENT_DATA@/sydent.log
+pidfile.path = @SYDENT_DATA@/sydent.pid
+db.file = @SYDENT_DATA@/sydent.db
+clientapi.http.port = 8090
+clientapi.http.bind_address = 127.0.0.1
+replication.https.certfile = 
+replication.https.cacert = 
+replication.https.port = 4434
+obey_x_forwarded_for = False
+token.length = 6
+email.template = res/email.template
+email.from = Sydent Validation <noreply@{hostname}>
+email.subject = Your Validation Token
+email.invite.subject = %(sender_display_name)s has invited you to chat
+email.smtphost = localhost
+email.smtpport = 25
+email.smtpusername = 
+email.smtppassword = 
+email.hostname = 
+email.tlsmode = 0
+bodytemplate = Your code is {token}
+ed25519.signingkey = 
+
+[general]
+server.name = 
+
+[db]
+
+[http]
+
+[email]
+
+[crypto]
+
+[sms]
+
Index: pkgsrc/www/py-sydent/files/sydent.sh
diff -u /dev/null pkgsrc/www/py-sydent/files/sydent.sh:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/files/sydent.sh        Tue Aug 29 14:15:01 2023
@@ -0,0 +1,23 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# PROVIDE: sydent
+# REQUIRE: DAEMON
+
+if [ -f /etc/rc.subr ]; then
+  . /etc/rc.subr
+fi
+
+name="sydent"
+rcvar="sydent"
+procname="@PYTHONBIN@"
+ctl_command="@PYTHONBIN@"
+conf_file="@PKG_SYSCONFDIR@/sydent.conf"
+required_files="$conf_file"
+pidfile="@SYDENT_DATA@/sydent.pid"
+: ${sydent_user:=@SYDENT_USER@}
+
+start_cmd="@SU@ -m ${sydent_user} -c \
+    'cd @PKG_SYSCONFDIR@ && ${ctl_command} -m sydent.sydent 2>&- 1>&- 0<&- &'"
+
+load_rc_config $name
+run_rc_command "$1"

Index: pkgsrc/www/py-sydent/patches/patch-sydent_http_httpclient.py
diff -u /dev/null pkgsrc/www/py-sydent/patches/patch-sydent_http_httpclient.py:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/patches/patch-sydent_http_httpclient.py        Tue Aug 29 14:15:01 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-sydent_http_httpclient.py,v 1.1 2023/08/29 14:15:01 manu Exp $
+
+--- sydent/http/httpclient.py.orig
++++ sydent/http/httpclient.py
+@@ -16,9 +16,9 @@
+ 
+ import json
+ import logging
+ 
+-from StringIO import StringIO
++from io import StringIO
+ from twisted.internet import defer, reactor
+ from twisted.web.client import FileBodyProducer, Agent
+ from twisted.web.http_headers import Headers
+ 
Index: pkgsrc/www/py-sydent/patches/patch-sydent_http_httpsclient.py
diff -u /dev/null pkgsrc/www/py-sydent/patches/patch-sydent_http_httpsclient.py:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/patches/patch-sydent_http_httpsclient.py       Tue Aug 29 14:15:01 2023
@@ -0,0 +1,23 @@
+$NetBSD
+
+--- sydent/http/httpsclient.py.orig
++++ sydent/http/httpsclient.py
+@@ -16,9 +16,9 @@
+ 
+ import logging
+ import json
+ 
+-from StringIO import StringIO
++from io import StringIO
+ 
+ from zope.interface import implementer
+ 
+ import twisted.internet.reactor
+@@ -69,5 +69,5 @@
+ 
+     def creatorForNetloc(self, hostname, port):
+         return optionsForClientTLS(hostname.decode("ascii"),
+                                    trustRoot=self.sydent.sslComponents.trustRoot,
+-                                   clientCertificate=self.sydent.sslComponents.myPrivateCertificate)
+\ No newline at end of file
++                                   clientCertificate=self.sydent.sslComponents.myPrivateCertificate)
Index: pkgsrc/www/py-sydent/patches/patch-sydent_http_httpserver.py
diff -u /dev/null pkgsrc/www/py-sydent/patches/patch-sydent_http_httpserver.py:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/patches/patch-sydent_http_httpserver.py        Tue Aug 29 14:15:01 2023
@@ -0,0 +1,99 @@
+$NetBSD: patch-sydent_http_httpserver.py,v 1.1 2023/08/29 14:15:01 manu Exp $
+
+--- sydent/http/httpserver.py.orig     2017-04-25 17:29:32.000000000 +0200
++++ sydent/http/httpserver.py  2023-08-22 02:02:39.118761474 +0200
+@@ -53,46 +53,47 @@
+         ephemeralPubkey = Resource()
+ 
+         pk_ed25519 = self.sydent.servlets.pubkey_ed25519
+ 
+-        root.putChild('_matrix', matrix)
+-        matrix.putChild('identity', identity)
+-        identity.putChild('api', api)
+-        api.putChild('v1', v1)
++        root.putChild(bytes('_matrix', 'utf-8'), matrix)
++        matrix.putChild(bytes('identity', 'utf-8'), identity)
++        identity.putChild(bytes('api', 'utf-8'), api)
++        api.putChild(bytes('v1', 'utf-8'), v1)
+ 
+-        v1.putChild('validate', validate)
+-        validate.putChild('email', email)
+-        validate.putChild('msisdn', msisdn)
++        v1.putChild(bytes('validate', 'utf-8'), validate)
++        validate.putChild(bytes('email', 'utf-8'), email)
++        validate.putChild(bytes('msisdn', 'utf-8'), msisdn)
+ 
+-        v1.putChild('lookup', lookup)
+-        v1.putChild('bulk_lookup', bulk_lookup)
++        v1.putChild(bytes('lookup', 'utf-8'), lookup)
++        v1.putChild(bytes('bulk_lookup', 'utf-8'), bulk_lookup)
+ 
+-        v1.putChild('pubkey', pubkey)
+-        pubkey.putChild('isvalid', self.sydent.servlets.pubkeyIsValid)
+-        pubkey.putChild('ed25519:0', pk_ed25519)
+-        pubkey.putChild('ephemeral', ephemeralPubkey)
+-        ephemeralPubkey.putChild('isvalid', self.sydent.servlets.ephemeralPubkeyIsValid)
++        v1.putChild(bytes('pubkey', 'utf-8'), pubkey)
++        pubkey.putChild(bytes('isvalid', 'utf-8'), self.sydent.servlets.pubkeyIsValid)
++        pubkey.putChild(bytes('ed25519:0', 'utf-8'), pk_ed25519)
++        pubkey.putChild(bytes('ephemeral', 'utf-8'), ephemeralPubkey)
++        ephemeralPubkey.putChild(bytes('isvalid', 'utf-8'), self.sydent.servlets.ephemeralPubkeyIsValid)
+ 
+-        v1.putChild('3pid', threepid)
+-        threepid.putChild('bind', bind)
+-        threepid.putChild('getValidated3pid', getValidated3pid)
++        v1.putChild(bytes('3pid', 'utf-8'), threepid)
++        threepid.putChild(bytes('bind', 'utf-8'), bind)
++        threepid.putChild(bytes('getValidated3pid', 'utf-8'), getValidated3pid)
+ 
+-        email.putChild('requestToken', emailReqCode)
+-        email.putChild('submitToken', emailValCode)
++        email.putChild(bytes('requestToken', 'utf-8'), emailReqCode)
++        email.putChild(bytes('submitToken', 'utf-8'), emailValCode)
+ 
+-        msisdn.putChild('requestToken', msisdnReqCode)
+-        msisdn.putChild('submitToken', msisdnValCode)
++        msisdn.putChild(bytes('requestToken', 'utf-8'), msisdnReqCode)
++        msisdn.putChild(bytes('submitToken', 'utf-8'), msisdnValCode)
+ 
+-        v1.putChild('store-invite', self.sydent.servlets.storeInviteServlet)
++        v1.putChild(bytes('store-invite', 'utf-8'), self.sydent.servlets.storeInviteServlet)
+ 
+-        v1.putChild('sign-ed25519', self.sydent.servlets.blindlySignStuffServlet)
++        v1.putChild(bytes('sign-ed25519', 'utf-8'), self.sydent.servlets.blindlySignStuffServlet)
+ 
+         self.factory = Site(root)
+ 
+     def setup(self):
+         httpPort = int(self.sydent.cfg.get('http', 'clientapi.http.port'))
++        httpListen = str(self.sydent.cfg.get('http', 'clientapi.http.bind_address'))
+         logger.info("Starting Client API HTTP server on port %d", httpPort)
+-        twisted.internet.reactor.listenTCP(httpPort, self.factory)
++        twisted.internet.reactor.listenTCP(httpPort, self.factory, interface=httpListen)
+ 
+ 
+ class ReplicationHttpsServer:
+     def __init__(self, sydent):
+@@ -101,17 +102,17 @@
+         root = Resource()
+         matrix = Resource()
+         identity = Resource()
+ 
+-        root.putChild('_matrix', matrix)
+-        matrix.putChild('identity', identity)
++        root.putChild(bytes('_matrix', 'utf-8'), matrix)
++        matrix.putChild(bytes('identity', 'utf-8'), identity)
+ 
+         replicate = Resource()
+         replV1 = Resource()
+ 
+-        identity.putChild('replicate', replicate)
+-        replicate.putChild('v1', replV1)
+-        replV1.putChild('push', self.sydent.servlets.replicationPush)
++        identity.putChild(bytes('replicate', 'utf-8'), replicate)
++        replicate.putChild(bytes('v1', 'utf-8'), replV1)
++        replV1.putChild(bytes('push', 'utf-8'), self.sydent.servlets.replicationPush)
+ 
+         self.factory = Site(root)
+ 
+     def setup(self):
Index: pkgsrc/www/py-sydent/patches/patch-sydent_sydent.py
diff -u /dev/null pkgsrc/www/py-sydent/patches/patch-sydent_sydent.py:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/patches/patch-sydent_sydent.py Tue Aug 29 14:15:01 2023
@@ -0,0 +1,94 @@
+$NetBSD: patch-sydent_sydent.py,v 1.1 2023/08/29 14:15:01 manu Exp $
+
+--- sydent/sydent.py.orig      2017-04-25 17:29:32.000000000 +0200
++++ sydent/sydent.py   2023-08-22 02:03:44.352677913 +0200
+@@ -13,40 +13,40 @@
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ 
+-import ConfigParser
++import configparser
+ import logging
+ import os
+ 
+ import twisted.internet.reactor
+ from twisted.python import log
+ 
+-from db.sqlitedb import SqliteDatabase
++from sydent.db.sqlitedb import SqliteDatabase
+ 
+-from http.httpcommon import SslComponents
+-from http.httpserver import ClientApiHttpServer, ReplicationHttpsServer
+-from http.httpsclient import ReplicationHttpsClient
+-from http.servlets.blindlysignstuffservlet import BlindlySignStuffServlet
+-from http.servlets.pubkeyservlets import EphemeralPubkeyIsValidServlet, PubkeyIsValidServlet
+-from validators.emailvalidator import EmailValidator
+-from validators.msisdnvalidator import MsisdnValidator
+-
+-from sign.ed25519 import SydentEd25519
+-
+-from http.servlets.emailservlet import EmailRequestCodeServlet, EmailValidateCodeServlet
+-from http.servlets.msisdnservlet import MsisdnRequestCodeServlet, MsisdnValidateCodeServlet
+-from http.servlets.lookupservlet import LookupServlet
+-from http.servlets.bulklookupservlet import BulkLookupServlet
+-from http.servlets.pubkeyservlets import Ed25519Servlet
+-from http.servlets.threepidbindservlet import ThreePidBindServlet
+-from http.servlets.replication import ReplicationPushServlet
+-from http.servlets.getvalidated3pidservlet import GetValidated3pidServlet
+-from http.servlets.store_invite_servlet import StoreInviteServlet
++from sydent.http.httpcommon import SslComponents
++from sydent.http.httpserver import ClientApiHttpServer, ReplicationHttpsServer
++from sydent.http.httpsclient import ReplicationHttpsClient
++from sydent.http.servlets.blindlysignstuffservlet import BlindlySignStuffServlet
++from sydent.http.servlets.pubkeyservlets import EphemeralPubkeyIsValidServlet, PubkeyIsValidServlet
++from sydent.validators.emailvalidator import EmailValidator
++from sydent.validators.msisdnvalidator import MsisdnValidator
++
++from sydent.sign.ed25519 import SydentEd25519
++
++from sydent.http.servlets.emailservlet import EmailRequestCodeServlet, EmailValidateCodeServlet
++from sydent.http.servlets.msisdnservlet import MsisdnRequestCodeServlet, MsisdnValidateCodeServlet
++from sydent.http.servlets.lookupservlet import LookupServlet
++from sydent.http.servlets.bulklookupservlet import BulkLookupServlet
++from sydent.http.servlets.pubkeyservlets import Ed25519Servlet
++from sydent.http.servlets.threepidbindservlet import ThreePidBindServlet
++from sydent.http.servlets.replication import ReplicationPushServlet
++from sydent.http.servlets.getvalidated3pidservlet import GetValidated3pidServlet
++from sydent.http.servlets.store_invite_servlet import StoreInviteServlet
+ 
+-from threepid.bind import ThreepidBinder
++from sydent.threepid.bind import ThreepidBinder
+ 
+-from replication.pusher import Pusher
++from sydent.replication.pusher import Pusher
+ 
+ logger = logging.getLogger(__name__)
+ 
+ 
+@@ -60,8 +60,9 @@
+         # db
+         'db.file': 'sydent.db',
+         # http
+         'clientapi.http.port': '8090',
++        'clientapi.http.bind_address': '',
+         'replication.https.certfile': '',
+         'replication.https.cacert': '', # This should only be used for testing
+         'replication.https.port': '4434',
+         'obey_x_forwarded_for': False,
+@@ -143,13 +144,13 @@
+ 
+         self.pusher = Pusher(self)
+ 
+     def parse_config(self):
+-        self.cfg = ConfigParser.SafeConfigParser(Sydent.CONFIG_DEFAULTS)
++        self.cfg = configparser.SafeConfigParser(Sydent.CONFIG_DEFAULTS)
+         for sect in Sydent.CONFIG_SECTIONS:
+             try:
+                 self.cfg.add_section(sect)
+-            except ConfigParser.DuplicateSectionError:
++            except configparser.DuplicateSectionError:
+                 pass
+         self.cfg.read("sydent.conf")
+ 
+     def save_config(self):
Index: pkgsrc/www/py-sydent/patches/patch-sydent_threepid_bind.py
diff -u /dev/null pkgsrc/www/py-sydent/patches/patch-sydent_threepid_bind.py:1.1
--- /dev/null   Tue Aug 29 14:15:01 2023
+++ pkgsrc/www/py-sydent/patches/patch-sydent_threepid_bind.py  Tue Aug 29 14:15:01 2023
@@ -0,0 +1,14 @@
+$NetBSD: patch-sydent_threepid_bind.py,v 1.1 2023/08/29 14:15:01 manu Exp $
+--- sydent/threepid/bind.py.orig
++++ sydent/threepid/bind.py
+@@ -30,9 +30,9 @@
+ from sydent.threepid import ThreepidAssociation
+ 
+ from OpenSSL import SSL
+ from OpenSSL.SSL import VERIFY_NONE
+-from StringIO import StringIO
++from io import StringIO
+ from twisted.internet import reactor, defer, ssl
+ from twisted.names import client, dns
+ from twisted.names.error import DNSNameError
+ from twisted.web.client import FileBodyProducer, Agent



Home | Main Index | Thread Index | Old Index