How to upload content to the Contenthub

#1

The information below is also included in the user manual for firmware 8.0.

Contenthub

Integrated into MediaFast-enabled routers, ContentHub allows you to deliver web-pages and applications using the local storage on your router.
Users will be able to access news, articles, videos, and access your web app, without the need for internet access.

ContentHub Storage needs to be configured before content can be uploaded to the ContentHub.
Follow the link on the information panel to configure storage.


To access ContentHub, navigate to Network > ContentHub and check the Enable box.:


On an external server configure content (a website or application) that will be synced to the ContentHub; for example a html5 website.
To configure a website or application as content follow these steps.

Configure a website to be published from the contenthub

This option allows you to sync a website to the Peplink router, this website will then be published with the specified domain from the router itself and makes the content available to the client via the HTTP/HTTPS protocol.
Only FTP sync is supported for this type of Contenthub content.
The content should be uploaded to an FTP server before you sync it with the Contenthub.
Click New Website, and the following configuration options will appear:


The Active checkbox toggles the activation of the content.
For type, select Website.

Options
Protocol HTTP,HTTPS or both
Domain/Path The contenhub uses this as the domain name for client access (such as http://mytest.com).
Source Enter the server details that the content will be downloaded from. Enter your credentials under Username and Password.
Period This field determines how often the Router will search for updates to the source content.
Method Only applicable for application: Choose between sync or file upload
Bandwidth Limit Used to limit the bandwidth for each client to access the web server.

Click “Save & Apply Now” to activate the changes. Below is a screenshot after configuration:


The content will be synced based on the Period that is configured before.
If you want to trigger the sync manually, you can click image
The “Status” column shows the sync progress.
When the sync is completed, you’ll sees a summary as shown in the screenshot below:

To access the content, open a browser in MFA’s client and enter the domain configured before (such as http://mytest.com).

Configure an application to be published from the contenthub

Mediafast Routers allow you to configure and publish ant application from the router itself by using the supported framework

  • Python (version 2.7.12)
  • Ruby (version 2.3.3)
  • Node.js (version 6.9.2)

First install the desired framework in “Package Manager” as below:

After installing the framework, you can select the type to “Application” and configure the website:

The setting is same as Website type and you can refer to the description in the above section
For the Application type, you need to pack your application as below:

  1. Implement two bash script files, start.sh and stop.sh in root folder, to start and stop your application. the Mediafast router will only execute start.sh and stop.sh when the corresponding website is enabled and disabled respectively.
  2. Compress your application files and the bash script to .tar.gz format.
  3. Upload this tar file to the router.
3 Likes