Add plugin doesn't work

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Add plugin doesn't work
« on October 29th, 2012, 04:18 AM »
Sort of putting this in right here, right now.

None of the add plugin stuff works, mostly because I haven't figured out a way that doesn't suck that works without being insecure for uploading plugins.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Powerbob

  • Posts: 151
Re: Add plugin doesn't work
« Reply #1, on October 29th, 2012, 05:49 AM »
Is it possible for Alpha testers to download themselves and apply manually?

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Add plugin doesn't work
« Reply #2, on October 29th, 2012, 07:44 AM »
Pete, you need to start giving up on 'good UI', and just going for 'UI' ;)

You're free to rewrite it later anyway! That's what 'new versions' are for...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Add plugin doesn't work
« Reply #3, on October 29th, 2012, 03:02 PM »
It's not UI at all. It's fundamental security issues that I'm talking about... The UI that is needed is only marginally more than what is there. But I WILL NOT release a version that is insecure by design. I'd rather remove the 'add plugin' stuff and make it so people have to use FTP themselves than crank some half assed solution.

@Powerbob: You can unpack them and upload them to the Plugins folder in Wedge. That's one of the truly great things - uploading a plugin will make it available immediately and since no file changes can occur, that's all that's needed to get it there, then it's just a case of clicking the button to enable it. Disabling, generally, should work the same way, you can just remove or rename the folder to disable it (though, depending on what it does, that is not necessarily ideal)

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Add plugin doesn't work
« Reply #4, on October 30th, 2012, 01:50 AM »
I'd say use FTP (SFTP) and forget upload by PHP. Should anyone besides the root admin be able to add new plugins too his site?
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Add plugin doesn't work
« Reply #5, on October 30th, 2012, 02:07 AM »
I don't see why anyone besides root admin should be able to do so.

On the other hand, in theory the upload could be done via FTP anyway and have PHP handle that connection, but that raises a great many other issues (like avoiding timeouts and the potential contamination via temporary folders)

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Add plugin doesn't work
« Reply #6, on November 5th, 2012, 05:39 PM »
Suggesting that we disable that feature entirely from the UI. That way, we won't get reports on how it's broken...

Also, right now we're using AeMe to upload plugins, and I'm not sure I can find a reason to switch to another system later. So, perhaps we could at the very least retrieve a list of items that are in that particular album. ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Add plugin doesn't work
« Reply #7, on November 5th, 2012, 05:44 PM »
Quote
Also, right now we're using AeMe to upload plugins, and I'm not sure I can find a reason to switch to another system later.
I can think of several reasons, performance being the biggest, followed by having to butcher the crap out of it to save bandwidth while providing all the necessary meta data (there is a reason, after all, why SMF package servers provide XML files, it's so that the relevant information can be provided to users without having to crawl the actual page, and there is a bunch of stuff around that), not to mention the fact that I have various levels of thoughts about things like auto-updating packages, which specifically requires doing a ton of stuff that AeMe currently doesn't or can't support without a lot of work (and none of that should be in the core)

I have thought about simply removing it entirely, but all the time it's there, I can keep telling myself that I'll finish it - if it is removed, I'll stop thinking about how to make it work well, which also means not worrying about things like auto updating.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Add plugin doesn't work
« Reply #8, on November 8th, 2012, 09:08 AM »
We can still use AeMe to host the plugins, and develop a mini-plugin that will help communication between AeMe and Wedge auto-downloads.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Add plugin doesn't work
« Reply #9, on December 2nd, 2012, 06:39 AM »
Putting aside everything related to repos and repo management (though that is a todo), I've been working on this stuff.

The FTP class has been extended to support uploads and downloads, though that's a work in progress and will require more work yet.

There's also a zip handling class coming, that when combined with the FTP class, should make it possible to upload plugins, though admins will have to provide FTP details, and lots of stuff behind the scenes to hopefully make it work on various shared hosts.

The only caveat is that the zip library I'll be adding is LGPL and I've made quite extensive modifications, so to fulfil the licence we need to be able to distribute it standalone. No biggie, there's no Wedge specific code in it.

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Add plugin doesn't work
« Reply #11, on December 2nd, 2012, 07:06 AM »
If you mean the PEAR library, it's unmaintained and had PHP 5.3 issues.

If you mean the not-installed by default class, that doesn't do what I need, nor can be cajoled into doing what I want as far as I can tell.
Re: Add plugin doesn't work
« Reply #12, on December 2nd, 2012, 04:43 PM »
Just to expand when I'm not using an iPod...

SMF has a zip handling library, except it doesn't work on some zip files, Plus it's also about just unpacking the entire archive in full into a local directory which is not what I want.

ZipArchive (in either form) tends to do much the same thing, though both are more capable of handling zip files.

What I need, ultimately, is something that can handle as much of zip files as I can throw at it, and on top of that, I need it to be able to handle extracting files one at a time - and here's the bit that ZipArchive can't do - and I want that file to be pulled into a variable, I do NOT want it pushed out to a file in temp/ not even temporarily.

See, here's how this is going to work. The setup is geared for being able to process this across multiple page loads, so I need to be able to pull things from zip files at will, and I want as little as possible to be in the temporary area. Since the upload must go there by definition, I can't change that, but I can prevent new files appearing in temp, which will be subject to pruning by the operating system and will be subject potentially to tampering from other scripts.

Once I've uploaded the file, I can extract it piece by piece and send that to the server via FTP (and as I understand it, can make this faster by only opening one pair of connections rather than the typical one connection the whole time, one connection per file, but I might have that understanding of FTP wrong)

Hmm. Now that I think about it, actually I can't do it that way. I'm going to ditch the current SFTP class and reimport phpseclib - into its own folder. Condensing the files is rather time consuming and there's been substantial changes since I did it a year ago, so I'll just import the entire library as-is.

I won't be doing that with the PclZip class, because it isn't forwards compatible with PHP 5.x, but also it isn't 'actively maintained', as the last release was in 2009. (Also, of note, the author of PclZip was the former maintainer of the PEAR ZipArchive)

Powerbob

  • Posts: 151
Re: Add plugin doesn't work
« Reply #13, on December 3rd, 2012, 02:35 AM »
TBH I think downloading a zip/arc file to my PC, and extracting it, and then uploading the folder to the plugins directory is very easy as such! I think it's fine as it is. Do we really need an "add plugin option"? I don't think so, but hey what do I know :whistle:

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Add plugin doesn't work
« Reply #14, on December 3rd, 2012, 03:39 AM »
Given how many people seem to have trouble with even the most basic of tasks, I've been wondering the same thing, but on the other hand, if the framework is there for such things, it's also going to be possible to do things like plugin updates.

Cutting this out cuts out a *lot* of other stuff too.