mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-10 15:12:49 +02:00
Compare commits
12 commits
ab1ca2764a
...
338f1a4c4f
Author | SHA1 | Date | |
---|---|---|---|
|
338f1a4c4f |
||
|
d21f07a3cc | ||
|
f29a881b23 | ||
|
6068db1345 | ||
|
143d39e371 | ||
|
a32aba6989 | ||
|
3b6a0ec48a | ||
|
6402a0e58f | ||
|
5cce024841 | ||
|
e87c461b8d |
||
|
b934898f51 |
||
|
83e3de55a4 |
19 changed files with 312 additions and 112 deletions
|
@ -26,3 +26,7 @@ max_line_length = 98
|
||||||
[*.yml]
|
[*.yml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
|
|
@ -161,7 +161,7 @@ jobs:
|
||||||
var-lib-apt-${{ matrix.slug }}
|
var-lib-apt-${{ matrix.slug }}
|
||||||
key: var-lib-apt-${{ matrix.slug }}
|
key: var-lib-apt-${{ matrix.slug }}
|
||||||
- name: inject cache into docker
|
- name: inject cache into docker
|
||||||
uses: https://github.com/reproducible-containers/buildkit-cache-dance@v3.1.0
|
uses: https://github.com/reproducible-containers/buildkit-cache-dance@v3.3.0
|
||||||
with:
|
with:
|
||||||
cache-map: |
|
cache-map: |
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,24 +39,73 @@ jobs:
|
||||||
renovate:
|
renovate:
|
||||||
name: Renovate
|
name: Renovate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ghcr.io/renovatebot/renovate:41
|
||||||
|
options: --tmpfs /tmp:exec
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
show-progress: false
|
||||||
|
|
||||||
|
- name: print node heap
|
||||||
|
run: /usr/local/renovate/node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
|
||||||
|
|
||||||
|
- name: Restore renovate repo cache
|
||||||
|
uses: https://github.com/actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/renovate/cache/renovate/repository
|
||||||
|
key: repo-cache-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
repo-cache-
|
||||||
|
|
||||||
|
- name: Restore renovate package cache
|
||||||
|
uses: https://github.com/actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/renovate/cache/renovate/renovate-cache-sqlite
|
||||||
|
key: package-cache-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
package-cache-
|
||||||
|
|
||||||
- name: Self-hosted Renovate
|
- name: Self-hosted Renovate
|
||||||
uses: https://github.com/renovatebot/github-action@v40.1.0
|
uses: https://github.com/renovatebot/github-action@v43.0.9
|
||||||
env:
|
env:
|
||||||
LOG_LEVEL: ${{ inputs.logLevel || 'info' }}
|
LOG_LEVEL: ${{ inputs.logLevel || 'info' }}
|
||||||
RENOVATE_AUTODISCOVER: 'false'
|
|
||||||
RENOVATE_BINARY_SOURCE: 'install'
|
|
||||||
RENOVATE_DRY_RUN: ${{ inputs.dryRun || 'false' }}
|
RENOVATE_DRY_RUN: ${{ inputs.dryRun || 'false' }}
|
||||||
RENOVATE_ENDPOINT: ${{ github.server_url }}/api/v1
|
|
||||||
RENOVATE_GIT_TIMEOUT: 60000
|
RENOVATE_PLATFORM: forgejo
|
||||||
RENOVATE_GIT_URL: 'endpoint'
|
RENOVATE_ENDPOINT: ${{ github.server_url }}
|
||||||
RENOVATE_GITHUB_TOKEN_WARN: 'false'
|
RENOVATE_AUTODISCOVER: 'false'
|
||||||
RENOVATE_ONBOARDING: 'false'
|
|
||||||
RENOVATE_PLATFORM: 'forgejo'
|
|
||||||
RENOVATE_PR_COMMITS_PER_RUN_LIMIT: 3
|
|
||||||
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
|
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
|
||||||
|
|
||||||
|
RENOVATE_GIT_TIMEOUT: 60000
|
||||||
|
|
||||||
RENOVATE_REQUIRE_CONFIG: 'required'
|
RENOVATE_REQUIRE_CONFIG: 'required'
|
||||||
|
RENOVATE_ONBOARDING: 'false'
|
||||||
|
|
||||||
|
RENOVATE_PR_COMMITS_PER_RUN_LIMIT: 3
|
||||||
|
|
||||||
|
RENOVATE_GITHUB_TOKEN_WARN: 'false'
|
||||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
||||||
|
GITHUB_COM_TOKEN: ${{ secrets.GH_PUBLIC_RO }}
|
||||||
|
|
||||||
|
RENOVATE_REPOSITORY_CACHE: 'enabled'
|
||||||
|
RENOVATE_X_SQLITE_PACKAGE_CACHE: true
|
||||||
|
|
||||||
|
- name: Save renovate repo cache
|
||||||
|
if: always() && env.RENOVATE_DRY_RUN != 'full'
|
||||||
|
uses: https://github.com/actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/renovate/cache/renovate/repository
|
||||||
|
key: repo-cache-${{ github.run_id }}
|
||||||
|
|
||||||
|
- name: Save renovate package cache
|
||||||
|
if: always() && env.RENOVATE_DRY_RUN != 'full'
|
||||||
|
uses: https://github.com/actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/renovate/cache/renovate/renovate-cache-sqlite
|
||||||
|
key: package-cache-${{ github.run_id }}
|
||||||
|
|
22
Cargo.lock
generated
22
Cargo.lock
generated
|
@ -4058,7 +4058,7 @@ checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma"
|
name = "ruma"
|
||||||
version = "0.10.1"
|
version = "0.10.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assign",
|
"assign",
|
||||||
"js_int",
|
"js_int",
|
||||||
|
@ -4078,7 +4078,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-appservice-api"
|
name = "ruma-appservice-api"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
|
@ -4090,7 +4090,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-client-api"
|
name = "ruma-client-api"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"assign",
|
"assign",
|
||||||
|
@ -4113,7 +4113,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-common"
|
name = "ruma-common"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
@ -4145,7 +4145,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-events"
|
name = "ruma-events"
|
||||||
version = "0.28.1"
|
version = "0.28.1"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as_variant",
|
"as_variant",
|
||||||
"indexmap 2.10.0",
|
"indexmap 2.10.0",
|
||||||
|
@ -4170,7 +4170,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-federation-api"
|
name = "ruma-federation-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"headers",
|
"headers",
|
||||||
|
@ -4192,7 +4192,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identifiers-validation"
|
name = "ruma-identifiers-validation"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
|
@ -4201,7 +4201,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-identity-service-api"
|
name = "ruma-identity-service-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
|
@ -4211,7 +4211,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-macros"
|
name = "ruma-macros"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
|
@ -4226,7 +4226,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-push-gateway-api"
|
name = "ruma-push-gateway-api"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js_int",
|
"js_int",
|
||||||
"ruma-common",
|
"ruma-common",
|
||||||
|
@ -4238,7 +4238,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruma-signatures"
|
name = "ruma-signatures"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=b753738047d1f443aca870896ef27ecaacf027da#b753738047d1f443aca870896ef27ecaacf027da"
|
source = "git+https://forgejo.ellis.link/continuwuation/ruwuma?rev=8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd#8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
|
|
|
@ -352,7 +352,7 @@ version = "0.1.2"
|
||||||
[workspace.dependencies.ruma]
|
[workspace.dependencies.ruma]
|
||||||
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
|
||||||
#branch = "conduwuit-changes"
|
#branch = "conduwuit-changes"
|
||||||
rev = "b753738047d1f443aca870896ef27ecaacf027da"
|
rev = "8fb268fa2771dfc3a1c8075ef1246e7c9a0a53fd"
|
||||||
features = [
|
features = [
|
||||||
"compat",
|
"compat",
|
||||||
"rand",
|
"rand",
|
||||||
|
|
|
@ -21,6 +21,7 @@ This document contains the help content for the `admin` command-line program.
|
||||||
* [`admin users list-joined-rooms`↴](#admin-users-list-joined-rooms)
|
* [`admin users list-joined-rooms`↴](#admin-users-list-joined-rooms)
|
||||||
* [`admin users force-join-room`↴](#admin-users-force-join-room)
|
* [`admin users force-join-room`↴](#admin-users-force-join-room)
|
||||||
* [`admin users force-leave-room`↴](#admin-users-force-leave-room)
|
* [`admin users force-leave-room`↴](#admin-users-force-leave-room)
|
||||||
|
* [`admin users force-leave-remote-room`↴](#admin-users-force-leave-remote-room)
|
||||||
* [`admin users force-demote`↴](#admin-users-force-demote)
|
* [`admin users force-demote`↴](#admin-users-force-demote)
|
||||||
* [`admin users make-user-admin`↴](#admin-users-make-user-admin)
|
* [`admin users make-user-admin`↴](#admin-users-make-user-admin)
|
||||||
* [`admin users put-room-tag`↴](#admin-users-put-room-tag)
|
* [`admin users put-room-tag`↴](#admin-users-put-room-tag)
|
||||||
|
@ -295,6 +296,7 @@ You can find the ID using the `list-appservices` command.
|
||||||
* `list-joined-rooms` — - Lists all the rooms (local and remote) that the specified user is joined in
|
* `list-joined-rooms` — - Lists all the rooms (local and remote) that the specified user is joined in
|
||||||
* `force-join-room` — - Manually join a local user to a room
|
* `force-join-room` — - Manually join a local user to a room
|
||||||
* `force-leave-room` — - Manually leave a local user from a room
|
* `force-leave-room` — - Manually leave a local user from a room
|
||||||
|
* `force-leave-remote-room` — - Manually leave a remote room for a local user
|
||||||
* `force-demote` — - Forces the specified user to drop their power levels to the room default, if their permissions allow and the auth check permits
|
* `force-demote` — - Forces the specified user to drop their power levels to the room default, if their permissions allow and the auth check permits
|
||||||
* `make-user-admin` — - Grant server-admin privileges to a user
|
* `make-user-admin` — - Grant server-admin privileges to a user
|
||||||
* `put-room-tag` — - Puts a room tag for the specified user and room ID
|
* `put-room-tag` — - Puts a room tag for the specified user and room ID
|
||||||
|
@ -449,6 +451,19 @@ Reverses the effects of the `suspend` command, allowing the user to send message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## `admin users force-leave-remote-room`
|
||||||
|
|
||||||
|
- Manually leave a remote room for a local user
|
||||||
|
|
||||||
|
**Usage:** `admin users force-leave-remote-room <USER_ID> <ROOM_ID>`
|
||||||
|
|
||||||
|
###### **Arguments:**
|
||||||
|
|
||||||
|
* `<USER_ID>`
|
||||||
|
* `<ROOM_ID>`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## `admin users force-demote`
|
## `admin users force-demote`
|
||||||
|
|
||||||
- Forces the specified user to drop their power levels to the room default, if their permissions allow and the auth check permits
|
- Forces the specified user to drop their power levels to the room default, if their permissions allow and the auth check permits
|
||||||
|
|
115
renovate.json
115
renovate.json
|
@ -1,62 +1,59 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": [
|
"extends": ["config:recommended"],
|
||||||
"config:recommended"
|
"lockFileMaintenance": {
|
||||||
],
|
"enabled": true,
|
||||||
"lockFileMaintenance": {
|
"schedule": ["at any time"]
|
||||||
"enabled": true,
|
},
|
||||||
"schedule": [
|
"nix": {
|
||||||
"at any time"
|
"enabled": true
|
||||||
|
},
|
||||||
|
"labels": ["Dependencies", "Dependencies/Renovate"],
|
||||||
|
"ignoreDeps": [
|
||||||
|
"tikv-jemallocator",
|
||||||
|
"tikv-jemalloc-sys",
|
||||||
|
"tikv-jemalloc-ctl",
|
||||||
|
"opentelemetry",
|
||||||
|
"opentelemetry_sdk",
|
||||||
|
"opentelemetry-jaeger",
|
||||||
|
"tracing-opentelemetry"
|
||||||
|
],
|
||||||
|
"github-actions": {
|
||||||
|
"enabled": true,
|
||||||
|
"managerFilePatterns": [
|
||||||
|
"/(^|/)\\.forgejo/workflows/[^/]+\\.ya?ml$/",
|
||||||
|
"/(^|/)\\.forgejo/actions/[^/]+/action\\.ya?ml$/",
|
||||||
|
"/(^|/)\\.github/workflows/[^/]+\\.ya?ml$/",
|
||||||
|
"/(^|/)\\.github/actions/[^/]+/action\\.ya?ml$/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"description": "Batch minor and patch GitHub Actions updates",
|
||||||
|
"matchManagers": ["github-actions"],
|
||||||
|
"matchUpdateTypes": ["minor", "patch"],
|
||||||
|
"groupName": "github-actions-non-major"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Group Rust toolchain updates into a single PR",
|
||||||
|
"matchManagers": ["custom.regex"],
|
||||||
|
"matchPackageNames": ["rust", "rustc", "cargo"],
|
||||||
|
"groupName": "rust-toolchain"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Group lockfile updates into a single PR",
|
||||||
|
"matchUpdateTypes": ["lockFileMaintenance"],
|
||||||
|
"groupName": "lockfile-maintenance"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Batch patch-level Rust dependency updates",
|
||||||
|
"matchManagers": ["cargo"],
|
||||||
|
"matchUpdateTypes": ["patch"],
|
||||||
|
"groupName": "rust-patch-updates"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matchManagers": ["cargo"],
|
||||||
|
"prConcurrentLimit": 5
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"nix": {
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"labels": [
|
|
||||||
"Dependencies",
|
|
||||||
"Dependencies/Renovate"
|
|
||||||
],
|
|
||||||
"ignoreDeps": [
|
|
||||||
"tikv-jemallocator",
|
|
||||||
"tikv-jemalloc-sys",
|
|
||||||
"tikv-jemalloc-ctl",
|
|
||||||
"opentelemetry",
|
|
||||||
"opentelemetry_sdk",
|
|
||||||
"opentelemetry-jaeger",
|
|
||||||
"tracing-opentelemetry"
|
|
||||||
],
|
|
||||||
"github-actions": {
|
|
||||||
"enabled": true,
|
|
||||||
"fileMatch": [
|
|
||||||
"(^|/)\\.forgejo/workflows/[^/]+\\.ya?ml$",
|
|
||||||
"(^|/)\\.forgejo/actions/[^/]+/action\\.ya?ml$",
|
|
||||||
"(^|/)\\.github/workflows/[^/]+\\.ya?ml$",
|
|
||||||
"(^|/)\\.github/actions/[^/]+/action\\.ya?ml$"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"packageRules": [
|
|
||||||
{
|
|
||||||
"description": "Batch minor and patch GitHub Actions updates",
|
|
||||||
"matchManagers": ["github-actions"],
|
|
||||||
"matchUpdateTypes": ["minor", "patch"],
|
|
||||||
"groupName": "github-actions-non-major"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "Group Rust toolchain updates into a single PR",
|
|
||||||
"matchManagers": ["regex"],
|
|
||||||
"matchPackageNames": ["rust", "rustc", "cargo"],
|
|
||||||
"groupName": "rust-toolchain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "Group lockfile updates into a single PR",
|
|
||||||
"matchUpdateTypes": ["lockFileMaintenance"],
|
|
||||||
"groupName": "lockfile-maintenance"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "Batch patch-level Rust dependency updates",
|
|
||||||
"matchManagers": ["cargo"],
|
|
||||||
"matchUpdateTypes": ["patch"],
|
|
||||||
"groupName": "rust-patch-updates"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use std::{collections::BTreeMap, fmt::Write as _};
|
use std::{collections::BTreeMap, fmt::Write as _};
|
||||||
|
|
||||||
use api::client::{
|
use api::client::{
|
||||||
full_user_deactivate, join_room_by_id_helper, leave_all_rooms, leave_room, update_avatar_url,
|
full_user_deactivate, join_room_by_id_helper, leave_all_rooms, leave_room, remote_leave_room,
|
||||||
update_displayname,
|
update_avatar_url, update_displayname,
|
||||||
};
|
};
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Result, debug, debug_warn, error, info, is_equal_to,
|
Err, Result, debug, debug_warn, error, info, is_equal_to,
|
||||||
|
@ -926,3 +926,29 @@ pub(super) async fn redact_event(&self, event_id: OwnedEventId) -> Result {
|
||||||
))
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[admin_command]
|
||||||
|
pub(super) async fn force_leave_remote_room(
|
||||||
|
&self,
|
||||||
|
user_id: String,
|
||||||
|
room_id: OwnedRoomOrAliasId,
|
||||||
|
) -> Result {
|
||||||
|
let user_id = parse_local_user_id(self.services, &user_id)?;
|
||||||
|
let (room_id, _) = self
|
||||||
|
.services
|
||||||
|
.rooms
|
||||||
|
.alias
|
||||||
|
.resolve_with_servers(&room_id, None)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
assert!(
|
||||||
|
self.services.globals.user_is_local(&user_id),
|
||||||
|
"Parsed user_id must be a local user"
|
||||||
|
);
|
||||||
|
remote_leave_room(self.services, &user_id, &room_id, None)
|
||||||
|
.boxed()
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
self.write_str(&format!("{user_id} has been joined to {room_id}.",))
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
|
@ -103,6 +103,12 @@ pub enum UserCommand {
|
||||||
room_id: OwnedRoomOrAliasId,
|
room_id: OwnedRoomOrAliasId,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/// - Manually leave a remote room for a local user.
|
||||||
|
ForceLeaveRemoteRoom {
|
||||||
|
user_id: String,
|
||||||
|
room_id: OwnedRoomOrAliasId,
|
||||||
|
},
|
||||||
|
|
||||||
/// - Forces the specified user to drop their power levels to the room
|
/// - Forces the specified user to drop their power levels to the room
|
||||||
/// default, if their permissions allow and the auth check permits
|
/// default, if their permissions allow and the auth check permits
|
||||||
ForceDemote {
|
ForceDemote {
|
||||||
|
|
3
src/api/client/admin/mod.rs
Normal file
3
src/api/client/admin/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
mod suspend;
|
||||||
|
|
||||||
|
pub(crate) use self::suspend::*;
|
77
src/api/client/admin/suspend.rs
Normal file
77
src/api/client/admin/suspend.rs
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
use axum::extract::State;
|
||||||
|
use conduwuit::{Err, Result};
|
||||||
|
use ruma::api::client::admin::{get_suspended, set_suspended};
|
||||||
|
|
||||||
|
use crate::Ruma;
|
||||||
|
|
||||||
|
/// # `GET /_matrix/client/v1/admin/suspend/{userId}`
|
||||||
|
///
|
||||||
|
/// Check the suspension status of a target user
|
||||||
|
pub(crate) async fn get_suspended_status(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
body: Ruma<get_suspended::v1::Request>,
|
||||||
|
) -> Result<get_suspended::v1::Response> {
|
||||||
|
let sender_user = body.sender_user();
|
||||||
|
if !services.users.is_admin(sender_user).await {
|
||||||
|
return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
|
||||||
|
}
|
||||||
|
if !services.globals.user_is_local(&body.user_id) {
|
||||||
|
return Err!(Request(InvalidParam("Can only check the suspended status of local users")));
|
||||||
|
}
|
||||||
|
if !services.users.is_active(&body.user_id).await {
|
||||||
|
return Err!(Request(NotFound("Unknown user")));
|
||||||
|
}
|
||||||
|
Ok(get_suspended::v1::Response::new(
|
||||||
|
services.users.is_suspended(&body.user_id).await?,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// # `PUT /_matrix/client/v1/admin/suspend/{userId}`
|
||||||
|
///
|
||||||
|
/// Set the suspension status of a target user
|
||||||
|
pub(crate) async fn put_suspended_status(
|
||||||
|
State(services): State<crate::State>,
|
||||||
|
body: Ruma<set_suspended::v1::Request>,
|
||||||
|
) -> Result<set_suspended::v1::Response> {
|
||||||
|
let sender_user = body.sender_user();
|
||||||
|
if !services.users.is_admin(sender_user).await {
|
||||||
|
return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
|
||||||
|
}
|
||||||
|
if !services.globals.user_is_local(&body.user_id) {
|
||||||
|
return Err!(Request(InvalidParam("Can only set the suspended status of local users")));
|
||||||
|
}
|
||||||
|
if !services.users.is_active(&body.user_id).await {
|
||||||
|
return Err!(Request(NotFound("Unknown user")));
|
||||||
|
}
|
||||||
|
if body.user_id == *sender_user {
|
||||||
|
return Err!(Request(Forbidden("You cannot suspend yourself")));
|
||||||
|
}
|
||||||
|
if services.users.is_admin(&body.user_id).await {
|
||||||
|
return Err!(Request(Forbidden("You cannot suspend another admin")));
|
||||||
|
}
|
||||||
|
if services.users.is_suspended(&body.user_id).await? == body.suspended {
|
||||||
|
// No change
|
||||||
|
return Ok(set_suspended::v1::Response::new(body.suspended));
|
||||||
|
}
|
||||||
|
|
||||||
|
let action = if body.suspended {
|
||||||
|
services
|
||||||
|
.users
|
||||||
|
.suspend_account(&body.user_id, sender_user)
|
||||||
|
.await;
|
||||||
|
"suspended"
|
||||||
|
} else {
|
||||||
|
services.users.unsuspend_account(&body.user_id).await;
|
||||||
|
"unsuspended"
|
||||||
|
};
|
||||||
|
|
||||||
|
if services.config.admin_room_notices {
|
||||||
|
// Notify the admin room that an account has been un/suspended
|
||||||
|
services
|
||||||
|
.admin
|
||||||
|
.send_text(&format!("{} has been {} by {}.", body.user_id, action, sender_user))
|
||||||
|
.await;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(set_suspended::v1::Response::new(body.suspended))
|
||||||
|
}
|
|
@ -19,10 +19,15 @@ use crate::Ruma;
|
||||||
/// of this server.
|
/// of this server.
|
||||||
pub(crate) async fn get_capabilities_route(
|
pub(crate) async fn get_capabilities_route(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
_body: Ruma<get_capabilities::v3::Request>,
|
body: Ruma<get_capabilities::v3::Request>,
|
||||||
) -> Result<get_capabilities::v3::Response> {
|
) -> Result<get_capabilities::v3::Response> {
|
||||||
let available: BTreeMap<RoomVersionId, RoomVersionStability> =
|
let available: BTreeMap<RoomVersionId, RoomVersionStability> =
|
||||||
Server::available_room_versions().collect();
|
Server::available_room_versions().collect();
|
||||||
|
let authenticated = body.sender_user.as_ref().is_some()
|
||||||
|
&& services
|
||||||
|
.users
|
||||||
|
.is_active_local(body.sender_user.as_ref().unwrap())
|
||||||
|
.await;
|
||||||
|
|
||||||
let mut capabilities = Capabilities::default();
|
let mut capabilities = Capabilities::default();
|
||||||
capabilities.room_versions = RoomVersionsCapability {
|
capabilities.room_versions = RoomVersionsCapability {
|
||||||
|
@ -45,5 +50,15 @@ pub(crate) async fn get_capabilities_route(
|
||||||
json!({"enabled": services.config.forget_forced_upon_leave}),
|
json!({"enabled": services.config.forget_forced_upon_leave}),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
if authenticated
|
||||||
|
&& services
|
||||||
|
.users
|
||||||
|
.is_admin(body.sender_user.as_ref().unwrap())
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
// Advertise suspension API
|
||||||
|
capabilities.set("uk.timedout.msc4323", json!({"suspend":true, "lock": false}))?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(get_capabilities::v3::Response { capabilities })
|
Ok(get_capabilities::v3::Response { capabilities })
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,31 +156,34 @@ pub(crate) async fn join_room_by_id_or_alias_route(
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let mut servers = body.via.clone();
|
let mut servers = body.via.clone();
|
||||||
servers.extend(
|
if servers.is_empty() {
|
||||||
services
|
debug!("No via servers provided for join, injecting some.");
|
||||||
.rooms
|
servers.extend(
|
||||||
.state_cache
|
services
|
||||||
.servers_invite_via(&room_id)
|
.rooms
|
||||||
.map(ToOwned::to_owned)
|
.state_cache
|
||||||
.collect::<Vec<_>>()
|
.servers_invite_via(&room_id)
|
||||||
.await,
|
.map(ToOwned::to_owned)
|
||||||
);
|
.collect::<Vec<_>>()
|
||||||
|
.await,
|
||||||
|
);
|
||||||
|
|
||||||
servers.extend(
|
servers.extend(
|
||||||
services
|
services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.invite_state(sender_user, &room_id)
|
.invite_state(sender_user, &room_id)
|
||||||
.await
|
.await
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|event| event.get_field("sender").ok().flatten())
|
.filter_map(|event| event.get_field("sender").ok().flatten())
|
||||||
.filter_map(|sender: &str| UserId::parse(sender).ok())
|
.filter_map(|sender: &str| UserId::parse(sender).ok())
|
||||||
.map(|user| user.server_name().to_owned()),
|
.map(|user| user.server_name().to_owned()),
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(server) = room_id.server_name() {
|
if let Some(server) = room_id.server_name() {
|
||||||
servers.push(server.to_owned());
|
servers.push(server.to_owned());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
servers.sort_unstable();
|
servers.sort_unstable();
|
||||||
|
|
|
@ -215,7 +215,7 @@ pub async fn leave_room(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn remote_leave_room(
|
pub async fn remote_leave_room(
|
||||||
services: &Services,
|
services: &Services,
|
||||||
user_id: &UserId,
|
user_id: &UserId,
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub(crate) use self::{
|
||||||
};
|
};
|
||||||
pub use self::{
|
pub use self::{
|
||||||
join::join_room_by_id_helper,
|
join::join_room_by_id_helper,
|
||||||
leave::{leave_all_rooms, leave_room},
|
leave::{leave_all_rooms, leave_room, remote_leave_room},
|
||||||
};
|
};
|
||||||
use crate::{Ruma, client::full_user_deactivate};
|
use crate::{Ruma, client::full_user_deactivate};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
pub(super) mod account;
|
pub(super) mod account;
|
||||||
pub(super) mod account_data;
|
pub(super) mod account_data;
|
||||||
|
pub(super) mod admin;
|
||||||
pub(super) mod alias;
|
pub(super) mod alias;
|
||||||
pub(super) mod appservice;
|
pub(super) mod appservice;
|
||||||
pub(super) mod backup;
|
pub(super) mod backup;
|
||||||
|
@ -43,6 +44,7 @@ pub(super) mod well_known;
|
||||||
pub use account::full_user_deactivate;
|
pub use account::full_user_deactivate;
|
||||||
pub(super) use account::*;
|
pub(super) use account::*;
|
||||||
pub(super) use account_data::*;
|
pub(super) use account_data::*;
|
||||||
|
pub(super) use admin::*;
|
||||||
pub(super) use alias::*;
|
pub(super) use alias::*;
|
||||||
pub(super) use appservice::*;
|
pub(super) use appservice::*;
|
||||||
pub(super) use backup::*;
|
pub(super) use backup::*;
|
||||||
|
@ -55,7 +57,7 @@ pub(super) use keys::*;
|
||||||
pub(super) use media::*;
|
pub(super) use media::*;
|
||||||
pub(super) use media_legacy::*;
|
pub(super) use media_legacy::*;
|
||||||
pub(super) use membership::*;
|
pub(super) use membership::*;
|
||||||
pub use membership::{join_room_by_id_helper, leave_all_rooms, leave_room};
|
pub use membership::{join_room_by_id_helper, leave_all_rooms, leave_room, remote_leave_room};
|
||||||
pub(super) use message::*;
|
pub(super) use message::*;
|
||||||
pub(super) use openid::*;
|
pub(super) use openid::*;
|
||||||
pub(super) use presence::*;
|
pub(super) use presence::*;
|
||||||
|
|
|
@ -430,7 +430,7 @@ async fn handle_left_room(
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
// Left before last sync
|
// Left before last sync
|
||||||
if Some(since) >= left_count {
|
if (Some(since) >= left_count && !include_leave) || Some(next_batch) < left_count {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ pub(crate) async fn get_supported_versions_route(
|
||||||
("uk.tcpip.msc4133".to_owned(), true), /* Extending User Profile API with Key:Value Pairs (https://github.com/matrix-org/matrix-spec-proposals/pull/4133) */
|
("uk.tcpip.msc4133".to_owned(), true), /* Extending User Profile API with Key:Value Pairs (https://github.com/matrix-org/matrix-spec-proposals/pull/4133) */
|
||||||
("us.cloke.msc4175".to_owned(), true), /* Profile field for user time zone (https://github.com/matrix-org/matrix-spec-proposals/pull/4175) */
|
("us.cloke.msc4175".to_owned(), true), /* Profile field for user time zone (https://github.com/matrix-org/matrix-spec-proposals/pull/4175) */
|
||||||
("org.matrix.simplified_msc3575".to_owned(), true), /* Simplified Sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/4186) */
|
("org.matrix.simplified_msc3575".to_owned(), true), /* Simplified Sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/4186) */
|
||||||
|
("uk.timedout.msc4323".to_owned(), true), /* agnostic suspend (https://github.com/matrix-org/matrix-spec-proposals/pull/4323) */
|
||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -184,6 +184,8 @@ pub fn build(router: Router<State>, server: &Server) -> Router<State> {
|
||||||
"/_matrix/client/unstable/im.nheko.summary/rooms/:room_id_or_alias/summary",
|
"/_matrix/client/unstable/im.nheko.summary/rooms/:room_id_or_alias/summary",
|
||||||
get(client::get_room_summary_legacy)
|
get(client::get_room_summary_legacy)
|
||||||
)
|
)
|
||||||
|
.ruma_route(&client::get_suspended_status)
|
||||||
|
.ruma_route(&client::put_suspended_status)
|
||||||
.ruma_route(&client::well_known_support)
|
.ruma_route(&client::well_known_support)
|
||||||
.ruma_route(&client::well_known_client)
|
.ruma_route(&client::well_known_client)
|
||||||
.route("/_conduwuit/server_version", get(client::conduwuit_server_version))
|
.route("/_conduwuit/server_version", get(client::conduwuit_server_version))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue