DOWNLOAD Ministra Vod + Pvr Server Configs

Gizmo

Well-known member
Joined
Jun 8, 2021
Messages
523
Awards
4
Offline
So I don't suspect this is really that relevant for an active environment but looks like a fun build to try for #&#+$ and giggles unfortunately it is a bit over my head but I just hope someone finds it usfull so here it is.

Infomir-Storage Server Installation on Ubuntu Server LTS 16.04

Install Ubuntu server 16.04
Upgrade Packages
sudo apt-get update
sudo apt-get upgrade

Install Required Packages
sudo apt-get install -y -u apache2 php php-soap python2.7 libapache2-mod-php

Unzip the folder Ministra.zip and copy the directory /stalker_portal/storage in /var/www/.
It will be like /var/www/stalker_portal/storage and files will be in storage folder.
Go to /var/www/stalker_portal/storage/ and run the following command
chmod a+x install.sh
./install.sh

Edit file /var/www/stalker_portal/storage/config.php
define ('VIDEO_STORAGE_DIR', '/media/raid0/storage/');
define ('KARAOKE_STORAGE_DIR', '/media/raid0/karaoke/');
define ('RECORDS_DIR', '/media/raid0/records/');
define ('NFS_HOME_PATH', '/media/raid0/mac/');
// Use login and password from the configuration file. (api_auth_login and api_auth_password in server/custom.ini)
define ('API_URL', 'http://login:[email protected]/stalker_portal/api/');
define ('PORTAL_URL', 'http://192.168.1.71/stalker_portal/');
define ('STORAGE_NAME', 'bb3');
define ('ASTRA_RECORDER', false);
define ('DUMPSTREAM_BUFFERING', 1); // set -1 for system default
where is:
VIDEO_STORAGE_DIR- directory for files of “Videoclub” storing;
KARAOKE_STORAGE_DIR- directory for files of “Karaoke” storing;
RECORDS_DIR- directory for files PVR and “TV Archive” storing; "TV archive" settings;
NFS_HOME_PATH- STB's home directory;
API_URL- URL, which will be used for channel recording request from middleware. Watch "TV archive" settings:
PORTAL_URL- portal address. At this address will be sent to requests from “storage” to check the keys to access the archive;
STORAGE_NAME- storage name.

If you change username and password for API authentication in custom.ini then you also must change it in API URL.
'http://username:[email protected]/stalker_portal/api/');
Where username is api_auth_login
Where Password is api_auth_password
Where x.x.x.x is IP Address of the middleware

Create following directories and give all directories the permissions 0777
/media/raid0/storage/
/media/raid0/karaoke/
/media/raid0/records/
/media/raid0/mac/
mkdir -p -m 0777 /media/raid0/storage /media/raid0/karaoke /media/raid0/records /media/raid0/mac

Create Directory /var/www/media/
mkdir /var/www/media

Create symlink to the STB’s home directories in /var/www/media/
ln -s /media/raid0/mac/ /var/www/media/<storage name="">
Let Suppose storage name is “bb3”
So
ln -s /media/raid0/mac/ /var/www/media/bb3
For Subtitles: ln -s /media/raid0/subtitles /var/www/subs
In Portal Admin interface go to Storage and add
Name - <storage name="">. For Example: bb3
IP - Ip Address of the storage server
Home Directory - <stb’s home="" directory="">. For example: /media/raid/mac/
Configure Apache Port in /etc/apache2/ports.conf
Listen 88

In /etc/apache2/sites-enabled/default.conf change <virtualhost *:80=""> to <virtualhost *:88="">
If there will be Tv Archive then it is necessary to add directive VirtualHost inside the block TimeOut 1800 and remove html/

File will be like:
<virtualhost *:88="">

ServerAdmin webmaster@localhost
DocumentRoot /var/www
TimeOut 1800
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</virtualhost>

Make sure that the package libapache2-mod-php5filter is not installed on the system. If necessary, remove it.
apt-get purge libapache2-mod-phpfilter
Install Nginx with extra packages
apt-get install nginx nginx-extras

Configure nginx in /etc/nginx/sites-available/default


geo $local_client {
default 0;
127.0.0.1/32 1;
X.X.X.X/32 1; Middle ware IP
}

map $local_client $client_allowed {
0 $secure_link;
1 1;
}


