Skip to content

Commit

Permalink
Merge branch 'develop' into nonascii-displayname
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Jan 3, 2024
2 parents 8c60a5d + 798a507 commit 22b34a6
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 203 deletions.
90 changes: 0 additions & 90 deletions .github/workflows/docs-add-version-picker.yaml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/triage-incoming.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Move new issues into the issue triage board

on:
# issues:
# types: [ opened ]
workflow_dispatch:
issues:
types: [ opened ]

jobs:
triage:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Welcome to Synapse

Please see the [contributors' guide](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html) in our rendered documentation.
Please see the [contributors' guide](https://element-hq.github.io/synapse/latest/development/contributing_guide.html) in our rendered documentation.
1 change: 1 addition & 0 deletions changelog.d/16761.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix email verification redirection. Contributed by Fadhlan Ridhwanallah.
1 change: 1 addition & 0 deletions changelog.d/16763.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove value from header in configuration documentation for `refresh_token_lifetime`.
1 change: 1 addition & 0 deletions changelog.d/16769.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add another custom statistics collection server to the documentation. Contributed by @loelkes.
1 change: 1 addition & 0 deletions changelog.d/16770.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow reactivate user without password with Admin API in some edge cases.
1 change: 1 addition & 0 deletions changelog.d/9453.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove run-once workflow after adding the version picker to the documentation.
19 changes: 10 additions & 9 deletions docs/admin_api/user_admin_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ Body parameters:
granting them access to the Admin API, among other things.
- `deactivated` - **bool**, optional. If unspecified, deactivation state will be left unchanged.

Note: the `password` field must also be set if both of the following are true:
- `deactivated` is set to `false` and the user was previously deactivated (you are reactivating this user)
- Users are allowed to set their password on this homeserver (both `password_config.enabled` and
`password_config.localdb_enabled` config options are set to `true`).
Note:
- For the password field there is no strict check of the necessity for its presence.
It is possible to have active users without a password, e.g. when authenticating with OIDC is configured.
You must check yourself whether a password is required when reactivating a user or not.
- It is not possible to set a password if the config option `password_config.localdb_enabled` is set `false`.
Users' passwords are wiped upon account deactivation, hence the need to set a new one here.

Note: a user cannot be erased with this API. For more details on
Expand Down Expand Up @@ -223,7 +224,7 @@ The following parameters should be set in the URL:
**or** displaynames that contain this value.
- `guests` - string representing a bool - Is optional and if `false` will **exclude** guest users.
Defaults to `true` to include guest users. This parameter is not supported when MSC3861 is enabled. [See #15582](https://github.com/matrix-org/synapse/pull/15582)
- `admins` - Optional flag to filter admins. If `true`, only admins are queried. If `false`, admins are excluded from
- `admins` - Optional flag to filter admins. If `true`, only admins are queried. If `false`, admins are excluded from
the query. When the flag is absent (the default), **both** admins and non-admins are included in the search results.
- `deactivated` - string representing a bool - Is optional and if `true` will **include** deactivated users.
Defaults to `false` to exclude deactivated users.
Expand Down Expand Up @@ -272,7 +273,7 @@ The following fields are returned in the JSON response body:
- `is_guest` - bool - Status if that user is a guest account.
- `admin` - bool - Status if that user is a server administrator.
- `user_type` - string - Type of the user. Normal users are type `None`.
This allows user type specific behaviour. There are also types `support` and `bot`.
This allows user type specific behaviour. There are also types `support` and `bot`.
- `deactivated` - bool - Status if that user has been marked as deactivated.
- `erased` - bool - Status if that user has been marked as erased.
- `shadow_banned` - bool - Status if that user has been marked as shadow banned.
Expand Down Expand Up @@ -887,7 +888,7 @@ The following fields are returned in the JSON response body:

### Create a device

Creates a new device for a specific `user_id` and `device_id`. Does nothing if the `device_id`
Creates a new device for a specific `user_id` and `device_id`. Does nothing if the `device_id`
exists already.

The API is:
Expand Down Expand Up @@ -1254,11 +1255,11 @@ The following parameters should be set in the URL:

## Check username availability

Checks to see if a username is available, and valid, for the server. See [the client-server
Checks to see if a username is available, and valid, for the server. See [the client-server
API](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available)
for more information.

This endpoint will work even if registration is disabled on the server, unlike
This endpoint will work even if registration is disabled on the server, unlike
`/_matrix/client/r0/register/available`.

The API is:
Expand Down
92 changes: 15 additions & 77 deletions docs/development/contributing_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ This document aims to get you started with contributing to Synapse!

# 1. Who can contribute to Synapse?

Everyone is welcome to contribute code to [Synapse](https://github.com/element-hq/synapse),
provided that they are willing to
license their contributions under the same license as the project itself. We
follow a simple 'inbound=outbound' model for contributions: the act of
submitting an 'inbound' contribution means that the contributor agrees to
license the code under the same terms as the project's overall 'outbound'
license - in our case, this is almost always Apache Software License v2 (see
[LICENSE](https://github.com/element-hq/synapse/blob/develop/LICENSE)).
Everyone is welcome to contribute code to
[Synapse](https://github.com/element-hq/synapse), provided that they are willing
to license their contributions to Element under a [Contributor License
Agreement](https://cla-assistant.io/element-hq/synapse) (CLA). This ensures that
their contribution will be made available under an OSI-approved open-source
license, currently Affero General Public License v3 (AGPLv3).

TODO THIS NEEDS UPDATING
Please see the
[Element blog post](https://element.io/blog/synapse-now-lives-at-github-com-element-hq-synapse/)
for the full rationale.

# 2. What do I need?

Expand Down Expand Up @@ -499,81 +499,19 @@ separate pull requests.)

## Sign off

In order to have a concrete record that your contribution is intentional
and you agree to license it under the same terms as the project's license, we've adopted the
same lightweight approach that the Linux Kernel
[submitting patches process](
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>),
[Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), and many other
projects use: the DCO ([Developer Certificate of Origin](http://developercertificate.org/)).
This is a simple declaration that you wrote
the contribution or otherwise have the right to contribute it to Matrix:
After you make a PR a comment from @CLAassistant will appear asking you to sign
the [CLA](https://cla-assistant.io/element-hq/synapse).
This will link a page to allow you to confirm that you have read and agreed to
the CLA by signing in with GitHub.

```
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```
If you agree to this for your contribution, then all that's needed is to
include the line in your commit or pull request comment:
```
Signed-off-by: Your Name <your@email.example.org>
```
Alternatively, you can sign off before opening a PR by going to
<https://cla-assistant.io/element-hq/synapse>.

We accept contributions under a legally identifiable name, such as
your name on government documentation or common-law names (names
claimed by legitimate usage or repute). Unfortunately, we cannot
accept anonymous contributions at this time.

Git allows you to add this signoff automatically when using the `-s`
flag to `git commit`, which uses the name and email set in your
`user.name` and `user.email` git configs.
### Private Sign off
If you would like to provide your legal name privately to the Matrix.org
Foundation (instead of in a public commit or comment), you can do so
by emailing your legal name and a link to the pull request to
[dco@matrix.org](mailto:dco@matrix.org?subject=Private%20sign%20off).
It helps to include "sign off" or similar in the subject line. You will then
be instructed further.
Once private sign off is complete, doing so for future contributions will not
be required.

# 10. Turn feedback into better code.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ consider using one of the following known implementations:

* [Matrix.org's Panopticon](https://github.com/matrix-org/panopticon)
* [Famedly's Barad-dûr](https://gitlab.com/famedly/infra/services/barad-dur)
* [Synapse Usage Exporter](https://github.com/loelkes/synapse-usage-exporter) for Prometheus
2 changes: 1 addition & 1 deletion docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ Example configuration:
refreshable_access_token_lifetime: 10m
```
---
### `refresh_token_lifetime: 24h`
### `refresh_token_lifetime`

Time that a refresh token remains valid for (provided that it is not
exchanged for another one first).
Expand Down
2 changes: 1 addition & 1 deletion synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def _send_response(
assert isinstance(response_object, bytes)
html_bytes = response_object

respond_with_html_bytes(request, 200, html_bytes)
respond_with_html_bytes(request, code, html_bytes)

def _send_error_response(
self,
Expand Down
9 changes: 0 additions & 9 deletions synapse/rest/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,6 @@ async def on_PUT(
target_user.to_string(), False, requester, by_admin=True
)
elif not deactivate and user["deactivated"]:
if (
"password" not in body
and self.auth_handler.can_change_password()
):
raise SynapseError(
HTTPStatus.BAD_REQUEST,
"Must provide a password to re-activate an account.",
)

await self.deactivate_account_handler.activate_account(
target_user.to_string()
)
Expand Down
2 changes: 1 addition & 1 deletion synapse/rest/synapse/client/password_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def _async_render_POST(self, request: Request) -> Tuple[int, bytes]:
return (
302,
(
b'You are being redirected to <a src="%s">%s</a>.'
b'You are being redirected to <a href="%s">%s</a>.'
% (next_link_bytes, next_link_bytes)
),
)
Expand Down
Loading

0 comments on commit 22b34a6

Please sign in to comment.