Commit Graph

139 Commits

Author SHA1 Message Date
Girish Ramakrishnan e106dcd76a storage: pass limits object to backend 2025-11-14 13:18:21 +01:00
Girish Ramakrishnan b8f486d8e4 backuptask: fix crash when (old) stats object has no copy field 2025-11-13 14:42:44 +01:00
Johannes Zellner 8522802f85 Update translations 2025-10-27 08:48:24 +01:00
Girish Ramakrishnan 07732310c1 backuptask: track copy and upload statistics 2025-10-20 14:09:12 +02:00
Girish Ramakrishnan 854661e2d4 backuptask: print the upload statistics 2025-10-20 11:22:28 +02:00
Girish Ramakrishnan 72030ee8fc backups: display mail backup stats 2025-10-16 14:51:33 +02:00
Girish Ramakrishnan 847cb91759 backuptask: fix crash when accessing stats of old backups 2025-10-16 12:32:32 +02:00
Girish Ramakrishnan 961959d361 add aggregated size to system backups 2025-10-10 13:14:49 +02:00
Girish Ramakrishnan 0fd056dff9 add note why the backupinfo is unencrypted 2025-10-09 09:04:22 +02:00
Girish Ramakrishnan 10cf8f1d0e rsync: integrity fixes 2025-10-09 00:23:44 +02:00
Girish Ramakrishnan 67d95cda76 store integrity signature in hex 2025-10-08 22:35:39 +02:00
Girish Ramakrishnan 43e426ab9f Revert "Add no-use-before-define linter rule"
This reverts commit fdcc5d68a2.

Unfortunately, this requires us to move exports to the bottom.
This in turn causes circular dep issues and also access of
exports.GLOBAL_VAR in the global context
2025-10-08 21:17:52 +02:00
Girish Ramakrishnan ddb7551b92 integrity: store signature as base64 2025-10-07 18:42:51 +02:00
Girish Ramakrishnan e93898d2ec typo that broke encryption 2025-10-07 17:42:51 +02:00
Girish Ramakrishnan 832eca2d9c backup size: display stats correctly 2025-10-01 17:43:27 +02:00
Girish Ramakrishnan 5157789774 backups: add per site enabledForUpdates flag
previously, we had a singleton 'main' flag to indicate a site can
be used for updates. with this new approach, we can get rid of the
'primary' concept. each site can be used for updates or not.
2025-09-22 18:03:01 +02:00
Girish Ramakrishnan 4c3a8e1fd7 backup site: add contents
it is a json that can be one of the three:

* null - include everything
* include - only include these ids
* exclude - everything except these ids
2025-09-22 13:28:16 +02:00
Girish Ramakrishnan c5b7264f1a rename backupTargets to backupSites 2025-09-12 10:32:37 +02:00
Girish Ramakrishnan 31df40a841 storage: add copyDir
we changed listDir in c44863a9bb to list
a directory . this broke copy for files since a '/' is added when listing
the file.
2025-08-26 00:01:14 +02:00
Girish Ramakrishnan cdda8649fc backuptask: log the target id 2025-08-25 23:04:56 +02:00
Girish Ramakrishnan 19682ec21b tgz: integrity check 2025-08-15 21:23:39 +05:30
Girish Ramakrishnan b71e2957d3 backuptask: add progress message for backupinfo 2025-08-15 16:01:59 +05:30
Girish Ramakrishnan e7fb444bb3 backuptask: save backupinfo in one place 2025-08-15 14:33:31 +05:30
Girish Ramakrishnan 12e073e8cf use node: prefix for requires
mostly because code is being autogenerated by all the AI stuff using
this prefix. it's also used in the stack trace.
2025-08-14 12:55:35 +05:30
Girish Ramakrishnan d7b5d1f947 rename .checksum to .backupinfo 2025-08-13 21:29:41 +05:30
Girish Ramakrishnan 2e16dd983f backups: stash the stats to the backups table 2025-08-12 20:21:54 +05:30
Girish Ramakrishnan 47fc9561ab backups (tgz): save integrity information
we generate a signing key pair for each target. Initially, I had this
as global. We needed a route to return the public key and putting it
under backup target seemed natural. Since we delete the backups when
we delete a target, we lose all the signing hashes. So, it's fine to lose
the key pair on target delete.
2025-08-12 19:00:29 +05:30
Johannes Zellner 410d4a47ed Fix typo 2025-08-03 21:05:46 +02:00
Girish Ramakrishnan ead6d9c7d3 Fix app import 2025-08-02 20:42:12 +02:00
Girish Ramakrishnan c935744f4c backups: root ~~canal~~ path surgery
remove rootPath and getBackupFilePath from the backup target and
make this backend specific.
2025-08-02 10:15:34 +02:00
Girish Ramakrishnan a01e1bad0f backuptarget: pseudo target for import and restore 2025-08-02 00:06:47 +02:00
Girish Ramakrishnan 3cabbc1328 backupformat: getFileExtension 2025-08-01 22:58:26 +02:00
Girish Ramakrishnan 7192439b2c no need for format specific getBackupFilePath 2025-08-01 20:49:11 +02:00
Girish Ramakrishnan ea419509f1 backups: add setup/teardown
1. add setup, teardown hooks
2. move the managed mount setup and teardown to filesystem backend
3. remove this vague storage.js

