Commit Graph

24 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
eada16c688 backup: Add support for Tor
Add support for connecting to the backup server through Tor, via its
SOCKS5 proxy.

See "Usage with Tor" in remote.md for documentation.
2021-02-26 10:35:48 +01:00
Wladimir J. van der Laan
cdfcd5a2fe backup: Add support for IPv6 addresses in socket backend
Support the bracketed `socket:[::]:1234` syntax for IPv6 addresses.

Also, add factor out the socket URI parsing to a function and add
tests for it. As a forward compatibility measure, reject query strings
(`?a=b`) because I intend to use these for parameters such as SOCKS5
proxy (for Tor) in a future patch.
2021-02-08 10:31:28 +01:00
Wladimir J. van der Laan
be140a72f7 backup: Use dummy backend in test_rewrite
Additional checking was added that a file exists when `create=False`,
this runs into an error with the `test_rewrite()` test. Update the test
to use dummy backend for the test, as it tests a method on the base
class, not any specific backend.
2021-02-04 13:06:41 +01:00
Wladimir J. van der Laan
4d6d738f80 backup: Update test for optional lightning-dir argument 2021-02-04 13:06:41 +01:00
Wladimir J. van der Laan
804a9bb290 backup: Implement network backup 2021-02-04 13:06:41 +01:00
Christian Decker
75ddf53400 backup: Add a test for compactions 2021-01-16 13:29:37 +01:00
Christian Decker
a097606495 ci: Increase timeout so we don't kill tests too often 2021-01-13 11:23:56 +01:00
Michael Schmoock
1e7701f033 backup: fix flake8 nits 2020-12-13 15:36:15 +01:00
Michael Schmoock
1f05674b5b backup: cleanup flake8 nits 2020-12-11 11:01:02 +01:00
Michael Schmoock
be523aa54f backup: restore default filename lightningd.sqlite3 2020-12-11 11:01:02 +01:00
Christian Decker
e6d26b479c backup: Add a test to reproduce #158 2020-12-11 10:52:23 +01:00
Christian Decker
3a1a89ecf8 backup: Add a warning about the deprecated backup-destination flag 2020-11-25 19:26:44 +01:00
Christian Decker
f34787d065 backup: Rely solely on backup.lock and do not cache writes
Caching writes was causing us some issues if the startup of
`lightningd` didn't complete, i.e., the writes would happen on the
live DB, but we'd forget about them. Since we have the backup.lock
file in same directory as the plugin is running in, we no longer have
to defer the writes. This hugely simplifies our logic.

Fixes #155

Changelog-Fixed: backup: The plugin doesn't lose sync anymore if the startup is interrupted
2020-11-25 19:26:44 +01:00
Christian Decker
b9a8622422 backup: Remove temporary node_factory shim
This was required in order to avoid cleaning the datadir on creation.
2020-08-28 23:06:30 +02:00
Christian Decker
a1f005012a backup: Perform preflight checks before entering the plugin loop 2020-05-18 22:44:49 +02:00
Christian Decker
9b5a9076d4 backup: Fix flaky test due to logs being dropped on shutdown
We were writing logs directly before killing `lightningd` which resulted in
the logs being lost. The subsequent check for the log-lines then would fail
obviously.
2020-05-18 22:44:49 +02:00
Christian Decker
41e440522e backup: NF wrapper was missing a keyword arg 2020-04-30 17:52:16 +02:00
Christian Decker
3a399fd55c backup: Temporarily use a wrapper of the node_factory
The node_factory from pyln-client clears the node directory when provisioning
a new node, which interferes with the backup-cli creation of the initial
snapshot. This just disables the cleaning until we can release the next
pyln-client version
2020-04-12 19:35:21 +02:00
Christian Decker
1e6b55b3cb backup: If a database exists write an intial snapshot 2020-04-12 19:35:21 +02:00
Christian Decker
a44284d04d pytest: Test starting without having initialized the backup 2020-04-12 19:35:21 +02:00
Christian Decker
4c146bf2a4 backend: Use th backup URL in backup-cli and add snapshot type to FileBackend 2020-04-12 19:35:21 +02:00
Christian Decker
c58e675877 backup: Ensure at startup that the backup backend was initialized 2020-04-12 19:35:21 +02:00
Christian Decker
4e19c32444 backup: Add backup-cli tool and use it to initialize the backups 2020-04-12 19:35:21 +02:00
Christian Decker
c049069cff backup: Initial version of the backup plugin 2020-04-12 19:35:21 +02:00