This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Converting some of the rst documentation to markdown. Attempted to preserve whitespace and line breaks to minimize cosmetic change.
- Loading branch information
Showing
41 changed files
with
2,088 additions
and
2,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Convert documentation to markdown (from rst) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
# Overview | ||
Captcha can be enabled for this home server. This file explains how to do that. | ||
The captcha mechanism used is Google's ReCaptcha. This requires API keys from Google. | ||
|
||
Getting keys | ||
------------ | ||
## Getting keys | ||
|
||
Requires a public/private key pair from: | ||
|
||
https://developers.google.com/recaptcha/ | ||
<https://developers.google.com/recaptcha/> | ||
|
||
Must be a reCAPTCHA v2 key using the "I'm not a robot" Checkbox option | ||
|
||
Setting ReCaptcha Keys | ||
---------------------- | ||
## Setting ReCaptcha Keys | ||
|
||
The keys are a config option on the home server config. If they are not | ||
visible, you can generate them via --generate-config. Set the following value:: | ||
visible, you can generate them via `--generate-config`. Set the following value: | ||
|
||
recaptcha_public_key: YOUR_PUBLIC_KEY | ||
recaptcha_private_key: YOUR_PRIVATE_KEY | ||
|
||
recaptcha_public_key: YOUR_PUBLIC_KEY | ||
recaptcha_private_key: YOUR_PRIVATE_KEY | ||
In addition, you MUST enable captchas via: | ||
|
||
In addition, you MUST enable captchas via:: | ||
enable_registration_captcha: true | ||
|
||
enable_registration_captcha: true | ||
## Configuring IP used for auth | ||
|
||
Configuring IP used for auth | ||
---------------------------- | ||
The ReCaptcha API requires that the IP address of the user who solved the | ||
captcha is sent. If the client is connecting through a proxy or load balancer, | ||
it may be required to use the X-Forwarded-For (XFF) header instead of the origin | ||
IP address. This can be configured using the x_forwarded directive in the | ||
it may be required to use the `X-Forwarded-For` (XFF) header instead of the origin | ||
IP address. This can be configured using the `x_forwarded` directive in the | ||
listeners section of the homeserver.yaml configuration file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Synapse Documentation | ||
|
||
This directory contains documentation specific to the `synapse` homeserver. | ||
|
||
All matrix-generic documentation now lives in its own project, located at [matrix-org/matrix-doc](https://github.com/matrix-org/matrix-doc) | ||
|
||
(Note: some items here may be moved to [matrix-org/matrix-doc](https://github.com/matrix-org/matrix-doc) at some point in the future.) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
> **Warning** | ||
> These architecture notes are spectacularly old, and date back | ||
> to when Synapse was just federation code in isolation. This should be | ||
> merged into the main spec. | ||
# Server to Server | ||
|
||
## Server to Server Stack | ||
|
||
To use the server to server stack, home servers should only need to | ||
interact with the Messaging layer. | ||
|
||
The server to server side of things is designed into 4 distinct layers: | ||
|
||
1. Messaging Layer | ||
2. Pdu Layer | ||
3. Transaction Layer | ||
4. Transport Layer | ||
|
||
Where the bottom (the transport layer) is what talks to the internet via | ||
HTTP, and the top (the messaging layer) talks to the rest of the Home | ||
Server with a domain specific API. | ||
|
||
1. **Messaging Layer** | ||
|
||
This is what the rest of the Home Server hits to send messages, join rooms, | ||
etc. It also allows you to register callbacks for when it get's notified by | ||
lower levels that e.g. a new message has been received. | ||
|
||
It is responsible for serializing requests to send to the data | ||
layer, and to parse requests received from the data layer. | ||
|
||
2. **PDU Layer** | ||
|
||
This layer handles: | ||
|
||
- duplicate `pdu_id`'s - i.e., it makes sure we ignore them. | ||
- responding to requests for a given `pdu_id` | ||
- responding to requests for all metadata for a given context (i.e. room) | ||
- handling incoming backfill requests | ||
|
||
So it has to parse incoming messages to discover which are metadata and | ||
which aren't, and has to correctly clobber existing metadata where | ||
appropriate. | ||
|
||
For incoming PDUs, it has to check the PDUs it references to see | ||
if we have missed any. If we have go and ask someone (another | ||
home server) for it. | ||
|
||
3. **Transaction Layer** | ||
|
||
This layer makes incoming requests idempotent. i.e., it stores | ||
which transaction id's we have seen and what our response were. | ||
If we have already seen a message with the given transaction id, | ||
we do not notify higher levels but simply respond with the | ||
previous response. | ||
|
||
`transaction_id` is from "`GET /send/<tx_id>/`" | ||
|
||
It's also responsible for batching PDUs into single transaction for | ||
sending to remote destinations, so that we only ever have one | ||
transaction in flight to a given destination at any one time. | ||
|
||
This is also responsible for answering requests for things after a | ||
given set of transactions, i.e., ask for everything after 'ver' X. | ||
|
||
4. **Transport Layer** | ||
|
||
This is responsible for starting a HTTP server and hitting the | ||
correct callbacks on the Transaction layer, as well as sending | ||
both data and requests for data. | ||
|
||
## Persistence | ||
|
||
We persist things in a single sqlite3 database. All database queries get | ||
run on a separate, dedicated thread. This that we only ever have one | ||
query running at a time, making it a lot easier to do things in a safe | ||
manner. | ||
|
||
The queries are located in the `synapse.persistence.transactions` module, | ||
and the table information in the `synapse.persistence.tables` module. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Registering an Application Service | ||
|
||
The registration of new application services depends on the homeserver used. | ||
In synapse, you need to create a new configuration file for your AS and add it | ||
to the list specified under the `app_service_config_files` config | ||
option in your synapse config. | ||
|
||
For example: | ||
|
||
```yaml | ||
app_service_config_files: | ||
- /home/matrix/.synapse/<your-AS>.yaml | ||
``` | ||
The format of the AS configuration file is as follows: | ||
```yaml | ||
url: <base url of AS> | ||
as_token: <token AS will add to requests to HS> | ||
hs_token: <token HS will add to requests to AS> | ||
sender_localpart: <localpart of AS user> | ||
namespaces: | ||
users: # List of users we're interested in | ||
- exclusive: <bool> | ||
regex: <regex> | ||
- ... | ||
aliases: [] # List of aliases we're interested in | ||
rooms: [] # List of room ids we're interested in | ||
``` | ||
See the [spec](https://matrix.org/docs/spec/application_service/unstable.html) for further details on how application services work. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.