Repository navigation
gui: Show internal config and state paths (fixes #8323) - #8324
Conversation
Previously the locations package was used to provide default paths, possibly with an overridden home directory. Extra paths supplied on the command line were handled and passed around in the options object. To make the changed paths available to any other interested package, override the location setting from the option if supplied, instead of vice versa when not supplied. Adapt code using this to read from the locations package instead of passing through the options object.
Generate a reusable string in locations.PrettyPrintPaths(). Enumerating all possible locations in different packages is error prone, so add a new public function to generate the listing as a string in the locations package. Adapt cmd/syncthing --paths to use that instead of its own console output.
The paths should be available for troubleshooting from a running instance. Using the --paths CLI option is not easy in some environments, so expose the locations mapping to a JSON endpoint. Add utility function ListExpandedPaths() that also filters out any entries which still contain variable placeholders.
|
Some ideas that didn't make it into this proposal:
The unused |
|
This is a great addition, long overdue. However, I think we should do it a bit more manually, and the
So I think we could boil this down to showing "Configuration directory (contains configuration and keys)", "Database location" (the database is a directory, but that's kind of an implementation detail), "GUI overrides directory" (or something like that) and "Log file", each with localization... So technically that would be |
|
Thanks for your comments, I'm fine with going that route in general.
Not quite true,
I don't think hard-coding that assertion into the GUI code is a good idea. That's the last place one would think of adjusting when something like the conf / data split ever happens again. Better print full paths to each item, that's safer for the situations I'm thinking about where people are already in trouble because of something. Combining a directory path with a file name might be just one bit too much to handle correctly. My primary goal was to mirror the |
|
Okay fair enough, in that case how about grouping by directory? I'm trying to drive focus towards the one or two directories where almost always everything will be, rather than every little individual key file as if they are ever spread out in random places. |
|
Looks very useful. Just a general remark on UI: I'd put it into it's own modal/actions menu item - under logs it's not very discoverable. Or maybe putting it in "about", that'd make more sense to me than logs (has information on the build already). |
|
I had thought about the "About" dialog, but found it to have an overwhelming amount of information already. I don't prefer making an own modal for two reasons: 1) not cluttering the Actions menu further with very seldomly used, but prominent stuff and 2) it's such a small piece of info that it just doesn't warrant a separate dialog. The idea behind putting it in the Logs modal was that most people will need it during troubleshooting, where the first thing they will be sent to check are the logs. Other opinions on this? |
Maybe rename "Logs" to "Troubleshooting" and then put it there (as this PR already does)? I'd also put the tab right after "Logs" and move "Debugging" to the end as the most "advanced" of the three (similarly to the "advanced" tab in the folder settings). The current name of the modal, i.e. "Logs", isn't exactly correct right now already, as it contains both logs and debugging, so I think it'd fit well. Just my opinion, of course 🙂. |
|
I might be murdering someones baby for asking but can't we shrink the current About page? The list of contributors could be maintained on the Github readme for example. |
Well "Debugging" there is strictly about logging debug facilities, so that fits well in my opinion. I don't think the action menu is very cluttered. If we want to keep the number of entries down, then a proposed "Troubleshooting" that replaces/incorporates the "Support Bundle" would make most sense to me. "Logs" is likely to be often used already, removing it might cause confusion. I think "Support Bundle" is niche enough that replacing it is ok. |
|
I like the idea of replacing the "Support Bundle" link. However, it took me some time to even find information about it, because it is hidden unless the Debugging flag is flipped on in advanced configuration. That's too much of a hurdle for accessing the paths. |
|
The support bundle thing is specific functionality that is only available when debugging is enabled, yeah, not really related. Frankly I think "About" is a good place. (I also think we should keep the list of all contributors there. Scrolling is alright.) |
Well we don't need to keep that: "Troubleshooting" could then have a conditionally visible tab/button for support bundle, but itself is always visible (including the paths). Anyway I don't particularly care where it goes in the end (about, standalone, troubleshooting, ...), only that it's discoverable. And as a tab in "Logs" I don't think it is. |
The reason for suggesting the merge was that I think everything will become confusing with a new and separate "Troubleshooting" entry. We will have both "Logs" and "Troubleshooting" in the Actions menu, but then inside "Logs" there is "Debugging" whose purpose is also to troubleshoot (related to the logs, but still). On top of that, logging in itself is commonly considered a part of the troubleshooting process too. |
Use tabs to separate authors from included third-party software.
|
I think this is done, please review. Do we want to keep the |
What's the purpose of the separate endpoint? |
Exactly because the info never changes during runtime, we don't really need it as part of the 10 second refresh cycle. However, the So you're suggesting to drop the separate endpoint and use only system status instead? I'd actually prefer the opposite, making endpoints more granular instead of stuffing everything together into one big "status". |
|
I was questioning having it in both. Personally I'd probably go for simplicity over granularity/optimisation given the existing |
|
I removed it from |
|
Ping. Anything else to get this merge-ready? |
|
Ping again. Another week, another conflict resolution. Kindly asking to get this reviewed / merged soonish. |
I can only say that on the GUI side, everything seems to work perfectly fine. I'd just like to ask to maybe add a new screenshot, as the final version is quite different than what's being shown now. Also, I'd like to ask a question regarding the "user home" terminology. Wouldn't it be better to make it more explicit, e.g. "user home directory" or "user home folder"? There's no "user home" on some operating systems, either because the terminology is different (i.e. Windows, which uses "user profile"), or because the concept itself doesn't exist (i.e. Android). I think at least adding the word "directory" or "folder" makes it easier to understand. |
* release: lib/ur: Properly initialize map in failure data (fixes syncthing#8479)
* main: build: bump actions/setup-go from 2.2.0 to 3.2.1 (syncthing#8492) build: Let dependabot suggest updates to GitHub actions (syncthing#8490) update: Go version in update-docs-translations action (syncthing#8489) gui, man, authors: Update docs, translations, and contributors cmd/syncthing: Refactor CLI code to allow passing CLI arguments via function parameter (syncthing#8485) build: Update quic-go for Go 1.19 (syncthing#8483) lib/ur: Properly initialize map in failure data (fixes syncthing#8479) (syncthing#8480) lib/ur: Properly initialize map in failure data (fixes syncthing#8479)
* main: (121 commits) gui, api: Show internal config and state paths (fixes syncthing#8323) (syncthing#8324) build(deps): bump github.com/go-ldap/ldap/v3 from 3.4.1 to 3.4.4 (syncthing#8475) build: bump actions/setup-go from 2.2.0 to 3.2.1 (syncthing#8492) build: Let dependabot suggest updates to GitHub actions (syncthing#8490) update: Go version in update-docs-translations action (syncthing#8489) gui, man, authors: Update docs, translations, and contributors cmd/syncthing: Refactor CLI code to allow passing CLI arguments via function parameter (syncthing#8485) build: Update quic-go for Go 1.19 (syncthing#8483) lib/ur: Properly initialize map in failure data (fixes syncthing#8479) (syncthing#8480) lib/ur: Properly initialize map in failure data (fixes syncthing#8479) gui, man, authors: Update docs, translations, and contributors docs: Clarify docker network mode limitations (syncthing#8472) lib/config: Use net.JoinHostPort instead of string manipulation (syncthing#8470) lib/api: Fix inverted logic in string comparison lib/model: Use bytes.Equal instead of converting to string (syncthing#8469) all: Add build constants for runtime.GOOS comparisons (syncthing#8442) cmd/strelaysrv: Fix superfluous else statements (syncthing#8468) all: Fix nested `if` with `else if` (syncthing#8467) all: Unused errors lib/fs: Consolidate append in test ...
* main: gui, api: Show internal config and state paths (fixes syncthing#8323) (syncthing#8324) build(deps): bump github.com/go-ldap/ldap/v3 from 3.4.1 to 3.4.4 (syncthing#8475) build: bump actions/setup-go from 2.2.0 to 3.2.1 (syncthing#8492) build: Let dependabot suggest updates to GitHub actions (syncthing#8490) update: Go version in update-docs-translations action (syncthing#8489) lib/ur: Properly initialize map in failure data (fixes syncthing#8479)
Well it's under a "paths" heading, so that should point in the right direction. Anyway thanks for merging @calmh. |
* main: (256 commits) cmd/syncthing: Use os.executable in monitor, only fallback to PATH (syncthing#8502) all: Modernize error wrapping (syncthing#8491) gui, man, authors: Update docs, translations, and contributors cmd/syncthing: Work around binary in current dir restriction (fixes syncthing#8499) (syncthing#8500) lib/fs: Cache user lookups (syncthing#8496) all: Make scanning ownership opt-in (syncthing#8497) lib/model: Skip paused folders in aggregated completion loop (fixes syncthing#8219) (syncthing#8220) gui: Remove unused strings from translations (syncthing#8288) gui, api: Show internal config and state paths (fixes syncthing#8323) (syncthing#8324) build(deps): bump github.com/go-ldap/ldap/v3 from 3.4.1 to 3.4.4 (syncthing#8475) build: bump actions/setup-go from 2.2.0 to 3.2.1 (syncthing#8492) build: Let dependabot suggest updates to GitHub actions (syncthing#8490) update: Go version in update-docs-translations action (syncthing#8489) gui, man, authors: Update docs, translations, and contributors cmd/syncthing: Refactor CLI code to allow passing CLI arguments via function parameter (syncthing#8485) build: Update quic-go for Go 1.19 (syncthing#8483) lib/ur: Properly initialize map in failure data (fixes syncthing#8479) (syncthing#8480) lib/ur: Properly initialize map in failure data (fixes syncthing#8479) gui, man, authors: Update docs, translations, and contributors docs: Clarify docker network mode limitations (syncthing#8472) ...
Purpose
Make the information shown by the
--pathscommand line option accessible through the GUI, under a new tab in the Logs modal. Should help e.g. finding the config file on exotic platforms that set some unexpected home directory through the package integrations.This is exposed through a new API endpoint, together with some cleanup in the
locationspackage. Some more detailed explanations to be found in the commit messages.Testing
No new tests added.
Screenshots
Documentation