feat: frps-manager v1.0 - frp 0.70.1 multi-tenant web management system

- Multi-tenant client/proxy management with Flask+SQLite
- Frps server control (start/restart/token rotation)
- Generate frpc.ini with shared server token + admin API
- Dashboard API integration (live client/proxy status)
- RBAC: admin/tenant_admin/user roles
- Audit logging for all operations
- Systemd service files included
- Requires legacy INI format (frp 0.70 TOML auth broken)
This commit is contained in:
Your Name
2026-08-10 14:17:49 +08:00
commit 71214524f4
27 changed files with 2847 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
{% extends "base.html" %}
{% block title %}{{ '编辑' if item else '新建' }}客户端 · frps-manager{% endblock %}
{% block content %}
<h1>{{ '编辑客户端' if item else '新建客户端 (frpc 注册)' }}</h1>
<form method="post" class="form-card">
{% if item %}
<label>名称 (frpc user) <input value="{{ item.name }}" disabled></label>
<label>租户
<select name="tenant_id">
{% for t in tenants %}
<option value="{{ t.id }}" {% if t.id == item.tenant_id %}selected{% endif %}>{{ t.name }}</option>
{% endfor %}
</select>
</label>
{% else %}
<label>租户
<select name="tenant_id" required>
{% for t in tenants %}<option value="{{ t.id }}">{{ t.name }}</option>{% endfor %}
</select>
</label>
<label>名称 (frpc user 字段)
<input name="name" required pattern="[a-zA-Z0-9_.-]+" title="字母数字下划线短横线点">
</label>
{% endif %}
<label>frps 地址 (文档用)
<input name="server_addr" value="{{ item.server_addr or '' if item else '' }}"
placeholder="例如 your.frps.host">
</label>
<label>描述 <input name="description" value="{{ item.description or '' if item else '' }}"></label>
<label class="checkbox">
<input type="checkbox" name="is_active" {% if item is none or item.is_active %}checked{% endif %}>
启用(禁用后 frpc 即使配了相同 token 也会被 dashboard 列为 inactive
</label>
<div class="form-actions">
<button class="btn btn-primary" type="submit">保存</button>
<a class="btn" href="{{ url_for('clients_list') }}">取消</a>
</div>
{% if item %}
<p class="muted small">
创建后请到客户端列表页点 <strong>frpc.toml</strong> 按钮下载配置。
frpc 端不需要填 token — server token 是共享的,在仪表盘上能看到。
</p>
{% endif %}
</form>
{% endblock %}