feat: dynamic OS codename resolution for plugin repo sources#2069
Open
cyrus104 wants to merge 1 commit intoRaspAP:masterfrom
Open
feat: dynamic OS codename resolution for plugin repo sources#2069cyrus104 wants to merge 1 commit intoRaspAP:masterfrom
cyrus104 wants to merge 1 commit intoRaspAP:masterfrom
Conversation
Introduce config/plugin_vars.json to map manifest tokens to system values read from /etc/os-release. PluginInstaller now resolves tokens in local .list repo files before passing them to plugin_helper.sh, enabling plugins like Docker to target the correct apt repository for any Debian-based OS without hardcoding a codename. Extend plugin_helper.sh keys action to accept a local file path (in addition to a URL) as the repo argument. Also add pipefail and automatic keyring directory creation for robustness.
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
config/plugin_vars.jsonto map manifest tokens to system values read from/etc/os-release, enabling plugins to reference the host Debian codename without hardcoding itPluginInstaller.phpwithloadVariableMap()andresolveManifestVariables()to substitute tokens across the entire manifest at install time, including the content of local.listrepo filesplugin_helper.shkeysaction to accept a local file path (in addition to a URL) as therepoargument, with token substitution already applied by the PHP layerMotivation
Plugins like Docker reference a Debian-specific apt repository (
https://download.docker.com/linux/debian <codename> stable). Previously this required hardcoding a release name (e.g.bookworm) in either the manifest or the.listfile, breaking installs on any other Debian release. This change lets the installer resolve the correct codename at runtime from/etc/os-release.Files Changed
config/plugin_vars.jsonREPLACEME_CODENAME→VERSION_CODENAMEfrom/etc/os-releaseinstallers/plugin_helper.shkeysaction now accepts local file path; addspipefailandmkdir -pfor keyring dirsrc/RaspAP/Plugins/PluginInstaller.phploadVariableMap(),resolveManifestVariables(), local repo file token substitution, and temp file cleanupTest Plan
keysentry using a local.listfile containingREPLACEME_CODENAMEon Debian Bookworm — verify codename resolves correctlykeysentry using a local.listfile containingREPLACEME_CODENAMEon Debian Trixie — verify codename resolves correctlykeysentry — verify existing URL-based flow is unaffected.listfiles in/tmp/are cleaned up after install (success and failure)plugin_vars.jsonmissing or empty — confirm installer proceeds without error🤖 Generated with Claude Code