luci-mod-system: make repokeys more future proof
authorPaul Donald <newtwen+github@gmail.com>
Thu, 29 Jan 2026 18:12:10 +0000 (19:12 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Thu, 29 Jan 2026 18:12:10 +0000 (19:12 +0100)
Detect future release key names based on pattern.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/repokeys.js

index d8870aaef403e6c2344c827c26f8963bbac99d4b..3a6c22ab2264acf6a413aab0e7ea362bc8fc9a38 100644 (file)
@@ -22,6 +22,10 @@ function isFileInSafeList(file){
        for (let name of safeList) {
                if (file === name)
                        return true;
+               if (file.toLocaleLowerCase().replace(/^openwrt-[0-9]+\.[0-9]+/i, '') !== file)
+                       return true;
+               if (file.toLocaleLowerCase().replace(/^openwrt-snapshots/i, '') !== file)
+                       return true;
        }
        return false;
 }