-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: syncs settings to disk for authenticated users #2445
Conversation
This should be ready for testing @EDIflyer. I think you should be able to just install and validate settings are stored. You can mount |
OK have tried this and seems to work 🙂 As instructed I added a volume to my docker compose so I could view the I then went to a new browser, logged in with the same credentials on Authelia and it showed the expected settings. So the only bit I was expecting to work that didn't was a [Ctrl-[F5] on a browser that was already using Dozzle, but presumably that's not enough to reload the settings and would require the stored site data to be cleared. Perhaps worthy of a UI button to 'load settings from server'?? |
Not sure what you mean ctrl-F5. But yes, What do you think? |
Sorry I was just meaning that Ctrl-F5 is a fuller reset on a browser page so normally causes cached items to reload. As use cases might be different I wonder if the best sequence might be:
It's just if the last bit doesn't exist then server settings would only be used for new browsers and the only way to load them for old browsers would be to clear site settings (which is normally a bit of a hassle) - at least this way we'd be giving users who want to sync settings the ability to do so, but without forcing it on them? Also in that last scenario it would be handy for the user to know when on the settings page that server settings exist as if they don't load them from the server first then save any changes they'll end up overwriting the server settings with their existing |
What would be the harm to always overwrite? I am just trying to avoid a button that probably won't get used much. Also, I wouldn't know if it's out of sync really. I just know they are different. What's an instance where the user wouldn't want to always sync when they are signed in? |
I'd want that personally but thought you had maybe done that on purpose and were preferring I guess the main reason not to do it is some users may want different settings on different browsers but presumably they would then not just bothering using user ID pass through at all? |
Yea, I was thinking that too. I can't think of any product behaving that way. If I store some settings for a product then I would expect it to sync across devices. I'll keep thinking about it. I might change my mind when I try to code it up :P |
Ok try again. I make it always overwrite now. Then went on a different browser and noticed it updated after a refresh. Tell me if it feels more natural. I think it feels right for me. At least enough to want to an explicit button. |
Just tried and I agree that seems much more natural and obvious to me that I change settings in one place and when I hit refresh on another browser they're imported from the server. I think it removes a level of potential confusion around changes not being reflected. The only very very minor thing that I thought may confuse a user is if you change settings in one place whilst you have Dozzle already running in another browser and you navigate to the settings page and change something - the settings on that page now overwrite the server settings. I don't support it would be possible to warn the user if they go to the settings page and they're out of sync with the server and warn them to refresh the page? (I'm guessing you don't want to force refresh on navigation to the settings page). As I Say very minor and not a big issue given the fairly small number of settings available to change anyway but just something that occurred to me! (hope my description makes sense!!) |
That's right. This is actually the reason I didn't want to make the server settings over writing local. But as you said, I think it would be very very tiny set of people. This is probably something I'll come back to.
I think the better option would be just sync browsers. If you save settings on one browser, then it would just notify all open browsers for user. But that's probably not worth the complexity because I don't think that many people will have this issue. I got some more work to do on this but should be merging it soon. |
Just to confirm tried latest cffe751 build and still works well. |
For authenticated users, settings is now saved to
/data/[username]/settings.json
. This location will also be used for other user stuff likesavedSearch.json
.User should be able to do the following:
--volume /path/to/data:/data
is needed to persist settings between dozzle restart. However, Dozzle also stores content tolocalStorage
so it will also sync localStorage.