pro-tip: don't use .env files. They're a hack anyway.
What do you use instead???
Cursor uploads .env file with secrets despite .gitignore and .cursorignore
11–20 of 22 posts
Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#12Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#13 Ignore files: Improved .cursorignore behavior to more consistently exclude files
I don't think I'm crazy to think that a .ignore file should result in perfectly consistent ignoring...Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#14Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#15Earlier quoted context omitted.
What do you use instead???
Tools like direnv gets .env files out of repo paths and improves things a lot. You can integrate secrets management in code, but with that there's still no getting away with the assumption that some kind of auth mechanism exists in your env
export SECRET_KEY=$(pass work/secret_key)
Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#16If the Cursor team is reading, I'd recommend that you give real-time visibility into exactly what's indexed and uploaded and have more rigorous testing and documented guarantees around .cursorignore. That would go a long way toward making people like myself feel better about the product.
Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#17pro-tip: don't use .env files. They're a hack anyway.
Almost every application out there supports environment variables for configuration, and every language supports reading data from the environment.
dotenvs are a clean and lightweight way of using this pattern that works regardless of tech stack. If the language doesn't have a library for loading dotenvs, you can usually write a simple library for it with a few lines of code.
In Golang-land, this is much easier than having to boilerplate your way through a Config interface with a Config struct for defining the YAML schema, though I suppose this is a non-issue with LLMs now.
Ensuring that plain-text dotenvs aren't in gitignore and that encrypted dotenvs are can be enforced with client-side Git hooks, which are painless to set up, in my opinion.
That said, I mostly use sops with PGP these days. YAML is more expressive than dotenv, though sops works well with dotenvs. I would recommend sops + Vault for enterprise scenarios.
Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#18pro-tip: don't use .env files. They're a hack anyway.
I disagree. Almost every application out there supports environment variables for configuration, and every language supports reading data from the environment. dotenvs are a clean and lightweight way of using this pattern that works regardless of tech stack. If the language doesn't have a library for loading dotenvs, you can usually write a simple library for it with a few lines of code. In Golang-land, this is much…
It didn't used to be that way, surprisingly. Most configuration was done via files using INI. Then people started using JSON, and now YAML -- if they have a configuration file at all. Containers pretty much required using environment for configuration because it was the only way to "inject" configuration before we got volumes and fancy stuff like secrets.
That doesn't make it any less of a hack instead of a proper configuration format.
Re: Cursor uploads .env file with secrets despite .gitignore and .cursorignore
#19Earlier quoted context omitted.
I disagree. Almost every application out there supports environment variables for configuration, and every language supports reading data from the environment. dotenvs are a clean and lightweight way of using this pattern that works regardless of tech stack. If the language doesn't have a library for loading dotenvs, you can usually write a simple library for it with a few lines of code. In Golang-land, this is much…
> Almost every application out there supports environment variables for configuration It didn't used to be that way, surprisingly. Most configuration was done via files using INI. Then people started using JSON, and now YAML -- if they have a configuration file at all. Containers pretty much required using environment for configuration because it was the only way to "inject" configuration before we got volumes and fa…