3
Python 3/ Secret Keys for everyone
Zertyazertyu (2)

Hello, i'm a newbie on repl.it, so I cheked the doc to see how we can hide files (with .env file). It works fine for some projects but now i want to make a kind of console that requests username and password to start (if the guy enters his logins he gets a key to decode the content of other files to read them). My code works.. only for me ! The reason is that .env files are protected for others peoples so i can't really finish my project (it's for a RP game)

Is there any alternatives to .env files ? I want that only the program can read .env files but users can't directly access to it with filetree.

I'm on python 3 but if solutions are only on others languages I can migrate
Sorry for my bad english, I'm french

You are viewing a single comment. View All
1
Zertyazertyu (2)

@heyitsmarcus
Hello !
I'm really sorry but your solution don't work as I want.
I created a main file with:

import dotenv
import os

dotenv.load_dotenv()

print(os.getenv("SECRET"))
print(dotenv.find_dotenv(".env"))

So the code worked for me in my own environnement, but when I try to launch it with the console link https://Brouillon-test-poubelle.zertyazertyu.repl.run the .env is hidden so there are no secret key and no file path...

I need that other peoples can use a login and password but without being able to easily read the file that contains login infos

Is there any solution for this specific case ? Or do i need to create a flask server ? It could be really annoying

Thanks for your patience