apache: Stop installing uwsgi by default

Closes: Debian #1144740.

- When one of the applications such as bepasty, radicale, or searx need it, then
install it.

- Reduces the number of dependencies for freedombox package.

- Reduces size of the disk image.

- Ensures that uwsgi does not run on every freedombox machine.

- Apache's proxy_uwsgi module (provided by apache2-bin, apache2) can still be
enabled by default because uwsgi is not a dependency for the Apache module and
uwsgi socket connections are not attempted until specific configuration is
enabled and requests arrive.

- Change dependency from uwsgi-core to uwsgi. uwsgi-core does not have init
scripts but uwsgi package has init script (but only on trixie and not forky and
up). The init script is disabled and masked by bepasty, radicale, and searx
apps. So, this should not be a problem.

Tests:

- On a freshly installed Debian forky and trixie machines, install freedombox
deb package built with changes. Installation succeeds. uwsgi is not installed at
all. bepasty and radicale can be installed and basic requests to web UI work.
uwsgi init script is not started and is masked.

- Functional tests for bepasty and radicale work.

- On a Trixie machine, setup freedombox from trixie. Then install freedombox deb
package with the patch. uwsgi is not marked as manually installed and running
unattended-updates will remove it. Install bepasty and uwsgi package is
installed and marked as manually installed.

- On a Trixie machine, setup freedombox from trixie. Install the bepasty app.
Then install freedombox deb package with the patch. uwsgi is marked as manually
installed and running unattended-updates will not remove it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2026-08-18 16:26:19 -07:00 committed by James Valleroy
parent 714abafb0c
commit b1cc874abb
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
6 changed files with 30 additions and 23 deletions

View File

