Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1b2c8575c | ||
|
|
54bdada04d | ||
|
|
8a2867e64b | ||
|
|
2e6e8e72b8 | ||
|
|
d36c782e56 | ||
|
|
ad7d735739 | ||
|
|
4bb2dd4449 |
No files matched your search
@@ -94,8 +94,16 @@ jobs:
|
||||
|
||||
- name: Audit matrixbot dependencies
|
||||
# --local scans the env without spawning a venv (required for standalone Python)
|
||||
# CVE-2026-3219 is in pip itself, not our code — ignore it explicitly
|
||||
run: /opt/python/bin/pip-audit --local --ignore-vuln CVE-2026-3219
|
||||
# CVE-2026-3219 is in pip itself, not our code — ignore it explicitly.
|
||||
# The filelock CVEs (fixed in 4.2.1) are in pip-audit's own dependency
|
||||
# (CacheControl[filecache]); the bot doesn't use filelock, and 4.2+
|
||||
# needs Python 3.11, which this 3.10 audit env can't install.
|
||||
run: >-
|
||||
/opt/python/bin/pip-audit --local
|
||||
--ignore-vuln CVE-2026-3219
|
||||
--ignore-vuln CVE-2026-112906 --ignore-vuln CVE-2026-112907
|
||||
--ignore-vuln CVE-2026-112913 --ignore-vuln CVE-2026-112914
|
||||
--ignore-vuln CVE-2026-112937 --ignore-vuln CVE-2026-112940
|
||||
|
||||
secret-scan:
|
||||
name: Secret scan (gitleaks)
|
||||
|
||||
@@ -50,7 +50,7 @@ matrix/
|
||||
|
||||
| Service | IP | LXC | RAM | Disk | Versions |
|
||||
|---------|----|-----|-----|------|----------|
|
||||
| Synapse | 10.10.10.29 | 151 | 12GB | 50GB | Synapse 1.159.0, LiveKit 1.9.11, hookshot 7.3.2, coturn latest |
|
||||
| Synapse | 10.10.10.29 | 151 | 12GB | 50GB | Synapse 1.163.2, LiveKit 1.9.11, hookshot 7.3.2, coturn latest |
|
||||
| PostgreSQL 17 | 10.10.10.44 | 109 | 6GB | 80GB | PostgreSQL 17.9 |
|
||||
| Cinny Web | 10.10.10.6 | 106 | 2GB | 8GB | Debian 12, nginx, Node 24, Lotus Cinny fork (custom, tracks `cinnyapp/cinny` main) |
|
||||
| Draupnir | 10.10.10.24 | 110 | 1GB | 10GB | Draupnir v2.9.0, Node.js v22 |
|
||||
|
||||
@@ -17,6 +17,14 @@ map $uri $lotus_shell_cache_control {
|
||||
# decoration picker can fetch hundreds of thumbnails, which would otherwise use
|
||||
# up chat_limit and 503 the app's own files.
|
||||
limit_req_zone $binary_remote_addr zone=decorations_limit:10m rate=100r/s;
|
||||
#
|
||||
# [cinny #201 follow-up] Content-hashed app files (js/css/fonts/images/wasm)
|
||||
# likewise: a cold page load fires ~75 requests within a second, and the
|
||||
# service worker precaches all ~126 build files at once (every deploy renames
|
||||
# them), both past chat_limit's burst of 60, so chunks 503ed and pages
|
||||
# rendered blank / the precache install failed. Immutable files, cheap to
|
||||
# serve; pages and the webhook keep chat_limit.
|
||||
limit_req_zone $binary_remote_addr zone=assets_limit:10m rate=100r/s;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
@@ -85,6 +93,8 @@ server {
|
||||
}
|
||||
location ~* \.(?:js|css|woff2?|png|svg|ico|webp|wasm)$ {
|
||||
include snippets/cinny-security-headers-framed.conf;
|
||||
# Own budget (replaces the server-level chat_limit; see assets_limit).
|
||||
limit_req zone=assets_limit burst=400 nodelay;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable" always;
|
||||
}
|
||||
@@ -93,6 +103,8 @@ server {
|
||||
# Cache content-addressed static assets aggressively
|
||||
location ~* \.(?:js|css|woff2?|png|svg|ico|webp)$ {
|
||||
include snippets/cinny-security-headers.conf;
|
||||
# Own budget (replaces the server-level chat_limit; see assets_limit).
|
||||
limit_req zone=assets_limit burst=400 nodelay;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable" always;
|
||||
}
|
||||
@@ -189,6 +201,8 @@ server {
|
||||
}
|
||||
location ~* \.(?:js|css|woff2?|png|svg|ico|webp|wasm)$ {
|
||||
include snippets/cinny-security-headers-call.conf;
|
||||
# Own budget (replaces the server-level chat_limit; see assets_limit).
|
||||
limit_req zone=assets_limit burst=400 nodelay;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable" always;
|
||||
}
|
||||
|
||||
@@ -77,4 +77,13 @@ if (event === 'ticket_created') {
|
||||
html = '[tinker-tickets] event: <code>' + event + '</code> ticket #' + id;
|
||||
}
|
||||
|
||||
result = { version: 'v2', plain: plain, html: html, msgtype: 'm.text' };
|
||||
// Explicit mentions (m.mentions): from Synapse 1.164 the legacy push rules
|
||||
// that pinged on a user ID or display name in the body are off by default
|
||||
// (MSC4210), so the people to notify must be listed here.
|
||||
result = {
|
||||
version: 'v2',
|
||||
plain: plain,
|
||||
html: html,
|
||||
msgtype: 'm.text',
|
||||
mentions: { user_ids: notifyUsers }
|
||||
};
|
||||
@@ -2273,7 +2273,9 @@ async def cmd_roast(client: AsyncClient, room_id: str, sender: str, args: str):
|
||||
f'<blockquote>{roast}</blockquote>'
|
||||
f'<sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>'
|
||||
)
|
||||
await send_html(client, room_id, plain, html)
|
||||
# Ping the person being roasted when they were named by Matrix ID.
|
||||
target_id = target_raw if re.fullmatch(r"@[^\s:]+:[^\s]+", target_raw) else None
|
||||
await send_html(client, room_id, plain, html, mention_user_ids=[target_id] if target_id else None)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
+15
-7
@@ -70,17 +70,25 @@ async def send_text(client: AsyncClient, room_id: str, text: str):
|
||||
return resp
|
||||
|
||||
|
||||
async def send_html(client: AsyncClient, room_id: str, plain: str, html: str):
|
||||
async def send_html(
|
||||
client: AsyncClient, room_id: str, plain: str, html: str, mention_user_ids: list[str] | None = None
|
||||
):
|
||||
logger = logging.getLogger("matrixbot")
|
||||
content = {
|
||||
"msgtype": "m.text",
|
||||
"body": plain,
|
||||
"format": "org.matrix.custom.html",
|
||||
"formatted_body": html,
|
||||
}
|
||||
# Explicit mentions (m.mentions). From Synapse 1.164 a name or user ID in
|
||||
# the body no longer pings anyone (MSC4210), so a message that should
|
||||
# notify someone has to say so.
|
||||
if mention_user_ids:
|
||||
content["m.mentions"] = {"user_ids": mention_user_ids}
|
||||
resp = await _room_send_trusted(
|
||||
client, room_id,
|
||||
message_type="m.room.message",
|
||||
content={
|
||||
"msgtype": "m.text",
|
||||
"body": plain,
|
||||
"format": "org.matrix.custom.html",
|
||||
"formatted_body": html,
|
||||
},
|
||||
content=content,
|
||||
)
|
||||
if not isinstance(resp, RoomSendResponse):
|
||||
logger.error("send_html failed: %s", resp)
|
||||
|
||||
Reference in new issue
Block a user