docs: document server-side rendering pipeline, response timing middleware, and Telegram pairing API

- Add comprehensive documentation for backend content rendering in AGENTS.md, detailing the new `render_content` and `render_title` Jinja globals built on mistune with media processing, emoji shortcodes, and XSS protection
- Document the `X-Response-Time` header and bottom-left render time indicator in README.md
- Update bot token pricing documentation to clarify fallback vs gateway cost headers
- Add `email_accounts` to soft-delete tables and `idx_users_role` composite index in database schema
- Implement `telegram_pairings` and `telegram_links` table creation with column migration and indexes
- Add `/profile/{username}/telegram` endpoint to docs API with request/unpair actions
- Register `TelegramService` in main.py lifespan and add `response_timing` middleware emitting `X-Response-Time` header
- Introduce `TelegramPairForm` model and `guard_public_host_sync` synchronous host validation function
This commit is contained in:
2026-06-18 22:09:34 +00:00
parent 95dca73291
commit 6ceca3d0d4
146 changed files with 6079 additions and 392 deletions
+23 -3
View File
@@ -231,6 +231,26 @@
</div>
<p class="customization-hint">Runs only when your text contains an inline `@ai instruction` directive: it executes that instruction and removes the `@ai` marker, using your API key. Applies to posts, comments, projects, gists, direct messages and your bio. Code and source files are never touched.</p>
</div>
<div class="customization-card" data-telegram-pairing data-username="{{ profile_user['username'] }}">
<div class="customization-head">
<span class="customization-title">Telegram</span>
</div>
<p class="customization-hint">Chat with your Devii from Telegram. Open the DevPlace bot in Telegram, then send it the four digit code below to connect this account.</p>
<div class="customization-row">
<span class="customization-label">Status</span>
<span data-telegram-status>{{ 'Connected' if telegram_paired else 'Not connected' }}</span>
</div>
<div class="customization-row">
<button type="button" class="btn btn-sm btn-primary" data-telegram-request>Request pairing code</button>
<button type="button" class="btn btn-sm" data-telegram-unpair {% if not telegram_paired %}hidden{% endif %}>Disconnect</button>
</div>
<div class="telegram-code" data-telegram-code hidden>
<code class="api-key-value" data-telegram-code-value></code>
<p class="customization-hint" data-telegram-code-hint></p>
</div>
<span class="ai-correction-status" data-telegram-status-msg></span>
</div>
{% endif %}
</aside>
@@ -455,7 +475,7 @@
{% for p in projects %}
<a href="/projects/{{ p['slug'] or p['uid'] }}" class="project-card">
<div class="project-card-header">
<h3 class="project-card-title">{{ p['title'] }}</h3>
<h3 class="project-card-title">{{ render_title(p['title']) }}</h3>
</div>
<div class="project-card-meta">
<span class="project-status {% if p.get('status') == 'Released' %}released{% else %}dev{% endif %}">
@@ -463,7 +483,7 @@
</span>
<span>{{ p.get('project_type', 'software')|replace('_', ' ')|capitalize }}</span>
</div>
<div class="project-card-desc rendered-content" data-render>{{ p.get('description', '')[:200] }}</div>
<div class="project-card-desc rendered-content">{{ render_content(p.get('description', '')[:200]) }}</div>
{% if p.get('platforms') %}
<div class="project-card-platforms">
{% for plat in p['platforms'].split(',') %}
@@ -480,7 +500,7 @@
{% set g = entry.gist %}
<a href="/gists/{{ g['slug'] or g['uid'] }}" class="gist-card">
<div class="gist-card-header">
<h3 class="gist-card-title">{{ g['title'] }}</h3>
<h3 class="gist-card-title">{{ render_title(g['title']) }}</h3>
<span class="gist-card-star">&#x2606; {{ g.get('stars', 0) }}</span>
</div>
<div class="gist-card-meta">