JoeGandy / ShareX-Custom-Upload

A little PHP script created for uploading custom sharex files to your own webserver
MIT License
166 stars 50 forks source link

Adding IP to gallery #41

Closed ghost closed 5 years ago

ghost commented 5 years ago

I've gone ahead and added my IPv6 and IPv4 to the gallery and neither are working. Am I missing something?

DJkikisa commented 5 years ago

Make an extra php file and check if : <?php echo $_SERVER['REMOTE_ADDR'] Dumps your ip.

ghost commented 5 years ago

na, not my ip, I'm using cloudflare. Is there a specific setting I can turn off on cloudflare to release my IP.

DJkikisa commented 5 years ago

Then you need add this code in index.php: if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; }

JoeGandy commented 5 years ago

Hi, I've recently done some work and made it more clear what IP needs adding to the gallery, go ahead and grab the latest update and let me know if you have any trouble :)

DJkikisa commented 5 years ago

Hi, I've recently done some work and made it more clear what IP needs adding to the gallery, go ahead and grab the latest update and let me know if you have any trouble :)

If using cloudflare need add extra check since, cloudflare gives client ip through other variable. Script what posted gives fix for it. Of course you can make extra security check to check if info comes from cloudflare servers.

JoeGandy commented 5 years ago

Hi, I've recently done some work and made it more clear what IP needs adding to the gallery, go ahead and grab the latest update and let me know if you have any trouble :)

If using cloudflare need add extra check since, cloudflare gives client ip through other variable. Script what posted gives fix for it. Of course you can make extra security check to check if info comes from cloudflare servers.

Ah, yep you're right. I glossed right over that for some reason, sorry!

I'll set up a PR tonight or tomorrow :)

ghost commented 5 years ago

I'm getting an error with the CHMOD perms saying they need to be 777 but I've already set them to 777 and I've triple checked

EDIT: I fixed it. thank you guys for your help!

JoeGandy commented 5 years ago

Added PR #45 to address ip issue for future :)