https://discord.cloudflare.com logo
Join Discord
Powered by
# r2
  • b

    brett

    04/27/2022, 6:34 PM
    makes an albert shapes jail in this connection limiting code
  • k

    kian

    04/27/2022, 6:34 PM
  • k

    kian

    04/27/2022, 6:34 PM
    he'll find a way to jailbreak
  • v

    Vitali

    04/27/2022, 6:35 PM
    If by putting out fires you mean jetting off to a beachy vacation to sip on a beer
  • v

    Vitali

    04/27/2022, 6:35 PM
    Next time I double-check with @brett before asking the community to DDOS us
  • a

    albert

    04/27/2022, 7:37 PM
    Copy code
    lua
    local function get_storageops_rate_limit(account_id)
        if account_id == "e5f0f929bb59b9d5e1bc9b35e9e3bf00" then
            return 200
        else
            return 1000
        end
    end
  • k

    kian

    04/27/2022, 7:38 PM
    Copy code
    lua
    local function get_rate_limit_message(account_id)
      if account_id == "e5f0f929bb59b9d5e1bc9b35e9e3bf00" then
        return "albert plz"
      else
        return "Your account is doing too many concurrent storage operations. Please back off and try again later"
      end
    end
  • v

    Vitali

    04/27/2022, 8:00 PM
    What we actually do.
    Copy code
    local function get_storageops_rate_limit(account_id)
        if account_id == "e5f0f929bb59b9d5e1bc9b35e9e3bf00" then
            return 1000 - 1 / timeSinceLastRequest(account_id)
        else
            return 1000
        end
    end
  • i

    itsmatteomanf

    04/27/2022, 8:07 PM
    I'd remove the limit on his account, just limit him to whenever no one is doing anything.
    return 1000 - 1000 / timeSinceLastRequest()
  • i

    Isaac McFadyen | YYZ01

    04/27/2022, 8:07 PM
    Hahaha \*evil laugh\*, my upload will stop yours Albert!
  • a

    albert

    04/27/2022, 8:08 PM
    Make requests fast enough and that function will return a negative value, causing R2 to crash yet again 😛
  • i

    itsmatteomanf

    04/27/2022, 8:09 PM
    It will not, assuming the return value is in milliseconds, meaning it will never go <1 🙂
  • i

    itsmatteomanf

    04/27/2022, 8:10 PM
    But rounding up to the closest second works for me, too 😛
  • a

    albert

    04/27/2022, 8:13 PM
    They really need to round up or they'll be dividing by zero 👀
  • i

    Isaac McFadyen | YYZ01

    04/27/2022, 8:14 PM
    What language is that?
  • i

    itsmatteomanf

    04/27/2022, 8:14 PM
    Yeah, rounded to the integer above, in whatever unit they want ahah
  • i

    Isaac McFadyen | YYZ01

    04/27/2022, 8:14 PM
    Ooh Lua?
  • i

    Isaac McFadyen | YYZ01

    04/27/2022, 8:14 PM
    Wow interesting.
  • a

    albert

    04/27/2022, 8:16 PM
    It's part of the joke. Cloudflare’s web server (and the regular rate limiting code) is written in Lua 🙂
  • a

    albert

    04/27/2022, 8:18 PM
    Well, NGINX is written in C, but Cloudflare's add-ons are mainly Lua.
  • k

    kian

    04/27/2022, 8:19 PM
    The original WAF by JGC was Lua iirc
  • k

    kian

    04/27/2022, 8:19 PM
    Not sure how much of it still is - if any
  • k

    kian

    04/27/2022, 8:20 PM
    It's one of the first tags on Cloudflare's company profile on LinkedIn
  • k

    kian

    04/27/2022, 8:20 PM
  • a

    albert

    04/27/2022, 8:20 PM
    It is :P
  • k

    kian

    04/27/2022, 8:22 PM

    https://www.youtube.com/watch?v=nlt4XKhucS4â–¾

    is cool - even if most of the slides are unreadable
  • i

    itsmatteomanf

    04/27/2022, 8:23 PM
    Guys... #812577823599755274? 🙂
  • j

    john.spurlock

    04/27/2022, 9:49 PM
    if
    R2PutOptions.md5
    is provided as a string, should it be in hex or b64?
  • d

    darrennotfound

    04/27/2022, 9:53 PM
    Send the string here
  • j

    john.spurlock

    04/27/2022, 9:55 PM
    huh?
1...686970...1050Latest