kolibri
kolibri copied to clipboard
Content Import from a peer Kolibri server does not allow access to private channels via "token"
Observed behavior
On the Device > Channels page, if you try to import content from a peer Kolibri server on the internet/LAN, the button to import using a "token" isn't available due to this line here
https://github.com/learningequality/kolibri/blob/ea04da8dc3a1d2646ab584d91145b08be274639a/kolibri/plugins/device/assets/src/views/AvailableChannelsPage/index.vue#L234-L237
This was intentional at the time, and you can see that the option to import private channels was only recently extended from importing from Kolibri Studio to Studio-like devices on a different domain.
Expected behavior
It's possible that certain use cases might require import private channels from Kolibri servers either individually (possible through the "channel token" modal) or in bulk (only possible if you enter each of the tokens first while in the "import whole channels" mode of the page).
It should be possible to see if a peer Kolibri has a private channel as long as it exposes this public/v1/channels/lookup endpoint
https://github.com/learningequality/kolibri/blob/ea04da8dc3a1d2646ab584d91145b08be274639a/kolibri/core/public/api.py#L97-L105
A quick way, but maybe not super robust way to make this work is to add code to the newest versions of Kolibri to return this.isStudioApplication = true
User-facing consequences
Errors and logs
Steps to reproduce
Try to import channels from a peer device
Context
…
this has been requested on a few occasions
The exported Kolibri channel has no knowledge of tokens, so this would require that we include the channel token in the published metadata.
@rtibbles is this something that is would be worth slating for 0.16?
We'd need to do some work on Studio as well to include tokens in the published channels.
The other slight complication that would not make it completely parallel is that tokens can also refer to collections, not just to channels - but we currently have no mechanism for importing 'collections' into Kolibri, only the individual channels within the collection.
So it might be feasible to do this just for channel tokens, but not for collection tokens.