Open jsaarija opened 2 months ago
What's the use case for fetching the manifest? If you have access to the window.cockpit
object you can query the manifests there as window.cockpit.manifests
.
The Python bridge removed manifest.json and replaced it with manifests.js.
In my use case I often have several copies of the same package installed in a Cockpit environment -- say, for example, that I have packages package-dev and package-prod in this case and they really only differentiate by the contents of their manifest.json file and the directory they're in. I've used the manifest file to have instance-specific attributes (such as a relevant backend server port number for either prod or dev) that each instance of the package has been able to read by just handily reading its own manifest.json file. Reading these same values from manifests.js (or manifests.json) does not seem to be very straightforward, though, as it seems there's no easy way for the package to know which manifest it actually needs to read when there's multiple copies of it installed in Cockpit.
This is a bit of legacy code from the earliest days of the package and these days the package code itself already reads a separate configuration JSON file for other use cases, so I believe I can just move the custom fields that are now in manifest.json to over there instead. However if this deprecation of loading the manifest.json directly is intended behavior then the documentation should probably be updated?
Explain what happens
I'm fetching
manifest.json
in my Cockpit package code according to related documentation:This used to work fine in Cockpit 264 (Ubuntu 20.04.6 LTS) but now in 314 (Ubuntu 24.04.1 LTS) trying to fetch
manifest.json
fails with 404 and returns a "Not found" HTML page instead:Fetching any other files from the same directory works fine with no issues whatsoever. Likewise fetching
../manifests.json
or../manifests.js
work both just fine.Is there something I'm possibly missing here, or has something broken or changed in fetching manifest.json files directly and possibly not reflected in the documentation?
Version of Cockpit
314
Where is the problem in Cockpit?
None
Server operating system
Ubuntu
Server operating system version
24.04.1 LTS
What browsers are you using?
Chrome
System log