server {

listen 10.1.1.4:80;
server_name _;

location / {
proxy_pass http://10.1.1.4:88/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}


location /tslink/ {

rewrite ^/tslink/(.+)/archive/(\d+)/(.+) /stalker_portal/server/api/chk_tmp_timeshift_link.php?key=$1&amp;file=$3 break;

proxy_set_header Host 10.1.1.3; # &lt;-- portal IP
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.1.1.3:88/; # &lt;-- portal IP
}

location /archive/ {
root /var/www;
internal;
}

location ~* ^(?!(\/tslink|\/archive))\/.*\.(mpg|mpeg|avi|ts|mkv|mp4|mov|m2ts|flv|m4v)$ {
secure_link $arg_st,$arg_e;
secure_link_md5 "supersecret$uri$remote_addr$arg_e";

if ($client_allowed = "") {
return 403;
}

if ($client_allowed = "0") {
return 410;
}

send_timeout 6h;
root /var/www/;

}

location ~* \.(srt|sub|ass)$ {
send_timeout 6h;
root /var/www/subs/;

}

}

As subtitles does not support nginx secure link token so add lines in /etc/nginx/sites-available/default and remove (srt|sub|ass) from secure link location

geo $local_client {
default 0;
127.0.0.1/32 1;
10.1.1.3/32 1;
}

map $local_client $client_allowed {
0 $secure_link;
1 1;
}

server {
listen 10.1.1.4:80;
server_name _;

location / {
proxy_pass http://10.1.1.4:88/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

location /tslink/ {

rewrite ^/tslink/(.+)/archive/(\d+)/(.+) /stalker_portal/server/api/chk_tmp_timeshift_link.php?key=$1&amp;file=$3 break;

proxy_set_header Host 10.1.1.3; # &lt;-- portal IP
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.1.1.3:88/; # &lt;-- portal IP
}

location /archive/ {
root /var/www;
internal;
}

location ~* ^(?!(\/tslink|\/archive))\/.*\.(mpg|mpeg|avi|ts|mkv|mp4|mov|m2ts|flv|m4v)$ {
secure_link $arg_st,$arg_e;
secure_link_md5 "supersecret$uri$remote_addr$arg_e";

if ($client_allowed = "") {
return 403;
}

if ($client_allowed = "0") {
return 410;
}

send_timeout 6h;
root /var/www/;

}

location ~* \.(srt|sub|ass)$ {
send_timeout 6h;
root /var/www/subs/;
}
}

Restart Nginx
Add Storage in admin panel Go to
Storage à Add storage à General Information tab
Mention Title
IP address of the storage server
Port of apache server
Home Directory /media/raid0/mac/
Maximum User
Add content in /var/www/media/bb3/
Configure inside the portal in Video club

TV Archive Settings

Checking of the availability of multicast streams can be performed with help of dumprtp utility. which is included in dvbstream packet.
apt-get install dvbstream

To check the streams are accessible to your system for recoding
dumprtp IP Port &gt; dump(name).ts
dumprtp 239.1.1.1 1234 &gt; dump239.1.1.1.ts

Install memcached
apt-get install memcached

In admin panel go to
Storage à edit current storage if using same VOD storage à Additional Information
select on the option storing content
Allow Tv Recording à Stalker DVR (Select Stalker DVR if using Stalker, Wowza DVR if Wowza, Flussonic DVR if Flussonic &amp; Nimble DVR if Nimble)
Note: - Incase of using separate storage for PVR, add storage and fill in general information and additional information

At the storage /var/www/stalker_portal/storage/config.php necessary to setup (In case of Separate Storage, if using same VOD server, use those information)
RECORDS_DIR (directory with permission 0777, it will be created archive directory, which will contain all files of recording)
API_URL (which will record the channels from middleware. Usually it is http://IPAddressofMiddleware/api/tv_archive/)
PORTAL_URL (portal address. At this address will be sent to requests from “storage” to check the keys to access the archive)
STORAGE_NAME (storage name, which indicated in Admin interface)
Make Directory
mkdir -p -m 0777 /media/raid0/records/archive

Create symlink of folder with archive in web server directory
ln -s /media/raid0/records/archive/ /var/www/

While editing TV channel in Admin interface you can choose “Enable TV archive” option.
Ensure that the Apache configuration file have directive “TimeOut 1800”

For Subtitles as they are not supported with secure link in nginx
mkdir -p -m 0777 /media/raid0/subtitles
ln -s /media/raid0/subtitles /var/www/subs

And Put the link without directory for example:
ffmpeg http://192.168.0.1/TheNun2018.srt</virtualhost></virtualhost></stb’s></storage></storage>
 
Top