pwpush-ephemeral: How to Add Persistence? #448
-
What is the background of the behavior "in the sqlite3 version of the container the data does not survive container restarts"? Is it just that is was not important enough so the logic to check for an existing file before creating a new one wasn't implemented yet? Or is it more complex than expected? I am asking because sqlite would be great for me, but although data not hugely important some level of persistence would be great. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
There are a couple reasons: 1. But not all hope is lost. If you don't want to run the Postgres or Mysql flavors, you can make the ephemeral version persist data by providing a Docker bind mount for the sqlite3 file. For the pwpush-ephemeral container, the path to the sqlite3 file is You can't overlay that whole directory because there are other bits in there but you could overlay that file with your own external sqlite3 file. (even a zero byte file created with
I hope this helps. If you have any issues, let me know. |
Beta Was this translation helpful? Give feedback.
-
You are right @jonnjonzzn. The ephemeral container doesn't automatically setup the database. I'll fix this soon and publish a new container image. In the meantime, if you want to fix your container that is giving you the
I'll post back once I push out another container with the fix. |
Beta Was this translation helpful? Give feedback.
-
Hi all, with This should allow you to replace the sqlite3 file as described in this comment above and have everything work out of the box. Please let me know if any issues remain. |
Beta Was this translation helpful? Give feedback.
There are a couple reasons:
1.
pwpush-ephemeral
was intended to throw up a quick instance, share some passwords and then delete all existence that it ever existed2. sqlite3 doesn't support concurrency so more than 1 user on the same record and errors start happening. It would be problematic for me to support that officially.
But not all hope is lost. If you don't want to run the Postgres or Mysql flavors, you can make the ephemeral version persist data by providing a Docker bind mount for the sqlite3 file.
For the pwpush-ephemeral container, the path to the sqlite3 file is
/opt/PasswordPusher/db/db.sqlite3
.You can't overlay that whole directory because there are other bits in there but y…