From 2c82c45f9d9977681fb37afacb3e2dc64d0c43ac Mon Sep 17 00:00:00 2001 From: feld Date: Mon, 17 Apr 2017 13:19:59 +0000 Subject: Move net/py-matrix-synapse to the net-im category --- MOVED | 1 + net-im/Makefile | 1 + net-im/py-matrix-synapse/Makefile | 96 +++++ net-im/py-matrix-synapse/distinfo | 3 + net-im/py-matrix-synapse/files/homeserver.yaml.in | 471 +++++++++++++++++++++ net-im/py-matrix-synapse/files/log.config.in | 35 ++ .../files/patch-synapse_python__dependencies.py | 11 + net-im/py-matrix-synapse/files/pkg-message.in | 22 + net-im/py-matrix-synapse/files/synapse.in | 56 +++ net-im/py-matrix-synapse/pkg-descr | 14 + net/Makefile | 1 - net/py-matrix-synapse/Makefile | 96 ----- net/py-matrix-synapse/distinfo | 3 - net/py-matrix-synapse/files/homeserver.yaml.in | 471 --------------------- net/py-matrix-synapse/files/log.config.in | 35 -- .../files/patch-synapse_python__dependencies.py | 11 - net/py-matrix-synapse/files/pkg-message.in | 22 - net/py-matrix-synapse/files/synapse.in | 56 --- net/py-matrix-synapse/pkg-descr | 14 - 19 files changed, 710 insertions(+), 709 deletions(-) create mode 100644 net-im/py-matrix-synapse/Makefile create mode 100644 net-im/py-matrix-synapse/distinfo create mode 100644 net-im/py-matrix-synapse/files/homeserver.yaml.in create mode 100644 net-im/py-matrix-synapse/files/log.config.in create mode 100644 net-im/py-matrix-synapse/files/patch-synapse_python__dependencies.py create mode 100644 net-im/py-matrix-synapse/files/pkg-message.in create mode 100644 net-im/py-matrix-synapse/files/synapse.in create mode 100644 net-im/py-matrix-synapse/pkg-descr delete mode 100644 net/py-matrix-synapse/Makefile delete mode 100644 net/py-matrix-synapse/distinfo delete mode 100644 net/py-matrix-synapse/files/homeserver.yaml.in delete mode 100644 net/py-matrix-synapse/files/log.config.in delete mode 100644 net/py-matrix-synapse/files/patch-synapse_python__dependencies.py delete mode 100644 net/py-matrix-synapse/files/pkg-message.in delete mode 100644 net/py-matrix-synapse/files/synapse.in delete mode 100644 net/py-matrix-synapse/pkg-descr diff --git a/MOVED b/MOVED index c2218cfdf516..f4477806877c 100644 --- a/MOVED +++ b/MOVED @@ -9234,3 +9234,4 @@ graphics/opencv2-java|graphics/opencv-java|2017-04-14|Revert previous rename graphics/py-opencv2|graphics/py-opencv|2017-04-14|Revert previous rename databases/pgpool-II-22|databases/pgpool|2017-04-14|Has expired: Deprecated by upstream; use database/pgpool instead databases/pgpool-II-23|databases/pgpool|2017-04-14|Has expired: Deprecated by upstream; use database/pgpool instead +net/py-matrix-synapse|net-im/py-matrix-synapse|2017-04-17|Move to net-im which is a more appropriate category diff --git a/net-im/Makefile b/net-im/Makefile index 7983fc0c0539..9e15d90cb4a5 100644 --- a/net-im/Makefile +++ b/net-im/Makefile @@ -132,6 +132,7 @@ SUBDIR += py-jabber SUBDIR += py-jabberbot SUBDIR += py-libturpial + SUBDIR += py-matrix-synapse SUBDIR += py-nbxmpp SUBDIR += py-punjab SUBDIR += py-python-telegram-bot diff --git a/net-im/py-matrix-synapse/Makefile b/net-im/py-matrix-synapse/Makefile new file mode 100644 index 000000000000..70007bdbbf78 --- /dev/null +++ b/net-im/py-matrix-synapse/Makefile @@ -0,0 +1,96 @@ +# Created by: Brendan Molloy +# $FreeBSD$ + +PORTNAME= matrix-synapse +DISTVERSIONPREFIX= v +DISTVERSION= 0.20.0 +PORTREVISION= 0 +CATEGORIES= net-im python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= feld@FreeBSD.org +COMMENT= Matrix protocol reference homeserver + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +# Keep the RUN_DEPENDS layout similar to the master/synapse/python_dependencies.py file +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}jsonschema>=2.5.1:devel/py-jsonschema \ + ${PYTHON_PKGNAMEPREFIX}frozendict>=0.5:devel/py-frozendict \ + ${PYTHON_PKGNAMEPREFIX}unpaddedbase64>=1.1.0:devel/py-unpaddedbase64 \ + ${PYTHON_PKGNAMEPREFIX}canonicaljson>=1.0.0:devel/py-canonicaljson \ + ${PYTHON_PKGNAMEPREFIX}signedjson>=1.0.0:security/py-signedjson \ + ${PYTHON_PKGNAMEPREFIX}pynacl>=1.0.1:security/py-pynacl \ + ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0:security/py-service_identity \ + ${PYTHON_PKGNAMEPREFIX}twisted>=16.6.0:devel/py-twisted \ + ${PYTHON_PKGNAMEPREFIX}openssl>=16.0.0:security/py-openssl \ + ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml \ + ${PYTHON_PKGNAMEPREFIX}pyasn1>=0.1.9:devel/py-pyasn1 \ + ${PYTHON_PKGNAMEPREFIX}daemonize>=2.4.2:devel/py-daemonize \ + ${PYTHON_PKGNAMEPREFIX}bcrypt>=0.4:security/py-bcrypt \ + ${PYTHON_PKGNAMEPREFIX}pillow>=3.1.1:graphics/py-pillow \ + ${PYTHON_PKGNAMEPREFIX}pydenticon>=0.2:devel/py-pydenticon \ + ${PYTHON_PKGNAMEPREFIX}ujson>=1.35:devel/py-ujson \ + ${PYTHON_PKGNAMEPREFIX}blist>=1.3.6:devel/py-blist \ + ${PYTHON_PKGNAMEPREFIX}pysaml2>=4.0.2:security/py-pysaml2 \ + ${PYTHON_PKGNAMEPREFIX}pymacaroons-pynacl>=0.9.3:security/py-pymacaroons-pynacl \ + ${PYTHON_PKGNAMEPREFIX}msgpack-python>=0.3.0:devel/py-msgpack-python \ + ${PYTHON_PKGNAMEPREFIX}phonenumbers>=8.2.0:devel/py-phonenumbers + +# Conditional requirements that aren't so conditional +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}matrix-angular-sdk>=0.6.6:devel/py-matrix-angular-sdk \ + ${PYTHON_PKGNAMEPREFIX}netaddr>0:net/py-netaddr \ + ${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml + +# Dependencies that aren't declared in python_dependencies.py which I have discovered +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}simplejson>=3.10.0:devel/py-simplejson \ + ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss + +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}virtualenv>=15.0:devel/py-virtualenv \ + ${PYTHON_PKGNAMEPREFIX}tox>=2.3.1:devel/py-tox + +USES= python +USE_GITHUB= yes +USE_PYTHON= autoplist distutils + +GH_ACCOUNT= matrix-org +GH_PROJECT= synapse + +USE_RC_SUBR= synapse + +USERS= synapse + +DBDIR?= /var/db/${PORTNAME} +LOGDIR?= /var/log/${PORTNAME} +PIDDIR?= /var/run/${PORTNAME} + +SUB_FILES= pkg-message homeserver.yaml log.config +SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} DBDIR=${DBDIR} LOGDIR=${LOGDIR} PIDDIR=${PIDDIR} USERS=${USERS} + +PLIST_FILES+= "@sample %%ETCDIR%%/homeserver.yaml.sample" +PLIST_FILES+= "@sample %%ETCDIR%%/log.config.sample" + +NO_ARCH= yes + +OPTIONS_DEFINE= EMAIL LDAP PGSQL SQLITE +OPTIONS_DEFAULT= SQLITE +EMAIL_DESC= Email notifications for missed messages +EMAIL_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.8:devel/py-Jinja2 \ + ${PYTHON_PKGNAMEPREFIX}bleach>=1.4.2:www/py-bleach +LDAP_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}matrix-synapse-ldap3>=0.1:net/py-matrix-synapse-ldap3 +PGSQL_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}psycopg2>0:databases/py-psycopg2 +SQLITE_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 + +.include + +do-test: + # -epy27 added to skip running python packaging and other dist tests + @(cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${TEST_TARGET} \ + -a "-epy27") + +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKDIR}/homeserver.yaml ${STAGEDIR}${ETCDIR}/homeserver.yaml.sample + ${INSTALL_DATA} ${WRKDIR}/log.config ${STAGEDIR}${ETCDIR}/log.config.sample + +.include diff --git a/net-im/py-matrix-synapse/distinfo b/net-im/py-matrix-synapse/distinfo new file mode 100644 index 000000000000..19d28c9f2691 --- /dev/null +++ b/net-im/py-matrix-synapse/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1492089523 +SHA256 (matrix-org-synapse-v0.20.0_GH0.tar.gz) = 2b844c551a9eeb9d2ada1793aae7d18143594f62b13fa61d7264f402a2294afd +SIZE (matrix-org-synapse-v0.20.0_GH0.tar.gz) = 788371 diff --git a/net-im/py-matrix-synapse/files/homeserver.yaml.in b/net-im/py-matrix-synapse/files/homeserver.yaml.in new file mode 100644 index 000000000000..c8b344cc96b9 --- /dev/null +++ b/net-im/py-matrix-synapse/files/homeserver.yaml.in @@ -0,0 +1,471 @@ +# vim:ft=yaml +# PEM encoded X509 certificate for TLS. +# You can replace the self-signed certificate that synapse +# autogenerates on launch with your own SSL certificate + key pair +# if you like. Any required intermediary certificates can be +# appended after the primary certificate in hierarchical order. +tls_certificate_path: "%%ETCDIR%%/example.com.tls.crt" + +# PEM encoded private key for TLS +tls_private_key_path: "%%ETCDIR%%/example.com.tls.key" + +# PEM dh parameters for ephemeral keys +tls_dh_params_path: "%%ETCDIR%%/example.com.tls.dh" + +# Don't bind to the https port +no_tls: False + +# List of allowed TLS fingerprints for this server to publish along +# with the signing keys for this server. Other matrix servers that +# make HTTPS requests to this server will check that the TLS +# certificates returned by this server match one of the fingerprints. +# +# Synapse automatically adds its the fingerprint of its own certificate +# to the list. So if federation traffic is handle directly by synapse +# then no modification to the list is required. +# +# If synapse is run behind a load balancer that handles the TLS then it +# will be necessary to add the fingerprints of the certificates used by +# the loadbalancers to this list if they are different to the one +# synapse is using. +# +# Homeservers are permitted to cache the list of TLS fingerprints +# returned in the key responses up to the "valid_until_ts" returned in +# key. It may be necessary to publish the fingerprints of a new +# certificate and wait until the "valid_until_ts" of the previous key +# responses have passed before deploying it. +tls_fingerprints: [] +# tls_fingerprints: [{"sha256": ""}] + + +## Server ## + +# The domain name of the server, with optional explicit port. +# This is used by remote servers to connect to this server, +# e.g. matrix.org, localhost:8080, etc. +# This is also the last part of your UserID. +server_name: "example.com" + +# When running as a daemon, the file to store the pid in +pid_file: %%PIDDIR%%/homeserver.pid + +# Whether to serve a web client from the HTTP/HTTPS root resource. +web_client: True + +# The public-facing base URL for the client API (not including _matrix/...) +# public_baseurl: https://example.com:8448/ + +# Set the soft limit on the number of file descriptors synapse can use +# Zero is used to indicate synapse should set the soft limit to the +# hard limit. +soft_file_limit: 0 + +# The GC threshold parameters to pass to `gc.set_threshold`, if defined +# gc_thresholds: [700, 10, 10] + +# List of ports that Synapse should listen on, their purpose and their +# configuration. +listeners: + # Main HTTPS listener + # For when matrix traffic is sent directly to synapse. + - + # The port to listen for HTTPS requests on. + port: 8448 + + # Local interface to listen on. + # The empty string will cause synapse to listen on all interfaces. + bind_address: '' + + # This is a 'http' listener, allows us to specify 'resources'. + type: http + + tls: true + + # Use the X-Forwarded-For (XFF) header as the client IP and not the + # actual client IP. + x_forwarded: false + + # List of HTTP resources to serve on this listener. + resources: + - + # List of resources to host on this listener. + names: + - client # The client-server APIs, both v1 and v2 + - webclient # The bundled webclient. + + # Should synapse compress HTTP responses to clients that support it? + # This should be disabled if running synapse behind a load balancer + # that can do automatic compression. + compress: true + + - names: [federation] # Federation APIs + compress: false + + # Unsecure HTTP listener, + # For when matrix traffic passes through loadbalancer that unwraps TLS. + - port: 8008 + tls: false + bind_address: '' + type: http + + x_forwarded: false + + resources: + - names: [client, webclient] + compress: true + - names: [federation] + compress: false + + # Turn on the twisted ssh manhole service on localhost on the given + # port. + # - port: 9000 + # bind_address: 127.0.0.1 + # type: manhole + + +# Database configuration +database: + # The database engine name + name: "sqlite3" + # Arguments to pass to the engine + args: + # Path to the database + database: "%%DBDIR%%/homeserver.db" + +# Number of events to cache in memory. +event_cache_size: "10K" + + + +# Logging verbosity level. +verbose: 0 + +# File to write logging to +log_file: "%%LOGDIR%%/homeserver.log" + +# A yaml python logging config file +log_config: "%%ETCDIR%%/log.config" + +# Stop twisted from discarding the stack traces of exceptions in +# deferreds by waiting a reactor tick before running a deferred's +# callbacks. +# full_twisted_stacktraces: true + + +## Ratelimiting ## + +# Number of messages a client can send per second +rc_messages_per_second: 0.2 + +# Number of message a client can send before being throttled +rc_message_burst_count: 10.0 + +# The federation window size in milliseconds +federation_rc_window_size: 1000 + +# The number of federation requests from a single server in a window +# before the server will delay processing the request. +federation_rc_sleep_limit: 10 + +# The duration in milliseconds to delay processing events from +# remote servers by if they go over the sleep limit. +federation_rc_sleep_delay: 500 + +# The maximum number of concurrent federation requests allowed +# from a single server +federation_rc_reject_limit: 50 + +# The number of federation requests to concurrently process from a +# single server +federation_rc_concurrent: 3 + + + +# Directory where uploaded images and attachments are stored. +media_store_path: "%%DBDIR%%/media_store" + +# Directory where in-progress uploads are stored. +uploads_path: "%%DBDIR%%/uploads" + +# The largest allowed upload size in bytes +max_upload_size: "10M" + +# Maximum number of pixels that will be thumbnailed +max_image_pixels: "32M" + +# Whether to generate new thumbnails on the fly to precisely match +# the resolution requested by the client. If true then whenever +# a new resolution is requested by the client the server will +# generate a new thumbnail. If false the server will pick a thumbnail +# from a precalculated list. +dynamic_thumbnails: false + +# List of thumbnail to precalculate when an image is uploaded. +thumbnail_sizes: +- width: 32 + height: 32 + method: crop +- width: 96 + height: 96 + method: crop +- width: 320 + height: 240 + method: scale +- width: 640 + height: 480 + method: scale +- width: 800 + height: 600 + method: scale + +# Is the preview URL API enabled? If enabled, you *must* specify +# an explicit url_preview_ip_range_blacklist of IPs that the spider is +# denied from accessing. +url_preview_enabled: False + +# List of IP address CIDR ranges that the URL preview spider is denied +# from accessing. There are no defaults: you must explicitly +# specify a list for URL previewing to work. You should specify any +# internal services in your network that you do not want synapse to try +# to connect to, otherwise anyone in any Matrix room could cause your +# synapse to issue arbitrary GET requests to your internal services, +# causing serious security issues. +# +# url_preview_ip_range_blacklist: +# - '127.0.0.0/8' +# - '10.0.0.0/8' +# - '172.16.0.0/12' +# - '192.168.0.0/16' +# - '100.64.0.0/10' +# - '169.254.0.0/16' +# +# List of IP address CIDR ranges that the URL preview spider is allowed +# to access even if they are specified in url_preview_ip_range_blacklist. +# This is useful for specifying exceptions to wide-ranging blacklisted +# target IP ranges - e.g. for enabling URL previews for a specific private +# website only visible in your network. +# +# url_preview_ip_range_whitelist: +# - '192.168.1.1' + +# Optional list of URL matches that the URL preview spider is +# denied from accessing. You should use url_preview_ip_range_blacklist +# in preference to this, otherwise someone could define a public DNS +# entry that points to a private IP address and circumvent the blacklist. +# This is more useful if you know there is an entire shape of URL that +# you know that will never want synapse to try to spider. +# +# Each list entry is a dictionary of url component attributes as returned +# by urlparse.urlsplit as applied to the absolute form of the URL. See +# https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit +# The values of the dictionary are treated as an filename match pattern +# applied to that component of URLs, unless they start with a ^ in which +# case they are treated as a regular expression match. If all the +# specified component matches for a given list item succeed, the URL is +# blacklisted. +# +# url_preview_url_blacklist: +# # blacklist any URL with a username in its URI +# - username: '*' +# +# # blacklist all *.google.com URLs +# - netloc: 'google.com' +# - netloc: '*.google.com' +# +# # blacklist all plain HTTP URLs +# - scheme: 'http' +# +# # blacklist http(s)://www.acme.com/foo +# - netloc: 'www.acme.com' +# path: '/foo' +# +# # blacklist any URL with a literal IPv4 address +# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' + +# The largest allowed URL preview spidering size in bytes +max_spider_size: "10M" + + + + +## Captcha ## +# See docs/CAPTCHA_SETUP for full details of configuring this. + +# This Home Server's ReCAPTCHA public key. +recaptcha_public_key: "YOUR_PUBLIC_KEY" + +# This Home Server's ReCAPTCHA private key. +recaptcha_private_key: "YOUR_PRIVATE_KEY" + +# Enables ReCaptcha checks when registering, preventing signup +# unless a captcha is answered. Requires a valid ReCaptcha +# public/private key. +enable_registration_captcha: False + +# A secret key used to bypass the captcha test entirely. +#captcha_bypass_secret: "YOUR_SECRET_HERE" + +# The API endpoint to use for verifying m.login.recaptcha responses. +recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify" + + +## Turn ## + +# The public URIs of the TURN server to give to clients +turn_uris: [] + +# The shared secret used to compute passwords for the TURN server +turn_shared_secret: "YOUR_SHARED_SECRET" + +# How long generated TURN credentials last +turn_user_lifetime: "1h" + + +## Registration ## + +# Enable registration for new users. +enable_registration: False + +# If set, allows registration by anyone who also has the shared +# secret, even if registration is otherwise disabled. +registration_shared_secret: "CHANGEME_50CHAR_RANDOM" + +# Set the number of bcrypt rounds used to generate password hash. +# Larger numbers increase the work factor needed to generate the hash. +# The default number of rounds is 12. +bcrypt_rounds: 12 + +# Allows users to register as guests without a password/email/etc, and +# participate in rooms hosted on this server which have been made +# accessible to anonymous users. +allow_guest_access: False + +# The list of identity servers trusted to verify third party +# identifiers by this server. +trusted_third_party_id_servers: + - matrix.org + - vector.im + + +## Metrics ### + +# Enable collection and rendering of performance metrics +enable_metrics: False +report_stats: False + + +## API Configuration ## + +# A list of event types that will be included in the room_invite_state +room_invite_state_types: + - "m.room.join_rules" + - "m.room.canonical_alias" + - "m.room.avatar" + - "m.room.name" + + +# A list of application service config file to use +app_service_config_files: [] + + +macaroon_secret_key: "CHANGEME_50CHAR_RANDOM" + +# Used to enable access token expiration. +expire_access_token: False + +## Signing Keys ## + +# Path to the signing key to sign messages with +signing_key_path: "%%ETCDIR%%/example.com.signing.key" + +# The keys that the server used to sign messages with but won't use +# to sign new messages. E.g. it has lost its private key +old_signing_keys: {} +# "ed25519:auto": +# # Base64 encoded public key +# key: "The public part of your old signing key." +# # Millisecond POSIX timestamp when the key expired. +# expired_ts: 123456789123 + +# How long key response published by this server is valid for. +# Used to set the valid_until_ts in /key/v2 APIs. +# Determines how quickly servers will query to check which keys +# are still valid. +key_refresh_interval: "1d" # 1 Day. + +# The trusted servers to download signing keys from. +perspectives: + servers: + "matrix.org": + verify_keys: + "ed25519:auto": + key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw" + + + +# Enable SAML2 for registration and login. Uses pysaml2 +# config_path: Path to the sp_conf.py configuration file +# idp_redirect_url: Identity provider URL which will redirect +# the user back to /login/saml2 with proper info. +# See pysaml2 docs for format of config. +#saml2_config: +# enabled: true +# config_path: "%%ETCDIR%%/sp_conf.py" +# idp_redirect_url: "http://example.com/idp" + + + +# Enable CAS for registration and login. +#cas_config: +# enabled: true +# server_url: "https://cas-server.com" +# service_url: "https://homesever.domain.com:8448" +# #required_attributes: +# # name: value + + +# The JWT needs to contain a globally unique "sub" (subject) claim. +# +# jwt_config: +# enabled: true +# secret: "a secret" +# algorithm: "HS256" + + + +# Enable password for login. +password_config: + enabled: true + # Uncomment and change to a secret random string for extra security. + # DO NOT CHANGE THIS AFTER INITIAL SETUP! + #pepper: "" + + + +# Enable sending emails for notification events +#email: +# enable_notifs: false +# smtp_host: "localhost" +# smtp_port: 25 +# notif_from: "Your Friendly %(app)s Home Server " +# app_name: Matrix +# template_dir: res/templates +# notif_template_html: notif_mail.html +# notif_template_text: notif_mail.txt +# notif_for_new_users: True + + +# password_providers: +# - module: "ldap_auth_provider.LdapAuthProvider" +# config: +# enabled: true +# uri: "ldap://ldap.example.com:389" +# start_tls: true +# base: "ou=users,dc=example,dc=com" +# attributes: +# uid: "cn" +# mail: "email" +# name: "givenName" +# #bind_dn: +# #bind_password: +# #filter: "(objectClass=posixAccount)" diff --git a/net-im/py-matrix-synapse/files/log.config.in b/net-im/py-matrix-synapse/files/log.config.in new file mode 100644 index 000000000000..6918bb2b2582 --- /dev/null +++ b/net-im/py-matrix-synapse/files/log.config.in @@ -0,0 +1,35 @@ + +version: 1 + +formatters: + precise: + format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s' + +filters: + context: + (): synapse.util.logcontext.LoggingContextFilter + request: "" + +handlers: + file: + class: logging.handlers.RotatingFileHandler + formatter: precise + filename: %%LOGDIR%%/homeserver.log + maxBytes: 104857600 + backupCount: 10 + filters: [context] + level: INFO + console: + class: logging.StreamHandler + formatter: precise + +loggers: + synapse: + level: INFO + + synapse.storage.SQL: + level: INFO + +root: + level: INFO + handlers: [file, console] diff --git a/net-im/py-matrix-synapse/files/patch-synapse_python__dependencies.py b/net-im/py-matrix-synapse/files/patch-synapse_python__dependencies.py new file mode 100644 index 000000000000..f6240a427ed3 --- /dev/null +++ b/net-im/py-matrix-synapse/files/patch-synapse_python__dependencies.py @@ -0,0 +1,11 @@ +--- synapse/python_dependencies.py.orig 2017-01-17 17:50:56 UTC ++++ synapse/python_dependencies.py +@@ -22,7 +22,7 @@ REQUIREMENTS = { + "unpaddedbase64>=1.1.0": ["unpaddedbase64>=1.1.0"], + "canonicaljson>=1.0.0": ["canonicaljson>=1.0.0"], + "signedjson>=1.0.0": ["signedjson>=1.0.0"], +- "pynacl==0.3.0": ["nacl==0.3.0", "nacl.bindings"], ++ "pynacl>=0.3.0": ["nacl>=0.3.0", "nacl.bindings"], + "service_identity>=1.0.0": ["service_identity>=1.0.0"], + "Twisted>=15.1.0": ["twisted>=15.1.0"], + "pyopenssl>=0.14": ["OpenSSL>=0.14"], diff --git a/net-im/py-matrix-synapse/files/pkg-message.in b/net-im/py-matrix-synapse/files/pkg-message.in new file mode 100644 index 000000000000..3b9faa8e8e3d --- /dev/null +++ b/net-im/py-matrix-synapse/files/pkg-message.in @@ -0,0 +1,22 @@ +Configuring Synapse: + +You may use the sample config located at %%ETCDIR%% to get started. It +already is configured to find the configuration in that location and +places the database in %%DBDIR%% and the logs in %%LOGDIR%%, but there +are some crucial values you will need to populate with unique data: +registration_shared_secret and macaroon_secret_key. Both of these +by default are 50 character random strings. These are by default set to +CHANGEME_50CHAR_RANDOM in the sample homeserver.yaml. + +If you wish to have Synapse handle this for you including generation of +self-signed TLS certificates and dhparams you can use the following +command: + +%%PYTHON_CMD%% -B -m synapse.app.homeserver -c %%ETCDIR%%/homeserver.yaml --generate-config --server-name=example.com + +Please note that you will still need to manually configure paths to log +directory, database, and media storage with this method. + +It is also important that you deploy a TLS certificate that your +clients accept as valid or some functionality will fail to work +correctly (eg, media file retrieval). diff --git a/net-im/py-matrix-synapse/files/synapse.in b/net-im/py-matrix-synapse/files/synapse.in new file mode 100644 index 000000000000..7d618f2b398c --- /dev/null +++ b/net-im/py-matrix-synapse/files/synapse.in @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Created by: Mark Felder +# $FreeBSD$ +# + +# PROVIDE: synapse +# REQUIRE: LOGIN postgresql +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable `synapse': +# +# synapse_enable="YES" + +. /etc/rc.subr +name=synapse + +rcvar=synapse_enable +load_rc_config ${name} + +: ${synapse_enable:=NO} +: ${synapse_user:=%%USERS%%} +: ${synapse_conf:=%%ETCDIR%%/homeserver.yaml} +: ${synapse_dbdir:=%%DBDIR%%} +: ${synapse_logdir:=%%LOGDIR%%} +: ${synapse_pidfile:=%%PIDDIR%%/homeserver.pid} + +pidfile="${synapse_pidfile}" +procname=%%PYTHON_CMD%% +command=%%PYTHON_CMD%% +command_args="-m synapse.app.homeserver --daemonize -c ${synapse_conf}" +start_precmd=start_precmd + +start_precmd() +{ + if [ ! -d ${synapse_pidfile%/*} ] ; then + install -d -o %%USERS%% -g wheel ${synapse_pidfile%/*}; + fi + + if [ ! -d ${synapse_dbdir} ] ; then + install -d -o %%USERS%% -g wheel ${synapse_dbdir}; + fi + + if [ ! -d ${synapse_logdir} ] ; then + install -d -o %%USERS%% -g wheel ${synapse_logdir}; + fi + + if $(grep -q CHANGEME ${synapse_conf}) ; then + echo "Error: Default secret values in config." + echo "Please replace the CHANGEME values in ${synapse_conf}" + exit 1 + fi +} + +run_rc_command "$1" diff --git a/net-im/py-matrix-synapse/pkg-descr b/net-im/py-matrix-synapse/pkg-descr new file mode 100644 index 000000000000..8ebc5eaa170c --- /dev/null +++ b/net-im/py-matrix-synapse/pkg-descr @@ -0,0 +1,14 @@ +Matrix is an ambitious new ecosystem for open federated Instant Messaging and +VoIP. The basics you need to know to get up and running are: + + * Everything in Matrix happens in a room. Rooms are distributed and do not + exist on any single server. Rooms can be located using convenience + aliases like #matrix:matrix.org or #test:localhost:8448. + * Matrix user IDs look like @matthew:matrix.org (although in the future you + will normally refer to yourself and others using a 3PID: email address, + phone number, etc rather than manipulating Matrix user IDs) + +Synapse is currently in rapid development, but as of version 0.5 we believe it +is sufficiently stable to be run as an internet-facing service for real usage! + +WWW: https://www.matrix.org diff --git a/net/Makefile b/net/Makefile index 653a04b641d2..9e59d5499e45 100644 --- a/net/Makefile +++ b/net/Makefile @@ -992,7 +992,6 @@ SUBDIR += py-libdnet SUBDIR += py-libnet SUBDIR += py-magic-wormhole - SUBDIR += py-matrix-synapse SUBDIR += py-matrix-synapse-ldap3 SUBDIR += py-maxminddb SUBDIR += py-miniupnpc diff --git a/net/py-matrix-synapse/Makefile b/net/py-matrix-synapse/Makefile deleted file mode 100644 index 6609143689a2..000000000000 --- a/net/py-matrix-synapse/Makefile +++ /dev/null @@ -1,96 +0,0 @@ -# Created by: Brendan Molloy -# $FreeBSD$ - -PORTNAME= matrix-synapse -DISTVERSIONPREFIX= v -DISTVERSION= 0.20.0 -PORTREVISION= 0 -CATEGORIES= net python -PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} - -MAINTAINER= feld@FreeBSD.org -COMMENT= Matrix protocol reference homeserver - -LICENSE= APACHE20 -LICENSE_FILE= ${WRKSRC}/LICENSE - -# Keep the RUN_DEPENDS layout similar to the master/synapse/python_dependencies.py file -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}jsonschema>=2.5.1:devel/py-jsonschema \ - ${PYTHON_PKGNAMEPREFIX}frozendict>=0.5:devel/py-frozendict \ - ${PYTHON_PKGNAMEPREFIX}unpaddedbase64>=1.1.0:devel/py-unpaddedbase64 \ - ${PYTHON_PKGNAMEPREFIX}canonicaljson>=1.0.0:devel/py-canonicaljson \ - ${PYTHON_PKGNAMEPREFIX}signedjson>=1.0.0:security/py-signedjson \ - ${PYTHON_PKGNAMEPREFIX}pynacl>=1.0.1:security/py-pynacl \ - ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0:security/py-service_identity \ - ${PYTHON_PKGNAMEPREFIX}twisted>=16.6.0:devel/py-twisted \ - ${PYTHON_PKGNAMEPREFIX}openssl>=16.0.0:security/py-openssl \ - ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml \ - ${PYTHON_PKGNAMEPREFIX}pyasn1>=0.1.9:devel/py-pyasn1 \ - ${PYTHON_PKGNAMEPREFIX}daemonize>=2.4.2:devel/py-daemonize \ - ${PYTHON_PKGNAMEPREFIX}bcrypt>=0.4:security/py-bcrypt \ - ${PYTHON_PKGNAMEPREFIX}pillow>=3.1.1:graphics/py-pillow \ - ${PYTHON_PKGNAMEPREFIX}pydenticon>=0.2:devel/py-pydenticon \ - ${PYTHON_PKGNAMEPREFIX}ujson>=1.35:devel/py-ujson \ - ${PYTHON_PKGNAMEPREFIX}blist>=1.3.6:devel/py-blist \ - ${PYTHON_PKGNAMEPREFIX}pysaml2>=4.0.2:security/py-pysaml2 \ - ${PYTHON_PKGNAMEPREFIX}pymacaroons-pynacl>=0.9.3:security/py-pymacaroons-pynacl \ - ${PYTHON_PKGNAMEPREFIX}msgpack-python>=0.3.0:devel/py-msgpack-python \ - ${PYTHON_PKGNAMEPREFIX}phonenumbers>=8.2.0:devel/py-phonenumbers - -# Conditional requirements that aren't so conditional -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}matrix-angular-sdk>=0.6.6:devel/py-matrix-angular-sdk \ - ${PYTHON_PKGNAMEPREFIX}netaddr>0:net/py-netaddr \ - ${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml - -# Dependencies that aren't declared in python_dependencies.py which I have discovered -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}simplejson>=3.10.0:devel/py-simplejson \ - ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss - -TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}virtualenv>=15.0:devel/py-virtualenv \ - ${PYTHON_PKGNAMEPREFIX}tox>=2.3.1:devel/py-tox - -USES= python -USE_GITHUB= yes -USE_PYTHON= autoplist distutils - -GH_ACCOUNT= matrix-org -GH_PROJECT= synapse - -USE_RC_SUBR= synapse - -USERS= synapse - -DBDIR?= /var/db/${PORTNAME} -LOGDIR?= /var/log/${PORTNAME} -PIDDIR?= /var/run/${PORTNAME} - -SUB_FILES= pkg-message homeserver.yaml log.config -SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} DBDIR=${DBDIR} LOGDIR=${LOGDIR} PIDDIR=${PIDDIR} USERS=${USERS} - -PLIST_FILES+= "@sample %%ETCDIR%%/homeserver.yaml.sample" -PLIST_FILES+= "@sample %%ETCDIR%%/log.config.sample" - -NO_ARCH= yes - -OPTIONS_DEFINE= EMAIL LDAP PGSQL SQLITE -OPTIONS_DEFAULT= SQLITE -EMAIL_DESC= Email notifications for missed messages -EMAIL_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.8:devel/py-Jinja2 \ - ${PYTHON_PKGNAMEPREFIX}bleach>=1.4.2:www/py-bleach -LDAP_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}matrix-synapse-ldap3>=0.1:net/py-matrix-synapse-ldap3 -PGSQL_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}psycopg2>0:databases/py-psycopg2 -SQLITE_RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 - -.include - -do-test: - # -epy27 added to skip running python packaging and other dist tests - @(cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${TEST_TARGET} \ - -a "-epy27") - -post-install: - ${MKDIR} ${STAGEDIR}${ETCDIR} - ${INSTALL_DATA} ${WRKDIR}/homeserver.yaml ${STAGEDIR}${ETCDIR}/homeserver.yaml.sample - ${INSTALL_DATA} ${WRKDIR}/log.config ${STAGEDIR}${ETCDIR}/log.config.sample - -.include diff --git a/net/py-matrix-synapse/distinfo b/net/py-matrix-synapse/distinfo deleted file mode 100644 index 19d28c9f2691..000000000000 --- a/net/py-matrix-synapse/distinfo +++ /dev/null @@ -1,3 +0,0 @@ -TIMESTAMP = 1492089523 -SHA256 (matrix-org-synapse-v0.20.0_GH0.tar.gz) = 2b844c551a9eeb9d2ada1793aae7d18143594f62b13fa61d7264f402a2294afd -SIZE (matrix-org-synapse-v0.20.0_GH0.tar.gz) = 788371 diff --git a/net/py-matrix-synapse/files/homeserver.yaml.in b/net/py-matrix-synapse/files/homeserver.yaml.in deleted file mode 100644 index c8b344cc96b9..000000000000 --- a/net/py-matrix-synapse/files/homeserver.yaml.in +++ /dev/null @@ -1,471 +0,0 @@ -# vim:ft=yaml -# PEM encoded X509 certificate for TLS. -# You can replace the self-signed certificate that synapse -# autogenerates on launch with your own SSL certificate + key pair -# if you like. Any required intermediary certificates can be -# appended after the primary certificate in hierarchical order. -tls_certificate_path: "%%ETCDIR%%/example.com.tls.crt" - -# PEM encoded private key for TLS -tls_private_key_path: "%%ETCDIR%%/example.com.tls.key" - -# PEM dh parameters for ephemeral keys -tls_dh_params_path: "%%ETCDIR%%/example.com.tls.dh" - -# Don't bind to the https port -no_tls: False - -# List of allowed TLS fingerprints for this server to publish along -# with the signing keys for this server. Other matrix servers that -# make HTTPS requests to this server will check that the TLS -# certificates returned by this server match one of the fingerprints. -# -# Synapse automatically adds its the fingerprint of its own certificate -# to the list. So if federation traffic is handle directly by synapse -# then no modification to the list is required. -# -# If synapse is run behind a load balancer that handles the TLS then it -# will be necessary to add the fingerprints of the certificates used by -# the loadbalancers to this list if they are different to the one -# synapse is using. -# -# Homeservers are permitted to cache the list of TLS fingerprints -# returned in the key responses up to the "valid_until_ts" returned in -# key. It may be necessary to publish the fingerprints of a new -# certificate and wait until the "valid_until_ts" of the previous key -# responses have passed before deploying it. -tls_fingerprints: [] -# tls_fingerprints: [{"sha256": ""}] - - -## Server ## - -# The domain name of the server, with optional explicit port. -# This is used by remote servers to connect to this server, -# e.g. matrix.org, localhost:8080, etc. -# This is also the last part of your UserID. -server_name: "example.com" - -# When running as a daemon, the file to store the pid in -pid_file: %%PIDDIR%%/homeserver.pid - -# Whether to serve a web client from the HTTP/HTTPS root resource. -web_client: True - -# The public-facing base URL for the client API (not including _matrix/...) -# public_baseurl: https://example.com:8448/ - -# Set the soft limit on the number of file descriptors synapse can use -# Zero is used to indicate synapse should set the soft limit to the -# hard limit. -soft_file_limit: 0 - -# The GC threshold parameters to pass to `gc.set_threshold`, if defined -# gc_thresholds: [700, 10, 10] - -# List of ports that Synapse should listen on, their purpose and their -# configuration. -listeners: - # Main HTTPS listener - # For when matrix traffic is sent directly to synapse. - - - # The port to listen for HTTPS requests on. - port: 8448 - - # Local interface to listen on. - # The empty string will cause synapse to listen on all interfaces. - bind_address: '' - - # This is a 'http' listener, allows us to specify 'resources'. - type: http - - tls: true - - # Use the X-Forwarded-For (XFF) header as the client IP and not the - # actual client IP. - x_forwarded: false - - # List of HTTP resources to serve on this listener. - resources: - - - # List of resources to host on this listener. - names: - - client # The client-server APIs, both v1 and v2 - - webclient # The bundled webclient. - - # Should synapse compress HTTP responses to clients that support it? - # This should be disabled if running synapse behind a load balancer - # that can do automatic compression. - compress: true - - - names: [federation] # Federation APIs - compress: false - - # Unsecure HTTP listener, - # For when matrix traffic passes through loadbalancer that unwraps TLS. - - port: 8008 - tls: false - bind_address: '' - type: http - - x_forwarded: false - - resources: - - names: [client, webclient] - compress: true - - names: [federation] - compress: false - - # Turn on the twisted ssh manhole service on localhost on the given - # port. - # - port: 9000 - # bind_address: 127.0.0.1 - # type: manhole - - -# Database configuration -database: - # The database engine name - name: "sqlite3" - # Arguments to pass to the engine - args: - # Path to the database - database: "%%DBDIR%%/homeserver.db" - -# Number of events to cache in memory. -event_cache_size: "10K" - - - -# Logging verbosity level. -verbose: 0 - -# File to write logging to -log_file: "%%LOGDIR%%/homeserver.log" - -# A yaml python logging config file -log_config: "%%ETCDIR%%/log.config" - -# Stop twisted from discarding the stack traces of exceptions in -# deferreds by waiting a reactor tick before running a deferred's -# callbacks. -# full_twisted_stacktraces: true - - -## Ratelimiting ## - -# Number of messages a client can send per second -rc_messages_per_second: 0.2 - -# Number of message a client can send before being throttled -rc_message_burst_count: 10.0 - -# The federation window size in milliseconds -federation_rc_window_size: 1000 - -# The number of federation requests from a single server in a window -# before the server will delay processing the request. -federation_rc_sleep_limit: 10 - -# The duration in milliseconds to delay processing events from -# remote servers by if they go over the sleep limit. -federation_rc_sleep_delay: 500 - -# The maximum number of concurrent federation requests allowed -# from a single server -federation_rc_reject_limit: 50 - -# The number of federation requests to concurrently process from a -# single server -federation_rc_concurrent: 3 - - - -# Directory where uploaded images and attachments are stored. -media_store_path: "%%DBDIR%%/media_store" - -# Directory where in-progress uploads are stored. -uploads_path: "%%DBDIR%%/uploads" - -# The largest allowed upload size in bytes -max_upload_size: "10M" - -# Maximum number of pixels that will be thumbnailed -max_image_pixels: "32M" - -# Whether to generate new thumbnails on the fly to precisely match -# the resolution requested by the client. If true then whenever -# a new resolution is requested by the client the server will -# generate a new thumbnail. If false the server will pick a thumbnail -# from a precalculated list. -dynamic_thumbnails: false - -# List of thumbnail to precalculate when an image is uploaded. -thumbnail_sizes: -- width: 32 - height: 32 - method: crop -- width: 96 - height: 96 - method: crop -- width: 320 - height: 240 - method: scale -- width: 640 - height: 480 - method: scale -- width: 800 - height: 600 - method: scale - -# Is the preview URL API enabled? If enabled, you *must* specify -# an explicit url_preview_ip_range_blacklist of IPs that the spider is -# denied from accessing. -url_preview_enabled: False - -# List of IP address CIDR ranges that the URL preview spider is denied -# from accessing. There are no defaults: you must explicitly -# specify a list for URL previewing to work. You should specify any -# internal services in your network that you do not want synapse to try -# to connect to, otherwise anyone in any Matrix room could cause your -# synapse to issue arbitrary GET requests to your internal services, -# causing serious security issues. -# -# url_preview_ip_range_blacklist: -# - '127.0.0.0/8' -# - '10.0.0.0/8' -# - '172.16.0.0/12' -# - '192.168.0.0/16' -# - '100.64.0.0/10' -# - '169.254.0.0/16' -# -# List of IP address CIDR ranges that the URL preview spider is allowed -# to access even if they are specified in url_preview_ip_range_blacklist. -# This is useful for specifying exceptions to wide-ranging blacklisted -# target IP ranges - e.g. for enabling URL previews for a specific private -# website only visible in your network. -# -# url_preview_ip_range_whitelist: -# - '192.168.1.1' - -# Optional list of URL matches that the URL preview spider is -# denied from accessing. You should use url_preview_ip_range_blacklist -# in preference to this, otherwise someone could define a public DNS -# entry that points to a private IP address and circumvent the blacklist. -# This is more useful if you know there is an entire shape of URL that -# you know that will never want synapse to try to spider. -# -# Each list entry is a dictionary of url component attributes as returned -# by urlparse.urlsplit as applied to the absolute form of the URL. See -# https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit -# The values of the dictionary are treated as an filename match pattern -# applied to that component of URLs, unless they start with a ^ in which -# case they are treated as a regular expression match. If all the -# specified component matches for a given list item succeed, the URL is -# blacklisted. -# -# url_preview_url_blacklist: -# # blacklist any URL with a username in its URI -# - username: '*' -# -# # blacklist all *.google.com URLs -# - netloc: 'google.com' -# - netloc: '*.google.com' -# -# # blacklist all plain HTTP URLs -# - scheme: 'http' -# -# # blacklist http(s)://www.acme.com/foo -# - netloc: 'www.acme.com' -# path: '/foo' -# -# # blacklist any URL with a literal IPv4 address -# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' - -# The largest allowed URL preview spidering size in bytes -max_spider_size: "10M" - - - - -## Captcha ## -# See docs/CAPTCHA_SETUP for full details of configuring this. - -# This Home Server's ReCAPTCHA public key. -recaptcha_public_key: "YOUR_PUBLIC_KEY" - -# This Home Server's ReCAPTCHA private key. -recaptcha_private_key: "YOUR_PRIVATE_KEY" - -# Enables ReCaptcha checks when registering, preventing signup -# unless a captcha is answered. Requires a valid ReCaptcha -# public/private key. -enable_registration_captcha: False - -# A secret key used to bypass the captcha test entirely. -#captcha_bypass_secret: "YOUR_SECRET_HERE" - -# The API endpoint to use for verifying m.login.recaptcha responses. -recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify" - - -## Turn ## - -# The public URIs of the TURN server to give to clients -turn_uris: [] - -# The shared secret used to compute passwords for the TURN server -turn_shared_secret: "YOUR_SHARED_SECRET" - -# How long generated TURN credentials last -turn_user_lifetime: "1h" - - -## Registration ## - -# Enable registration for new users. -enable_registration: False - -# If set, allows registration by anyone who also has the shared -# secret, even if registration is otherwise disabled. -registration_shared_secret: "CHANGEME_50CHAR_RANDOM" - -# Set the number of bcrypt rounds used to generate password hash. -# Larger numbers increase the work factor needed to generate the hash. -# The default number of rounds is 12. -bcrypt_rounds: 12 - -# Allows users to register as guests without a password/email/etc, and -# participate in rooms hosted on this server which have been made -# accessible to anonymous users. -allow_guest_access: False - -# The list of identity servers trusted to verify third party -# identifiers by this server. -trusted_third_party_id_servers: - - matrix.org - - vector.im - - -## Metrics ### - -# Enable collection and rendering of performance metrics -enable_metrics: False -report_stats: False - - -## API Configuration ## - -# A list of event types that will be included in the room_invite_state -room_invite_state_types: - - "m.room.join_rules" - - "m.room.canonical_alias" - - "m.room.avatar" - - "m.room.name" - - -# A list of application service config file to use -app_service_config_files: [] - - -macaroon_secret_key: "CHANGEME_50CHAR_RANDOM" - -# Used to enable access token expiration. -expire_access_token: False - -## Signing Keys ## - -# Path to the signing key to sign messages with -signing_key_path: "%%ETCDIR%%/example.com.signing.key" - -# The keys that the server used to sign messages with but won't use -# to sign new messages. E.g. it has lost its private key -old_signing_keys: {} -# "ed25519:auto": -# # Base64 encoded public key -# key: "The public part of your old signing key." -# # Millisecond POSIX timestamp when the key expired. -# expired_ts: 123456789123 - -# How long key response published by this server is valid for. -# Used to set the valid_until_ts in /key/v2 APIs. -# Determines how quickly servers will query to check which keys -# are still valid. -key_refresh_interval: "1d" # 1 Day. - -# The trusted servers to download signing keys from. -perspectives: - servers: - "matrix.org": - verify_keys: - "ed25519:auto": - key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw" - - - -# Enable SAML2 for registration and login. Uses pysaml2 -# config_path: Path to the sp_conf.py configuration file -# idp_redirect_url: Identity provider URL which will redirect -# the user back to /login/saml2 with proper info. -# See pysaml2 docs for format of config. -#saml2_config: -# enabled: true -# config_path: "%%ETCDIR%%/sp_conf.py" -# idp_redirect_url: "http://example.com/idp" - - - -# Enable CAS for registration and login. -#cas_config: -# enabled: true -# server_url: "https://cas-server.com" -# service_url: "https://homesever.domain.com:8448" -# #required_attributes: -# # name: value - - -# The JWT needs to contain a globally unique "sub" (subject) claim. -# -# jwt_config: -# enabled: true -# secret: "a secret" -# algorithm: "HS256" - - - -# Enable password for login. -password_config: - enabled: true - # Uncomment and change to a secret random string for extra security. - # DO NOT CHANGE THIS AFTER INITIAL SETUP! - #pepper: "" - - - -# Enable sending emails for notification events -#email: -# enable_notifs: false -# smtp_host: "localhost" -# smtp_port: 25 -# notif_from: "Your Friendly %(app)s Home Server " -# app_name: Matrix -# template_dir: res/templates -# notif_template_html: notif_mail.html -# notif_template_text: notif_mail.txt -# notif_for_new_users: True - - -# password_providers: -# - module: "ldap_auth_provider.LdapAuthProvider" -# config: -# enabled: true -# uri: "ldap://ldap.example.com:389" -# start_tls: true -# base: "ou=users,dc=example,dc=com" -# attributes: -# uid: "cn" -# mail: "email" -# name: "givenName" -# #bind_dn: -# #bind_password: -# #filter: "(objectClass=posixAccount)" diff --git a/net/py-matrix-synapse/files/log.config.in b/net/py-matrix-synapse/files/log.config.in deleted file mode 100644 index 6918bb2b2582..000000000000 --- a/net/py-matrix-synapse/files/log.config.in +++ /dev/null @@ -1,35 +0,0 @@ - -version: 1 - -formatters: - precise: - format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s' - -filters: - context: - (): synapse.util.logcontext.LoggingContextFilter - request: "" - -handlers: - file: - class: logging.handlers.RotatingFileHandler - formatter: precise - filename: %%LOGDIR%%/homeserver.log - maxBytes: 104857600 - backupCount: 10 - filters: [context] - level: INFO - console: - class: logging.StreamHandler - formatter: precise - -loggers: - synapse: - level: INFO - - synapse.storage.SQL: - level: INFO - -root: - level: INFO - handlers: [file, console] diff --git a/net/py-matrix-synapse/files/patch-synapse_python__dependencies.py b/net/py-matrix-synapse/files/patch-synapse_python__dependencies.py deleted file mode 100644 index f6240a427ed3..000000000000 --- a/net/py-matrix-synapse/files/patch-synapse_python__dependencies.py +++ /dev/null @@ -1,11 +0,0 @@ ---- synapse/python_dependencies.py.orig 2017-01-17 17:50:56 UTC -+++ synapse/python_dependencies.py -@@ -22,7 +22,7 @@ REQUIREMENTS = { - "unpaddedbase64>=1.1.0": ["unpaddedbase64>=1.1.0"], - "canonicaljson>=1.0.0": ["canonicaljson>=1.0.0"], - "signedjson>=1.0.0": ["signedjson>=1.0.0"], -- "pynacl==0.3.0": ["nacl==0.3.0", "nacl.bindings"], -+ "pynacl>=0.3.0": ["nacl>=0.3.0", "nacl.bindings"], - "service_identity>=1.0.0": ["service_identity>=1.0.0"], - "Twisted>=15.1.0": ["twisted>=15.1.0"], - "pyopenssl>=0.14": ["OpenSSL>=0.14"], diff --git a/net/py-matrix-synapse/files/pkg-message.in b/net/py-matrix-synapse/files/pkg-message.in deleted file mode 100644 index 3b9faa8e8e3d..000000000000 --- a/net/py-matrix-synapse/files/pkg-message.in +++ /dev/null @@ -1,22 +0,0 @@ -Configuring Synapse: - -You may use the sample config located at %%ETCDIR%% to get started. It -already is configured to find the configuration in that location and -places the database in %%DBDIR%% and the logs in %%LOGDIR%%, but there -are some crucial values you will need to populate with unique data: -registration_shared_secret and macaroon_secret_key. Both of these -by default are 50 character random strings. These are by default set to -CHANGEME_50CHAR_RANDOM in the sample homeserver.yaml. - -If you wish to have Synapse handle this for you including generation of -self-signed TLS certificates and dhparams you can use the following -command: - -%%PYTHON_CMD%% -B -m synapse.app.homeserver -c %%ETCDIR%%/homeserver.yaml --generate-config --server-name=example.com - -Please note that you will still need to manually configure paths to log -directory, database, and media storage with this method. - -It is also important that you deploy a TLS certificate that your -clients accept as valid or some functionality will fail to work -correctly (eg, media file retrieval). diff --git a/net/py-matrix-synapse/files/synapse.in b/net/py-matrix-synapse/files/synapse.in deleted file mode 100644 index 7d618f2b398c..000000000000 --- a/net/py-matrix-synapse/files/synapse.in +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# -# Created by: Mark Felder -# $FreeBSD$ -# - -# PROVIDE: synapse -# REQUIRE: LOGIN postgresql -# KEYWORD: shutdown - -# -# Add the following line to /etc/rc.conf to enable `synapse': -# -# synapse_enable="YES" - -. /etc/rc.subr -name=synapse - -rcvar=synapse_enable -load_rc_config ${name} - -: ${synapse_enable:=NO} -: ${synapse_user:=%%USERS%%} -: ${synapse_conf:=%%ETCDIR%%/homeserver.yaml} -: ${synapse_dbdir:=%%DBDIR%%} -: ${synapse_logdir:=%%LOGDIR%%} -: ${synapse_pidfile:=%%PIDDIR%%/homeserver.pid} - -pidfile="${synapse_pidfile}" -procname=%%PYTHON_CMD%% -command=%%PYTHON_CMD%% -command_args="-m synapse.app.homeserver --daemonize -c ${synapse_conf}" -start_precmd=start_precmd - -start_precmd() -{ - if [ ! -d ${synapse_pidfile%/*} ] ; then - install -d -o %%USERS%% -g wheel ${synapse_pidfile%/*}; - fi - - if [ ! -d ${synapse_dbdir} ] ; then - install -d -o %%USERS%% -g wheel ${synapse_dbdir}; - fi - - if [ ! -d ${synapse_logdir} ] ; then - install -d -o %%USERS%% -g wheel ${synapse_logdir}; - fi - - if $(grep -q CHANGEME ${synapse_conf}) ; then - echo "Error: Default secret values in config." - echo "Please replace the CHANGEME values in ${synapse_conf}" - exit 1 - fi -} - -run_rc_command "$1" diff --git a/net/py-matrix-synapse/pkg-descr b/net/py-matrix-synapse/pkg-descr deleted file mode 100644 index 8ebc5eaa170c..000000000000 --- a/net/py-matrix-synapse/pkg-descr +++ /dev/null @@ -1,14 +0,0 @@ -Matrix is an ambitious new ecosystem for open federated Instant Messaging and -VoIP. The basics you need to know to get up and running are: - - * Everything in Matrix happens in a room. Rooms are distributed and do not - exist on any single server. Rooms can be located using convenience - aliases like #matrix:matrix.org or #test:localhost:8448. - * Matrix user IDs look like @matthew:matrix.org (although in the future you - will normally refer to yourself and others using a 3PID: email address, - phone number, etc rather than manipulating Matrix user IDs) - -Synapse is currently in rapid development, but as of version 0.5 we believe it -is sufficiently stable to be run as an internet-facing service for real usage! - -WWW: https://www.matrix.org -- cgit