Getting Started

Prerequisites

TIP

Installation

This section will help you setup a basic MediaDB API from ground up.

  • Step 1: Configure environment

Setup a basic environment using the given examplesopen in new window.

  • Step 2: Clone the repository
cd /var/www/html
git clone git@github.com:francoism90/mediadb.git api
1
2
  • Step 3: Initialize Laravel
cd api
cp .env.example .env
vi .env
composer install
php artisan key:generate
php artisan horizon:install
php artisan telescope:install
php artisan migrate --seed
php artisan storage:link
php artisan scout:create-indexes
1
2
3
4
5
6
7
8
9
10

TIP

  • Replace .env.example with .env.sail.example to configure Laravel Sail.
  • Replace vi with your favorite editor.
  • Check all configuration files and change them when necessary, especially .env, config/api.php and config/filesystems.php.
  • Step 4: Configure Laravel & nginx

Update .env:

DASH_URL=https://mediadb.test
DASH_KEY=d5460ef7a5c2bece2d1b24e0d9959e5ea9beb9dd449080147bdba001e9106793
DASH_IV=722d4f9191c53d5e934e13719d02cced
1
2
3

Update /etc/nginx/sites/mediadb-vod.conf:

vod_base_url "https://mediadb.test";
vod_segments_base_url "https://mediadb.test";
vod_secret_key "randomstring-$vod_filepath";

secure_token_encrypt_uri_key d5460ef7a5c2bece2d1b24e0d9959e5ea9beb9dd449080147bdba001e9106793;
secure_token_encrypt_uri_iv 722d4f9191c53d5e934e13719d02cced;
1
2
3
4
5
6

TIP

  • One may use dd if=/dev/urandom bs=1 count=32 2> /dev/null | xxd -p -c32 to generate the DASH_KEY/DASH_IV values.

MediaDB will now listen at https://localhost:3000open in new window and https://mediadb.test/apiopen in new window.

By now, you should have a basic but functional MediaDB API. Next, learn about the basics of configuration and usage of MediaDB.

Last Updated:
Contributors: francoism90, François M