Skip to content

Commit

Permalink
Fix federation in demo scripts. (matrix-org#12783)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored May 18, 2022
1 parent d38c73e commit a1cb05b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/12783.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix federation when using the demo scripts.
7 changes: 5 additions & 2 deletions demo/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ export PYTHONPATH

echo "$PYTHONPATH"

# Create servers which listen on HTTP at 808x and HTTPS at 848x.
for port in 8080 8081 8082; do
echo "Starting server on port $port... "

https_port=$((port + 400))
mkdir -p demo/$port
pushd demo/$port || exit

# Generate the configuration for the homeserver at localhost:848x.
# Generate the configuration for the homeserver at localhost:848x, note that
# the homeserver name needs to match the HTTPS listening port for federation
# to properly work..
python3 -m synapse.app.homeserver \
--generate-config \
--server-name "localhost:$port" \
--server-name "localhost:$https_port" \
--config-path "$port.config" \
--report-stats no

Expand Down
9 changes: 5 additions & 4 deletions docs/development/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Requires you to have a [Synapse development environment setup](https://matrix-org.github.io/synapse/develop/development/contributing_guide.html#4-install-the-dependencies).

The demo setup allows running three federation Synapse servers, with server
names `localhost:8080`, `localhost:8081`, and `localhost:8082`.
names `localhost:8480`, `localhost:8481`, and `localhost:8482`.

You can access them via any Matrix client over HTTP at `localhost:8080`,
`localhost:8081`, and `localhost:8082` or over HTTPS at `localhost:8480`,
Expand All @@ -20,9 +20,10 @@ and the servers are configured in a highly insecure way, including:
The servers are configured to store their data under `demo/8080`, `demo/8081`, and
`demo/8082`. This includes configuration, logs, SQLite databases, and media.

Note that when joining a public room on a different HS via "#foo:bar.net", then
you are (in the current impl) joining a room with room_id "foo". This means that
it won't work if your HS already has a room with that name.
Note that when joining a public room on a different homeserver via "#foo:bar.net",
then you are (in the current implementation) joining a room with room_id "foo".
This means that it won't work if your homeserver already has a room with that
name.

## Using the demo scripts

Expand Down

0 comments on commit a1cb05b

Please sign in to comment.