mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-10 14:32:50 +02:00
Compare commits
12 commits
ab1ca2764a
...
338f1a4c4f
Author | SHA1 | Date | |
---|---|---|---|
|
338f1a4c4f |
||
|
d21f07a3cc | ||
|
f29a881b23 | ||
|
6068db1345 | ||
|
143d39e371 | ||
|
a32aba6989 | ||
|
3b6a0ec48a | ||
|
6402a0e58f | ||
|
5cce024841 | ||
|
e87c461b8d |
||
|
b934898f51 |
||
|
83e3de55a4 |
8 changed files with 130 additions and 79 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 }}
|
||||||
|
|
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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,10 @@ pub(crate) async fn get_suspended_status(
|
||||||
let sender_user = body.sender_user();
|
let sender_user = body.sender_user();
|
||||||
if !services.users.is_admin(sender_user).await {
|
if !services.users.is_admin(sender_user).await {
|
||||||
return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
|
return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
|
||||||
};
|
}
|
||||||
if !services.globals.user_is_local(&body.user_id) {
|
if !services.globals.user_is_local(&body.user_id) {
|
||||||
return Err!(Request(InvalidParam("Can only check the suspended status of local users")));
|
return Err!(Request(InvalidParam("Can only check the suspended status of local users")));
|
||||||
};
|
}
|
||||||
if !services.users.is_active(&body.user_id).await {
|
if !services.users.is_active(&body.user_id).await {
|
||||||
return Err!(Request(NotFound("Unknown user")));
|
return Err!(Request(NotFound("Unknown user")));
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ pub(crate) async fn put_suspended_status(
|
||||||
let sender_user = body.sender_user();
|
let sender_user = body.sender_user();
|
||||||
if !services.users.is_admin(sender_user).await {
|
if !services.users.is_admin(sender_user).await {
|
||||||
return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
|
return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
|
||||||
};
|
}
|
||||||
if !services.globals.user_is_local(&body.user_id) {
|
if !services.globals.user_is_local(&body.user_id) {
|
||||||
return Err!(Request(InvalidParam("Can only set the suspended status of local users")));
|
return Err!(Request(InvalidParam("Can only set the suspended status of local users")));
|
||||||
};
|
}
|
||||||
if !services.users.is_active(&body.user_id).await {
|
if !services.users.is_active(&body.user_id).await {
|
||||||
return Err!(Request(NotFound("Unknown user")));
|
return Err!(Request(NotFound("Unknown user")));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,14 +19,14 @@ 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()
|
let authenticated = body.sender_user.as_ref().is_some()
|
||||||
&& services
|
&& services
|
||||||
.users
|
.users
|
||||||
.is_active_local(_body.sender_user.as_ref().unwrap())
|
.is_active_local(body.sender_user.as_ref().unwrap())
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let mut capabilities = Capabilities::default();
|
let mut capabilities = Capabilities::default();
|
||||||
|
@ -53,7 +53,7 @@ pub(crate) async fn get_capabilities_route(
|
||||||
if authenticated
|
if authenticated
|
||||||
&& services
|
&& services
|
||||||
.users
|
.users
|
||||||
.is_admin(_body.sender_user.as_ref().unwrap())
|
.is_admin(body.sender_user.as_ref().unwrap())
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
// Advertise suspension API
|
// Advertise suspension API
|
||||||
|
|
|
@ -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) */
|
||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue