feat(apps): добавить MikrotikManager app id mm
quality / commitlint (push) Skipped
quality / changes (push) Successful in 7s
quality / docker-check (push) Skipped
quality / web (push) Successful in 40s
quality / api (push) Successful in 36s
CD / quality (push) Successful in 1m37s
CD / publish (push) Successful in 1m40s

Регистрация mm в каталоге приложений, permissions mm:*, target-app и docs.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-09-04 20:38:27 +07:00
co-authored by Cursor
parent 01d3a79e13
commit fd7d9fd13c
13 changed files with 166 additions and 4 deletions
@@ -48,6 +48,7 @@ const DEFAULT_ICONS: Record<AppId, AppSwitcherIconName> = {
fw: 'server',
dns: 'globe',
cdn: 'cloud',
mm: 'dashboard',
}
const DEFAULT_AUTH_MODE: Record<AppId, AppAuthMode> = {
@@ -57,6 +58,7 @@ const DEFAULT_AUTH_MODE: Record<AppId, AppAuthMode> = {
fw: 'jwt',
dns: 'oidc',
cdn: 'jwt',
mm: 'jwt',
}
/** Seed / fallback when DB is empty. */
+2 -1
View File
@@ -12,6 +12,7 @@ export const AUDIT_SOURCE_APPS = [
'fw',
'dns',
'cdn',
'mm',
] as const
export type AuditSourceApp = (typeof AUDIT_SOURCE_APPS)[number]
export const auditSourceAppSchema = z.enum(AUDIT_SOURCE_APPS)
@@ -107,7 +108,7 @@ export type AuditPurgeResponse = z.infer<typeof auditPurgeResponseSchema>
export const ingestAuditEventSchema = z.object({
event_id: z.string().min(1).max(128),
source_app: z.enum(['vps', 'cfdm', 'bgp', 'fw', 'dns', 'cdn']),
source_app: z.enum(['vps', 'cfdm', 'bgp', 'fw', 'dns', 'cdn', 'mm']),
action: z.string().min(1).max(200),
severity: auditSeveritySchema.optional(),
actor_user_id: z.string().nullable().optional(),
+25 -1
View File
@@ -1,6 +1,6 @@
import { z } from 'zod'
export const APP_IDS = ['cfdm', 'vps', 'bgp', 'fw', 'dns', 'cdn'] as const
export const APP_IDS = ['cfdm', 'vps', 'bgp', 'fw', 'dns', 'cdn', 'mm'] as const
export type AppId = (typeof APP_IDS)[number]
export const appIdSchema = z.enum(APP_IDS)
@@ -64,6 +64,13 @@ export const APPS: AppMeta[] = [
url: 'https://cdn.shnt.top',
authMode: 'jwt',
},
{
id: 'mm',
title: 'MikrotikManager',
description: 'MikroTik: серверы, фильтры, BGP, uptime',
url: 'https://mm.shnt.top',
authMode: 'jwt',
},
]
export type CatalogSection = {
@@ -174,6 +181,23 @@ export const PERMISSION_CATALOG: AppPermissionCatalog[] = [
section('settings', 'Настройки', 'Naming, TTL, Cloudflare', ['admin']),
],
},
{
appId: 'mm',
title: 'MikrotikManager',
sections: [
section('dashboard', 'Дашборд', 'Обзор и KPI', ['read']),
section('servers', 'Серверы', 'MikroTik / CHR хосты'),
section('filters', 'Фильтры', 'Firewall и address-list'),
section('bgp', 'BGP', 'BGP-сессии и префиксы'),
section('uptime', 'Uptime', 'Пинги и speed-probes'),
section('traffic', 'Трафик', 'Интерфейсы и графики'),
section('alerts', 'Алерты', 'Правила и Telegram'),
section('backups', 'Бэкапы', 'Конфиги и расписание'),
section('certificates', 'Сертификаты', 'ACME / TLS'),
section('network', 'Сеть', 'GRE, OSPF, пути'),
section('settings', 'Настройки', 'Настройки приложения', ['admin']),
],
},
]
export function permissionKey(