Commit Graph
9942 Commits
Author SHA1 Message Date
Sunil Mohan Adapa e64270ebc3 calibre: Remove existing data directory before a restore operation
Fixes: #2500.

systemd 257 has introduced in which DynamicUser= services will use id-mapped
mounts[1] instead of performing chown on the entire data directory. On Debian
stable release, calibre service will contain data folders with a dynamic user
ownership while on testing release, calibre service will contain data folders
with nobody:nogroup ownership.

When a backup from stable release is restored on testing release, the two
directories are merged. The top level directory will be still owned by
nobody:nogroup while the files instead will be owned by dynamic user and group.
In this case, systemd will not recursively update the ownership. Calibre will
fail to access the library files.

The fix is to completely wipe the existing data folder before a restore. When
systemd notices that the directory ownership is not properly it will recursively
change the ownership before starting the service.

Links:

1) https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=

Tests:

- Without patch, restore the app on testing from a backup on stable machine and
notice that the data folder is owned by nobody:nogroup but files inside are
owned by a calibre-server-freedombox user and group. This leads to failure when
accessing the library.

- With patch, restore again notice that the library is accessible and all the
files are owned by nobody:nogroup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-01 09:46:18 -04:00
Sunil Mohan Adapa ac8dbcfc1c backups: Add ability to cleanup files before restoring a backup
- Many times, merging old and new data folders is not ideal and could lead to
unexpected outcomes. Perhaps removing all the backup folders and files before
restore is ideal. However, this patch tries to introduce that approach slowly on
an experimental basis.

Tests:

