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

Commit

Permalink
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/roo…
Browse files Browse the repository at this point in the history
…m_upgrade_depublishing
  • Loading branch information
anoadragon453 committed Oct 23, 2019
2 parents b72074f + 92e88a7 commit 656bbe4
Show file tree
Hide file tree
Showing 297 changed files with 5,626 additions and 4,501 deletions.
11 changes: 6 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ include demo/demo.tls.dh
include demo/*.py
include demo/*.sh

recursive-include synapse/storage/schema *.sql
recursive-include synapse/storage/schema *.sql.postgres
recursive-include synapse/storage/schema *.sql.sqlite
recursive-include synapse/storage/schema *.py
recursive-include synapse/storage/schema *.txt
recursive-include synapse/storage *.sql
recursive-include synapse/storage *.sql.postgres
recursive-include synapse/storage *.sql.sqlite
recursive-include synapse/storage *.py
recursive-include synapse/storage *.txt
recursive-include synapse/storage *.md

recursive-include docs *
recursive-include scripts *
Expand Down
1 change: 1 addition & 0 deletions changelog.d/5726.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ability to upload cross-signing signatures.
1 change: 1 addition & 0 deletions changelog.d/6102.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make the `synapse_port_db` script create the right indexes on a new PostgreSQL database.
1 change: 1 addition & 0 deletions changelog.d/6203.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enforce that all boolean configuration values are lowercase in CI.
1 change: 1 addition & 0 deletions changelog.d/6229.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent the demo Synapse's from blacklisting `::1`.
1 change: 1 addition & 0 deletions changelog.d/6231.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor storage layer in preparation to support having multiple databases.
1 change: 1 addition & 0 deletions changelog.d/6236.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove some extra quotation marks across the codebase.
1 change: 1 addition & 0 deletions changelog.d/6243.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make the `synapse_port_db` script create the right indexes on a new PostgreSQL database.
2 changes: 1 addition & 1 deletion contrib/experiments/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def main(stdscr):
root_logger = logging.getLogger()

formatter = logging.Formatter(
"%(asctime)s - %(name)s - %(lineno)d - " "%(levelname)s - %(message)s"
"%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s"
)
if not os.path.exists("logs"):
os.makedirs("logs")
Expand Down
4 changes: 2 additions & 2 deletions contrib/graph/graph2.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def make_graph(db_name, room_id, file_prefix, limit):
args = [room_id]

if limit:
sql += " ORDER BY topological_ordering DESC, stream_ordering DESC " "LIMIT ?"
sql += " ORDER BY topological_ordering DESC, stream_ordering DESC LIMIT ?"

args.append(limit)

Expand All @@ -53,7 +53,7 @@ def make_graph(db_name, room_id, file_prefix, limit):

for event in events:
c = conn.execute(
"SELECT state_group FROM event_to_state_groups " "WHERE event_id = ?",
"SELECT state_group FROM event_to_state_groups WHERE event_id = ?",
(event.event_id,),
)

Expand Down
3 changes: 1 addition & 2 deletions demo/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,13 @@ for port in 8080 8081 8082; do

# Reduce the blacklist
blacklist=$(cat <<-BLACK
# Set the blacklist so that it doesn't include 127.0.0.1
# Set the blacklist so that it doesn't include 127.0.0.1, ::1
federation_ip_range_blacklist:
- '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'
- '::1/128'
- 'fe80::/64'
- 'fc00::/7'
BLACK
Expand Down
10 changes: 7 additions & 3 deletions docs/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ connect to a postgres database.

## Set up database

Assuming your PostgreSQL database user is called `postgres`, create a
user `synapse_user` with:
Assuming your PostgreSQL database user is called `postgres`, first authenticate as the database user with:

su - postgres
# Or, if your system uses sudo to get administrative rights
sudo -u postgres bash

Then, create a user ``synapse_user`` with:

createuser --pwprompt synapse_user

Before you can authenticate with the `synapse_user`, you must create a
database that it can access. To create a database, first connect to the
database with your database user:

su - postgres
su - postgres # Or: sudo -u postgres bash
psql

and then run:
Expand Down
30 changes: 15 additions & 15 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pid_file: DATADIR/homeserver.pid
# Whether room invites to users on this server should be blocked
# (except those sent by local server admins). The default is False.
#
#block_non_admin_invites: True
#block_non_admin_invites: true

# Room searching
#
Expand Down Expand Up @@ -239,7 +239,7 @@ listeners:

# Global blocking
#
#hs_disabled: False
#hs_disabled: false
#hs_disabled_message: 'Human readable reason for why the HS is blocked'
#hs_disabled_limit_type: 'error code(str), to help clients decode reason'

Expand All @@ -261,15 +261,15 @@ listeners:
# sign up in a short space of time never to return after their initial
# session.
#
#limit_usage_by_mau: False
#limit_usage_by_mau: false
#max_mau_value: 50
#mau_trial_days: 2

# If enabled, the metrics for the number of monthly active users will
# be populated, however no one will be limited. If limit_usage_by_mau
# is true, this is implied to be true.
#
#mau_stats_only: False
#mau_stats_only: false

# Sometimes the server admin will want to ensure certain accounts are
# never blocked by mau checking. These accounts are specified here.
Expand All @@ -294,7 +294,7 @@ listeners:
#
# Uncomment the below lines to enable:
#limit_remote_rooms:
# enabled: True
# enabled: true
# complexity: 1.0
# complexity_error: "This room is too complex."

Expand Down Expand Up @@ -411,7 +411,7 @@ acme:
# ACME support is disabled by default. Set this to `true` and uncomment
# tls_certificate_path and tls_private_key_path above to enable it.
#
enabled: False
enabled: false

# Endpoint to use to request certificates. If you only want to test,
# use Let's Encrypt's staging url:
Expand Down Expand Up @@ -786,7 +786,7 @@ uploads_path: "DATADIR/uploads"
# connect to arbitrary endpoints without having first signed up for a
# valid account (e.g. by passing a CAPTCHA).
#
#turn_allow_guests: True
#turn_allow_guests: true


## Registration ##
Expand Down Expand Up @@ -829,7 +829,7 @@ uploads_path: "DATADIR/uploads"
# where d is equal to 10% of the validity period.
#
#account_validity:
# enabled: True
# enabled: true
# period: 6w
# renew_at: 1w
# renew_email_subject: "Renew your %(app)s account"
Expand Down Expand Up @@ -971,7 +971,7 @@ account_threepid_delegates:

# Enable collection and rendering of performance metrics
#
#enable_metrics: False
#enable_metrics: false

# Enable sentry integration
# NOTE: While attempts are made to ensure that the logs don't contain
Expand Down Expand Up @@ -1023,7 +1023,7 @@ metrics_flags:
# Uncomment to enable tracking of application service IP addresses. Implicitly
# enables MAU tracking for application service users.
#
#track_appservice_user_ips: True
#track_appservice_user_ips: true


# a secret which is used to sign access tokens. If none is specified,
Expand Down Expand Up @@ -1149,7 +1149,7 @@ saml2_config:
# - url: https://our_idp/metadata.xml
#
# # By default, the user has to go to our login page first. If you'd like
# # to allow IdP-initiated login, set 'allow_unsolicited: True' in a
# # to allow IdP-initiated login, set 'allow_unsolicited: true' in a
# # 'service.sp' section:
# #
# #service:
Expand Down Expand Up @@ -1263,13 +1263,13 @@ password_config:
# smtp_port: 25 # SSL: 465, STARTTLS: 587
# smtp_user: "exampleusername"
# smtp_pass: "examplepassword"
# require_transport_security: False
# require_transport_security: false
# notif_from: "Your Friendly %(app)s Home Server <[email protected]>"
# app_name: Matrix
#
# # Enable email notifications by default
# #
# notif_for_new_users: True
# notif_for_new_users: true
#
# # Defining a custom URL for Riot is only needed if email notifications
# # should contain links to a self-hosted installation of Riot; when set
Expand Down Expand Up @@ -1447,11 +1447,11 @@ password_config:
# body: >-
# To continue using this homeserver you must review and agree to the
# terms and conditions at %(consent_uri)s
# send_server_notice_to_guests: True
# send_server_notice_to_guests: true
# block_events_error: >-
# To continue using this homeserver you must review and agree to the
# terms and conditions at %(consent_uri)s
# require_at_registration: False
# require_at_registration: false
# policy_name: Privacy Policy
#

Expand Down
9 changes: 9 additions & 0 deletions scripts-dev/config-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Find linting errors in Synapse's default config file.
# Exits with 0 if there are no problems, or another code otherwise.

# Fix non-lowercase true/false values
sed -i -E "s/: +True/: true/g; s/: +False/: false/g;" docs/sample_config.yaml

# Check if anything changed
git diff --exit-code docs/sample_config.yaml
1 change: 1 addition & 0 deletions scripts-dev/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ set -e
isort -y -rc synapse tests scripts-dev scripts
flake8 synapse tests
python3 -m black synapse tests scripts-dev scripts
./scripts-dev/config-lint.sh
Loading

0 comments on commit 656bbe4

Please sign in to comment.