Hosting site for oxz files

General discussion for players of Oolite.

Moderators: another_commander, winston

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Hosting site for oxz files

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

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

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

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

Post by maik »

Dylan just confirmed the requested changes, uploads to the wiki are now possible up to 150MB.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2560
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Hosting site for oxz files

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

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

Post 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)

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

Post 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]

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Hosting site for oxz files

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

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

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

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Hosting site for oxz files

Post by Diziet Sma »

Ok.. thanks for the clarification.
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

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

Post 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

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Hosting site for oxz files

Post by cim »

Yes, that works fine.

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

Post by maik »

Cool, thanks!

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Hosting site for oxz files

Post 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)
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

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 1881
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Hosting site for oxz files

Post by maik »

Both correct, Diziet Dma.

Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 1998
Joined: Mon May 31, 2010 11:11 pm

Re: Hosting site for oxz files

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

Post Reply