- Unit tests work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-01 09:46:15 -04:00
James Valleroy c3655d9b7f Translated using Weblate (Hindi)
Currently translated at 39.3% (719 of 1826 strings)
2025-04-01 14:13:56 +02:00
James Valleroy 755e4c2b90 Translated using Weblate (Hindi)
Currently translated at 39.3% (719 of 1826 strings)
2025-04-01 13:43:15 +02:00
James Valleroy 008a420eb2 Translated using Weblate (Telugu)
Currently translated at 89.6% (1637 of 1826 strings)
2025-04-01 13:14:09 +02:00
2300030127 69894604a5 Translated using Weblate (Telugu)
Currently translated at 89.1% (1628 of 1826 strings)
2025-04-01 12:22:52 +02:00
Vemula Sai Ruchitha ac7587f165 Translated using Weblate (Telugu)
Currently translated at 89.1% (1628 of 1826 strings)
2025-04-01 12:22:52 +02:00
MohammedSaalif beef03bd3e Translated using Weblate (Hindi)
Currently translated at 38.7% (707 of 1826 strings)
2025-04-01 05:34:52 +02:00
Valurouthu Jashwanth e94b9e127e Translated using Weblate (Hindi)
Currently translated at 38.7% (707 of 1826 strings)
2025-04-01 05:34:52 +02:00
Reddy Saneesh Sumesh 4c729d7031 Translated using Weblate (Hindi)
Currently translated at 38.7% (707 of 1826 strings)
2025-04-01 05:34:52 +02:00
Soumika Devarakonda b5b97307ad Translated using Weblate (Hindi)
Currently translated at 38.7% (707 of 1826 strings)
2025-04-01 05:34:52 +02:00
ANNAPUREDDY RAKSHITHA 79d38e9b52 Translated using Weblate (Telugu)
Currently translated at 88.8% (1623 of 1826 strings)
2025-04-01 05:34:50 +02:00
Reddy Saneesh Sumesh c407ea0059 Translated using Weblate (Hindi)
Currently translated at 37.8% (691 of 1826 strings)
2025-04-01 05:13:27 +02:00
NALLAPANENI LAKSHMI SOWJANYA 9902c9dbde Translated using Weblate (Telugu)
Currently translated at 88.4% (1615 of 1826 strings)
2025-04-01 05:13:27 +02:00
ANNAPUREDDY RAKSHITHA 8577486b3c Translated using Weblate (Telugu)
Currently translated at 88.4% (1615 of 1826 strings)
2025-04-01 05:13:27 +02:00
Reddy Saneesh Sumesh fe2673e857 Translated using Weblate (Hindi)
Currently translated at 37.7% (689 of 1826 strings)
2025-04-01 05:12:48 +02:00
Reddy Saneesh Sumesh 688a717310 Translated using Weblate (Hindi)
Currently translated at 37.6% (688 of 1826 strings)
2025-04-01 05:12:33 +02:00
Reddy Saneesh Sumesh 38199f29fb Translated using Weblate (Hindi)
Currently translated at 37.6% (687 of 1826 strings)
2025-04-01 05:12:05 +02:00
MohammedSaalif cd021ca2c6 Translated using Weblate (Hindi)
Currently translated at 37.6% (687 of 1826 strings)
2025-04-01 05:12:04 +02:00
Soumika Devarakonda c0df2332c4 Translated using Weblate (Hindi)
Currently translated at 37.6% (687 of 1826 strings)
2025-04-01 05:12:04 +02:00
Manitej Chowdary Gadagottu bc8f274ded Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:04 +02:00
Gurukalyanakki 6a8570d892 Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:04 +02:00
Bekkam B S M G Babi 31522ffeb1 Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:04 +02:00
Nadham sai pallavi c07d90d420 Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:03 +02:00
klu2300032597 f41935df61 Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:03 +02:00
psfdvarun e8b0c03f5c Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:03 +02:00
Mallu Venkata SiriPriya 88971bc7bf Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:03 +02:00
Pallavireddy06 0e116b359e Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:03 +02:00
mohanpavanchandu 8a00d97898 Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:03 +02:00
ANNAPUREDDY RAKSHITHA cf073c1c10 Translated using Weblate (Telugu)
Currently translated at 88.3% (1614 of 1826 strings)
2025-04-01 05:12:02 +02:00
Harshitha2300033363 242382834f Translated using Weblate (Hindi)
Currently translated at 36.7% (671 of 1826 strings)
2025-04-01 05:07:28 +02:00
MURALA SAI GANESH fc03789ec0 Translated using Weblate (Hindi)
Currently translated at 36.7% (671 of 1826 strings)
2025-04-01 05:07:28 +02:00
Soumika Devarakonda bb86d73814 Translated using Weblate (Hindi)
Currently translated at 36.7% (671 of 1826 strings)
2025-04-01 05:07:28 +02:00
Reddy Saneesh Sumesh c23fe488c2 Translated using Weblate (Hindi)
Currently translated at 36.7% (671 of 1826 strings)
2025-04-01 05:07:28 +02:00
Aryan Raj 4bb13c7295 Translated using Weblate (Hindi)
Currently translated at 36.7% (671 of 1826 strings)
2025-04-01 05:07:27 +02:00
Pallavireddy06 3c113045aa Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:27 +02:00
NALLAPANENI LAKSHMI SOWJANYA 4258274206 Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:27 +02:00
Bekkam B S M G Babi 33562de2ce Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:27 +02:00
Nadham sai pallavi 56590baf26 Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:26 +02:00
2300030127 86fe13a1e4 Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:26 +02:00
ANNAPUREDDY RAKSHITHA 2b2d02d96b Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:26 +02:00
psfdvarun b8ce200e7e Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:26 +02:00
Manitej Chowdary Gadagottu e4e1e9ae8f Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:26 +02:00
mohanpavanchandu 468421062b Translated using Weblate (Telugu)
Currently translated at 87.4% (1597 of 1826 strings)
2025-04-01 05:07:25 +02:00
MohammedSaalif 1673b42b5e Translated using Weblate (Hindi)
Currently translated at 36.2% (662 of 1826 strings)
2025-04-01 05:05:35 +02:00
Valurouthu Jashwanth 72652da0a1 Translated using Weblate (Hindi)
Currently translated at 36.2% (662 of 1826 strings)
2025-04-01 05:05:35 +02:00
Aryan Raj bf6ae05bdd Translated using Weblate (Hindi)
Currently translated at 36.2% (662 of 1826 strings)
2025-04-01 05:05:34 +02:00
Soumika Devarakonda 357cad9851 Translated using Weblate (Hindi)
Currently translated at 36.2% (662 of 1826 strings)
2025-04-01 05:05:34 +02:00
Harshitha2300033363 e888926750 Translated using Weblate (Hindi)
Currently translated at 36.2% (662 of 1826 strings)
2025-04-01 05:05:34 +02:00
ganesh29111865 4e4450d3a5 Translated using Weblate (Telugu)
Currently translated at 86.8% (1586 of 1826 strings)
2025-04-01 05:05:34 +02:00