You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
/app YAML schema: add service dns and privileged - #125
Adds two service keys that RouterOS accepts but our /app YAML schemas rejected (services use additionalProperties: false):
dns (RouterOS 7.23+, changelog: app - allow parsing DNS in YAML). Raised on the forum in the /app manual thread, post #30. Not in MikroTik's YAML Field Reference.
privileged (RouterOS 7.25+, changelog: allow the privileged mode to be enabled per service in the container app YAML). Also not in the field reference.
How it was verified
CHR 7.25.2 and 7.26beta7 (x86, quickchr, container package + device-mode). Each variant was added as an app, enabled, and checked on the resulting /container entry and inside the container. RouterOS doesn't validate /app YAML when you add it (an unknown key zzz_unknown was accepted too), so being accepted at add time proves nothing.
YAML
Result on RouterOS
strict
editor
dns: [8.8.8.8], block list of two, dns: 8.8.8.8, dns: [9.9.9.9, 1.0.0.1], IPv6
/container dns= set, resolv.conf matches
pass
pass
dns: 8.8.8.8,1.1.1.1
silently dropped (router default DNS)
fail
pass
dns: [not-an-ip], dns: ["[routerIP]"]
silently dropped
fail
pass
fe80::1%ether1 (list or string), 0.0.0.0, ::, 010.000.000.001, 999.999.999.999
silently dropped
fail
pass
8.8.8
rewritten to 8.8.0.8
fail
pass
fe80::1, ::ffff:8.8.8.8
kept as written
pass
pass
list mixing a bad entry with 1.1.1.1
bad entry dropped, 1.1.1.1 kept
fail
pass
privileged: true / 'true'
privileged=true, /dev 405 entries
pass
pass
privileged: false / absent
privileged=false, /dev 18 entries
pass
pass
privileged: yes / maybe
silently privileged=false
fail
fail
Both versions behaved identically.
Schema notes
Strict dns uses a ^[0-9A-Fa-f.:]+$ pattern andanyOfipv4/ipv6 formats. The pattern is there because tikapp.html runs Ajv with unknownFormats: 'ignore', so formats alone would let comma strings through in the browser editor.
The editor schema keeps dns as a plain string or list of strings, so autocompletion isn't blocked. Its description explains what RouterOS ignores.
privileged is enum: [true, false, "true", "false"] in both. Quoted forms are allowed because RouterOS's YAML parser is string-typed (see the re-serialization note in CLAUDE.md).
Checks
All 204 built-in apps in docs/7.25.2/app.json and docs/7.26beta7/app.json pass both schemas.
bun test: 261 pass. bun run lint is clean.
Per-version docs/{version}/routeros-app-yaml-schema.json files aren't touched. CI regenerates them.
Both keys are accepted by RouterOS but were rejected by our schemas
(services have additionalProperties: false).
Verified on CHR 7.25.2 and 7.26beta7 by enabling apps and reading the
resulting /container entry:
- dns (7.23+, changelog "app - allow parsing DNS in YAML"): a single IP
or a list of IPs (v4/v6) becomes /container dns= and the container's
resolv.conf. Comma-joined strings, hostnames and [placeholders] are
silently dropped, so the strict schema rejects them.
- privileged (7.25+): true or 'true' sets /container privileged=true
(/dev goes from 18 to 405 entries). yes, maybe etc. silently leave it
unprivileged, so both schemas allow only true/false/'true'/'false'.
RouterOS does not validate /app YAML at add time (an unknown key is
accepted too), so these were checked on the running container, not on
/app/add acceptance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 79af93f4-8f97-40ab-bf6b-97bd5ca2263a
Commits
Reviewing files that changed from the base of the PR and between 820e7f0 and 1cede9f.
Files selected for processing: 3
app-yaml-schema.test.ts
docs/routeros-app-yaml-schema.editor.json
docs/routeros-app-yaml-schema.latest.json
No actionable comments were generated in the recent review.
Walkthrough
The service schemas add DNS and privilege properties. Enum completion removes duplicate values from the snippet choices.
Changes: Service schema properties
Layer / File(s)
Summary
Add DNS and privilege properties docs/routeros-app-yaml-schema.latest.json, docs/routeros-app-yaml-schema.editor.json
Both schemas add dns and privileged service properties. The latest schema constrains DNS values to IP addresses. The descriptions note RouterOS version requirements and unsupported-value handling.
Enum completion
Layer / File(s)
Summary
Deduplicate completion choices docs/tikapp.html
Enum values are deduplicated before they are joined into the completion snippet choices.
This change lets the app YAML schemas accept the dns and privileged service keys and removes duplicate editor completion choices. It is low impact and reads as safe to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "/app YAML schema: add service dns and privileged" matches the main change. The raw summary shows the schema files gaining the dns and privileged service properties, and the PR objectives co…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "/app YAML schema: add service dns and privileged" matches the main change. The raw summary shows the schema files gaining the dns and privileged service properties, and the PR objectives confirm that PR #125 adds these keys to the /app YAML service schemas. The title does not mention the tikapp.html enum de-duplication, but that is a minor secondary change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 4b7cc9d1-9ad3-4b44-985a-965d710b3dd2
Commits
Reviewing files that changed from the base of the PR and between c800bd3 and 820e7f0.
Files selected for processing: 3
docs/routeros-app-yaml-schema.editor.json
docs/routeros-app-yaml-schema.latest.json
docs/tikapp.html
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
- privileged: add "type": ["boolean","string"] so the WebMCP schema
outline tool no longer reports it as "object".
- strict dns: the pattern now requires canonical IPv4 octets (or an
IPv6-shaped string containing ':'). tikapp.html's Ajv 6 accepted
010.000.000.001 while CI's ajv-formats rejected it; the pattern no
longer depends on which format validator is in use.
- tikapp.html: de-duplicate enum choices in completion snippets, so
privileged offers true,false instead of true,false,true,false.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex (gpt-6.2-sol, high) review addressed in 820e7f0: privileged gets an explicit type (the WebMCP outline tool was reporting it as object); the strict dns pattern now requires canonical IPv4, so the browser and CI agree on 010.000.000.001; enum completion choices are de-duplicated in tikapp.html. Scoped IPv6 (fe80::1%ether1) is deliberately still rejected by the strict schema, since it's documented for /container dns= but untested through /app YAML.
Tested on CHR 7.25.2 and 7.26beta7: scoped IPv6 (fe80::1%ether1, as a
list item or a string), 0.0.0.0 and :: are all silently dropped from
/container dns=; plain fe80::1 and ::ffff:8.8.8.8 are kept; 8.8.8 is
rewritten to 8.8.0.8. A bad entry in a list is dropped on its own and
the rest kept. The strict schema already rejected the scoped, leading-
zero, out-of-range and three-octet forms; it now rejects 0.0.0.0 and ::
too. The descriptions in both schemas list what RouterOS ignores.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Edge cases tested on CHR 7.25.2 and 7.26beta7 in d7e696c. Scoped IPv6 (fe80::1%ether1) is silently dropped through /app YAML, so the strict schema is right to reject it. 0.0.0.0 and :: are also dropped, and the strict schema now rejects them too. The PR description table has the full set; the strict schema matches RouterOS on all 23 cases.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The schema additions lack test coverage for valid and invalid dns values and accepted privileged forms, leaving their behavior vulnerable to regression.
Updates the RouterOS /app YAML schemas to support service-level dns and privileged keys, while improving editor completion handling for duplicate enum values.
Changes:
Adds strict and editor-friendly definitions for dns and privileged.
Documents RouterOS-compatible DNS formats and privileged value forms.
Deduplicates enum choices in Monaco editor completions.
File
Description
docs/tikapp.html
Deduplicates enum values in generated YAML completion snippets.
docs/routeros-app-yaml-schema.latest.json
Adds strict schema definitions for service-level dns and privileged properties.
docs/routeros-app-yaml-schema.editor.json
Adds editor-friendly definitions and documentation for the new service-level keys.
Anchor tests for the cases checked on CHR 7.25.2 and 7.26beta7:
- both variants accept the dns forms RouterOS applies and the four
privileged forms it honors, and reject privileged yes/maybe/{};
- strict rejects every dns form RouterOS silently drops, both with
ajv-formats and without (tikapp.html has none), so the pattern is
covered on its own;
- editor still accepts those dns forms, documenting the relaxed variant.
Against main's schemas 33 of the new tests fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerate existing versioned schemas with the new properties
docs/routeros-app-yaml-schema.latest.json:332
These properties are added only to the root *.latest.json/editor schemas, but the public version-specific schemas remain generated snapshots. For example, docs/7.25/routeros-app-yaml-schema.json still has no dns or privileged, and auto.yaml dispatches appyamlschemas.yaml only when that file is missing, so existing 7.23+/7.25+ versioned URLs will continue rejecting the newly supported keys after this change. Please regenerate the affected versioned schemas (and their store schemas), or otherwise add a refresh path for existing versions; if older versions must remain strict, apply the RouterOS version cutoffs while doing so.
IPv6 pattern accepts malformed addresses
docs/routeros-app-yaml-schema.latest.json:344
This pattern is not a valid IPv6 validator. Because tikapp.html configures Ajv with unknownFormats: 'ignore' and does not add ipv4/ipv6 formats, the pattern is the only check in the browser; values such as ::::, 1:2:3:4:5:6:7:8:9, and 8.8.8.8: match it and are accepted even though RouterOS silently drops them. Please either provide the formats to the editor validator or tighten the schema/test cases so malformed colon-containing addresses are rejected.
tikapp.html loads Ajv 6.12.6, whose built-in ipv4/ipv6 formats apply
despite unknownFormats: 'ignore'. Checked with that exact build and
options: ::::, 1:2:3:4:5:6:7:8:9 and 8.8.8.8: are rejected. The test
comment wrongly said tikapp.html runs without formats.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IPv6 pattern in the browser: this premise doesn't hold. tikapp.html loads ajv@6.12.6, and Ajv 6 ships built-in ipv4/ipv6 formats that still apply with unknownFormats: 'ignore'. That option only affects formats Ajv doesn't know. I checked with that exact build and options: ::::, 1:2:3:4:5:6:7:8:9 and 8.8.8.8: are all rejected, along with every CHR-tested dropped form. 1cede9f adds those three as tests and corrects a test comment that had repeated the same wrong premise.
Stale per-version schemas: agreed, and that's planned for a follow-up PR after this merges. A plain regeneration isn't right everywhere. On a 7.24.7 CHR, dns works but privileged: true is silently ignored (the changelog dates it to 7.25). So 7.23.x/7.24.x need a version cutoff in appyamlvalidate.js, while 7.25.x/7.26 can be regenerated as-is. Scope is waiting on the maintainer.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The published per-version schemas remain stale, so selecting an existing RouterOS version will still reject the newly supported dns and privileged keys.
Regenerate existing versioned schemas with dns and privileged
docs/routeros-app-yaml-schema.latest.json:335
This updates only the root schemas, but the editor loads docs/{version}/routeros-app-yaml-schema.json for a selected version. Existing published schemas such as docs/7.25.2/routeros-app-yaml-schema.json still have no dns or privileged, so selecting that version continues to reject these keys. The automatic workflow dispatches regeneration only when a per-version schema is missing, so these existing files will not be refreshed by this PR; regenerate the published per-version schemas (or otherwise make the versioned schema update part of the rollout).
* Backfill /app schemas to long-term with dns and privileged
#125 added service dns and privileged to *.latest.json, but per-version
schemas are snapshots taken at build time and CI only writes missing
ones, so tikapp.html kept rejecting both keys for every published
version. Regenerate them back to the current long-term (7.24.x), per
the policy now written in CLAUDE.md.
- appyamlvalidate.js: SERVICE_PROPERTY_MIN_VERSION leaves a service
property out of per-version schemas below its RouterOS major.minor.
privileged is 7.25 (7.24.7 CHR: privileged: true still gives
/container privileged=false); dns is 7.23 (works on 7.24.7).
- Regenerated with `bun appyamlvalidate.js <v> --app-json
docs/<v>/app.json` for 7.24, 7.24.1-.7, 7.25, 7.25.1, 7.25.2 and
7.26beta1/3/4/5/7. Every version's own built-in apps pass. 7.24 through
7.24.5 also pick up the earlier #117 and #107 fixes they had missed.
Store schemas are unchanged. 7.25 betas/RCs are superseded and left as
published.
- Tests pin which keys each backfilled version has.
- Docs: backfill policy and procedure; INSPECTFILE still needs URLBASE
to answer the version call, with a working offline stub example.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address CodeRabbit: gate catalog keys at 7.25, reject all-zero dns
All three findings checked on CHR 7.24.7 and 7.25.2 (x86) first.
- supported-archs / compatible-boards are 7.25+. Through app-store-urls,
7.24.7 still lists an app restricted to arm64 or to board RDS2216;
7.25.2 hides it. appyamlvalidate.js gains APP_PROPERTY_MIN_VERSION
(top-level keys) beside SERVICE_PROPERTY_MIN_VERSION, so the 7.24.x
snapshots drop both keys. compatible-boards descriptions now say 7.25+.
- dns: 0:0:0:0:0:0:0:0 and ::0 are dropped like :: and 0.0.0.0 (::1 is
kept). The strict schema now rejects any string made only of 0, ':'
and '.' (every spelling of the unspecified address) instead of
listing two literals.
- CLAUDE.md stub example: kill the saved PID, not job %1.
All 15 backfilled versions are regenerated; each still passes its own
built-in apps. Tests cover the new dns spellings, ::1, and the catalog
keys per version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* AGENTS.md: per-version /app schemas need a backfill, not automatic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two service keys that RouterOS accepts but our
/appYAML schemas rejected (services useadditionalProperties: false):dns(RouterOS 7.23+, changelog:app - allow parsing DNS in YAML). Raised on the forum in the /app manual thread, post #30. Not in MikroTik's YAML Field Reference.privileged(RouterOS 7.25+, changelog:allow the privileged mode to be enabled per service in the container app YAML). Also not in the field reference.How it was verified
CHR 7.25.2 and 7.26beta7 (x86, quickchr, container package + device-mode). Each variant was added as an app, enabled, and checked on the resulting
/containerentry and inside the container. RouterOS doesn't validate/appYAML when you add it (an unknown keyzzz_unknownwas accepted too), so being accepted at add time proves nothing.dns: [8.8.8.8], block list of two,dns: 8.8.8.8,dns: [9.9.9.9, 1.0.0.1], IPv6/container dns=set, resolv.conf matchesdns: 8.8.8.8,1.1.1.1dns: [not-an-ip],dns: ["[routerIP]"]fe80::1%ether1(list or string),0.0.0.0,::,010.000.000.001,999.999.999.9998.8.88.8.0.8fe80::1,::ffff:8.8.8.81.1.1.11.1.1.1keptprivileged: true/'true'privileged=true,/dev405 entriesprivileged: false/ absentprivileged=false,/dev18 entriesprivileged: yes/maybeprivileged=falseBoth versions behaved identically.
Schema notes
dnsuses a^[0-9A-Fa-f.:]+$pattern andanyOfipv4/ipv6formats. The pattern is there becausetikapp.htmlruns Ajv withunknownFormats: 'ignore', so formats alone would let comma strings through in the browser editor.dnsas a plain string or list of strings, so autocompletion isn't blocked. Its description explains what RouterOS ignores.privilegedisenum: [true, false, "true", "false"]in both. Quoted forms are allowed because RouterOS's YAML parser is string-typed (see the re-serialization note in CLAUDE.md).Checks
docs/7.25.2/app.jsonanddocs/7.26beta7/app.jsonpass both schemas.bun test: 261 pass.bun run lintis clean.docs/{version}/routeros-app-yaml-schema.jsonfiles aren't touched. CI regenerates them.🤖 Generated with Claude Code
Summary by CodeRabbit
privilegedsetting, its accepted values, and RouterOS compatibility behavior.