Rama4 / yelpcamp

A full-stack Node.js project from my web dev course
https://rama-yelpcamp.herokuapp.com/
7 stars 0 forks source link

Some people are adding NSFW images #1

Closed FrozenHearth closed 6 years ago

FrozenHearth commented 6 years ago

Just saw your Yelp Camp project on Heroku and I saw that some people are adding NSFW images to your project. You might want to look into that.

AlexMachin1997 commented 6 years ago

I wouldnt say there NSFW images. However, if you @FrozenHearth wanted to block this he could add cloudinary api addons which can prevent adult content.

FrozenHearth commented 6 years ago

Well, one of them is a picture of an adult star, which seems pretty intentional by the guy who posted it.

Yeah he needs to do that, and first of all, delete those images.

Rama4 commented 6 years ago

thanks for bringing up this issue to me, and sorry for seeing this late. can i make all future campground/comment additions to await moderation, before it is displayed? i.e if any user submits a campground, it does not get displayed in public until i review it....

if you guys have any other solution please tell me..

AlexMachin1997 commented 6 years ago

As i previously mentioned you can add an adult content filter if you are using cloudinary. If adult content detected then it wont allow submission.

https://cloudinary.com/blog/automatic_image_moderation_removing_adult_or_inappropriate_photos_using_webpurify_and_cloudinary

Rama4 commented 6 years ago

hey, can you check now? i think i resolved it.. i tried uploading a bad image, and it got rejected.. As of now, only the owner of the rejected image can see it. If no one is logged in, or another user logs in, they cannot see rejected image

AlexMachin1997 commented 6 years ago

Hey @Rama4 i got an internal server error when trying to upload a camp with an adult themed photo.

You might want to check your application log on heroku

Rama4 commented 6 years ago

oops, i missed an open brace in a file.. fixed it try now.. it should work..

AlexMachin1997 commented 6 years ago

It shows awaiting moderation, is this what should happen ? i would take advantage of cloudinary API and automatically filter adult content out, it uses machine learning so its pretty accurate lol

Rama4 commented 6 years ago

yeah it does use cloudinary api to automatically filter. once you upload the image, the state of the image is set to 0 (pending). when the response arrives from cloudinary webpurfy api, there are 2 possible scenarios: accepted and rejected.

case 1: image awaiting moderation: what the owner sees: "awaiting moderation" text what everyone else see: nothing

case 2: image was rejected by webpurify what the owner sees: "image rejected" what everyone else see: nothing

case 3: image accepted by webpurify: everyone sees the image

so, when you upload the image, it will initially be pending , then you refresh the page, and see the result of moderation. It usually gets filtered instantly, so we might not necessarily see the "pending moderation" text..

Rama4 commented 6 years ago

hey, i saw the logs, and it seems that webpurify was unable to load your image.. log: { error: { message: 'Resource not found - Error in loading https://www.pornhub.com/gif/16166312 - HTML response', status: 404 } } probably it doesn't filter gifs.. can you try with an image?