Hi! It is my understanding that anything I store in the .data/ folder won’t be seen when shared, but mine isn’t disappearing when I look at the link for sharing with non-contributors in incognito mode. It’s still there for an anonymous user.
The .data folder will be empty if someone remixes the project but is otherwise visible.
The .env file is the one you can use to share your projects while keeping ‘secrets’. Its contents are not visible to others.
That kind of works around the issue, for now, wonder if the default behavior changed at some point and it wasn’t noticed til now - personally I always expect files I specifically create through the editor to remain visible.
To clarify, if the file was created in the editor and is in a directory starting with ‘.’, it will wait until the container sleeps and restarts before it becomes hidden. So that would happen if you close the browser window and wait 5 min for the container to sleep due to inactivity, but you can also force a refresh event by adding/editing a .gitignore, or calling the ‘refresh’ command from the console.
As shindakun says, .env is the only file that’s truly private and shows blank values on sharing. So it’s where we recommend storing sensitive credentials. Since multi-line env vars aren’t supported, a private key would have to be on a single line (which you can use new line characters to make happen). Anything in .data isn’t copied on remix though.
@Gareth, I was using a .data folder to store a CSV with usernames and passwords for a website I am creating with Flask. I closed the browser, and when I re-opened the project, the CSV file was gone, even though I am the owner. Shouldn’t the .data folder only not remix? I thought .data only made sure files inside it were not remixed, but it seems as though they automatically get deleted. Is this true?
Chances are, it’s not gone, only hidden. Can you run cat .data/csvfilename.csv in the terminal and see what happens? It should output the contents of the file.
But is there a way to access it on Glitch? like in the folder view and not the terminal? Because if for example I have a CSV file inside the .data folder that I need to edit, is there a way to show the file/folder on the Glitch UI?