syncthing/lib
André Colomb 63de838f27
gui, api: Show internal config and state paths (fixes #8323) (#8324)
* lib/locations: Fix enum values camelCase.

* lib/locations: Remove unused FailuresFile.

* cmd/syncthing: Turn around role of locations storage.

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.

* lib/locations: Refactor showPaths to locations package.

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.

* lib/locations: Include CSRF token in pretty printed paths.

* lib/api: New endpoint /rest/system/paths.

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.

* gui: List runtime paths in separate log viewer tab.

* Wrap paths.

* lib/syncthing: Utilize locations.Get() instead of passing an arg.

* Include base directories, move label to table caption.

* gui: Switch to hard-coded paths instead of iterating over all.

* gui: Break aboutModalView into tabs.

Use tabs to separate authors from included third-party software.

* gui: Move paths from log viewer to about modal.

* lib/locations: Adjust pretty print output order to match GUI.

* gui, authors: Remove additional bot names and fix indent.

The indentation changed because of the tabbed about dialog, fix the
authors script to respect that.

Skip Syncthing*Automation in authors list as well.

* Update AUTHORS list to remove bot names.

* Revert AUTHORS email order change.

* Do not emphasize DB and log file locations.

* Review line wrapping.

* review part 1: strings.Builder, naming

* Rename and extend locations.Set() with error handling.

Remodel the Override() function along the existing SetBaseDir() and
rename it to simply Set().  Make sure to use absolute paths when given
log file or GUI assets override options.  Add proper error reporting
if that goes wrong.

* Remove obsolete comment about empty logfile option.

* Don't filter out unexpanded baseDir placeholders, only ${timestamp}.

* Restore behavior regarding special "-" logfile argument.

If the option is given, but with empty value, assume the no log
file (same as "-").  Don't try to convert the special value to an
absolute path though and document this fact in a comment for the Set()
function.

* Use template to check for location key validity.

* Don't filter out timestamp placeholders.

* lib/api: Remove paths from /rest/system/status.

* lib/ur: Properly initialize map in failure data (fixes #8479)

Co-authored-by: Jakob Borg <jakob@kastelo.net>
2022-08-10 08:25:13 +02:00
..
api gui, api: Show internal config and state paths (fixes #8323) (#8324) 2022-08-10 08:25:13 +02:00
assets lib/assets: MIME types, time formats (#8351) 2022-05-22 22:10:18 +02:00
beacon all: Unused args, retvals, assignments (#7926) 2021-09-08 00:11:16 +02:00
build all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
config lib/config: Use net.JoinHostPort instead of string manipulation (#8470) 2022-07-28 22:06:55 +02:00
connections build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
db build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
dialer lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
discover build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
events all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
fs all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
ignore all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
locations gui, api: Show internal config and state paths (fixes #8323) (#8324) 2022-08-10 08:25:13 +02:00
logger cmd/syncthing, lib/logger: Add date to default log format (fixes #8272) (#8273) 2022-04-15 07:46:14 +04:00
model build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
nat all: Unused parameter should be replaced by underscore (#8464) 2022-07-28 17:17:29 +02:00
osutil all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
pmp all: Unused parameter should be replaced by underscore (#8464) 2022-07-28 17:17:29 +02:00
protocol all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
rand all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
rc all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
relay all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
scanner all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
sha256 all: Use crypt/rand through its buffered version, but not in benchmarks (#7420) 2021-03-02 19:17:20 +01:00
signature all: Use crypt/rand through its buffered version, but not in benchmarks (#7420) 2021-03-02 19:17:20 +01:00
stats all: Truncate some timestamps (fixes #7457) (#7459) 2021-03-12 10:35:10 +01:00
stun all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
svcutil all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
sync lib/sync: Make the clock a function pointer 2021-11-27 15:35:07 +01:00
syncthing gui, api: Show internal config and state paths (fixes #8323) (#8324) 2022-08-10 08:25:13 +02:00
testutils all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
tlsutil lib/syncthing: Clean up / refactor LoadOrGenerateCertificate() utility function. (#8025) 2021-11-07 23:59:48 +01:00
upgrade all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
upnp all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
ur lib/ur: Properly initialize map in failure data (fixes #8479) (#8480) 2022-08-03 10:41:26 +02:00
util all: Unused parameter should be replaced by underscore (#8464) 2022-07-28 17:17:29 +02:00
versioner build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
watchaggregator all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
weakhash all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00