技能 routeros-app-yaml
📦

routeros-app-yaml

安全 ⚙️ 外部命令🌐 网络访问

编写 RouterOS 容器 YAML 配置

为 MikroTik RouterOS 容器应用创建和验证 YAML 配置。该技能帮助你为 RouterOS /app 子系统定义服务、端口、卷和网络,无需掌握 docker-compose 知识。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“routeros-app-yaml”。 为 Home Assistant 容器创建 /app YAML,使用端口 8123 和持久化存储

预期结果:

  • 一个包含 name、services、volumes 和 networks 部分的 YAML 文件。
  • Web 服务使用 ghcr.io/home-assistant/home-assistant 镜像,映射端口 8123。
  • 命名卷 home-assistant-config 挂载到 /config。
  • 重启策略设置为 always 以确保可靠性。

正在使用“routeros-app-yaml”。 展示 RouterOS YAML 中旧端口格式和新端口格式的差异

预期结果:

  • 旧 OCI 风格在协议前使用斜杠:8080:80/tcp
  • 新的 RouterOS 7.23 风格使用冒号:8080:80:web:tcp
  • 两种格式均有效。从 7.23beta2 开始的新部署应优先使用冒号风格。
  • 包含 target、published 和 protocol 字段的长形式对象语法在所有版本中均有效。

安全审计

安全
v2 • 4/16/2026

All 159 static analysis findings are false positives. The skill contains only documentation and YAML configuration examples for RouterOS container applications. There is no executable code, no actual shell commands, no network requests, and no credential handling. The static scanner flagged YAML examples in markdown code blocks as security risks (for example, backticks in YAML values, example URLs in documentation, and placeholder IP addresses in configuration samples). After manual review, no genuine security issues were found.

2
已扫描文件
453
分析行数
5
发现项
2
审计总数
低风险问题 (3)
False positive: External command detection in YAML documentation
The static scanner flagged 132 locations as external command execution. These are YAML configuration examples and markdown documentation, not executable code. Examples include shell commands in YAML entrypoint values (for example, nginx -g daemon off in SKILL.md line 32 and references/examples.md line 31) and backtick-formatted text in markdown. No actual command execution exists.
False positive: Network pattern detection in documentation URLs
The static scanner flagged 13 locations as network risks including hardcoded URLs, hardcoded IP addresses, and fetch API calls. All are documentation examples: example.com URLs in YAML samples (references/examples.md lines 19, 21), example IP addresses like 192.168.1.1 in port mapping examples (SKILL.md line 110, references/examples.md line 145), and TypeScript fetch snippets showing RouterOS REST API usage (SKILL.md lines 216, 222). No actual network requests are made by this skill.
False positive: Blocker patterns misidentified in YAML content
The static scanner flagged weak cryptographic algorithms, Windows SAM database references, LLM role token injection, and system reconnaissance patterns. None of these patterns exist in the actual file content. The scanner likely misidentified YAML property names or markdown formatting as security threats.

风险因素

⚙️ 外部命令 (132)
references/examples.md:5-12 references/examples.md:12-16 references/examples.md:16-105 references/examples.md:105-109 references/examples.md:109-134 references/examples.md:134-138 references/examples.md:138-161 references/examples.md:161-165 references/examples.md:165-176 references/examples.md:31 SKILL.md:8 SKILL.md:8 SKILL.md:8 SKILL.md:12 SKILL.md:15 SKILL.md:16 SKILL.md:17 SKILL.md:19 SKILL.md:25 SKILL.md:26 SKILL.md:30 SKILL.md:32 SKILL.md:33 SKILL.md:33 SKILL.md:33 SKILL.md:39 SKILL.md:40 SKILL.md:41 SKILL.md:42 SKILL.md:43 SKILL.md:43 SKILL.md:44 SKILL.md:44 SKILL.md:45 SKILL.md:45 SKILL.md:46 SKILL.md:47 SKILL.md:48 SKILL.md:49 SKILL.md:50 SKILL.md:51 SKILL.md:52 SKILL.md:56-61 SKILL.md:61-67 SKILL.md:67 SKILL.md:67-71 SKILL.md:71 SKILL.md:71 SKILL.md:71-72 SKILL.md:72 SKILL.md:72-73 SKILL.md:73-74 SKILL.md:74-75 SKILL.md:75-76 SKILL.md:76-77 SKILL.md:77 SKILL.md:77 SKILL.md:77-78 SKILL.md:78 SKILL.md:78-79 SKILL.md:79 SKILL.md:79-80 SKILL.md:80 SKILL.md:80 SKILL.md:80 SKILL.md:80 SKILL.md:80-81 SKILL.md:81-82 SKILL.md:82-83 SKILL.md:83-84 SKILL.md:84-85 SKILL.md:85-86 SKILL.md:86-87 SKILL.md:87 SKILL.md:87-88 SKILL.md:88-89 SKILL.md:89-90 SKILL.md:90-91 SKILL.md:91-92 SKILL.md:92-93 SKILL.md:93-101 SKILL.md:101-103 SKILL.md:103-106 SKILL.md:106-111 SKILL.md:111-115 SKILL.md:115-117 SKILL.md:117-120 SKILL.md:120-125 SKILL.md:125-129 SKILL.md:129-136 SKILL.md:136-141 SKILL.md:141-145 SKILL.md:145-153 SKILL.md:153-154 SKILL.md:154-155 SKILL.md:155-156 SKILL.md:156-157 SKILL.md:157-163 SKILL.md:163-165 SKILL.md:165-181 SKILL.md:181-185 SKILL.md:185-193 SKILL.md:193-197 SKILL.md:197-199 SKILL.md:199-208 SKILL.md:208-210 SKILL.md:210-214 SKILL.md:214-216 SKILL.md:216-222 SKILL.md:222-227 SKILL.md:227-229 SKILL.md:229-237 SKILL.md:237 SKILL.md:237-238 SKILL.md:238-240 SKILL.md:240-245 SKILL.md:245-252 SKILL.md:252-254 SKILL.md:254-259 SKILL.md:259 SKILL.md:259-260 SKILL.md:260 SKILL.md:260 SKILL.md:260 SKILL.md:260-265 SKILL.md:265-267 SKILL.md:267-268 SKILL.md:268 SKILL.md:268-269 SKILL.md:269 SKILL.md:269-273 SKILL.md:273-274
🌐 网络访问 (13)
审计者: claude 查看审计历史 →

