Commit graph

2956 commits

Author SHA1 Message Date
Brian Meek 823b675bce
Merge pull request #71 from HereNotThere/main-merge
Main merge
2023-02-08 08:25:21 -08:00
Brian Meek c243677795
Merge local harmony changes, Dendrite tests passing
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-08 08:23:06 -08:00
Giuseppe Rodriguez cade6d1de3 Audit Fixes 3 - [M-1] More than one Role can contain the Permissions.Owner permission (#1429)
Impact: High

Likelihood: Low

According to the discussion with the team, it is expected that in Space
contracts, only one Role can have the Permissions.Owner permission.
Currently, multiple Roles can be created containing this permission.
This is caused by Space.sol’s createRole() function allowing the
OpenZeppelin owner to create new owner-permissioned roles without limit.

Remediations to consider:

Do not allow multiple roles to be created with the ownership permission.
This could be done with something like: if Space.sol’s ownerRoleId is
set, do not allow new roles to be created with the Permissions.Owner
permission.

 Fixes HNT-703 as well
2023-02-07 19:23:07 -08:00
Brian Meek 9cc55befe7
Merge upstream
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:31:43 -08:00
Brian Meek ceff2ae574
Merge upstream
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:31:02 -08:00
Brian Meek c74798b5ab
Merge branch 'matrix-org-main' 2023-02-07 17:30:09 -08:00
Brian Meek 34504e3cfe
Merge upstream
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:30:01 -08:00
Brian Meek d89f1aee85
Merge pull request #69 from HereNotThere/brian/merge_upstream
Brian/merge upstream
2023-02-07 17:18:57 -08:00
Brian Meek 706e81f512 Revert "Merge upstream latest"
This reverts commit 06c319d580.
2023-02-07 17:14:27 -08:00
Brian Meek ff194d6610 Revert "Fix lint warning about ioutil deprecation"
This reverts commit 6225873d04.
2023-02-07 17:14:27 -08:00
Brian Meek be1fd40275 Revert "Fix lint warning about ioutil deprecation"
This reverts commit 8610b4225e.
2023-02-07 17:14:27 -08:00
Brian Meek 92e468f352 Revert "Debug test failure"
This reverts commit 548029d6da.
2023-02-07 17:14:27 -08:00
Brian Meek c47b088eda Revert "Fix lint warning about ignored err assignment"
This reverts commit a4c410b81f.
2023-02-07 17:14:27 -08:00
Brian Meek 04d272d32a Revert "Logging the config in the error to debug CI"
This reverts commit 9d8dfcabcf.
2023-02-07 17:14:27 -08:00
Brian Meek 7df85cde1d Revert "Logging the config in the error to debug CI"
This reverts commit 39377bd048.
2023-02-07 17:14:27 -08:00
Brian Meek 13c221469b Revert "Logging the config in the error to debug CI"
This reverts commit c8f8e90446.
2023-02-07 17:14:27 -08:00
Brian Meek a610e6d043 Revert "HArdcoding the server_name while debugging while it isn't loading from the config"
This reverts commit d179b9f6f7.
2023-02-07 17:14:27 -08:00
Brian Meek a21b421156 Revert "Set the test config server_name to localhost"
This reverts commit 7fa8ee0d1a.
2023-02-07 17:14:27 -08:00
Brian Meek 7fa8ee0d1a Set the test config server_name to localhost
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek d179b9f6f7 HArdcoding the server_name while debugging while it isn't loading from the config
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek c8f8e90446 Logging the config in the error to debug CI
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 39377bd048 Logging the config in the error to debug CI
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 9d8dfcabcf Logging the config in the error to debug CI
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek a4c410b81f Fix lint warning about ignored err assignment
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 548029d6da Debug test failure
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 8610b4225e Fix lint warning about ioutil deprecation
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 6225873d04 Fix lint warning about ioutil deprecation
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 06c319d580 Merge upstream latest
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 17:13:06 -08:00
Brian Meek 34c62de3d6
Set the test config server_name to localhost
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 16:42:36 -08:00
Brian Meek 69d7eef327
HArdcoding the server_name while debugging while it isn't loading from the config
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 16:28:29 -08:00
Giuseppe Rodriguez 7d6ffad2de Audit Fixes 1 - Removes OZ Ownable from Space contract and makes checks for space token ownership to see if caller is space owner (#1424)
Removing the OpenZeppelin ownership logic, and, checking directly for
the ownership of the Space’s SpaceOwner NFT. The SpaceFactory could be
the owner during the bootstrapping phase, and afterwards, could transfer
the NFT to the proper owner. Doing a direct check like
_spaceOwner().ownerOf(tokenId) == _msgSender() would be safe because
that’s what the owner entitlement is going to check eventually.

---------

Co-authored-by: Kerem Kazan <kerem.kazan@gmail.com>
2023-02-07 15:57:39 -08:00
Brian Meek f23e0f5e06
Logging the config in the error to debug CI
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 15:53:58 -08:00
Brian Meek cc5dab6828
Logging the config in the error to debug CI
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 14:51:02 -08:00
Brian Meek e515dd4ccd
Logging the config in the error to debug CI
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 14:33:53 -08:00
Brian Meek c0d986fdb1
Fix lint warning about ignored err assignment
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 09:17:09 -08:00
Brian Meek b19342ecee
Debug test failure
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 09:13:26 -08:00
Brian Meek 5e556292c9
Fix lint warning about ioutil deprecation
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 08:24:08 -08:00
Brian Meek b41d9915d7
Fix lint warning about ioutil deprecation
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-07 08:11:33 -08:00
Till eb29a31550
Optimize /sync and history visibility (#2961)
Should fix the following issues or make a lot less worse when using
Postgres:

The main issue behind #2911: The client gives up after a certain time,
causing a cascade of context errors, because the response couldn't be
built up fast enough. This mostly happens on accounts with many rooms,
due to the inefficient way we're getting recent events and current state

For #2777: The queries for getting the membership events for history
visibility were being executed for each room (I think 185?), resulting
in a whooping 2k queries for membership events. (Getting the
statesnapshot -> block nids -> actual wanted membership event)

Both should now be better by:
- Using a LATERAL join to get all recent events for all joined rooms in
one go (TODO: maybe do the same for room summary and current state etc)
- If we're lazy loading on initial syncs, we're now not getting the
whole current state, just to drop the majority of it because we're lazy
loading members - we add a filter to exclude membership events on the
first call to `CurrentState`.
- Using an optimized query to get the membership events needed to
calculate history visibility

---------

Co-authored-by: kegsay <kegan@matrix.org>
2023-02-07 14:31:23 +01:00
Brian Meek 4f1c8983ad
Merge upstream latest
Signed-off-by: Brian Meek <brian@hntlabs.com>
2023-02-06 20:50:50 -08:00
Devon Hudson cf254ba044
Add max frame size to pinecone bindings 2023-02-04 06:05:39 -07:00
Devon Hudson 4ed61740ab
Disable fulltext search in pinecone builds 2023-02-04 05:56:33 -07:00
Devon Hudson 26f86a76b6
Update dendrite-pinecone gobindings build script 2023-02-03 09:06:03 -07:00
Till baf118b08c
Add Sytest/Complement coverage to scheduled runs (#2962)
This adds Sytest and Complement coverage reporting to the nightly
scheduled CI runs.

Fixes a few API mode related issues as well, since we seemingly never
really ran them with Complement.

Also fixes a bug related to device list changes: When we pass in an
empty `newlyLeftRooms` slice, we got a list of all currently joined
rooms with the corresponding members. When we then got the
`newlyJoinedRooms`, we wouldn't update the `changed` slice, because we
already got the user from the `newlyLeftRooms` query. This is fixed by
simply ignoring empty `newlyLeftRooms`.
2023-02-03 13:42:35 +01:00
dependabot[bot] 9c826d064d
Bump activesupport from 6.0.5 to 6.0.6.1 in /docs (#2959)
Bumps [activesupport](https://github.com/rails/rails) from 6.0.5 to
6.0.6.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rails/rails/releases">activesupport's
releases</a>.</em></p>
<blockquote>
<h2>v6.0.6.1</h2>
<h2>Active Support</h2>
<ul>
<li>No changes.</li>
</ul>
<h2>Active Model</h2>
<ul>
<li>No changes.</li>
</ul>
<h2>Active Record</h2>
<ul>
<li>
<p>Make <code>sanitize_as_sql_comment</code> more strict</p>
<p>Though this method was likely never meant to take user input, it was
attempting sanitization. That sanitization could be bypassed with
carefully crafted input.</p>
<p>This commit makes the sanitization more robust by replacing any
occurrances of &quot;/<em>&quot; or &quot;</em>/&quot; with &quot;/
<em>&quot; or &quot;</em> /&quot;. It also performs a
first pass to remove one surrounding comment to avoid compatibility
issues for users relying on the existing removal.</p>
<p>This also clarifies in the documentation of annotate that it should
not
be provided user input.</p>
<p>[CVE-2023-22794]</p>
</li>
</ul>
<h2>Action View</h2>
<ul>
<li>No changes.</li>
</ul>
<h2>Action Pack</h2>
<ul>
<li>No changes.</li>
</ul>
<h2>Active Job</h2>
<ul>
<li>No changes.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="28bb76d3ef"><code>28bb76d</code></a>
Version 6.0.6.1</li>
<li><a
href="91cf62e7b4"><code>91cf62e</code></a>
Version 6.0.6</li>
<li><a
href="c7d64e91b6"><code>c7d64e9</code></a>
Preparing for 6.0.5.1 release</li>
<li><a
href="c177e45858"><code>c177e45</code></a>
updating version and changelog</li>
<li>See full diff in <a
href="https://github.com/rails/rails/compare/v6.0.5...v6.0.6.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=activesupport&package-manager=bundler&previous-version=6.0.5&new-version=6.0.6.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the
default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as
the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as
the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the
default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/matrix-org/dendrite/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-02 10:27:38 +01:00
Devon Hudson a666c06da1
Consolidate pinecone demo http server variations 2023-02-01 14:11:48 -07:00
Devon Hudson 048e35026c
Refactor common pinecone demo code to remove major duplication 2023-02-01 13:41:38 -07:00
Devon Hudson dbc2869cbd
Refactor pinecone demo to remove duplicate pinecone setup 2023-02-01 13:41:38 -07:00
Devon Hudson d4f64f91ca
Refactor pinecone demo to remove duplicate key setup 2023-02-01 13:41:37 -07:00
Devon Hudson 2f8377e94b
Remove nolint: gocyclo from relayapi routing setup 2023-02-01 13:41:37 -07:00