Commit Graph

391 Commits

Author SHA1 Message Date
Martchus 3b50d78f1e Use resource lock to avoid concurrent execution of tests requiring Syncthing test instance
This is likely the cleaner approach compared to just enforcing a serial run
for the CLI test.
2021-10-13 00:14:35 +02:00
Martchus 1f74a82ecb Adapt test for loading self-signed certificate 2021-10-12 23:55:17 +02:00
Martchus 77f0a8d5ae Update translations 2021-10-09 01:15:49 +02:00
Martchus c63719e2d1 Check whether loaded certificate is not null 2021-10-09 01:14:54 +02:00
Martchus 3c6716ebb9 Expect more TLS error types to support Schannel backend
Apparently the Schannel backend also produces
`QSslError::CertificateUntrusted` errors. Also adding
`QSslError::CertificateRejected` to be sure.
2021-10-09 01:14:54 +02:00
Martchus ab605049aa Improve TLS error messages
* Add fallback to .toPem() when .toText() is not implemented by the TLS
  plugin
* Add error number (Qt's enum value)
* Remove leftover cerr logging
2021-10-09 01:14:54 +02:00
Martchus c3182ff256 Apply cmake-format 2021-10-07 18:28:13 +02:00
Martchus 8b273b6945 Improve messages for TLS errors
Before one only gets the generic error "TLS handshake failed". Now one gets
more details error messages plus the problematic certificate. This should
be helpful for debugging.
2021-10-07 18:22:41 +02:00
Julianne420 ddefa35daa Add zh_CN translation 2021-10-07 01:20:24 +08:00
Martchus 8261a161ab Set default re-connect interval back to 30 seconds
See https://github.com/Martchus/syncthingtray/issues/16#issuecomment-932986686
2021-10-03 23:05:49 +02:00
Hannah Rittich 2968898195 Allow finding of packages in namespaces 2021-10-03 02:07:18 +02:00
Martchus 239d751342 Avoid an unhandled exception when local setup is incorrect
Apparently Boost.Process relies on the setup to be correct so the
configured locale actually needs to be available.
2021-09-30 23:41:27 +02:00
Martchus 8d6a9a042e Adapt config parser tests to changed GUI address 2021-08-25 21:48:33 +02:00
Martchus b828d7c274 Fix launching Syncthing with program/args containing non-ASCII characters
* Pass program/args for Syncthing launcher using UTF-16 under Windows
* See https://github.com/Martchus/syncthingtray/issues/107
2021-08-25 00:15:00 +02:00
Martchus 6aac7b0eae Suppress console Window under Windows
See https://github.com/Martchus/syncthingtray/issues/108
2021-08-24 23:50:28 +02:00
Martchus 7e7eab9eb8 Hardcode `127.0.0.1` in test setup instead of relying on DNS resolution of `localhost`
This should not be necessary but apparently helps with test failures
reported in https://github.com/Martchus/syncthingtray/issues/105.
2021-08-09 13:05:12 +02:00
Martchus f2db5e737c Fix typo in logging of tests 2021-08-07 16:03:57 +02:00
Martchus a1fddfcb07 Apply clang-format/cmake-format 2021-08-03 14:06:17 +02:00
Martchus 4c6315b450 Terminate Syncthing gracefully via REST-API on non-UNIX platforms (2)
A follow up to 0faacaa7c8 to cover the stop button within the launcher
and terminating Syncthing on shutdown/exit. To find the relevant connection
the connection settings are searched for a local URL where the port matches
the port from the Syncthing process log.
2021-07-15 02:38:26 +02:00
Martchus 0ef3b80447 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:29:49 +02:00
Martchus 9f7a19eabc Update translations 2021-07-03 18:50:59 +02:00
Martchus 1acfb8c896 Consider directories still out-of-sync if there are pull errors
Syncthing can report an "idle" status despite pull errors. This still means
the directory is out-of-sync. With this change the out-of-sync status is
only cleared when reading a "FolderSummary" event without pull errors (or
temporarily if the directory is e.g. scanning).
2021-07-01 17:40:23 +02:00
Martchus fdc73bed60 Query only one event at the beginning (to find the ID of the latest event)
Syncthing's official web UI also does the first query for events like this.
This should make loading times a bit faster and removes the possibility of
picking-up obsolete events (which was always problematic).
2021-07-01 17:37:47 +02:00
Martchus 6cfa8a96b6 Do not buffer further output when `readData()` is called on empty buffer
See comment; otherwise calls to `readAll()` with no `bytesAvailable()`
like done in the `syncthingctl` tests fail sporadically as async read
operations are started concurrently.
2021-07-01 17:32:49 +02:00
Martchus 7508e59379 Update translations 2021-06-27 18:59:26 +02:00
Martchus 17f394c118 Add missing library ws2_32 required by Boost.Asio under Windows 2021-06-27 18:54:43 +02:00
Martchus 0faacaa7c8 Terminate Syncthing gracefully via REST-API on non-UNIX platforms
If there's a configured and local Syncthing connection and we're on a
non-UNIX platform which doesn't support SIGTERM (basically Windows) it
makes sense to use the REST-API instead. That's likely better than just
terminating the process forcefully.

This doesn't cover the stop button within the launcher settings yet because
from this context is isn't clear which connection is relevant as there can
be multiple tray icons/widgets but only one settings page.
2021-06-21 23:18:51 +02:00
Martchus 04c82e3ec4 Make logging of process exit an info message 2021-06-21 22:32:51 +02:00
Martchus 900dac793d Silence clazy warnings
For some reason clazy thinks `QIODevice::aboutToClose()` is not a signal.
2021-06-21 22:30:26 +02:00
Martchus 765a323b47 Use a queued connection to handle SyncthingProcess::finished 2021-06-21 22:23:18 +02:00
Martchus eac3b31727 Link against threading library when using Boost.Process 2021-06-21 17:44:43 +02:00
Martchus d91448dfb4 Avoid using `QProcess::ProcessError` to avoid `QMetaMethod::invoke` error
Otherwise `QMetaMethod::invoke` wouldn't be able to handle it:
```
QMetaMethod::invoke: Unable to handle unregistered datatype 'QProcess::ProcessError'
```
2021-06-17 21:17:21 +02:00
Martchus 1bc52ebb0f Improve Boost.Process-based SyncthingProcess
* Implement member functions required to run tests
* Add documentation
* Add minor tweaks
2021-06-17 20:32:40 +02:00
Martchus 9ce9b11ba4 Use Boost.Process for launcher to cope with further sub processes
* Use a process group / job object via Boost.Process to be able to
  terminate sub processes as well
* Do not try to stop the process gracefully under Windows by posting
  WM_CLOSE because this has no effect on Syncthing anyways
* See https://github.com/Martchus/syncthingtray/issues/94
2021-06-16 22:44:48 +02:00
Martchus 7f55afc51c Update translations 2021-06-04 16:26:35 +02:00
Martchus 986959c8b2 Avoid reading reply data if the reply isn't open
This might be the case when the request has been aborted. Reading from the
reply in this case would result in an unwanted log message from Qt.
2021-06-04 16:26:09 +02:00
Martchus 93f59ebf8a Apply clang-format 2021-05-27 18:16:56 +02:00
Martchus 0c475f5b7e Update translations 2021-05-27 18:16:22 +02:00
Martchus 7ad82c9dfe Emit time stamp parsing errors like other parsing errors 2021-05-21 22:34:42 +02:00
Martchus 62e7797558 Allow enabling logging of libsyncthingconnector at runtime
* Remove compile-time switches to enable logging
* Enable logging if certain environment variables are set
* Allow logging all API responses
2021-05-18 18:21:48 +02:00
Martchus fbb7685f4b Fix warnings about detatching Qt container via for loop 2021-05-18 00:08:21 +02:00
Martchus 239f750028 Improve timestamp parsing/handling
* Use local time consistently for timestamps which might get displayed
  within the UI, e.g. the dir status was in one case set to the local time
  and in other cases GMT was used which could lead to discarding status
  updates
* Print warning when timestamp parsing fails (instead of ignoring it
  silently)
* Set directory status from folder status response even when parsing the
  timestamp fails
* Catch possible exception when printing log timestamps in syncthingctl
2021-05-18 00:08:21 +02:00
Martchus b5aa29c98b Update translations 2021-04-07 20:01:07 +02:00
Martchus 46099abc0c Assign empty completion when receiving 404 response 2021-04-07 19:55:47 +02:00
Martchus 9ae7f4a265 Avoid requesting completion for paused devs/dirs after remote index changed 2021-04-07 19:53:16 +02:00
Martchus a5f629d710 Avoid crash when start time can not be parsed 2021-04-07 19:42:07 +02:00
Martchus 31ad8b979c Do not request completion for paused directories
See https://github.com/Martchus/PKGBUILDs/issues/132
2021-04-07 15:12:28 +02:00
Martchus f75966aadc Fix warnings 2021-03-20 22:39:40 +01:00
Martchus 6c12f18eaf Update translations 2021-03-06 16:26:23 +01:00
Martchus 851edeaafc Never consider the own device as paused 2021-02-12 19:44:27 +01:00