.env not included in the app build #6936
-
I'm building an app using Diesel + MySQL, and the Getting Started recommends to create a DATABASE_URL=mysql://mitch:password@localhost/db_name Everything looks good when using
So, I'm guessing the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You potentially could bundle it as a resource, but i think this would not be next to the binary in a .deb package. Also keep in mind that shipping .env files is often not the best idea since then all your users can just read the URL including the password. |
Beta Was this translation helpful? Give feedback.
-
Here's a youtube tutorial on 6 different ways how you can get environment variables set in Tauri, including |
Beta Was this translation helpful? Give feedback.
You potentially could bundle it as a resource, but i think this would not be next to the binary in a .deb package.
Also keep in mind that shipping .env files is often not the best idea since then all your users can just read the URL including the password.
If you don't care about that you could look at https://docs.rs/dotenvy_macro/0.15.7/dotenvy_macro/ which will include the env var from the .env file into the binary at build time (still somewhat easy to read but at least not a plain text file)