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.

Howdy,
Any chance there is an update to exporting credentials in windows?

The credentials are actually sent to OutputDebugString on Windows with -print-credentials, so you can view them with DebugView.

1 Like

I couldn’t see the output with the DebugView even with “capture global” option enabled and running as admin.

When I run

duplicacy_win_x64_2.6.1.exe -print-credentials

I get

Incorrect Usage

-print-credentials is an option for the web GUI executable, not the CLI.

2 Likes

Oops, understood. It worked, thanks.

Perhaps this should be documented somewhere (i.e. in the guide)?

@gchen should this still work? because it does not work for me. I am launching duplicacy_web_win_x64_1.6.3.exe -print-credentials from the cmd, that makes duplicacy launch, I tried both as admin and not as admin, but I always just see this in DebugView:

So no credentials anywhere.