AL Download Protection online documentation

Contents

About AL Download Protection

AL Download Protection is server-side counterpart of Anti-Leech Plugin.

AL Download Protection works like small personal Anti-Leech Online server, provide you with the following functions:

Together with Anti-Leech Plugin, this software provide an ultimate protection of your web content.

Link protection concepts

AL Download Protection & Anti-Leech Plugin protection is based on secure transmission of links from server to Plugin.

Links are to be organized into collections called packages. There are two forms of a package:

Plugin accepts package files and download resources from links contained in the package.

Plugin can interpret package files in both forms. However, only transmission of encrypted form provides required level of protection. Package files in source form can be used for debugging purposes.

Additional protection is controlled by parameters included into a package:

Administrator's interface and main menu

Administrator's interface located in so-called public directory of your AL Download Protection instance.

Invoke index.html or admin.pl to log in. You will be prompted for login and password.

All management operations are listed at the first page and also duplicated in a menu at top and bottom of every page.

For security reason, AL Download Protection checks your activity at administrator's interface. If you are not active for 4 minutes, The Protection decides that you have leave the site. If your continue management operations after this time, you will be forced to log in again.

Management operations

Creating a package

To create a new package select new from the menu.

You will be prompted for a filename of a package and then you will be moved to editor form, where you can set all Package content and parameters.

Note that filenames should be unique inside your instance of AL Download Protection.

If you are experienced webmaster, you may prefer to create an XML package file with a text editor instead of Anti-Leech web-based editor. See package parameters section and Appendix B for details.

Editing a package

To edit a package select edit from the menu and select a package to edit from the list.

You will be moved to editor form, where you can modify all Package content and parameters.

After you fill editor form and submit it, you can select one of  3 options:

If you are experienced webmaster, you may prefer to edit an XML package file with a text editor instead of Anti-Leech web-based editor. See package parameters section and Appendix B for details.

Deleting a package

To delete a package (or multiple packages) select delete from the menu and then select packages to delete from the list.

Note that deletion can not be undone.

Linking to your site

After you created a package, you should set a link to the package from your site.

An URL to refer to the package must be the following:

http://<server>/<public path>/download.pl?package=<package filename>

where

<server> is a server where you have installed AL Download Protection
<public path> is an URL path to the  public directory of your AL Download Protection instance inside the <server>
<package filename>
is a filename of a package; you set it when you created a package.

This link refers to download page, which includes an instance of Anti-Leech Plugin confugured to interpret this particular pacakage.

See more in package retrieval details section.

Importing packages

You should import packages in several cases:

To import packages, connect to the server with FTP client and upload packages to <private>/import directory (here <private> is a path of the directory where you installed private part of AL Download Protection; you setup this path during installation process).

Then select import from the menu and select packages to import.

AL Download Protection will add selected packages to your package collection.

If package is accompanied with the file of the same name and '.html' extension, this file will be regarded as download template for this package and will be imported as well.

There is a 20 sec. delay between the moment when you import a package and the moment when it become available for download.

Backup and restore packages

Package files are located in <private>/packages directory. The package can be accompanied with a download template which has the same name and an '.html' extension.

To make a backup copy of your package(s), connect to the server with FTP client and download all or selected content from <private>/packages directory to your workstation.

In opposite, to restore packages from a backup copy, you should upload selected content to <private>/import directory and execute import operation. Note: Simple copying of package files to the server will not produce correct results.

Setup and view download statistics

AL Download Protection contains tools to collect and view statistics of downloads of   resources included into packages.

Statistics collector is located at http://<server>/<public path>/stats/stats.pl.

To force Anti-Leech Plugin to send statistics to you AL Download Protection instance, enter this path into as report parameter of the package.

To view statistics, select statistics from the menu, then select one of the following reports:

Every report, except raw log, contains link to view similar report from the past.

Changing your password

To change your password, select change password from the menu.

Package content and parameters

Package parameters are listed in the table below in the same order as they appear in the package editor form.

It is shown in the Group column how parameters are grouped and can they repeat: 1 - single parameter, * - can repeat.
In the XML column corresponding XML tag is shown.

 

