Repository navigation
fix(frontend): parse service configs with a spec-compliant TOML library - #122
Merged
Merged
Conversation
The Services page's config editor used toml-js 0.0.8, which corrupts
configs on save:
- it strips all whitespace from every line before parsing, so string
values lose their spaces ("ops team@x" saves back as "opsteam@x");
- it cuts each line at the first '#', even inside a string, so a value
containing '#' no longer parses and the editor opens empty;
- a comment line after a [table] header ends the table, so the keys that
follow are read as top-level keys. With the shipped logloader.toml,
opening the editor and pressing Save without changing anything drops
[data], [download] and [upload] and moves their keys to the top level,
where logloader does not read them: it falls back to its defaults,
including a data directory under the service user's home.
Switch to smol-toml (TOML 1.0), which parses all of these correctly and
whose output python's toml (merge_configs.py) and the services read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dakejahl
added a commit
that referenced
this pull request
Oct 23, 2026
The web UI can control any service that has a manifest, so an add-on needs no polkit rule (or sudoers entry) of its own. Remove the example's rule and the README's polkit section, and say that the manifest is what lets the web UI control the service. Also drop the caveat about the config editor stripping whitespace from strings; #122 fixes the parser. 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The config editor on the Services page used
toml-js0.0.8. That parser corrupts configs when they're saved. This PR replaces it withsmol-toml, a TOML 1.0 parser. The change is three lines inTomlEditor.vueplus the dependency swap.What toml-js got wrong
email = "ops team@example.com""opsteam@example.com".api_key = "abc#123"#, even inside quotes[table]headerThe third row affects a shipped config. In the UI on
main, opening the logloader editor and pressing Save without changing anything deletes[data],[download]and[upload]and moves their keys to the top level:logloader reads those keys only inside their sections, so after that save it falls back to its built-in defaults. Its data directory moves to
~/.local/share/ark/logloader/under the service user's home instead of/var/lib/ark-os/logs/. Changes the operator makes to the download settings, or to the remoteapi_key, have no effect.Testing
I tested with the x86 harness (
test/), driving headless Chrome through the real Services page:main: reproduced the logloader save above.logloader.tomlare identical to the shipped file, and every section renders with its own fields.ops team@example.comandk3y#with spaces "q"intoupload_remote.emailandupload_remote.api_key, saved, reopened, and saved again. Both values were saved and read back exactly.main, including the_optionsdropdowns and dds-agent's conditional fields. No console errors.packaging/config/*.tomlkeeps its values throughsmol-toml's parse → stringify. The output also loads with Pythontoml0.10.2, whichmerge_configs.pyuses on upgrade.vue-cli-service lintpasses, andvue-cli-service buildsucceeds.Not changed
1.0is saved as1. So this isn't a regression, and none of the shipped configs has a float.🤖 Generated with Claude Code