Skip to content

feat: dynamic OS codename resolution for plugin repo sources#2069

Open
cyrus104 wants to merge 1 commit intoRaspAP:masterfrom
cyrus104:feat/plugin-vars-dynamic-codename
Open

feat: dynamic OS codename resolution for plugin repo sources#2069
cyrus104 wants to merge 1 commit intoRaspAP:masterfrom
cyrus104:feat/plugin-vars-dynamic-codename

Conversation

@cyrus104
Copy link

Summary

  • Add config/plugin_vars.json to map manifest tokens to system values read from /etc/os-release, enabling plugins to reference the host Debian codename without hardcoding it
  • Extend PluginInstaller.php with loadVariableMap() and resolveManifestVariables() to substitute tokens across the entire manifest at install time, including the content of local .list repo files
  • Extend plugin_helper.sh keys action to accept a local file path (in addition to a URL) as the repo argument, with token substitution already applied by the PHP layer

Motivation

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 .list file, breaking installs on any other Debian release. This change lets the installer resolve the correct codename at runtime from /etc/os-release.

Files Changed

File Change
config/plugin_vars.json New — maps REPLACEME_CODENAMEVERSION_CODENAME from /etc/os-release
installers/plugin_helper.sh keys action now accepts local file path; adds pipefail and mkdir -p for keyring dir
src/RaspAP/Plugins/PluginInstaller.php Adds loadVariableMap(), resolveManifestVariables(), local repo file token substitution, and temp file cleanup

Test Plan

  • Install a plugin with a keys entry using a local .list file containing REPLACEME_CODENAME on Debian Bookworm — verify codename resolves correctly
  • Install a plugin with a keys entry using a local .list file containing REPLACEME_CODENAME on Debian Trixie — verify codename resolves correctly
  • Install a plugin with a URL-based keys entry — verify existing URL-based flow is unaffected
  • Verify temp .list files in /tmp/ are cleaned up after install (success and failure)
  • Verify plugin_vars.json missing or empty — confirm installer proceeds without error

🤖 Generated with Claude Code

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant