@baris thanks very much for this. I'll test it now
Edit - from what I can see, everything now works as expected. Thanks
Removed the imgur client ID setting from admin/settings. After enabling the plugin the id can be put in the plugins/imgur page. Once enabled all images including user profile images, post images, site logo and category images are uploaded to imgur through the plugin. The only thing that is saved to local is the favicon.ico since imgur doesn't seem to allow icons.
Might have to do some more work there since some plugins like the S3 should still work for the icon.
Nice work! Are you calling
.hasListeners() to hide the upload fields if no upload plugins are installed?
Yeah kind of
config.hasImageUploadPlugin = Plugins.hasListeners('filter:uploadImage'); is in the api/config.
@baris, is it possible to specify that only images by a non-admin be uploaded to Imgur or S3 or other Cloud storage platform? That is, the only images saved locally will be those by the admin or any user in the admin group. Is that doable?
@planner nope, it goes for all uploads. Reason being is that ideally you can have NodeBB running on several servers fronted by a load balancer, and data is sorted in a shared manner. That's why you use an asset server (s3, imgur, rack-cdn, nginx) for file uploads. Ideally we'd have a plugin that was "nodebb-plugin-uploads-local" or something, which was one that wrote to disk where NodeBB is running and serves using connect.static or something.
Ideally we'd have a plugin that was "nodebb-plugin-uploads-local" or something, which was one that wrote to disk where NodeBB is running and serves using connect.static or something.
Yeah, that's the idea whenever we create hooks to move core features to plugins. When we move search to its own hooks, a Reds NodeBB plugin will be created.
I'm not sure about this, but are uploads sorted by month and year? If not, any plans to make it so?
@planner For the S3 Uploads plugin I just released, I used UUID's, but it's fairly straight forward to write a plugin that stores the files with a different name format.
Hi @baris ,
After installed client id to setting, everytime i try to upload images it just give an error "invalid image". Please help
I had the same problem too... make sure you updated the plugin to latest
npm install nodebb-plugin-imgur
npm install nodebb-plugin-imgur
@psychobunny Yup, mine is the latest one, but still unluck, did u manage to make it work?
Any chance to import from an image url ?
Just pick an application name and use
Anonymous usage without user authorization rest is optional.
@baris imgur insists on this
Authorization callback URL
What should I do?
Just put in your site url.
Further documentation: https://docs.nodebb.org/en/latest/admin/uploads.html?highlight=imgur
Hi @Baris, is there a way to configure the plugin to upload the images to a specific account? I believe the current plugin uploads everything to the "anonymous" area.
@baris is there a reason why it wont allow pdf uploads? I keep getting an error that uploads are not enabled.
@DanaGriffin Imgur will only allow images, if you want to upload other files, you will need to use the local file uploader.