Retrieving storage encryption password?

I had setup a test backup via duplicacy-web a while back, configuring the “encryption password” via the web UI.

I now wanted to do a restore test via the duplicacy CLI version. The problem is that I do not remember the encryption password I had setup for this test data set, so I cannot init the storage space.

Because this is just a test, I could re-create the data set, but I’d rather avoid that option if possible to save on upload time and network bandwidth costs (it’s on a cloud storage).

Since I have the duplicacy.json file and the administration password for the duplicacy-web installation (“the password to encrypt/decrypt the passwords/credentials stored in the configuration file”), is there a way to retrieve the storage password (i.e. : the one I will eventually have to pass with the “-e” flag of cli version?)

Thanks,
Gabriele

Would be inappropriate, from a design perspective, if you could recover the password from the json file.

But, take a look on this topic:

You can do this by starting duplicacy-web with the old configuration and then inspecting the environment of any running duplicacy process that calls that storage. For example, on a Linux host, I would use pgrep -fl duplicacy to show the process id of the duplicacy command that’s running via duplicacy-web (easiest way is to schedule a check). With this process id in hand, you can use procfs to inspect the environment via the file /proc/<pid>/environ. Putting it all together, I’d use sudo cat /proc/$(pgrep -n duplicacy)/environ (-n tells pgrep to show the pid of the newest duplicacy process). I’m not sure how to inspect the environment on non-windows based systems, but I bet someone else can help.

1 Like

That is a nice trick from @tedski, but there is an undocumented option that can print out all credentials passed to the CLI process as environment variables:

duplicacy_web_osx_x64 -print-credentials
2 Likes

Why is it undocumented? Well, I guess now it is documented, so: why was it undocumented?

How does this work? Does it work with the Web Edition for WIndows? I tried running it from CLI and got no output. I see nothing in the duplicacy_web.log or anything in the GUI either.

Maybe coz it works only on osx? On windows it doesn’t work

1 Like

It is supposed to send the credentials to stdout, but there may be some issue with stdout in DOS prompt. Unfortunately I’m travelling and won’t be able to look into this in a few days.