Skip to content

Deploying Custom html pages and images

bvinayakumar edited this page Dec 28, 2018 · 7 revisions

Sunbird supports configuration of multiple tenants (or channels) in a single instance. Each tenant can deploy their custom home page, logo and favicon to be displayed in portal and mobile app for users of that tenant.

Packaging

  • Create a folder for each tenant. The folder should have the channel name of the tenant as the folder name.
  • Custom html and images of the tenant should be copied to the above folder as per the below specifications:
    • The home page html file should be named "index.html". All the dependent files (like js, css and images) used by the home page should be either
      • within the package and referred using relative paths from "index.html"
      • or hosted in a CDN and referred by the full CDN URL from the html files
    • The logo of the tenant should be with the name "logo.png" (max width, height should be 200px, 80px)
    • Optionally, tenants can also configure the following:
      • an icon (to be displayed as browser favicon) which should be named as "favicon.ico"
      • poster image (to be used as flash screen in the mobile app) which should be named as "poster.png"
      • "Help" menu for users with Workspace access i.e. CONTENT_CREATOR, COURSE_MENTOR, CONTENT_REVIEWER, TEXTBOOK_REVIEWER, TEXTBOOK_CREATOR

Deployment

The above package should be placed inside a folder named tenant. Find below example package structure of tenant (sunbird_1 is the channel name of the tenant) specific custom home page and images:

Docker deployment

If sunbird portal is deployed using docker, the custom package of the tenant (e.g. sunbird_1) should be copied to a extensions folder (e.g. /data/extensions/tenant) on the docker swarm nodes and the volume should be mounted on the docker container. Please refer this wiki for instructions on configuring the mount volume.

Non-Docker deployment

If running the sunbird portal as node.js application directly on the VM, the package (e.g. sunbird_1 folder) should be copied to <app>/tenant folder.

Accessing the custom home page

Once the sunbird services are set up, navigate to https://sunbird.example.com/sunbird_1 (Assuming you've set up sunbird on sunbird.example.com) to access the custom home page.

To use a tenant's custom home page & logo as default home page & logo for your sunbird installation, the variable sunbird_default_tenant in -devops/ansible/inventories//group_vars/ should be updated to use the tenant's channel name.

For example, set sunbird_default_tenant: sunbird_1 and re-deploy the portal service. https://sunbird.example.com/ will now display the custom home page configured for the tenant sunbird_1.