Pectojin / duplicati-client

A command line client for controlling the Duplicati Server
GNU Lesser General Public License v2.1
75 stars 20 forks source link

Set password question #8

Closed swilkey closed 6 years ago

swilkey commented 6 years ago

Hi @Pectojin,

I've been stuck on other projects for the last 3 months but now I'm back working on a duplicati deployment. I'm glad to see that your command line client has continued to make progress in that time.

I've just reinstalled my duplicati application because it was no longer starting (it would die before fully starting up and I couldn't work out why), and as a result, when I first went to the duplicati web gui after the installation I saw the message about "if you have more than one person using this computer you should set a password, do you want to set a password now". (my paraphrase) I tried to find a way that your command line client might be able to respond to that message but I couldn't find anything. Do you know if it is possible?

That would be really helpful for doing automated deployments because then the commandline client could deal with that message as part of the installation process before a user ever had to be confused by the message.

Thanks, Stephen

Pectojin commented 6 years ago

Hey,

It looks like it can be done with a patch request to API/serversettings with the payload:

                    { 'has-asked-for-password-protection': 'true'}

Semantically it may make sense to have a duc set password command which sets the password and remove the message. Then perhaps duc set password --disable to remove the password from the server or just the message if it's run on a fresh installation.

swilkey commented 6 years ago

Thanks @Pectojin, that was the setting I suspected it was. If it is possible to do that with the client that would be wonderful. Regards, Stephen

Pectojin commented 6 years ago

I got the set password command working in my newest commit.

I just want to do a couple of tests before I build and release it, but it's more or less ready.

swilkey commented 6 years ago

Sounds wonderful @pectojin. Does it require a specific build of duplicati in order to use this function or will it work equally with the beta or newer releases? Regards, Stephen

Pectojin commented 6 years ago

I'm not aware of that part of the API having changed in the past year, so - without having verified anything yet - I'm fairly certain it will work with every version in the past year including the beta.

swilkey commented 6 years ago

Once I get to try I'll let you know.

Pectojin commented 6 years ago

I've had time to test it on each platform it all works great. I got a chance to include some other fixes before pushing out the release too 💯

Take a look when you've got time https://github.com/Pectojin/duplicati_client/releases/tag/0.3.16_beta