The download link contain a random part (I got images/f/f3 now), which we must insert into the manifest.plist within the oxz so an instant update is needed after every upload.
The easiest solution is probably to not put the download_url at all in the copy of the manifest.plist which is inside the OXZ. By the time anyone can read that file, they no longer need the download URL.
It is possible to change the wiki configuration to not save uploads in these subdirectories (generated based on an MD5 hash of the file name btw). However, I'd have to move all media that has been uploaded so far into from their subdirectories to a flat file structure. If cim's proposal is ok then I'd rather avoid doing that.
I already checked it, but since its page says "The code or configuration described here poses a major security risk" I'm not going to install it. Instead, I'd rather take it as an opportunity to understand how to build my own extension.
Instead, I'd rather take it as an opportunity to understand how to build my own extension.
My download counter extension is now active on the sandbox wiki.
When you upload a file there, it creates an entry for it in its database. Every[*] download is piped through a script that updates the counter. I created a new parser function {{#downloads: filename}} that shows the download count or "unknown" if the file is not in its downloads database. For an example on how to use it see the source code of my user page there.
Let me know if this makes sense and give it a test please. If all is well I will move it to the proper wiki.
[*] You can still bypass the counter update script by accessing the file URL directly, e.g. http://sandbox.maikschulz.de/images/3/34/Q-Bomb_Detector_1.3.m.oxz. In order to prevent this, I would have to move the upload directory outside the web server's document root. I just don't see the point, it's only a download counter after all.[/size]
You can still bypass the counter update script by accessing the file URL directly, e.g. http://sandbox.maikschulz.de/images/3/34/Q-Bomb_Detector_1.3.m.oxz. In order to prevent this, I would have to move the upload directory outside the web server's document root. I just don't see the point, it's only a download counter after all.
Unless I'm missing something here, isn't this in fact how the 1.79 OXZ Manager itself accesses the OXZs? By using a direct reference to the file URL, as supplied by the manifest.plist? See, for example, the manifest.plist for the QBD:
{
identifier = "oolite.oxp.Diziet.Q-Bomb-Detector";
version = "1.3";
title = "Q-Bomb-Detector";
required_oolite_version = "1.79";
description = "Detects the launch of a Quirium Cascade Mine and sounds a siren to alert the pilot.";
file_size = 168938;
category = "Equipment";
tags = ("quirium","bomb","mine","detector");
author = "Diziet Sma";
license = "CC-BY-NC-SA 3.0";
download_url = "http://wiki.alioth.net/images/e/ee/Q-Bomb_Detector_1.3.oxz"
information_url = "http://wiki.alioth.net/index.php/Quirium_Cascade_Mine_Detector";
}
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
You can still bypass the counter update script by accessing the file URL directly, e.g. http://sandbox.maikschulz.de/images/3/34/Q-Bomb_Detector_1.3.m.oxz. In order to prevent this, I would have to move the upload directory outside the web server's document root. I just don't see the point, it's only a download counter after all.
Unless I'm missing something here, isn't this in fact how the 1.79 OXZ Manager itself accesses the OXZs? By using a direct reference to the file URL, as supplied by the manifest.plist? See, for example, the manifest.plist for the QBD:
{
identifier = "oolite.oxp.Diziet.Q-Bomb-Detector";
version = "1.3";
title = "Q-Bomb-Detector";
required_oolite_version = "1.79";
description = "Detects the launch of a Quirium Cascade Mine and sounds a siren to alert the pilot.";
file_size = 168938;
category = "Equipment";
tags = ("quirium","bomb","mine","detector");
author = "Diziet Sma";
license = "CC-BY-NC-SA 3.0";
download_url = "http://wiki.alioth.net/images/e/ee/Q-Bomb_Detector_1.3.oxz"
information_url = "http://wiki.alioth.net/index.php/Quirium_Cascade_Mine_Detector";
}
The URL would need to be e.g. http://sandbox.maikschulz.de/img_auth.php/3/34/Q-Bomb_Detector_1.3.m.oxz. You see it when you hover over the download link created using the [[Media:Q-Bomb_Detector_1.3.oxz]] download link on the wiki. The difference is in using the php script vs. bypassing php.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
The URL would need to be e.g. http://sandbox.maikschulz.de/img_auth.php/3/34/Q-Bomb_Detector_1.3.m.oxz. You see it when you hover over the download link created using the [[Media:Q-Bomb_Detector_1.3.oxz]] download link on the wiki. The difference is in using the php script vs. bypassing php.
Ok.. as I understand it, at the moment this php script is only installed on your sandbox Wiki, not the main or backup wikis, correct?
Also, reading between the lines of your earlier remarks, I get the impression this will only work correctly on OXZ files uploaded after the script gets installed on the Wiki server.. any files uploaded before then would not get the correct URL applied to them.. is this assumption correct?
(I have a 1.4 version ready for testing, when this goes live)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Instead, I'd rather take it as an opportunity to understand how to build my own extension.
My download counter extension is now active on the sandbox wiki.
When you upload a file there, it creates an entry for it in its database. Every[*] download is piped through a script that updates the counter. I created a new parser function {{#downloads: filename}} that shows the download count or "unknown" if the file is not in its downloads database. For an example on how to use it see the source code of my user page there.
Let me know if this makes sense and give it a test please. If all is well I will move it to the proper wiki.
[*] You can still bypass the counter update script by accessing the file URL directly, e.g. http://sandbox.maikschulz.de/images/3/34/Q-Bomb_Detector_1.3.m.oxz. In order to prevent this, I would have to move the upload directory outside the web server's document root. I just don't see the point, it's only a download counter after all.[/size]
ok, I've got a brand new OXZ to upload but am at a loss how to upload the file. I am clueless on PHP.