Plugin custom configuration system with granular admin override controls - #70
Plugin custom configuration system with granular admin override controls#70ChandlerMoeller wants to merge 21 commits into
Conversation
…section info from all sections
|
Sorry to prod again - are we any closer with this PR 🙏 super excited by it and kinda waiting for it to be merged before making a start on some other things |
|
I've done the process to try and resolve the issues and merged it into the experimental branch. There are issues that I'm sure you're aware of, if you're around to take a look it'd be greatly appreciated, otherwise I'll start having a look over the week and trying to resolve some of the issues :) |
|
Hi, sorry for my disappearance and not circling back after you merged this into the experimental branch. Life got busy. You were right there were issues, the 2 big ones that got me were the config ui and trying to wrangle the json per-user backend read/writes. Glad to see the per-section settings is landing in v12! Rather than trying to revive this, I would like to close this draft and contribute some (much smaller) PRs on top of your implementation in v12, if that's welcome. A few things I had in mind:
If that sounds good, since Jellyfin is moving towards EFCore, would you prefer I match that or keep it slightly simpler with plain Microsoft.Data.sqlite?
Totally understand if you already have a plan or direction for the custom config system that I'm not aware of, it has been awhile. |
All good! Life happens.
I think this makes a lot of sense for sure!
Yeah this is fine
As things stand I've not been able to get plugin pages to work on v12 so haven't done anything with user side config yet, its definitely worth supporting and the page itself will remain the same so if you want to adapt this into user configurability etc then feel free. Yes please to EF Core.
Yep this makes a lot of sense to do as well |
|
With all your PRs please base them against the v12 branch rather than main since I won't be merging for a little while |
Sorry for the very large PR. Over the next few days I will work to split off different parts into smaller PRs.
Main Feature: Plugin-extensible Custom Configuration System
This PR introduces a flexible configuration system that allows home screen sections to define their own custom settings. Individual sections can now register configuration options that appear in both the admin interface and user settings, enabling fine-tuned control over section behavior.
The system supports several configuration input types:
Each section can define which options are available to administrators versus regular users, providing appropriate access controls. This extensible approach means new sections can easily add their own configuration without requiring changes to the core plugin structure.
Additionally, synthetic options are automatically added to every section. This means all sections, whether built-in or externally registered, automatically inherit core functionality without requiring any additional configuration from the section implementation:
Main Feature: Granular Admin Override Controls
Administrators now have fine-grained control over which configuration options users can modify. For each section and each individual setting within that section, admins can decide whether to allow user overrides or enforce server-wide defaults.
The permission system operates through layered controls:
Options that sections explicitly mark as non-user-overridable do not appear in the admin interface for permission control. These options, whether restricted by the section definition or by admin configuration, are completely hidden from users and remain server-controlled.
User defaults are automatically inherited from admin-configured values. When a user first accesses their settings, all options start with the values set by the administrator. Users can then modify only the options they have permission to change, while locked options remain at the admin-set values across all users.
Secondary Feature: Section Info
Sections can now provide optional metadata to help administrators and users understand their purpose and source. This information appears in the admin interface and provides context for each section.
The Section Info system includes:
Sections cannot specify arbitrary URLs. Instead, they provide platform, username, and repository details, and the system generates proper source control links. If we would prefer, this can be switched to allow arbitrary URLs.
More External Section Plugin Support
This update expands the existing external plugin registration system to support the new custom configuration and section info capabilities. External plugins can now take advantage of the enhanced configuration system without any breaking changes to their existing integration.
New Readiness API
A new
/HomeScreen/Readyendpoint allows external plugins to verify that the home screen system is fully initialized before attempting section registration. This endpoint returns HTTP 200 when ready or HTTP 503 when not ready. If used, this should fix a startup race condition causing external plugins to not register. (Resolves: IAmParadox27/jellyfin-plugin-collection-sections#4)Expanded Configuration Support
External sections can now include custom configuration options when registering sections. The existing registration API accepts additional metadata for configuration options and section info, allowing external plugins to define dropdown menus, text boxes, number boxes, and checkboxes with validation rules. Each option can be marked as user-overridable or admin-only, with advanced options automatically grouped separately.
Collection Sections Plugin Updates
External sections will work as-is without any changes as the new capabilities are optional. The existing Collection Sections plugin PR is for testing and demonstrating how an external plugin can use these new features.
That PR adds section info as well as new configurations for:
In addition the synthetic options "Custom Display Name" and "Section Header Display" are automatically added without any changes from the collections plugin.
It also uses the new
/HomeScreen/Readywhich resolves IAmParadox27/jellyfin-plugin-collection-sections#4Admin Configuration
User Configuration
Other features added
TODO