FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
177 stars 96 forks source link

GitHub repo adapter #222

Closed philipsc closed 3 years ago

philipsc commented 4 years ago

I made this request in the Flarum community, but have not received a response. https://discuss.flarum.org/d/4154-friendsofflarum-upload-the-intelligent-file-attachment-extension/1019 Hope the author can consider supporting GitHub storage.

https://github.com/yumusb/autoPicCdn

clarkwinkelmann commented 4 years ago

It will be very complicated for us to integrate a library that's not documented in English. But we can accept a PR if someone wants to help with it.

The first step in creating a new adapter would be to write a Flysystem-compatible driver for the upload method, which I don't think that package has.

Also, isn't it possibly against GitHub TOS?

philipsc commented 4 years ago

The project provides an api interface and can be used for PicGo's web-uploader. The API address is written as "http://yourname/up.php", and the POST parameters are filled in with "pic"

clarkwinkelmann commented 4 years ago

I'm keeping this open together with the other adapter suggestions.

If many people express an interest in it, we might consider implementing it. Otherwise we gladly accept PRs for less wanted adapters if the implementation doesn't over-complicate the existing extension.

I do have some concerns regarding whether GitHub would actually allow this. For a few images it might be fine but if the repo in which you store the attachments grows GitHub will likely want you to use something like Git Large File Storage which is billed by the GB, and it probably isn't as cost efficient as other cloud storage methods.

philipsc commented 4 years ago

Can plugin users decide whether to use the same storage? For example, pictures are stored on GitHub, and other files are stored on local or cloud storage.

LCinHK commented 4 years ago

https://github.com/892768447/flarum-ext-github-upload

Here is a complete finished extension, which can be easily merged I guess?

luceos commented 3 years ago

Hi there and thank you for suggesting this upload adapter for fof/upload.

In order to keep this extension maintainable with the few number of people currently involved with it, we do not accept pull requests or feature requests for new upload adapters. The reason for this is that we would need to test the adapter on each upgrade of Flarum, plus whenever changes occur on this API of the upload service.

As a small team maintaining many extensions isn't always easy. That's why we try to reduce the workload by making clear choices on what we do and don't support .

The best option you have is to (have someone) create a completely new extension that registers the additional upload adapter. The maintenance of that extension is then dispersed away from our team. The best way to add your adapter is by listening to the Collecting event using the Flarum\Extend\Event extender.

If you have any questions about the implementation, feel free to open a discussion on the dev tag on discuss.

Thank you for your understanding.