质量评分

41
架构
100
可维护性
87
内容
32
社区
99
安全
100
规范符合性

你能构建什么

为 RouterOS 定义容器应用

网络管理员编写 YAML,通过 /app 子系统在 MikroTik 路由器上部署包含 Grafana 和 Prometheus 的监控栈。

将 docker-compose 项目迁移到 RouterOS

开发者将现有的 docker-compose 配置适配为 RouterOS /app YAML 格式,调整端口语法并移除不支持的属性。

创建用于团队部署的应用商店

系统工程师构建包含预配置应用的 tikappstore YAML 文件,以便在多个 RouterOS 设备上一致部署。

试试这些提示

创建基本的 /app 定义
编写一个 RouterOS /app YAML 文件,在端口 8080 上运行 nginx 容器,并使用命名卷存储持久化数据。
将 docker-compose 转换为 RouterOS YAML
将此 docker-compose 文件转换为 RouterOS /app YAML 格式。标出不支持或行为不同的属性。
创建多服务应用
编写一个 RouterOS /app YAML,包含 Web 前端、PostgreSQL 数据库和 Redis 缓存。包含正确的卷挂载、网络隔离和健康检查。
构建应用商店文件
创建一个 RouterOS 应用商店 YAML 文件,包含三个应用:Web 服务器、数据库管理器和监控面板。每个应用都应具有适当的分类和元数据。

最佳实践

  • 始终使用 .tikapp.yaml 文件扩展名来命名自定义 RouterOS 应用定义,以区别于通用 YAML 文件。
  • 开发期间使用 *.editor.json schema 变体以获得更好的自动补全功能,部署前再针对 *.latest.json 进行验证。
  • 在部署到生产环境硬件之前,先在 RouterOS CHR 虚拟机上测试 YAML,以便尽早发现 schema 错误。

避免

  • 假设完全兼容 docker-compose。RouterOS /app 仅支持 compose 属性的子集,且某些属性的处理方式不同。
  • 使用 version 顶级键。RouterOS 会忽略此键,它在 /app YAML 中没有任何作用。
  • 在单个端口字符串中混用端口格式风格。每个端口条目必须 exclusively 使用旧 OCI 风格或新冒号风格之一。

常见问题

我需要什么版本的 RouterOS 才能使用 /app YAML?
/app 路径从 RouterOS 7.21 开始内置。通过 /app/add 创建自定义应用需要 RouterOS 7.22 或更高版本。此外还必须安装 container 额外软件包。
RouterOS /app YAML 与 docker-compose 相同吗?
不是。RouterOS /app YAML 看起来与 docker-compose 相似,但支持的属性更少。deploy 和 resources 等某些属性不受支持。端口映射语法也有所不同。
我应该为 /app YAML 文件使用什么文件扩展名?
单个应用定义使用 .tikapp.yaml,应用商店文件使用 .tikappstore.yaml。这些约定有助于工具和编辑器应用正确的 schema。
RouterOS YAML 中的占位符如何工作?
占位符如 [accessIP]、[accessPort]、[containerIP] 和 [routerIP] 会在部署时由 RouterOS 展开。它们出现在端口映射、环境变量值和配置内容中。
我可以使用小写名称的环境变量吗?
严格验证 schema 要求环境变量名称为大写,且匹配模式 [A-Z_][A-Z0-9_]*。如果需要混合大小写的变量名,请使用编辑器 schema 变体。
如何将自定义应用添加到 RouterOS?
使用 CLI 命令 /app/add,并通过 yaml-url 参数指向你的 YAML 文件 URL。或者,使用 REST API 的 PUT 端点 /app,在请求体中包含 yaml-url。

开发者详情

文件结构