we should convert storageApi into a real object, so we don't have to
keep passing apiConfig around
2025-08-01 15:36:25 +02:00
Girish Ramakrishnan ae3a34287a backup target: create snapshot and cache files per target
snapshot file tracks the snapshot directory. when app gets deleted,
the cleaner will remove the upstream snapshot directory when it runs.

cache files are used in rsync logic to track what was uploading into
snapshot in the previous run without needing to rescan upstream.
2025-07-30 11:44:42 +02:00
Girish Ramakrishnan a0792aa469 backups: make sure reused error backup is in same target 2025-07-25 14:06:35 +02:00
Girish Ramakrishnan fc4da4408c backups: fix app restore with tgz 2025-07-25 13:39:09 +02:00
Girish Ramakrishnan 276db17f0c backups: use a real targetId 2025-07-25 08:12:27 +02:00
Girish Ramakrishnan 62017b3ff5 backup: rename back backuplisting.js to backups.js
this was a transitional rename till I figured out how to split
it in backuptargets.js
2025-07-25 01:37:19 +02:00
Girish Ramakrishnan 3aafbd2ccb backups: add backup multiple targets 2025-07-25 01:30:27 +02:00
Girish Ramakrishnan 931311f11f rename backups to backuptargets 2025-07-24 18:54:10 +02:00
Girish Ramakrishnan 5e456f378b backups: split listing and targets 2025-07-24 18:21:48 +02:00
Girish Ramakrishnan bf315258c5 backups: add target foreign key to backups table
format is part of the backup target

in the future, if we want per-app format or schedule, we can add this
separately to the apps table itself. the full box backup can ignore
apps with a set backup target and use the latest backup (like an errored app).
the nice thing is restore will work correctly.
2025-07-24 17:32:16 +02:00
Girish Ramakrishnan cb52dfdd0f backups.backupApp was used by the app update logic 2025-07-18 17:44:22 +02:00
Girish Ramakrishnan 0fa281083e apps: backup is not a state anymore
this is launched as a separate task
2025-07-18 14:14:54 +02:00
Girish Ramakrishnan 0aca6c2588 locks: rename lock types to make it clearer 2025-07-18 13:40:15 +02:00
Girish Ramakrishnan 989d843fcb shell: make shell.sudo promise based and waitable 2025-07-16 22:04:24 +02:00
Girish Ramakrishnan 50b585c1dd shell: merge some options 2025-07-16 21:32:27 +02:00
Girish Ramakrishnan 26637c0f1c backuptask: improve the debugs 2025-07-14 15:16:28 +02:00
Girish Ramakrishnan 758b05393c catch app backup error to release lock 2024-12-17 19:08:43 +01:00