Name Group Meaning XML
Title 1 A title of the package which appears at the top of Anti-Leech Plugin <title>...</title>
Referer: * A legal referrer of the package. Retrieval of the links from other page will be blocked. Enter an URL of a page of your site in which you inserted links to the package. If needed, add multiple URLs with a help of the next parameter (Add new referrer). See more detailed explanations in and instructions in package retrieval details section. To disable this feature, leave the parameter blank. <referer href="..."/>
Add new referer 1 Same as above, separated for technical reason. Use it to extend a list of referrers. same as above
Lifetime 1 Lifetime of an encrypted form of a package. Must contain a number of days, hours or minutes, in a form: 2d, 3h or 25m. Lifetime is measured from a moment when a package was encrypted. Recommended value is 1d. To disable this feature, leave it blank. <lifetime period="..."/>
Rescramble period 1 A period of automatic rebuilding of an encrypted form of a package. Must contain a number of days, hours or minutes, in the same form as Lifetime. Use this parameter in conjunction with Lifetime parameter. To keep your original encrypted package always fresh, set this parameter less than Lifetime. To disable this feature, leave it blank. <rescramble period="..."/>
Report download to 1 An URL for statistics collector. To collect download statistics for this package set this parameter to http://<server>/<public path>/stats/stats.pl (see setup statistics section). To disable this feature, leave it blank. <report href="..."/>
Download template 1 A page with embedded Anti-Leech Plugin, suited to download resources from this package. You can install your own download template instead default template supplied with AL Download Protection. See more. no representation in XML
Download source base 1 A base for relative URLs of resources included into the package. Every relative URL will be prepended with this value. Note that resources must not reside at the same server where AL Download Protection and packages reside. <base href="..."/>
File
Title * A title of the resource which appears in Anti-Leech Plugin file list after Plugin downloaded and interpreted a package <file title="..." href="..." rename="..."/>
Href A link to the resource (an URL). Note that resources must not reside at the same server where AL Download Protection and packages reside.
Rename A name of the resource file after it downloaded and saved at a client's workstation. To disable rename feature, leave the parameter blank; a name will be extracted from the URL of the resource.
Add new file
Title * The same meaning as for File. Separated for technical reason. Use it to extend a collection of resource links contained in a package. same as above
Href
Rename

If you are experienced webmaster, you may prefer to edit an XML package file with a text editor instead of Anti-Leech web-based editor. For this purpose see detailed description of package XML format in Appendix B. Note that there is very poor XML syntax verification in AL Download Protection, so be careful. After you have edited a package, you should import it. Note that simple copying to the server will not produce correct result.

Package retrieval details

When client's browser tries to retrieve a package from "http://<server>/<public path>/download.pl?package=<package filename>" (see linking to your site section), the following events occure:

How and when referrers are compared

As described above, referer list is used twice, but in different context:

In both cases comparison of page location and referrers is executed under similar rules.

