Difference between revisions of "WDLXTV Repository"

From WikiDLXTV
Jump to: navigation, search
Line 226: Line 226:
  
  
== Respository usage ==
+
== Repository usage ==
 
Now that you have setup your own repository (or just a mirror of our SVN), how to use it?
 
Now that you have setup your own repository (or just a mirror of our SVN), how to use it?
  

Revision as of 06:36, 6 April 2015

Introduction

This section explains how to setup WDLXTV Web Repositories. You can run your own UMSP/apps/wdtvext repositories, either for mirroring the official one or hosting your own plugins and apps.

I'm not going to cover how to setup the webserver itself (ie apache), there's lot's of information available on that topic on the web. This guide describes the structure of the repositories used by WDLXTV. Additionally I will provide the original scripts to keep the repos in sync with SVN.

In this guide I will use the domain example.com, any occurance of this domain should be replaced with your domain or IP.


Repository Setup

UMSP Repository

Directory structure

/var/www/umsp.example.com# ls -al
-rw-r--r-- 1 www-data www-data     0 Jan 31 19:06 favicon.ico
-rw-r--r-- 1 www-data www-data     0 Feb  7 19:43 index.html
-rw-r--r-- 1 www-data www-data 81549 Feb  7 19:05 manifest.xml
drwxrwxr-x 2 www-data www-data 12288 Feb  2 13:38 plugins
-rwxr-xr-x 1 www-data www-data   326 May 13  2011 plugins.php
-rw-r--r-- 1 www-data www-data    26 Feb  7 17:27 robots.txt
/var/www/umsp.example.com/plugins# ls -al a*
-rw-r--r-- 1 www-data www-data 7933 Feb  7 19:05 apple-trailers.tgz
-rw-r--r-- 1 www-data www-data  611 Feb  7 19:05 apple-trailers.xml

Files

plugins.php

This file simply lists all plugins in the repository as a simple plaintext list. It's used by umsp-plugman-web to get the plugin list (repolist).

<?php
unset($res_array);
$res = exec("find ./plugins -maxdepth 1 -type f -name '*.xml' | sort", $res_array);
print "<"."pre>\n";
foreach ($res_array as $plugin) {
       if ($plugin != "") {
               $plugin = preg_replace('/^\.\/plugins\//', "", $plugin);
               print preg_replace('/\.xml$/', "", $plugin);
               print "\n";
       }
}
print "</"."pre>";
?>

manifest.xml

This is an XML file which is a concatenation of all the plugin XML files in the plugins dir, eclosed by a <manifest> tag.

<?xml version='1.0' standalone='yes'?>
<manifest>
  <umspplugin>
    <name>Apple Trailers</name>
    <author>shunte, RMerlin, zoster et. al.</author>
    <basefirmware>*</basefirmware>
    <category>Trailers</category>
    <date>2012-10-14</date>
    <desc>Apple Trailers</desc>
    <filename>apple-trailers.php</filename>
    <id>apple-trailers</id>
    <rating>General</rating>
    <thumbnail>http://lh3.googleusercontent.com/_xJcSFBlLg_Y/TZDbFvRJSmI/AAAAAAAAA1A/P-V72s4dzYM/s200/apple-logo-2pgray.png</thumbnail>
    <type>umsp</type>
    <url>http://forum.wdlxtv.com/viewtopic.php?f=53&t=3941</url>
    <version>0.2.4</version>
  </umspplugin>
</manifest>

plugins/apple-trailers.tgz

This is a tar/gz file containing the plugin directory structure and files. More info can be found here: UMSP_plugin_development#Plugin_API

 apple-trailers/
 apple-trailers/apple-trailers_wec.php
 apple-trailers/config.php
 apple-trailers/apple-trailers-with-check.php
 apple-trailers/info.php
 apple-trailers/apple-trailers-proxy.php
 apple-trailers/apple-trailers.php

plugins/apple-trailers.xml

This is the plugin info file in XML format.

Important:

  • The <id> tag must hold the name of the plugin directory.
  • Always encode the & in urls in the url tag as & amp;! (Mediawiki always interprets this already as &, so the example below is a bad example ;))
<?xml version='1.0' standalone='yes'?>
<umspplugin>
  <name>Apple Trailers</name>
  <author>shunte, RMerlin, zoster et. al.</author>
  <basefirmware>*</basefirmware>
  <category>Trailers</category>
  <date>2012-10-14</date>
  <desc>Apple Trailers</desc>
  <filename>apple-trailers.php</filename>
  <id>apple-trailers</id>
  <rating>General</rating>
  <thumbnail>http://lh3.googleusercontent.com/_xJcSFBlLg_Y/TZDbFvRJSmI/AAAAAAAAA1A/P-V72s4dzYM/s200/apple-logo-2pgray.png</thumbnail>
  <type>umsp</type>
  <url>http://forum.wdlxtv.com/viewtopic.php?f=53&t=3941</url>
  <version>0.2.4</version>
