[nodebb-plugin-imgur] Imgur Plugin


  • Admin

    NodeBB Plugin Imgur

    A plugin that uploads images to Imgur.

    Installation

    npm install nodebb-plugin-imgur
    

    Setup

    • Register an imgur app here

    • Once you register you will get a client ID and secret.

    • Enter these values in your NodeBB ACP page.

    • After entering the values click Authorize, you will be redirected to imgur to allow access to your app.

    • Once you allow access you will be redirected back to nodebb.

    • Optinally create an album for your forum on imgur and put its album ID in the NodeBB ACP.

    More info on Github


  • Admin

    Oh nice! I think this'll count for a submission to Plugin Weekend v4... how does this alter existing behaviour in NodeBB?


  • Admin

    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.


  • Admin

    Nice work! Are you calling .hasListeners() to hide the upload fields if no upload plugins are installed?


  • Admin

    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.


  • Admin

    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


  • Admin

    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?


  • GNU/Linux

    Any chance to import from an image url ?



  • @baris, how exactly should the imgur app be configured?


  • Admin

    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?


  • Admin

    Just put in your site url.


  • Admin



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


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.