Add support for third-party (Community) DNS App repositories#2063
Open
Hemsby wants to merge 9 commits into
Open
Add support for third-party (Community) DNS App repositories#2063Hemsby wants to merge 9 commits into
Hemsby wants to merge 9 commits into
Conversation
Adds an opt-in "Third Party" sub-tab under Apps for browsing and installing DNS apps from admin-added repository URLs, alongside the existing official DNS App Store. A repository is a JSON manifest in the same schema the official store already uses. - DnsApplicationManager: persists repository URLs to a new appRepositories.config file, fetches/caches each repo independently with per-repo error isolation (one bad repo can't break the list) - New endpoints: apps/repositories/list, apps/repositories/add, apps/repositories/remove - Existing Apps tab, official store, and install/update/uninstall endpoints are unchanged
Matches Synology Package Center's pattern: a repository is now added with a Name + URL pair (name optional, falls back to the URL) instead of a bare URL, so the UI can show a friendly label. Bumped the repo config file to format version 2, with a version-gated fallback to read pre-existing v1 (URL-only) entries. Renamed the "Third Party" tab/identifiers to "Community" throughout the frontend to match the Synology terminology this feature is modeled on.
A repository whose manifest is a single bare app object (as some single-app repositories publish, e.g. the schema used in TechnitiumSoftware#2058) previously crashed the entire repositories/list call at EnumerateArray() on the object root, taking down every other configured repository's listing along with it. The per-repo try/catch around JsonDocument.Parse never caught this, since Parse succeeds on a valid object and the failure happened later in a separate, unguarded loop. Now the root shape is checked right after parsing (array or object both accepted; anything else is a per-repo error, same as invalid JSON) and each individual app entry is processed in its own try/catch so one malformed entry can't take down its siblings or the repo.
Confirmed with user: community/third-party repo apps deliberately do not participate in the existing automatic update timer, which only checks the official DNS App Store. Documented this as an intentional scope decision rather than a silent gap.
Clicking the top-level Apps tab left whichever sub-tab (Installed or Community) was last active, unlike other tabbed sections which reset to their first pane. Now it always shows Installed apps first.
…repository manifests Community-installed apps share the same Installed Apps table as official store apps. Cross-references api/apps/repositories/list (already tracks per-app installed state for the Community tab) against api/apps/list purely client-side to flag matching rows, so official app rendering, apps/list, and the install/update/uninstall endpoints are untouched. Also adds CommunityAppRepositories.md documenting the manifest schema for admins installing community apps and authors publishing them.
Community-installed apps previously required manual updates. Adds a separate dnsAppsEnableAutomaticUpdateCommunity setting and daily timer, independent of the official DNS App Store's dnsAppsEnableAutomaticUpdate, so disabling one has no effect on the other. Persisted in the existing appRepositories.config file (bumped to v3) rather than the core dns.config. Also relabels the three Software Update checkboxes in Settings to be explicit about which update path each one controls (Core DNS Server, Official Apps, Community Apps), and updates APIDOCS.md and CommunityAppRepositories.md accordingly.
Community tab (repository management + browsing), the Community badge in the shared Installed Apps list, and the relabeled Software Update settings.
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
Adds support for community (third-party) DNS App repositories, so apps that the official DNS App Store can't accept get a distribution path of their own. See #2058, where a UniFi Insights Exporter submission was declined because it needs hardware the maintainer can't test against, with a note that proper multi-repository support is planned but not imminent.
{name, description, versions[]}entries, or a single bare object). Each repository is fetched and cached independently; one bad/unreachable repo doesn't affect the others.apps/repositories/list,apps/repositories/add,apps/repositories/remove. Existing endpoints (apps/list,apps/install,apps/uninstall,apps/downloadAndInstall,apps/downloadAndUpdate) are untouched, community installs reuse them as-is.apps/repositories/list's installed-state againstapps/list. No backend changes needed for this.dnsAppsEnableAutomaticUpdateCommunity(default off) with its own daily timer, separate from the official store'sdnsAppsEnableAutomaticUpdate. Toggling one has no effect on the other. Persisted in a newappRepositories.configfile rather than the coredns.config.Core DNS Server/Official Apps/Community Apps) instead of the previous ambiguous shared wording.CommunityAppRepositories.md: documents the manifest schema, version-resolution rules, and trust model for both admins installing community apps and authors publishing them (nothing like this existed for the official store's schema either, so it's net-new documentation).APIDOCS.mdupdated for all of the above.Screenshots
Community tab, repository management and browsing:

Community badge in the shared Installed Apps list:

Settings, relabeled Software Update checkboxes:

Testing
Built and deployed to a private test server, exercised through the live API and web console rather than just compiling:
dnsAppsEnableAutomaticUpdateCommunityisfalseby default, flips independently ofdnsAppsEnableAutomaticUpdate, and persists correctly across a full service restart.error, other repositories keep working) and don't crash the listing.Notes for reviewer
DnsApplicationManager.csorWebServiceAppsApi.cswas modified. This is additive. The one exception isrefreshApps()/getAppRowHtml()inapps.js, which needed a small, backward-compatible parameter addition to support the badge.develop(63ecf6f2) before opening this PR.