</umspplugin>


Scripts

All the scripts are available in SVN: misc/repos/umsp

mkrepo-umsp.pl

This Perl script checks out a current SVN tree to /tmp and builds the plugin archives as well as manages the XML info files and manifest.xml. It's intended to be called by the SVN post-commit hook script.

post-commit

This is the SVN post-commit hook script. You will only need this if you have your own SVN server running (on the same server the repo is on).

plugins.php

see above


WDTVExt Repository

Directory structure

/var/www/wdtvext.example.com# ls -al
drwxr-xr-x 3 www-data www-data 4096 Apr  6 15:01 .
drwxr-xr-x 3 root     root     4096 Apr  6 14:40 ..
-rw-r--r-- 1 www-data www-data    0 Apr  6 15:01 favicon.ico
-rw-r--r-- 1 www-data www-data    0 Apr  6 15:01 index.html
-rw-r--r-- 1 www-data www-data 5310 Apr  6 14:46 manifest.xml
drwxr-xr-x 2 www-data www-data 4096 Apr  6 14:44 plugins
-rwxr-xr-x 1 www-data www-data  316 Apr  6 15:00 plugins.php
/var/www/wdtvext.example.com/plugins# ls -al O*
-rw-r--r-- 1 www-data www-data 40004 Apr  6 14:46 OSDNotice.tgz
-rw-r--r-- 1 www-data www-data   331 Apr  6 14:46 OSDNotice.xml


Files

plugins.php

This file simply lists all plugins in the repository as a simple plaintext list. It's used by umsp-plugman-web to get the plugin list (repolist).

<?php
unset($res_array);
$res = exec("find ./plugins -type f -name '*.xml'", $res_array);
print "
\n";
 foreach ($res_array as $plugin) {
   if ($plugin != "") {
     $plugin = preg_replace('/^\.\/plugins\//', "", $plugin);
     print preg_replace('/\.xml$/', "", $plugin);
     print "\n";
   }
 }
 print "
";
?>

manifest.xml

This is an XML file which is a concatenation of all the plugin XML files in the plugins dir, eclosed by a <manifest> tag.

<?xml version='1.0' standalone='yes'?>
<manifest>
  <wdtvextplugin>
    <name>OSD Notice</name>
    <author>recliq</author>
    <date>2011-07-18</date>
    <desc>Plugin to display short OSD notices</desc>
    <filename>OSDNotice.plugin.js</filename>
    <type>wdtvext</type>
    <url>http://forum.wdlxtv.com</url>
    <version>1.0.0</version>
  </wdtvextplugin>
</manifest>

plugins/OSDNotice.tgz

This is a tar/gz file containing the plugin directory structure and files. More info can be found here: DevelopWDTVExtPlugin#Repository

OSDNotice/
OSDNotice/OSDNotice.plugin.js
OSDNotice/OSDNotice_wec.php
OSDNotice/title_back.png

plugins/OSDNotice

This is the plugin info gathered from file meta-info in XML format. Important:

  • Always encode the & in urls in the url tag as & amp;! (Mediawiki always interprets this already as &!!)
<?xml version='1.0' standalone='yes'?>
<wdtvextplugin>
  <name>OSD Notice</name>
  <author>recliq</author>
  <date>2011-07-18</date>
  <desc>Plugin to display short OSD notices</desc>
  <filename>OSDNotice.plugin.js</filename>
  <id>OSDNotice</id>
  <type>wdtvext</type>
  <url>http://forum.wdlxtv.com</url>
  <version>1.0.0</version>
</wdtvextplugin>


Scripts

All the scripts are available in SVN: misc/repos/wdtvext

mkrepo-wdtvext.pl

This Perl script checks out a current SVN tree to /tmp and builds the plugin archives as well as manages the XML info files and manifest.xml. It's intended to be called by the SVN post-commit hook script.

post-commit

This is the SVN post-commit hook script. You will only need this if you have your own SVN server running (on the same server the repo is on).

plugins.php

see above


Application Repository

Directory structure

Files

apps.php

manifest.xml

Repository usage

Now that you have setup your own repository (or just a mirror of our SVN), how to use it?

IT as simple as adding your new repository URL with an identifier to WDLXTV config:

Shell

Have a look at the current APPS/UMSP/WDTVEXT_WEB_REPO config variables:

# grep WEB_REPO /conf/config
WDTVEXT_WEB_REPO='Main,http://wdtvext.wdlxtv.com'
UMSP_WEB_REPO='Main,http://umsp.wdlxtv.com'
APPS_WEB_REPO='Main,http://apps.wdlxtv.com'

Now simply add your own by using | as a seperator:

config_tool -c UMSP_WEB_REPO='Main,http://umsp.wdlxtv.com%7CMyRepo,http://umsp.example.com'

the same goes for the the other two repos.

WEC

You can of course configure these in WEC as well, simply add the new repository in the respecting config box on a new line and save your config.


WIP, please stand by...