Seeder Support Script for Modern Image Board Systems
Because when it comes to "serious business", I'm here to help ;) 
    WakaChan BBS
    4Chan BBS

Releases / Downloads
See working example
of this script

Become a seeder for
an ImageBoard

Give your ImageBoard
the ability to be seeded

(Tool for making
ImageBoard mirrors)




SeedSupport.php Documentation


Command Line:   Cmd=AddSeed
Example:   SeedSupport.php?Cmd=AddSeed.......... (to many args to list)
Purpose:   Seeder script usage.  Used to tell the ImageBoard server that you are seeding.  The script will also send information about what port you are seeding off from, and what you are interested in seeding (some image board have multiple sections, and in some cases, a seeder may only want to seed a certain number of specific sections.

When a seeder is done seeding (wants to stop), their script should call the ImageBoard-side script with Cmd=DoneSeed

Command Line:   Cmd=DoneSeed
Example:   SeedSupport.php?Cmd=DoneSeed
Purpose:   When this command line is called t the ImageBoard-side, the I.B.-side script will remove the remote IP address (that called the command line) from the seed list.  This will stop any more users of the board from being redirected to that seeder.
Command Line:   Cmd=RemoveFileFromImgBrdTracker
Example:   SeedSupport.php?AdminUser=root&AdminPass=longcat&filename=1177828384779.jpg
Purpose:   Removes a file from the ImageBoard-Tracker.  As it is shown in the example, a admin/mod user and pass is needed
This has not been grouped with DoAdminCommand because Cmd=AddSeed isn't....  Yeah, not a very good reason, but I just wanted to keep them together
Command Line:   Cmd=PushNewFilesOut
Example:   SeedSupport.php?Cmd=PushNewFilesOut&AdminUser=root&AdminPass=longcat    [[Optional &ForceExecute=TRUE]]
Purpose:   For script use only.  This request can only be issued by IP or localhost, though this may seem useless, it is made a public command because doing this is the only way to create a new process-thread in PHP without using certain extensions; extensions which are not included in the standard windows PHP installation.  So if I was to use those extensions, it would mean I would have to make yet another walkthrough to help people download it and add it to their php.ini (a file which btw also does not come with the Windows PHP installation =_=*  ) I reaaallly don't feel like doing anymore than I half to...  I'd prefer to Keep It Simple and Stupid.

This command will trigger a file_get_contents($LongCat) for every seeder.  Where $LongCat is the URL to a target seeder's KernelPHP.php file with the parameter in it telling the seeder to check the board with the URL SeedSupport.php?Cmd=NewFileList, which will tell the seeder what files have been uploaded to the board (and are not on the seeder's machine).  Because this is using file_get_contents($LongCat), this should return a string from the user after the user is done checking for new files, and done updating its own ShareList.txt file.  This string should be what is in the newly updated ShareList.txt, and thus is basically a newly compiled listing of what is being shared by that seeder.

This will be done to ever seeder, and thus, this can become pretty time-consuming, therefore, this command should be triggered by something like file_get_contents("", , , , 1);  This is because when you execute that line, it will only get the fist character of what is returned from that string, AND THEN GO ON.  Thus you don't need to wait for every seeder to finish checking for new files before continuing onto the next line.

This command can be used at a max of once every 5 minuets.  Attempting to trigger this command any sooner will result in being ignored unless the ForceExecute=TRUE parameter is given.  Also take note though that seeds may ignore a request to check for new files if they are already requested to do so in the past 10 minuets.

