9602 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
6cc71aa5d7
app: During startup, run post-init operation in background
- This allows for the service to become "ready" and serving web connection sooner.

- If some operations such as obtaining certificates and domain configurations
are happening, these can be shown as operations with UI notifications.

Tests:

- Running 'freedombox-develop --setup' works. 'App initialization completed'
message is printed before 'Running setup...' message. Process exits
successfully.

- Running 'freedombox-develop --setup-no-install' works. 'App initialization
completed' message is printed before 'Running setup...' message. Process exits
successfully.

- Running 'freedombox-develop' works. 'App initialization completed' message is
printed before 'Running regular setup' and 'Setup finished'. Cherrypy starts
listening before 'App initialization completed' message.

- Running a fresh VM setup works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-05 10:20:56 -04:00
Sunil Mohan Adapa
a8eba9e719
upgrades: Increase distribution upgrade timeout to 3 days
- 12 hours might genuinely not enough with SD cards, slow download speeds, and
large number of packages (due to apps such as GNOME).

Tests:

- None

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-05 08:23:18 -04:00
Sunil Mohan Adapa
2b6bac2b73
radicale: Rerun setup when package updated
Closes: #2501

Tests:

- Install radicale app.

- Install a sample package using apt. Trigger will be run and but  will
not result in radicale setup rerun.

- Make newer radicale available. This can be done by enabling testing
distribution but setting its priority low. radicale priority from testing will
be set to high. When unattened-upgrades is run, it will trigger the FreedomBox
mechanism and will result in database upgrade.

- After this install a sample package using apt. Trigger will be run but will
not result in radicale setup rerun.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-04 21:34:49 -04:00
Sunil Mohan Adapa
f098aecc2a
mediawiki: Run database upgrade after package upgrade
Fixes: #2119

Tests:

- Install mediawiki app.

- Install a sample package using apt. Trigger will be run and but  will
not result in Mediawiki setup rerun.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-04 21:34:46 -04:00
Sunil Mohan Adapa
0023406e6e
setup: Implement mechanism to rerun setup when apt is updated
Closes: #1447

Find and rerun setup for apps after a dpkg operation is completed.

This is needed in a couple of situations:

1) Some Debian packages don't manage the database used by the package. When
these packages are updated, their database schema is left at an older version
and service might become unavailable. FreedomBox can perform the database schema
upgrade. However, FreedomBox needs to know when a package has been updated so
that database schema can be upgraded.

2) A package is installed but FreedomBox has not modified its configuration.
Newer version of package becomes available with a new configuration file. Since
the original configuration file has not changed at all, the new configuration
file overwrites the old one and unattended-upgrades deals with this case. Now,
say, the configuration file modifies some defaults that FreedomBox expects
things might break. In this case, FreedomBox can apply the require configuration
changes but it needs to notified as soon as the package has been updated.

When apt runs dpkg, after the operation is completed it triggers commands listed
under the configuration 'Dpkg::Post-Invoke'. This in turn calls this class via a
DBus notification. Here, we iterate through all the apps. If an app is currently
installed and interested in rerunning setup after dpkg operations, then its
setup is rerun. Interest is expressed using the 'rerun_setup_on_upgrade' flag on
the Package() component. If all packages of the app have not be upgraded since
the last check, we skip the operation.

Tests:

- When an app is installed from FreedomBox, the trigger is not run.

- When a package is installed from command line with apt, the trigger is run. It
does nothing.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-04 21:34:43 -04:00
Sunil Mohan Adapa
97bae21e65
package: Allow app to say it wants to rerun setup after updates
Tests:

- Unit tests pass.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-04 21:34:40 -04:00
Sunil Mohan Adapa
1d4e9eacff
packages: Don't run force upgrade hooks when freedombox perform ops
- We have a hook that triggers when 'apt update' is successfully run. This hook
handles the force upgrading mechanism. It's intended purpose is to handle
packages with configuration file prompts that unattended-upgrades does not
touch. 'apt update' is run on behalf of unattended-upgrades every day on a
schedule. This is the primary time the hook is intended to run. However, the
hook also run every time FreedomBox runs 'apt update' before installing an app.
Also no operations are performed, there is a race to see of apt is available for
the operation.

- Avoid these unnecessary runs by setting an environmental variable and by
checking it before running the trigger.

- There is one place where we want to genuinely run the trigger. That is after a
distribution upgrade. Handle this case.

Tests:

- When apt update is run on the command line, the hook is triggered.

- When installing an app, however, the hook is not triggered.

- During a dist-upgrade, the hook is triggered at the end.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-04 21:34:36 -04:00
Soumika Devarakonda
ddbdbc35a4
Translated using Weblate (Hindi)
Currently translated at 39.5% (722 of 1826 strings)
2025-04-02 23:57:52 +02:00
Sripath Roy Koganti
881404fcbc
Translated using Weblate (Telugu)
Currently translated at 92.3% (1686 of 1826 strings)
2025-04-02 23:57:52 +02:00
Sunil Mohan Adapa
2499767aa5
kiwix: Remove existing data directory before a restore operation
Although there are no issues with kiwix like for calibre, it is the right way to
do this.

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 kiwix-server-freedombox user and group. This is not ideal.

- 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:21 -04:00
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