An URL of the page must be equal to referrer allowed in the package, or it must be 'inside' the described referrer (for example, http://www.icenet.ru/en/news is 'inside' http://www.icenet.ru/en). If there are several referrers allowed in the package, the page must match at least one of them.

This provides a flexibility in referrer checks and allow you to setup referrer list more secure or, in opposite, more simple for maintenance. You can regards 'referrers' as dedicated pages as well as a whole sites.

Note that URL of download.pl script must match a referrer from the list. Usually the editor helps you, including an URL to public directory to the list when you create a package.

Setting appropriate referrers

This section contains recommedations how to set up a list of referrers for a package.

  1. Simple case: you allow downloads only from one site and this site and AL Download Protector are located on the same virtual host. In this case a list of referrers must contain a root URL of this virtual host and nothing more.
  2. Complex case: you allow downloads from different sites which are located at different servers. In this case the list of referrers should contain root URLs of all these sites, and also a root URL of AL Download Protector (i.e. URL to public directory).
  3. More complex case: you allow download resources from particular pages only instead of whole sites. In this case list all these pages as your legal referrers. Don't forget to add URL of download.pl script to the list.

Using download page templates

Download template is a page shown to the user which is going to download resources from your package. It contains two things important for resource downloading:

Other features of the page are not connected with downloading and are under your control. You may decide to change them for informational, design or any other purposes.

Default download template is installed with AL Download Protection and also included in Appendix A. You can produce your own templates starting with its text and editing an html code. Please, check that you left html code for Anti-Leech Plugin and Anti-Leech logo image unchanged.

You can install individual download template for each package during edit operation.

You can also replace default download template with another one at the administrator's start page. This will affect the whole AL Download Protection instance.

Note: When download.pl script processes a template, it replaces a placeholder $package_href with an actual URL of the package. This is important for default template only. In individual template you may insert hardcoded URL of the package, in a form: http://<server>/<public path>/packages/<package filename>, however you are not required to do this.

Appendix A. Default download template


<html>

<head>
<title>Powered by Anti-Leech</title>
<script language="JavaScript" src="http://plugin.anti-leech.com/alplugin.js"></script>
</head>

<body>
<center>
<hr>
<script language="JavaScript">
///Embed a plugin, supply an URL of anti-leech package as parameter
   EMBED_ALPLUGIN('$package_href');
/// $package_href is a placeholder for package URL
/// download.pl can fill this placeholder automatically
</script>
<noscript>


<p align="center">Warning: javascript is not enabled. Anti-Leech Plug-In can be rendered
in wrong way. </p> </noscript>

<hr>

<p align="center"><a href="http://www.anti-leech.com"><img src="al_logo2.gif" width="150"
height="69" alt="http://www.anti-leech.com" border="0"></a></p>
</center>
</body>
</html>

Appendix B. Package file DTD


XML FORMAT EXAMPLE:

<package>
  <title>Dmitry's first package</title>
  <protection>
    <referer href="http://dmtest.icenet.ru/alinstall/download.shtml"/>
    <lifetime period="3h"/>
    <rescramble period="2h"/>
    <expire date="Tue, 29 Oct 2002 23:44:02 GMT"/>
  </protection>
  <stat>
    <report href="http://dmtest.icenet.ru/alinstall/stat.cgi"/>
  </stat>
  <content>
    <base href=href="http://dmtest.icenet.ru/alinstall/packages/"/>
    <file title="Song" href="package1a/1.dat" rename="Song.avi"/>
    <file title="Video" href="package1b/2.dat" rename="Video.avi"/>
    <file title="Executable" href="package1c/program.exe"/>
  </content>
</package>

XML FORMAT DEFINITION:

<!-- A <package> contains required <title> element, 
      optional <protection> and <stat> sections and required <content> section.
-->
<!ELEMENT package (
   title,
   protection?, 
   stat?, 
   content
)>

<!-- A <title> element contains any character string, which is to be shown in title of the plugin
      and also to be used to indentify the package in server-side web interface
-->
<!ELEMENT title (#PCDATA) >

<!-- A <protection> section contains zero or more <referer> elements and zero or one <lifetime>, <rescramble> and <expire> elements -->
<!ELEMENT protection (
  referer*, 
  lifetime?, 
  rescramble?, 
  expire?
)>

<!-- A <referer> element has href= attribute, which must contain an URL of the page in which the package can be loaded.
      A plugin should not download files if it is embedded into page with an URL which is not listed in one of the <referer> elements
      in the package. If no <referer> elements included in the package, a plugin is allowed to download files regardless of the page
      in which it is embedded -->
<!ELEMENT referer EMPTY>
<!ATTLIST referer
   href CDATA #REQUIRED
>

<!-- A <lifetime> element has period= attribute, which defines lifetime of the scrambled package.
      The attribute is intended to be used by a scrambler utlity.
      The value of the attribute must be an integer value appended by 'h', 'm' or 'd' character,
      which means a number of hours, minutes or days correspondently -->
<!ELEMENT lifetime EMPTY>
<!ATTLIST lifetime
  period CDATA #REQUIRED
>

<!-- A <rescramble> element has period= attribute.
      The attribute is intended to be used by a server-side software to schedule periodical rescrambling
      of the package.
      The value of the attribute must be an integer value appended by 'h', 'm' or 'd' character,
      which means a number of hours, minutes or days correspondently -->
<!ELEMENT rescramble EMPTY>
<!ATTLIST rescramble
  period CDATA #REQUIRED
>

<!-- An <expire> element has date= attribute, which defines the latest date and time of usage
      of the scrambled version of the package. A plugin should not download files of the expired package.
      The <expire> attribute should be added by scrambler utility directly before a scrambling of the package.
      The value of date= attribute should be calculated by the scrambler utility on a base of webmaster's host
      time and a value of a period= attribute of a <lifetime> element.
      The value of the attribute must be a date in form "Wed, 15 Nov 1995 06:25:24 GMT",
      as required by RFC822 (section 5) with update of RFC1123 (section 5.2.14).
-->
<!ELEMENT expire EMPTY>
<!ATTLIST expire
  date CDATA #REQUIRED
>

<!-- A <stat> section contains the only one optional element <report>.
      Other elements can be added in the future.
-->
<!ELEMENT stat (report?) >

<!-- A report element has an href= attribute, which contains an URL of a cgi script which provide
      download accounting. If the element present in the package, a plugin should send download
      statistics information to refered script.
-->
<!ELEMENT report EMPTY>
<!ATTLIST report
   href CDATA #REQUIRED
>

<!-- A <content> section contains zero or more <file> elements optionally prepended by a <base> element.
-->
<!ELEMENT content (base?, file*) >

<!-- A <base> element has an href= attribute which defines common base URL of all package resources, defined
      in <file> elements. If the <file> element contains a relative URL, the value of <base>'s href= must be prepended
      to the relative URL before downloading.
 -->
<!ELEMENT base EMPTY>
<!ATTLIST base
   href CDATA #REQUIRED
>

<!-- A <file> element decribes a resource contained in the package. It has the following attributes:
      title - any string which is used to identify theresource for plugin's user and in server-side web interface. Required.
      href - an URL of the resource. Can be relative to <base>'s href, if <base> present. Required.
      rename - a local name which must be assigned to the file after it has been downloaded. Optional.
-->
<!ELEMENT file EMPTY>
<!ATTLIST file
   title CDATA #REQUIRED
   href CDATA #REQUIRED
   rename CDATA #IMPLIED
>

SCRAMBLED PACKAGE FORMAT:

The file consists of 3 sections:
1. Signature. 4 bytes, contains fixed symbols 'ALSP'.
2. Format version. 2 bytes. High byte contains high version number and low byte contains low version number.
3. Package description in XML. Variable size, encrypted.

Copyright (C) 1999-2003 WakeNet AB. All right reserved.