@ -69,7 +69,7 @@ from plinth import action_utils
from plinth import app as app_module
from plinth import cfg
from plinth.config import DropinConfigs
from plinth.daemon import Daemon, RelatedDaemon
from plinth.daemon import Daemon
from plinth.modules import names
from plinth.modules.firewall.components import Firewall
from plinth.modules.letsencrypt.components import LetsEncrypt
@ -96,10 +96,9 @@ class ApacheApp(app_module.App):
is_essential=True, name=_('Apache HTTP Server'))
self.add(info)
packages = Packages('packages-apache', [
'apache2', 'php-fpm', 'ssl-cert', 'uwsgi-core',
'uwsgi-plugin-python3', 'libapache2-mod-auth-openidc'
])
packages = Packages(
'packages-apache',
['apache2', 'php-fpm', 'ssl-cert', 'libapache2-mod-auth-openidc'])
self.add(packages)
dropin_configs = DropinConfigs('dropin-configs-apache', [
@ -134,10 +133,6 @@ class ApacheApp(app_module.App):
daemon = Daemon('daemon-apache', 'apache2')
self.add(daemon)
# To be able to disable the old uwsgi init.d script.
related_daemon = RelatedDaemon('related-daemon-apache', 'uwsgi')
self.add(related_daemon)
@staticmethod
def post_init():
"""Perform post initialization operations."""

View File

@ -42,7 +42,7 @@ def _validate_service(service):
"""Validate a service manifest provided as a dictionary."""
assert isinstance(service['name'], str)
assert isinstance(service['type'], str)
assert service['type'] in ('apache', 'uwsgi', 'system')
assert service['type'] in ('apache', 'system')
if service['type'] == 'apache':
assert service['kind'] in ('config', 'site', 'module')

View File

@ -87,10 +87,6 @@ def test_invalid_directories_and_files(section):
None,
[],
['service'],
[{
'type': 'uwsgi',
'name': 'service'
}],
[{
'type': 'system',
'name': 'service'

View File

@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _
from plinth import app as app_module
from plinth import frontpage, menu
from plinth.config import DropinConfigs
from plinth.daemon import Daemon
from plinth.daemon import Daemon, RelatedDaemon
from plinth.modules.apache.components import Webserver
from plinth.modules.backups.components import BackupRestore
from plinth.modules.firewall.components import Firewall
@ -50,7 +50,7 @@ class BepastyApp(app_module.App):
app_id = 'bepasty'
_version = 4
_version = 5
def __init__(self) -> None:
"""Create components for the app."""
@ -72,7 +72,8 @@ class BepastyApp(app_module.App):
clients=manifest.clients, tags=info.tags)
self.add(shortcut)
packages = Packages('packages-bepasty', ['bepasty'])
packages = Packages('packages-bepasty',
['bepasty', 'uwsgi', 'uwsgi-plugin-python3'])
self.add(packages)
dropin_configs = DropinConfigs('dropin-configs-bepasty', [
@ -97,6 +98,10 @@ class BepastyApp(app_module.App):
**manifest.backup)
self.add(backup_restore)
# To be able to disable the old uwsgi init.d script.
related_daemon = RelatedDaemon('related-daemon-bepasty', 'uwsgi')
self.add(related_daemon)
def setup(self, old_version):
"""Install and configure the app."""
super().setup(old_version)

View File

@ -10,7 +10,7 @@ from django.utils.translation import gettext_lazy as _
from plinth import app as app_module
from plinth import cfg, frontpage, menu
from plinth.config import DropinConfigs
from plinth.daemon import Daemon
from plinth.daemon import Daemon, RelatedDaemon
from plinth.modules.apache.components import Webserver
from plinth.modules.backups.components import BackupRestore
from plinth.modules.firewall.components import Firewall
@ -42,7 +42,7 @@ class RadicaleApp(app_module.App):
app_id = 'radicale'
_version = 6
_version = 7
def __init__(self) -> None:
"""Create components for the app."""
@ -66,7 +66,8 @@ class RadicaleApp(app_module.App):
tags=info.tags, login_required=True)
self.add(shortcut)
packages = Packages('packages-radicale', ['radicale'],
packages = Packages('packages-radicale',
['radicale', 'uwsgi', 'uwsgi-plugin-python3'],
rerun_setup_on_upgrade=True)
self.add(packages)
@ -94,6 +95,10 @@ class RadicaleApp(app_module.App):
**manifest.backup)
self.add(backup_restore)
# To be able to disable the old uwsgi init.d script.
related_daemon = RelatedDaemon('related-daemon-radicale', 'uwsgi')
self.add(related_daemon)
def enable(self):
"""Fix missing directories before enabling radicale."""
privileged.fix_paths()

View File

@ -8,7 +8,7 @@ from django.utils.translation import gettext_lazy as _
from plinth import app as app_module
from plinth import frontpage, menu
from plinth.config import DropinConfigs
from plinth.daemon import Daemon
from plinth.daemon import Daemon, RelatedDaemon
from plinth.modules.apache.components import Webserver
from plinth.modules.backups.components import BackupRestore
from plinth.modules.firewall.components import Firewall
@ -31,7 +31,7 @@ class SearxApp(app_module.App):
app_id = 'searx'
_version = 7
_version = 8
def __init__(self) -> None:
"""Create components for the app."""
@ -59,7 +59,9 @@ class SearxApp(app_module.App):
# Include libjs-bootstrap to prevent accidental uninstall (see
# issue #2298).
packages = Packages('packages-searx', ['searx', 'libjs-bootstrap'])
packages = Packages(
'packages-searx',
['searx', 'libjs-bootstrap', 'uwsgi', 'uwsgi-plugin-python3'])
self.add(packages)
dropin_configs = DropinConfigs('dropin-configs-searx', [
@ -91,6 +93,10 @@ class SearxApp(app_module.App):
**manifest.backup)
self.add(backup_restore)
# To be able to disable the old uwsgi init.d script.
related_daemon = RelatedDaemon('related-daemon-searx', 'uwsgi')
self.add(related_daemon)
def set_shortcut_login_required(self, login_required):
"""Change the login_required property of shortcut."""
self.get_component('shortcut-searx').login_required = login_required