Command Line:   Cmd=NewFileList
Example:   SeedSupport.php?Cmd=NewFileList&TimeStamp=1126324382507&Section=A_Anime
Additional Args:   TimeStamp - Show files uploaded since when?
Section - Show files of what section? Multiple section may be given but must all be separated by "%0A" without quotes (this is "\n" escaped)
Purpose:   For seeder use only.  IP will be checked, and this request will be ignored if the IP is not a seeder
This will return a list if files being tracked by the ImageBoard-Tracker that were uploaded since the time-stamp.  WARNING: The TimeStamp input MUST be an output of time() in the PHP language, just like you see in the example.  It's MUST NOT be a data/time like the standard way humans read it - nothing like HH:MM
Command Line:   Cmd=MassXfer
Example:   SeedSupport.php?Cmd=MassXfer
Purpose:   Despite the command-line name, this command is used to download one file at a time.  However, this command is used so the seeder can download a mass of files from the image board server.  In most real world cases the imageboard server will still have all files users have uploaded to it, and when a seeder decides to seed, there will most likely be file already on the imageboard server that have been uploaded previously to the seeder deciding to seed.  This command is used so the seeder can download these images from the server, and seed them.
Future Plans:   Change the system so that new seeders download their content to seed from other seeder, however, to do this the image board server will have to somehow keep track, or at least verify that the content that is being set from one source to another.  This is because such a system may become open to attacks where people send false data to others.
Command Line:   Cmd=Cats
Example:   SeedSupport.php?Cmd=Cats
Purpose:   States what sections this ImageBoard-Tracker is taking care of.  This should return a a list where each member is separated by a CrLf or "/n".  No HTML code will be returned.
This is needed so when a seeder prepares to seed a certain ImageBoard, the seeder can first look at which sections are available to seed
Command Line:   Cmd=AdminView
Example:   SeedSupport.php?Cmd=AdminView&AdminUser=root&AdminPass=longcat
Additional Args:   AdminUser - User name
AdminPass - password
Purpose:   Shows information about the trackers and supplies  GUI to the admins to use, pretty basic, the GUI simply routs the user to other commands shown on this page, and fills in the $AdminUser  and $AdminPass with what w entered previously to get in.
Command Line:   Cmd=DoAdminCmd
Example:   SeedSupport.php?Cmd=DoAdminCmd_unban&Args=
Additional Args:   The admin authentication
AdminUser   User name of the admin who is issuing the command
AdminPass   Password for that administrator account

Then a parameter to be followed by "DoAdminCmd"....
_kickseed   Tells the ImageBoard-Tracker to stop considering the seeder with IP of $Args to be be seeding
_kickban   Triggers a Cmd=DoAdminCmd_ban and Cmd=DoAdminCmd_kickseed
_unban   Takes whatever text is in $Args, and removes it from the ban-list if it exists there
_ban   Adds whatever text is in $Args to the ban list if it does not yt exist there already
_changefowardrate   Changes the forward rate of user
_flushallseeders   Basically issues a Cmd=DoAdminCmd_kickseed to all seeds
_massunbanall   Basically issues a Cmd=DoAdminCmd_unban to all banns
_addfiletoimgbrdtracker   Adds a file to the ImageBoard-Tracker for tracking.  $Args must = a URL to the file, a %0A (escapped CrLf), and then the section/cat is is associated with.
_buildseedersharecache   $Args must be a URL to to a share.txt file.  This command will trigger a core function within the tracker to download that file, and add the URLs in that file to the source list for each of those files within the tracker.  Obviously any URLs to a file that is not be tracked by the tracker will be ignored.  Keep note that this will NOT check if the IP in the given URL is a seeder or not, however, before giving a URL to a user to be redirected to, this is checked and erased if the tracker notices that the given IP is not a seeder.
_forceaddfiles   When given a URL in $Args, this will command the tracker to download that URL which should be a list of URLs to files which should be added to the Tracker.  If the file is new then the default origin will be considered to the the inputted URL.  Each file will be downloaded by the tracker and he its CRC compiled, if the Tracker for some reason cannot download a given URL, then it will assume the given URL is a broken link and not add it into the track list.

