syncthing / syncthing-android

Wrapper of syncthing for Android.
https://syncthing.net/
Mozilla Public License 2.0
3.42k stars 379 forks source link

Syncthing looses user and password changed in GUI after restart #1710

Open wAmpIre opened 3 years ago

wAmpIre commented 3 years ago

Version Information

Syncthing Version: v1.18.3, v1.18.2 and older
Android Version: LineageOS 16, 17, 18

Steps to reproduce

So ONLY username and password are reseted - all other settings remain changed.

This ONLY happens on my Android devices. Linux devices with syncthing don't loose their settings.

Catfriend1 commented 3 years ago

Hi,

this is expected to happen when looking at the code. There's a default password creation routine running on startup.

Update 2023/10:

Fixed by: https://github.com/Catfriend1/syncthing-android/pull/1019

wAmpIre commented 3 years ago

I don't think that users expect this behavior ;) ... so I would call this a bug.

Catfriend1 commented 3 years ago

I'd say it could be improved, but in any way it has to be made sure the wrapper does have access to the native's restApi anytime without getting locked out. The wrapper needs this password to "steer" SyncthingNative.

Utini2000 commented 2 years ago

Also the port gets resetted.

I would feel "safer" if I could change username & port to something that is non-standard.

Catfriend1 commented 2 years ago

Ok, for feeling agreed ;). Do you have time to work on this so if the user changes credentials the wrapper handles the running instance gracefully without letting it run off in the wild after loosing connection? There needs to be code switching the wrapper context accordingly, whilst Syncthing is online (restapi) and while it is offline (ConfigXml)

Farzat07 commented 2 years ago

Maybe a better way to handle this is to set the default username and password for the GUI from the Syncthing Options setting, just like the URL.

KptnKMan commented 2 years ago

Oh my gosh, I've been fighting with this for weeks and now I find this. I use Synchhing on different devices, and manage each from my PC, but the Android version has indeed been resetting the username and password after each startup.

WHY IS THIS NOT CONFIGURABLE?!

I understand the default behaviour to reset the username and password, assumed for security, but there is no option to bypass this as an advanced user to set your own password.

Why can we not set the username+password in the Android wrapper GUI, and have that become the credentials auto-set at startup, and if not set, will reset as described? WHY?!

How is this even something that is not been highlighted more?

KptnKMan commented 2 years ago

Can someone please help us out by highlighting what the default password creation routine is, as I cannot find anything about this in the Syncthing Android docs? Is there a page I'm missing, or can someone please describe or hightlight the startup code that is controlling this?

Really honestly asking as the contributors seem to understand this well.

tomasz1986 commented 2 years ago

The password is literally your API key. You can find it in settings in the Web GUI. If you want to access Syncthing on Android remotely (as I normally do myself), just copy that API key and save it (e.g. in a password manager). The username, on the other hand, is always "syncthing".

KptnKMan commented 2 years ago

The password is literally your API key.

You're a legend among men, thank you. Again, I cannot find anywhere that mentions this in any doc.

Edit: Just to add, I find this method of using the API key to be not a great solution. We should be able to set a username+password in the Android UI wrapper that will take precedent over this.

imsodin commented 2 years ago

Again, I cannot find anywhere that mentions this in any doc.

Then write it up somewhere for other people with this use-case to find. Stop complaining and screaming around about some use-case you have that isn't covered. Do something about it or be nice with the off chance someone else does it for you - entitled brats usually don't get anything done for them. Except from @tomasz1986, who is just too nice a person (not really complaining of course).

Locking this issue as it's totally clear what the improvement here would be, PRs welcome.

Also for clarifications and questions, there is https://forum.syncthing.net. The forum has a lot more eyes and friendly people on it than the issue tracker.