Kobra is a database backend for Kolibre-KADOS with a REST API for managing the database. The database models created by Kobra has been designed to support both versions of the Daisy Online Devlivert Protocol and all features of the protocals. Kolibre-KADOS togethet with Kobra can thus act as isolated solution to deliver content to clients.
Supported database are:
The REST API is a JSON based with standard return codes. For examples on how to use the API with curl, see the script in [kados-demo]https://github.com/kolibre/kados-demo.
Kobra does not offer any authentication for the endpoints. Instead it's recommended to only expose the REST API on a private network. If that is not possible, authentication such as IP whitelisting or basic authentication is recommended to configure on top of Kobra.
The database is setup with a set of constant values required when interacting with other endpoints.
Returns the available categories for daisy books.
Returns the availble daisy formats for daisy books.
Returns the available content lists.
Returns the available states for a content.
Retuns the available questions types for dynamic menus.
Endpoints to add/update users and show status.
Add a new user.
Parameters:
Returns info about the user as well as it's current bookshelf.
Endpoint to add/delete content. Kobra does not provide any validation on contents so the user is expceted to validate daisy book before adding it and uploading resources.
Add a new content.
Parameters:
Delete a content and all its metadata, audios and resouces.
Returns the content and all its metadata, audios and resources
Add metadata for a content.
Parameters:
Upload an audio file for a content.
Parameters:
Upload a resource for a content.
Parameters:
Add a content to a user's bookshelf.
Parameters:
Add a content to one more more users' bookshelf.
Remove a content from one more more users' bookshelf.
Parameters:
The endpoints to manage terms of service are not yet implemented.
The endpoints to manage announcements are not yet implemented.
The endpoints to manage bookmarks are not yet implemented.
The endpoints to manage dynamic menus are not yet implemented.
This application is only targeted for running in docker and images are available at https://hub.docker.com/r/kolibreorg/kobra.
Running the image requires setting the following environment variables
The provided docker-compose file illustrates an example how to run the application with a PostgresSQL database and a Nginx serving uploaded files. It's not recommended to use the example for production use.
$ docker-compose up -d
$ docker build -t kobra .
$ docker run -it --rm -e SECRET_KEY=your-own-secret STORAGE_PATH=/tmp DATABASE_URL=sqlite3:/usr/src/app/db/prod.sqlite3 kobra
Start by deleting the .dockerignore file. This is needed so tests are added to the image and can be executed inside the image. In future version of docker it will be supported to declare ignore files for a specific Dockerfile and this step won't be needed.
$ docker build -t kobra:dev . -f Dockerfile.dev
Now run the image and mount the current directory inside the image
$ docker run -it --rm -v ${PWD}:/usr/src/app -p 127.0.0.1:3000:3000 kobra:dev
You can now edit files in your editor on the docker host and run tests, migrations etc inside the image. You can also start the application inside the image and connect to it from the docker host using http://localhost:3000
Content type
Image
Digest
sha256:b77dd21e0…
Size
375.4 MB
Last updated
over 1 year ago
docker pull kolibreorg/kobra