If the downloaded document (given by $Args) has the text <HTML> in it, then it is assumed that you have it a .html file, in which case it will parse out links only and make a list fo files o add from those links.  This becomes very useful say if you have many files in a directory and you want to add them all, Apache Server will auto show an indexing of all files in a directory (if configured to do so - if you don't have this option or cant get it to work, read up on the _testlocs~ section below), if you supply a link to that directory with no file in the URL, then the Tracker will DL that indexing, and parse out the links to the files and auto add them all.  If you use this tactic though, go back into the tracker and kill the mode links that proabal got added in along with the links to the files.

_forceaddsources   Save as "doadmincmd_forceaddfiles" but this will not add files, it will only declare the file sources for whatever files were found on the input URL list (or links on indexing page read the _forceaddfiles section about that)
_forceaddseed   This will add the given seeder to the tracker list, this will not do a firewall check.

$Args be as follows:
          -IP address of seeder
          -port the seeder is sharing off from
          -path to their PHPKernel
          -sections the seeder is seeding (separate by comma)
          -flow rate, number of users that can redirected to this seeder within ten seconds at max
All these inputs should be separated by "%0A" (without wuotes).  This is [Return] (CrLf) escaped

_testlocstoaddsources   Given $Args is a URL directory, this command will test if all URL + filenames (for all filenames being tracked by the tracker) exist.  Or in other words, it will see if that location has a file being tracked by the ImageBoard tracker, and if it does, it will add the location.  This is a good tool if you have a directory (public URL one) that has copies of files that are being tracked by the ImageBoard-Tracker, and you want to add these files as sources for those files.

Command Line:   Cmd=UpdateMyShareCache
Example:   SeedSupport.php?Cmd=UpdateMyShareCache
Purpose:   For seeder use only.  IP will be checked, and this request will be ignored if the IP is not a seeder
This tells the ImageBoard support system to discard any cache about what the seeder is sharing, and check the seed again.  This should be used when a seeder has added or deleted files in the public directory
Command Line:   Cmd=FirewallTest
Example:   SeedSupport.php?Cmd=FirewallTest&TestPort=80&TestPath=/PHPkernel.php%3FCmd%3DEchoMyIP
Example-note   the PHPkernel.php%3FCmd%3DVer is escaped for PHPkernel.php?Cmd=Ver
Purpose:   Will trigger SeedSupport.php to do
file_get_contents("http://TheRmtIP:$TestPort/$TestPath", , , , 20)
This will basically will try to download the file, but only the first 20 bytes.  It returns weather or not it was successful.  This method will either return whatever it downloaded or the string "false".  It will not return any HTML code.
In the code here I show TheRmtIP, but you cannot change this remotely for obvious security reasons.
Command Line:   Cmd=ReportStatic
Example:   SeedSupport.php?Cmd=ReportStatic&PingTime=8&TotalTime=11
Purpose:   When a user is redirected to an image, a JavaScript is given to them, this script is what does the user-side redirect, but it will also open a second hidden frame that will send information back to the Tracker about how long it took for the user to be redirected to a target seeder.  As shown in the example, the information consists of the ping time, and the total time it took to request and download the desired image/file from the seeder.

Known Issue
As it is right now, the JavaScript can only deal with images compatible by the browser it is being run by.  If bein redirected to a flash (.swf) file for example, there might be some problems.

Command Line:   Cmd=InterrogateSeeder (under construction)
Example:   SeedSupport.php?Cmd=InterrogateSeeder&AutoBanOnGuilty=True&IP=
Purpose:   This is usually used on a seeder who has been reported to be seeding incorrect files for other CRCs.  Script kiddies may do this as an attempt to attack an imagenboard, and this is the command used to detect them.
Command Line:   Cmd=IssueReport
Example:   SeedSupport.php?Cmd=IssueReport&Type=SeedingFalsContent  [[Text Message sent with POST in the variable $Msg]]
Additional Args   Type can be one of the following values
GUI   Shows a user friendly GUI to help a user report a given file/user
File   Used when actually submitting a report, states you will give a File argument, which should be a file ID (which is usually the filename)

Reason can be any listed below -OR- just plane text which will only be used for a custom report: