feat: add api key auth, devii agent, openai gateway, and admin service management

This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
This commit is contained in:
2026-06-08 15:38:33 +00:00
parent 921e382cbc
commit e0535bb7c5
270 changed files with 54408 additions and 541 deletions
+73 -14
View File
@@ -13,7 +13,7 @@
<img src="{{ avatar_url('multiavatar', profile_user['username'], 80) }}" class="avatar-img avatar-lg" alt="{{ profile_user['username'] }}" id="profile-avatar-preview" loading="lazy">
</div>
<h1 class="profile-name">{{ profile_user['username'] }}</h1>
{% if profile_user.get('role') %}
{% if is_admin(user) and profile_user.get('role') %}
<div class="profile-role">{{ profile_user['role'] }}</div>
{% endif %}
@@ -31,7 +31,7 @@
<span class="profile-stat-label">Stars</span>
</div>
<div class="profile-stat">
<a href="/leaderboard" class="profile-stat-value">{% if rank %}#{{ rank }}{% else %}&mdash;{% endif %}</a>
<a href="/leaderboard" class="profile-stat-value">{% if rank %}#{{ rank }}{% else %}-{% endif %}</a>
<span class="profile-stat-label">Rank</span>
</div>
</div>
@@ -57,22 +57,22 @@
</div>
</div>
{% if user and user['uid'] != profile_user['uid'] %}
{% if not is_self(user, profile_user['uid']) %}
<div class="profile-actions">
<a href="/messages?with_uid={{ profile_user['uid'] }}" class="btn btn-secondary btn-sm full-width justify-center"><span class="icon">&#x2709;&#xFE0F;</span>Send Message</a>
<a href="{% if user %}/messages?with_uid={{ profile_user['uid'] }}{% else %}/auth/login{% endif %}" class="btn btn-secondary btn-sm full-width justify-center{% if not user %} login-required{% endif %}"{% if not user %} title="Log in to participate"{% endif %}><span class="icon">&#x2709;&#xFE0F;</span>Send Message</a>
{% if is_following %}
<form method="POST" action="/follow/unfollow/{{ profile_user['username'] }}">
<button type="submit" class="btn btn-secondary btn-sm full-width"><span class="icon">&#x2796;</span>Unfollow</button>
<button type="submit" class="btn btn-secondary btn-sm full-width"{{ guest_disabled(user) }}><span class="icon">&#x2796;</span>Unfollow</button>
</form>
{% else %}
<form method="POST" action="/follow/{{ profile_user['username'] }}">
<button type="submit" class="btn btn-primary btn-sm full-width"><span class="icon">&#x2795;</span>Follow</button>
<button type="submit" class="btn btn-primary btn-sm full-width"{{ guest_disabled(user) }}><span class="icon">&#x2795;</span>Follow</button>
</form>
{% endif %}
</div>
{% endif %}
{% if user and user['uid'] == profile_user['uid'] %}
{% if is_self(user, profile_user['uid']) %}
<div class="profile-info">
<form method="POST" action="/profile/update">
<div class="profile-info-row">
@@ -142,6 +142,24 @@
</div>
</div>
{% endif %}
{% if can_view_api_key %}
<div class="api-key-card" data-api-key-card>
<div class="api-key-head">
<span class="api-key-title">API Key</span>
<a href="/docs/authentication.html" class="api-key-docs">Docs</a>
</div>
<code class="api-key-value" data-api-key data-key="{{ api_key }}" data-masked="true">{{ '•' * 12 }}</code>
<div class="api-key-actions">
<button type="button" class="btn btn-sm" data-api-key-reveal>Reveal</button>
<button type="button" class="btn btn-sm" data-api-key-copy>Copy</button>
{% if is_owner %}
<button type="button" class="btn btn-sm btn-primary" data-regen-api-key>Regenerate</button>
{% endif %}
</div>
<p class="api-key-hint">Use this key with <code>X-API-KEY</code>, <code>Authorization: Bearer</code>, or HTTP Basic auth on any request. {% if is_owner %}Regenerating immediately invalidates the old key.{% endif %}</p>
</div>
{% endif %}
</aside>
<div class="profile-content">
@@ -152,14 +170,21 @@
<h3 class="heatmap-title">Contributions</h3>
<span class="streak-info"><span class="icon">&#x1F525;</span> {{ streak.current }} day streak &middot; Longest {{ streak.longest }}</span>
</div>
<div class="heatmap-grid">
{% for week in heatmap %}
<div class="heatmap-week">
{% for day in week %}
<span class="heatmap-cell level-{{ day.level }}" title="{{ day.count }} on {{ day.date }}"></span>
{% endfor %}
<div class="heatmap-scroll">
<div class="heatmap-inner">
<div class="heatmap-months">
{% for month in heatmap_months %}<span>{{ month }}</span>{% endfor %}
</div>
<div class="heatmap-grid">
{% for week in heatmap %}
<div class="heatmap-week">
{% for day in week %}
<span class="heatmap-cell level-{{ day.level }}" title="{{ day.count }} on {{ day.date }}"></span>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
@@ -168,6 +193,8 @@
<a href="/profile/{{ profile_user['username'] }}?tab=projects" class="profile-tab {% if current_tab == 'projects' %}active{% endif %}"><span class="icon">&#x1F680;</span> Projects</a>
<a href="/profile/{{ profile_user['username'] }}?tab=gists" class="profile-tab {% if current_tab == 'gists' %}active{% endif %}"><span class="icon">&#x1F4DD;</span> Gists</a>
<a href="/profile/{{ profile_user['username'] }}?tab=activity" class="profile-tab {% if current_tab == 'activity' %}active{% endif %}"><span class="icon">&#x1F4CA;</span> Activity</a>
<a href="/profile/{{ profile_user['username'] }}?tab=followers" class="profile-tab {% if current_tab == 'followers' %}active{% endif %}"><span class="icon">&#x1F465;</span> Followers ({{ followers_count }})</a>
<a href="/profile/{{ profile_user['username'] }}?tab=following" class="profile-tab {% if current_tab == 'following' %}active{% endif %}"><span class="icon">&#x1F464;</span> Following ({{ following_count }})</a>
<button class="btn-ghost btn-icon profile-tab-btn">&#x25B3;</button>
</div>
@@ -223,6 +250,38 @@
{% else %}
<div class="empty-state">No gists yet.</div>
{% endfor %}
{% elif current_tab == 'followers' or current_tab == 'following' %}
{% for person in people %}
<div class="follow-row">
<a href="/profile/{{ person['username'] }}" class="follow-user">
<img src="{{ avatar_url('multiavatar', person['username'], 40) }}" class="avatar-img avatar-md" alt="{{ person['username'] }}" loading="lazy">
<div class="follow-user-info">
<span class="follow-user-name">{{ person['username'] }}</span>
{% if person['bio'] %}<span class="follow-user-bio">{{ person['bio'] }}</span>{% endif %}
</div>
</a>
{% if user and not person['is_self'] %}
{% if person['is_following'] %}
<form method="post" action="/follow/unfollow/{{ person['username'] }}">
<button type="submit" class="btn btn-ghost btn-sm"{{ guest_disabled(user) }}>Following</button>
</form>
{% else %}
<form method="post" action="/follow/{{ person['username'] }}">
<button type="submit" class="btn btn-primary btn-sm"{{ guest_disabled(user) }}>Follow</button>
</form>
{% endif %}
{% endif %}
</div>
{% else %}
<div class="empty-state">{% if current_tab == 'followers' %}No followers yet.{% else %}Not following anyone yet.{% endif %}</div>
{% endfor %}
{% if follow_pagination and follow_pagination.total_pages > 1 %}
<div class="follow-pagination">
{% if follow_pagination.has_prev %}<a class="btn btn-ghost btn-sm" href="/profile/{{ profile_user['username'] }}?tab={{ current_tab }}&page={{ follow_pagination.prev_page }}">Previous</a>{% endif %}
<span class="follow-page-label">Page {{ follow_pagination.page }} of {{ follow_pagination.total_pages }}</span>
{% if follow_pagination.has_next %}<a class="btn btn-ghost btn-sm" href="/profile/{{ profile_user['username'] }}?tab={{ current_tab }}&page={{ follow_pagination.next_page }}">Next</a>{% endif %}
</div>
{% endif %}
{% else %}
{% for act in activities %}
<div class="post-card activity-card">