.data/ folder not disappearing when sharing

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.

Any idea what might going on?

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.

It was said that:

Is that not still true?

Hmm. So it seems if you create a ‘hidden’ file it remains in the visible in the editor. Which kind of makes sense when you first create it…

However you can then create a .gitignore to hide what you’ve created…

Refresh the UI or wait a few moments…

Delete the .gitignore and the .data directory remains hidden, the file does not.

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.

1 Like

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.

2 Likes

@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?

Gareth I believe no longer works at Glitch.

I hope someone will reply then…

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.

2 Likes

Or, try running this:

ls -a .data/

tell us the contents so we can help you!

And also, if files have a dot (.) at the beginning, they should be automatically be hidden.

If the .data folder is only hidden and not deleted, then how do I access the contents of the folder? Like is there a way to show hidden folders?

You can use ls -a in the root directory to see all files and folders.

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?

There is not a way any longer. You could use the terminal to edit your file in a programming editor built in the nano command.

Try running

nano .data/filename.csv

Oh ok, thanks! Hopefully some Glitch editor person adds a feature like that sometime soon!