Limit on .env variable length

Hi lads.

Just curious, is there a specific length on how long an env variable (or it’s value) can be? I accidentally pasted in a 500kb userscript into the value and it works just fine, which is strange to me.

Anyways, hope to hear back soon!

1 Like

Hi there! I think there’s no limit, unless it’s bigger than your project-wide limit.

So in theory i could somehow execute code stored within a .env variable? Seems like a big flaw in my eyes.

I don’t think that’s really a huge flaw. Technically, yes, if you for example base64 encrypted the code and then decrypted it. But if you wanted to hide your code check out the .data folder - anything you put there will only be accessible with the terminal after creating it and refreshing the editor and it won’t be included in remixes - it’s the ideal place to store sensitive databases.

Not talking about db. Just code in general

If you are looking to hide your code, .env isn’t the place - you’ll have to encode it in some way so it fits the .env format, and .env just isn’t made for that. In that case, just make a file under the .data folder and call it in node - but beware, that might violate Glitch’s t&os.