技能 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」。 為居家助理容器建立 /app YAML,在連接埠 8123 上進行持久化儲存

預期結果:

  • 一個包含名稱、服務、磁碟區和網路區段的 YAML 檔案。
  • 網頁服務使用 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 格式,調整連接埠語法並移除不支持的屬性。

為團隊部署建立 app store

系統工程師建立一個 tikappstore YAML 檔案,其中包含預先配置的應用程式,以便在多個 RouterOS 裝置上一致部署。

試試這些提示

建立基本的 /app 定義
撰寫一個 RouterOS /app YAML 檔案,在連接埠 8080 上執行 nginx 容器,並使用命名磁碟區來持久化資料。
將 docker-compose 轉換為 RouterOS YAML
將此 docker-compose 檔案轉換為 RouterOS /app YAML 格式。標註任何不支持或行為不同的屬性。
建立多服務應用程式
撰寫一個包含網頁前端、PostgreSQL 資料庫和 Redis 快取的 RouterOS /app YAML。包含適當的磁碟區掛載、網路隔離和健康檢查。
建立 app store 檔案
建立一個包含三個應用程式的 RouterOS app store YAML 檔案:網頁伺服器、資料庫管理員和監控儀表板。每個都應有適當的分類和中繼資料。

最佳實務

  • 始終使用 .tikapp.yaml 副檔名來表示自訂 RouterOS 應用程式定義,以便與通用 YAML 檔案區分。
  • 在開發期間使用 *.editor.json 結構變體以獲得更好的自動完成,然後在部署前根據 *.latest.json 進行驗證。
  • 在部署到正式作業硬體之前,先在 RouterOS CHR 虛擬機器上測試 YAML,以提早發現結構錯誤。

避免

  • 假設完全相容於 docker-compose。RouterOS /app 只支援 compose 屬性的子集,有些屬性的處理方式也不同。
  • 使用 version 頂層金鑰。RouterOS 會忽略此金鑰,在 /app YAML 中沒有任何用途。
  • 在單一連接埠字串中混合連接埠格式樣式。每個連接埠項目必須專門使用舊版 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,app store 檔案使用 .tikappstore.yaml。這些慣例可幫助工具和編輯器套用正確的結構。
佔位符在 RouterOS YAML 中如何運作?
[accessIP]、[accessPort]、[containerIP] 和 [routerIP] 等佔位符會在部署時由 RouterOS 展開。它們會出現在連接埠對應、環境值和配置內容中。
我可以使用小寫環境變數嗎?
嚴格驗證結構要求大寫環境變數名稱,符合模式 [A-Z_][A-Z0-9_]*。如果您需要混合大小寫的變數名稱,請使用編輯器結構變體。
如何將自訂應用程式新增至 RouterOS?
使用 CLI 命令 /app/add 並搭配 yaml-url 參數指向您的 YAML 檔案 URL。或者,使用 REST API PUT 端點 /app 並在請求主體中包含 yaml-url。

開發者詳情

檔案結構