Note: This post now archived and as such no longer works

An external image showing your user-agent and the total "hit count"

  • @[email protected]
    link
    fedilink
    English
    351 year ago

    Salient demonstration, but if image proxying were to come to Lemmy I’d hope it was made optional, as it could overburden smaller instances, especially one-person instances (like mine). We also need a simple integrated way of configuring object storage.

    • Skull giver
      link
      fedilink
      141 year ago

      It would also introduce some nasty side effects. Imagine someone posting CSAM in memes@ and having that shit replicated across thousands of servers.

      Mastodon does this and I can’t say I’m a big fan of that approach to be honest.

    • @[email protected]
      link
      fedilink
      English
      31 year ago

      A better solution could be having an image proxy as a separate service, and somehow managing a list of proxies that are used for loading the image. Of course the clients themselves would have to deal with choosing to use the proxy… except if the backend serves the proxied image URL instead of the original one (and maybe that too under a new name)

  • @[email protected]
    link
    fedilink
    111 year ago

    Man, I remember I scared the crap out of trolls on Reddit when we started arguing over DM, and I added a link to a meme that tracked their IP and system info (without them knowing ofc). Let’s just say they went AFK quickly after that. Good times!

    • @[email protected]
      link
      fedilink
      31 year ago

      it is because the website providing the image is overloaded and cannot create an image.
      You just have to reload the image and eventually you will see one.

  • @[email protected]
    link
    fedilink
    English
    20
    edit-2
    1 year ago

    Easiest way to stop this from happening is to use ublock origin to block all third party request on your instance.

    One way to do this is via dynamic filtering. This is for advanced users so be sure to read the info page: https://github.com/gorhill/uBlock/wiki/Dynamic-filtering

    (Consider backing up your ublock settings before doing this)

    If you are using lemmy.ml your rule would be this:

    lemmy.ml * 3p block
    

    if you’re using another instance then change the domain or use both rules cause you might end up visiting the others as well. Note that adding this rule wont work unless enable advanced features in ublock origin.

    EDIT: THIS MIGHT BREAK THINGS ON YOUR INSTANCE, its recommended to learn how to use dynamic filtering to unbreak it: https://github.com/gorhill/uBlock/wiki/Dynamic-filtering:-quick-guide If it breaks stuff just remove that rule.

    You could also block it using static filters but I can’t remember how to do that exactly, if you know please reply below.

  • edric
    link
    fedilink
    51
    edit-2
    1 year ago
    • Mlem - knows exactly that it’s Mlem.
    • Memmy - sees Mobile Safari webkit.
    • Voyager - same as Memmy.
    • Thunder - just sees Mobile Client.
  • Skull giver
    link
    fedilink
    1691 year ago

    Made a meme one that took 3 minutes to program, 5 minutes to find a good offline GeoIP location source for, 10 minutes to come up with a design for, and half an hour to make sure nothing got logged by the web server.

    An image that tells you where you live based on your GeoIP location

    • WndyLady
      link
      fedilink
      English
      51 year ago

      I wonder why the Baltimore community is so dead, then.

      • @[email protected]
        link
        fedilink
        121 year ago

        It’s not the image, it’s a normal image. The server does the hard work when you make the request, and then it just builds the image accordingly.

        • SokathHisEyesOpen
          link
          fedilink
          41 year ago

          Yeah I saw OPs explanation in the comments. That is fucking cool! And scary! I’ve never needed to generate images with code before, so Ive never even considered something like this before.

      • Skull giver
        link
        fedilink
        25
        edit-2
        1 year ago

        The image is generated on demand by a PHP script. It’s not a static image file. Every time the web browser sends a GET /poc.png, a new image is generated based on the information your browser or app sends the server.

        It’s actually how a lot of tracking code works. The image data returned may be the same, but the data collection through cookies and maybe even some passive fingerprinting all happen every time you send a request.

      • Skull giver
        link
        fedilink
        17
        edit-2
        1 year ago

        Probably has bugs. Probably no security bugs. Feedback is welcome (but I don’t care enough about this to try my hardest).

        require_once('/var/www/html/geoip2.phar');
        use GeoIp2\Database\Reader;
        
        $ip = $_SERVER['HTTP_X_REAL_IP'] ?? $_SERVER['REMOTE_ADDR'];
        
        $cityReader = new Reader('/var/local/php/GeoLite2-City.mmdb');
        $record = $cityReader->city($ip);
        
        header('Content-Type: image/png');
        
        $image = @imagecreatefrompng('lemmybase.png');
        
        $black = imagecolorallocate($image, 0, 0, 0);
        
        // "Some City, SS, Country Name"
        $text = $record->city->name . ', ' . $record->mostSpecificSubdivision->isoCode . ', ' . $record->country->name;
        
        /* $font_path = '/tmp/ComicSand.ttf'; */
        $font_path = '/usr/share/fonts/ubuntu/Ubuntu-M.ttf';
        
        // Render text
        imagettftext($image, 30, 0, 28, 224, $black, $font_path, chunk_split($text, 22));
        
        // Dump image to web server
        imagepng($image);
        
        // Free resources
        imagedestroy($image);
        

        Edit: damn, Lemmy really hates < ? php. Just imagine that’s the first line in the file.

        • @[email protected]
          link
          fedilink
          101 year ago

          Damn, PHP is such a sleeper of a language, I always forget how useful it can be.Thanks for sharing!

          • Skull giver
            link
            fedilink
            81 year ago

            PHP is underappreciated, especially recent PHP. Null coalescing operators! Actually typed variables that produce an error if you pass the wrong type! It’s superior to Python despite it’s mid-2000s-spaghetti-college-kid-developer reputation.

            Hell, I may get downvoted for this, but I honestly believe PHP’s Doctrine is superior to Java/Kotlin’s Hibernate. Symfony and Spring are almost equally good in terms of functionality, though PHP is quite a lot slower, sadly.

            • @[email protected]
              link
              fedilink
              English
              1
              edit-2
              1 year ago

              Genuinely curious, how is it superior to Python in your opinion?

              Edit: Apart from the things you listed 😅

              • SokathHisEyesOpen
                link
                fedilink
                41 year ago

                It can run natively on an Apache server without any frameworks required to render user website markup and serve pages. That’s a pretty awesome advantage.

          • SokathHisEyesOpen
            link
            fedilink
            31 year ago

            PHP is the OG bad-ass for getting shit done. No setup, no compile, no deployment pipelines. Hell, you can create and write the files right there on the server with nothing more than an SSH terminal if you want.

      • Skull giver
        link
        fedilink
        11 year ago

        Haha it’s just an IP lookup in a free database I’ve downloaded, I did 0% of the hard work. Thanks for the reply anyway!

    • @[email protected]
      link
      fedilink
      261 year ago

      Joke’s on you. IP geolocation where I am is an unreliable mess and your image got it wrong by about 1000km!

      • Skull giver
        link
        fedilink
        131 year ago

        I’m sure it would be better if I paid MaxMind money, but that’d go a bit far for a stupid meme picture that I’ll probably take down in less than a week.

    • TwinTusks
      link
      fedilink
      English
      211 year ago

      Location is right, but I highly doubt anyone near me is using Lemmy (dictatorship here).

      • Skull giver
        link
        fedilink
        261 year ago

        If you live in a dictatorship and this thing can get your location right, you should probably be using some kind of VPN. Wouldn’t want you to run into trouble with the regime!

    • @[email protected]
      link
      fedilink
      11 year ago

      I hate this so much. Its super cool but MAN what the hell. I don’t think I’m going to ever turn off my VPN anymore. I’m in a super small town and that image is correct.

      It’s cached somewhere because I can’t get it to update. Maybe time for a new account too. Hmmmm

      • Skull giver
        link
        fedilink
        1
        edit-2
        1 year ago

        It’s should only be cached in your browser. Try opening the image in a new tab and hitting Ctrl+Shift+R. Opening it in a porn tab or clearing your browser cache should also work.

    • Rin
      link
      fedilink
      4
      edit-2
      1 year ago

      I was wondering for a second why my town of all places was posted lmao. Also made me realize I forgot to turn my vpn back on.

    • 👁️👄👁️
      link
      fedilink
      English
      71 year ago

      Woah this is really cool. Though I was way off for me and I’m not on a VPN right now.

    • Altima NEO
      link
      fedilink
      English
      31 year ago

      Hah, not my town, but close. That’s where my ISP is located though.

    • @[email protected]
      link
      fedilink
      41 year ago

      This is great, because it located me about a full day’s drive from where I live, so I’m still pretty anonymous :-)

    • @[email protected]
      link
      fedilink
      61 year ago

      Thanks for the heads-up.

      Routing my Lemmy mobile app through orbot from now on. Seems to have fixed the issue.

    • newIdentity
      link
      fedilink
      11 year ago

      Hey. I wanted to do this tomorrow.

      Well I have a new idea which is pretty similar

        • newIdentity
          link
          fedilink
          41 year ago

          I’m plannig to make one of these “dox’d memes” where someone says something controversial and another one answers with the ip address.

          • Skull giver
            link
            fedilink
            31 year ago

            Ah, I see! I was also thinking of maybe using something like Google Earth to make a GIF that zooms into your local area but that was waaaaaaay to computationally expensive to render on the server.

  • @[email protected]
    link
    fedilink
    55
    edit-2
    1 year ago

    I’m fine with this. Instances shouldn’t proxy or cache images because it opens instance owners to a lot more liability than text. A client side setting to not load images in comments by default is better.

    • @[email protected]
      link
      fedilink
      English
      71 year ago

      Each instance stores post thumbnails locally even if the post was on another server. It actually takes up quite a bit of hdd space.

  • @[email protected]
    link
    fedilink
    131 year ago

    What does it say? on jerboa is states that i use unknown mobile client, with infinity, android client. All i have is adaway on my phone