Page 3 of 5

Re: Hosting site for oxz files

Posted: Fri Feb 21, 2014 5:34 pm
by cim
Norby wrote:
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.

Re: Hosting site for oxz files

Posted: Sun Feb 23, 2014 9:48 pm
by maik
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.

Re: Hosting site for oxz files

Posted: Fri Feb 28, 2014 10:32 am
by maik
Dylan just confirmed the requested changes, uploads to the wiki are now possible up to 150MB.

Re: Hosting site for oxz files

Posted: Sat Mar 01, 2014 11:08 am
by Norby
It is a good news, thank you!

Here is a wiki download counter, can you check it please?
http://www.mediawiki.org/wiki/Extension:DownloadCounter

In this way we should use links like download.php?f=path/some.oxz in wiki pages of oxzs and in the oxz manager also to count all downloads.

Re: Hosting site for oxz files

Posted: Sun Mar 02, 2014 10:08 am
by maik
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. 8)

Re: Hosting site for oxz files

Posted: Fri Mar 21, 2014 10:43 am
by maik
maik wrote:
Instead, I'd rather take it as an opportunity to understand how to build my own extension. 8)
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]

Re: Hosting site for oxz files

Posted: Sat Mar 22, 2014 6:16 am
by Diziet Sma
maik wrote:
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:

Code: Select all

{
	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";
}

Re: Hosting site for oxz files

Posted: Sat Mar 22, 2014 7:36 am
by maik
Diziet Sma wrote:
maik wrote:
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:

Code: Select all

{
	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.

Re: Hosting site for oxz files

Posted: Sat Mar 22, 2014 7:48 am
by Diziet Sma
Ok.. thanks for the clarification.

Re: Hosting site for oxz files

Posted: Sat Mar 22, 2014 8:17 pm
by maik
@cim: could you please verify that this method still works with your OXZ downloader? The test link would be http://sandbox.maikschulz.de/img_auth.p ... _1.3.m.oxz. The php script streams the file as response.

Cheers,
-Maik

Re: Hosting site for oxz files

Posted: Sat Mar 22, 2014 8:55 pm
by cim
Yes, that works fine.

Re: Hosting site for oxz files

Posted: Sat Mar 22, 2014 10:00 pm
by maik
Cool, thanks!

Re: Hosting site for oxz files

Posted: Sun Mar 23, 2014 6:28 am
by Diziet Sma
maik wrote:
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)

Re: Hosting site for oxz files

Posted: Sun Mar 23, 2014 7:24 am
by maik
Both correct, Diziet Dma.

Re: Hosting site for oxz files

Posted: Sun Mar 23, 2014 11:30 pm
by Switeck
maik wrote:
maik wrote:
Instead, I'd rather take it as an opportunity to understand how to build my own extension. 8)
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.