diff --git a/freedombox/action_utils.py b/freedombox/action_utils.py index 8d9c91196..6c99e4cbf 100644 --- a/freedombox/action_utils.py +++ b/freedombox/action_utils.py @@ -790,7 +790,7 @@ def move_uploaded_file(source: str | pathlib.Path, If allow_overwrite is set to False and destination file exists, an exception is raised. """ - from plinth import settings + from freedombox import settings if isinstance(source, str): source = pathlib.Path(source) diff --git a/freedombox/actions.py b/freedombox/actions.py index d1ab50d2c..cce710fa4 100644 --- a/freedombox/actions.py +++ b/freedombox/actions.py @@ -14,7 +14,7 @@ import traceback import types import typing -from plinth import cfg, module_loader +from freedombox import cfg, module_loader logger = logging.getLogger(__name__) diff --git a/freedombox/app.py b/freedombox/app.py index 745f18e94..abef2ea51 100644 --- a/freedombox/app.py +++ b/freedombox/app.py @@ -9,9 +9,9 @@ import inspect import logging from typing import ClassVar, TypeAlias -from plinth import cfg -from plinth.diagnostic_check import DiagnosticCheck -from plinth.signals import post_app_loading +from freedombox import cfg +from freedombox.diagnostic_check import DiagnosticCheck +from freedombox.signals import post_app_loading from . import clients as clients_module from . import db @@ -314,7 +314,7 @@ class App: This is typically true if the apps has daemons or containers. """ - from plinth import log + from freedombox import log for component in self.components.values(): if isinstance(component, log.LogEmitter): return True @@ -323,7 +323,7 @@ class App: def get_logs(self) -> _list_type[dict[str, str]]: """Return the logs in a dictionary format.""" - from plinth import log + from freedombox import log logs: list[dict[str, str]] = [] for component in self.components.values(): if isinstance(component, log.LogEmitter): @@ -611,17 +611,17 @@ class EnableState(LeaderComponent): def is_enabled(self): """Return whether the app/component is enabled.""" - from plinth import kvstore + from freedombox import kvstore return kvstore.get_default(self.key, False) def enable(self): """Store that the app/component is enabled.""" - from plinth import kvstore + from freedombox import kvstore kvstore.set(self.key, True) def disable(self): """Store that the app/component is disabled.""" - from plinth import kvstore + from freedombox import kvstore kvstore.set(self.key, False) diff --git a/freedombox/config.py b/freedombox/config.py index 2cc0d1dc3..b60ef68a3 100644 --- a/freedombox/config.py +++ b/freedombox/config.py @@ -5,9 +5,9 @@ import pathlib from django.utils.translation import gettext_noop -from plinth.diagnostic_check import (DiagnosticCheck, - DiagnosticCheckParameters, Result) -from plinth.privileged import config as privileged +from freedombox.diagnostic_check import (DiagnosticCheck, + DiagnosticCheckParameters, Result) +from freedombox.privileged import config as privileged from . import app as app_module diff --git a/freedombox/conftest.py b/freedombox/conftest.py index a4ce1bbec..949f3c62c 100644 --- a/freedombox/conftest.py +++ b/freedombox/conftest.py @@ -62,7 +62,7 @@ def pytest_collection_modifyitems(config, items): @pytest.fixture(name='load_cfg') def fixture_load_cfg(): """Load test configuration.""" - from plinth import cfg + from freedombox import cfg keys = ('file_root', 'data_dir', 'custom_static_dir', 'store_file', 'doc_dir', 'server_dir', 'host', 'port', 'use_x_forwarded_for', @@ -187,7 +187,7 @@ def fixture_mock_run_as_user(): """A fixture to override action_utils.run_as_user.""" def _bypass_runuser(*args, username, **kwargs): - from plinth import action_utils + from freedombox import action_utils return action_utils.run(*args, **kwargs) with patch('plinth.action_utils.run_as_user') as mock: @@ -287,7 +287,7 @@ def fixture_host_sudo(host): @pytest.fixture(name='test_menu') def fixture_test_menu(): """Initialized menu module.""" - from plinth import menu as menu_module + from freedombox import menu as menu_module menu_module.Menu._all_menus = set() menu_module.init() diff --git a/freedombox/container.py b/freedombox/container.py index 574db4d6a..ccb523951 100644 --- a/freedombox/container.py +++ b/freedombox/container.py @@ -5,9 +5,9 @@ import contextlib from django.utils.translation import gettext_noop -from plinth import app, log, privileged -from plinth.daemon import diagnose_port_listening -from plinth.diagnostic_check import (DiagnosticCheck, +from freedombox import app, log, privileged +from freedombox.daemon import diagnose_port_listening +from freedombox.diagnostic_check import (DiagnosticCheck, DiagnosticCheckParameters, Result) @@ -89,7 +89,7 @@ class Container(app.LeaderComponent, log.LogEmitter): @contextlib.contextmanager def ensure_running(self): """Ensure a service is running and return to previous state.""" - from plinth.privileged import service as service_privileged + from freedombox.privileged import service as service_privileged starting_state = self.is_running() if not starting_state: service_privileged.enable(self.name) diff --git a/freedombox/context_processors.py b/freedombox/context_processors.py index 3afc1e2c6..de1477586 100644 --- a/freedombox/context_processors.py +++ b/freedombox/context_processors.py @@ -6,8 +6,8 @@ Django context processors to provide common data to templates. from django.utils.translation import gettext as _ from django.utils.translation import gettext_noop -from plinth import cfg, views, web_server -from plinth.utils import is_user_admin +from freedombox import cfg, views, web_server +from freedombox.utils import is_user_admin def common(request): @@ -20,7 +20,7 @@ def common(request): # the brand name 'FreedomBox' itself to be translated. gettext_noop('FreedomBox') - from plinth.notification import Notification + from freedombox.notification import Notification notifications_context = Notification.get_display_context( request, user=request.user) diff --git a/freedombox/daemon.py b/freedombox/daemon.py index 8b91a8148..71e16eea9 100644 --- a/freedombox/daemon.py +++ b/freedombox/daemon.py @@ -8,8 +8,8 @@ import subprocess import psutil from django.utils.translation import gettext_noop -from plinth import action_utils, app, log -from plinth.diagnostic_check import (DiagnosticCheck, +from freedombox import action_utils, app, log +from freedombox.diagnostic_check import (DiagnosticCheck, DiagnosticCheckParameters, Result) @@ -71,14 +71,14 @@ class Daemon(app.LeaderComponent, log.LogEmitter): def enable(self): """Run operations to enable the daemon/unit.""" - from plinth.privileged import service as service_privileged + from freedombox.privileged import service as service_privileged service_privileged.enable(self.unit) if self.alias: service_privileged.enable(self.alias) def disable(self): """Run operations to disable the daemon/unit.""" - from plinth.privileged import service as service_privileged + from freedombox.privileged import service as service_privileged service_privileged.disable(self.unit) if self.alias: service_privileged.disable(self.alias) @@ -90,7 +90,7 @@ class Daemon(app.LeaderComponent, log.LogEmitter): @contextlib.contextmanager def ensure_running(self): """Ensure a service is running and return to previous state.""" - from plinth.privileged import service as service_privileged + from freedombox.privileged import service as service_privileged if action_utils.service_show(self.unit)['LoadState'] == 'not-found': # The service's package not installed yet, don't try to start it diff --git a/freedombox/db/postgres.py b/freedombox/db/postgres.py index 2da14d950..f855ff892 100644 --- a/freedombox/db/postgres.py +++ b/freedombox/db/postgres.py @@ -7,7 +7,7 @@ Uses utilities from 'postgres' package such as 'psql' and 'pg_dump'. import os import pathlib -from plinth import action_utils +from freedombox import action_utils def _run_as(command, **kwargs): diff --git a/freedombox/dbus.py b/freedombox/dbus.py index e92e39510..94152c51d 100644 --- a/freedombox/dbus.py +++ b/freedombox/dbus.py @@ -6,7 +6,7 @@ Expose some API over D-Bus. import logging import threading -from plinth.utils import import_from_gi +from freedombox.utils import import_from_gi from . import setup @@ -95,7 +95,7 @@ class DBusServer(): self.package_handler = PackageHandler() self.package_handler.register(connection) - from plinth.modules.letsencrypt.dbus import LetsEncrypt + from freedombox.modules.letsencrypt.dbus import LetsEncrypt lets_encrypt = LetsEncrypt() lets_encrypt.register(connection) diff --git a/freedombox/diagnostic_check.py b/freedombox/diagnostic_check.py index a280acd6c..8c2958c00 100644 --- a/freedombox/diagnostic_check.py +++ b/freedombox/diagnostic_check.py @@ -9,7 +9,7 @@ from typing import TypeAlias from django.utils.translation import gettext -from plinth.utils import SafeFormatter +from freedombox.utils import SafeFormatter DiagnosticCheckParameters: TypeAlias = dict[str, str | int | bool | None] diff --git a/freedombox/forms.py b/freedombox/forms.py index c0310f494..6d5752b9d 100644 --- a/freedombox/forms.py +++ b/freedombox/forms.py @@ -54,7 +54,7 @@ class DomainSelectionForm(forms.Form): def __init__(self, show_none=False, *args, **kwargs): super().__init__(*args, **kwargs) - from plinth.modules.names.components import DomainName + from freedombox.modules.names.components import DomainName domains = list(DomainName.list_names()) choices = list(zip(domains, domains)) @@ -70,7 +70,7 @@ class DomainSelectionForm(forms.Form): def _get_domain_choices(): """Double domain entries for inclusion in the choice field.""" - from plinth.modules.names import get_available_tls_domains + from freedombox.modules.names import get_available_tls_domains return ((domain, domain) for domain in get_available_tls_domains()) diff --git a/freedombox/frontpage.py b/freedombox/frontpage.py index f9d79446d..0c265567b 100644 --- a/freedombox/frontpage.py +++ b/freedombox/frontpage.py @@ -6,8 +6,8 @@ import logging import pathlib from typing import ClassVar -from plinth import app, cfg -from plinth.modules.users import privileged as users_privileged +from freedombox import app, cfg +from freedombox.modules.users import privileged as users_privileged logger = logging.getLogger(__name__) diff --git a/freedombox/glib.py b/freedombox/glib.py index f4612d2a4..971322ae0 100644 --- a/freedombox/glib.py +++ b/freedombox/glib.py @@ -7,8 +7,8 @@ import logging import random import threading -from plinth import dbus, network -from plinth.utils import import_from_gi +from freedombox import dbus, network +from freedombox.utils import import_from_gi from . import cfg diff --git a/freedombox/kvstore.py b/freedombox/kvstore.py index 404aa2792..e1a1cfa23 100644 --- a/freedombox/kvstore.py +++ b/freedombox/kvstore.py @@ -8,7 +8,7 @@ from . import db def get(key): """Return the value of a key""" - from plinth.models import KVStore + from freedombox.models import KVStore with db.lock: # pylint: disable-msg=E1101 @@ -26,7 +26,7 @@ def get_default(key, default_value): def set(key, value): # pylint: disable-msg=W0622 """Store the value of a key""" - from plinth.models import KVStore + from freedombox.models import KVStore with db.lock: store = KVStore(key=key, value=value) store.save() @@ -34,7 +34,7 @@ def set(key, value): # pylint: disable-msg=W0622 def delete(key, ignore_missing=False): """Delete a key""" - from plinth.models import KVStore + from freedombox.models import KVStore with db.lock: try: return KVStore.objects.get(key=key).delete() diff --git a/freedombox/log.py b/freedombox/log.py index ed3a5c2f9..414b2a591 100644 --- a/freedombox/log.py +++ b/freedombox/log.py @@ -28,7 +28,7 @@ class LogEmitter: unit: str def get_logs(self: LogEmitterProtocol) -> dict[str, str]: - from plinth.privileged import service as service_privileged + from freedombox.privileged import service as service_privileged return service_privileged.get_logs(self.unit) diff --git a/freedombox/menu.py b/freedombox/menu.py index da2852b53..7aea0f2dc 100644 --- a/freedombox/menu.py +++ b/freedombox/menu.py @@ -5,7 +5,7 @@ from typing import ClassVar from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app +from freedombox import app class Menu(app.FollowerComponent): diff --git a/freedombox/middleware.py b/freedombox/middleware.py index b3b57140c..af3dbe2d3 100644 --- a/freedombox/middleware.py +++ b/freedombox/middleware.py @@ -19,9 +19,9 @@ from django.utils.deprecation import MiddlewareMixin from django.utils.translation import gettext as _ from stronghold.utils import is_view_func_public -from plinth import app as app_module -from plinth import setup -from plinth.utils import is_user_admin +from freedombox import app as app_module +from freedombox import setup +from freedombox.utils import is_user_admin from . import operation as operation_module from . import views diff --git a/freedombox/migrations/0003_merge_firstboot_completed_fields.py b/freedombox/migrations/0003_merge_firstboot_completed_fields.py index ee5275ac9..b413c24f4 100644 --- a/freedombox/migrations/0003_merge_firstboot_completed_fields.py +++ b/freedombox/migrations/0003_merge_firstboot_completed_fields.py @@ -8,7 +8,7 @@ from __future__ import unicode_literals from django.db import migrations -from plinth.models import KVStore +from freedombox.models import KVStore def merge_firstboot_finished_fields(apps, schema_editor): diff --git a/freedombox/migrations/0004_userprofile.py b/freedombox/migrations/0004_userprofile.py index 92636950b..1214f62cc 100644 --- a/freedombox/migrations/0004_userprofile.py +++ b/freedombox/migrations/0004_userprofile.py @@ -7,7 +7,7 @@ from django.conf import settings from django.contrib.auth.models import User from django.db import migrations, models -from plinth.models import UserProfile +from freedombox.models import UserProfile def insert_users(apps, schema_editor): diff --git a/freedombox/migrations/0005_storednotification.py b/freedombox/migrations/0005_storednotification.py index aeddc717c..715c3aaff 100644 --- a/freedombox/migrations/0005_storednotification.py +++ b/freedombox/migrations/0005_storednotification.py @@ -9,7 +9,7 @@ Django migration for adding the notification model. from django.db import migrations, models -from plinth.models import JSONField +from freedombox.models import JSONField class Migration(migrations.Migration): diff --git a/freedombox/module_loader.py b/freedombox/module_loader.py index 1700832db..452fae3c5 100644 --- a/freedombox/module_loader.py +++ b/freedombox/module_loader.py @@ -11,8 +11,8 @@ import types import django -from plinth import cfg -from plinth.signals import pre_module_loading +from freedombox import cfg +from freedombox.signals import pre_module_loading logger = logging.getLogger(__name__) @@ -50,7 +50,7 @@ def load_modules(): def _include_module_urls(module_import_path, module_name): """Include the module's URLs in global project URLs list""" - from plinth import urls + from freedombox import urls url_module = module_import_path + '.urls' try: urls.urlpatterns += [ diff --git a/freedombox/modules/apache/__init__.py b/freedombox/modules/apache/__init__.py index b9ab3c0f4..890544781 100644 --- a/freedombox/modules/apache/__init__.py +++ b/freedombox/modules/apache/__init__.py @@ -65,18 +65,18 @@ import os from django.utils.translation import gettext_lazy as _ -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 -from plinth.modules import names -from plinth.modules.firewall.components import Firewall -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.modules.oidc.components import OpenIDConnect -from plinth.package import Packages -from plinth.signals import domain_added, domain_removed -from plinth.utils import format_lazy, is_valid_user_name +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules import names +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.modules.oidc.components import OpenIDConnect +from freedombox.package import Packages +from freedombox.signals import domain_added, domain_removed +from freedombox.utils import format_lazy, is_valid_user_name from . import privileged diff --git a/freedombox/modules/apache/components.py b/freedombox/modules/apache/components.py index 05746a353..c5b6788d9 100644 --- a/freedombox/modules/apache/components.py +++ b/freedombox/modules/apache/components.py @@ -6,10 +6,10 @@ import subprocess from django.utils.translation import gettext_noop -from plinth import action_utils, app, kvstore -from plinth.diagnostic_check import (DiagnosticCheck, +from freedombox import action_utils, app, kvstore +from freedombox.diagnostic_check import (DiagnosticCheck, DiagnosticCheckParameters, Result) -from plinth.privileged import service as service_privileged +from freedombox.privileged import service as service_privileged from . import privileged diff --git a/freedombox/modules/apache/privileged.py b/freedombox/modules/apache/privileged.py index 319aca804..5d284ef4a 100644 --- a/freedombox/modules/apache/privileged.py +++ b/freedombox/modules/apache/privileged.py @@ -11,8 +11,8 @@ import urllib.parse import augeas -from plinth import action_utils, utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils, utils +from freedombox.actions import privileged, secret_str openidc_config_path = pathlib.Path( '/etc/apache2/conf-available/freedombox-openidc.conf') diff --git a/freedombox/modules/apache/tests/test_components.py b/freedombox/modules/apache/tests/test_components.py index 6c300e630..bd1778e28 100644 --- a/freedombox/modules/apache/tests/test_components.py +++ b/freedombox/modules/apache/tests/test_components.py @@ -8,9 +8,9 @@ from unittest.mock import Mock, PropertyMock, call, patch import pytest -from plinth import app, kvstore -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules.apache.components import (Webserver, WebserverRoot, +from freedombox import app, kvstore +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules.apache.components import (Webserver, WebserverRoot, check_url, diagnose_url, diagnose_url_on_all) diff --git a/freedombox/modules/apache/tests/test_uws.py b/freedombox/modules/apache/tests/test_uws.py index 035874012..f3edb0a54 100644 --- a/freedombox/modules/apache/tests/test_uws.py +++ b/freedombox/modules/apache/tests/test_uws.py @@ -3,9 +3,10 @@ Test module for (U)ser (Web) (S)ites. """ -from plinth.modules.apache import (user_of_uws_directory, user_of_uws_url, - uws_directory_of_url, uws_directory_of_user, - uws_url_of_directory, uws_url_of_user) +from freedombox.modules.apache import (user_of_uws_directory, user_of_uws_url, + uws_directory_of_url, + uws_directory_of_user, + uws_url_of_directory, uws_url_of_user) def test_uws_namings(): diff --git a/freedombox/modules/api/__init__.py b/freedombox/modules/api/__init__.py index 261d3ec06..3bcace62c 100644 --- a/freedombox/modules/api/__init__.py +++ b/freedombox/modules/api/__init__.py @@ -3,7 +3,7 @@ FreedomBox app for api for android app. """ -from plinth import app as app_module +from freedombox import app as app_module class ApiApp(app_module.App): diff --git a/freedombox/modules/api/urls.py b/freedombox/modules/api/urls.py index f0cb66038..ea508f027 100644 --- a/freedombox/modules/api/urls.py +++ b/freedombox/modules/api/urls.py @@ -6,7 +6,7 @@ URLs for the plinth api for android app. from django.urls import re_path from stronghold.decorators import public -from plinth.modules.api import views +from freedombox.modules.api import views urlpatterns = [ re_path(r'^api/(?P[0-9]+)/shortcuts/?$', public(views.shortcuts)), diff --git a/freedombox/modules/api/views.py b/freedombox/modules/api/views.py index 176f80b73..c36c6281d 100644 --- a/freedombox/modules/api/views.py +++ b/freedombox/modules/api/views.py @@ -10,7 +10,7 @@ from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse from django.templatetags.static import static -from plinth import frontpage +from freedombox import frontpage def shortcuts(request, **kwargs): diff --git a/freedombox/modules/avahi/__init__.py b/freedombox/modules/avahi/__init__.py index f710c9c81..0155d5c1b 100644 --- a/freedombox/modules/avahi/__init__.py +++ b/freedombox/modules/avahi/__init__.py @@ -3,17 +3,18 @@ from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.names import get_hostname -from plinth.modules.names.components import DomainType -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.signals import domain_added, domain_removed, post_hostname_change -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.names import get_hostname +from freedombox.modules.names.components import DomainType +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.signals import (domain_added, domain_removed, + post_hostname_change) +from freedombox.utils import format_lazy from . import manifest diff --git a/freedombox/modules/avahi/tests/test_functional.py b/freedombox/modules/avahi/tests/test_functional.py index 10f131f27..b387d8557 100644 --- a/freedombox/modules/avahi/tests/test_functional.py +++ b/freedombox/modules/avahi/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for avahi app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [ pytest.mark.system, pytest.mark.essential, pytest.mark.domain, diff --git a/freedombox/modules/avahi/urls.py b/freedombox/modules/avahi/urls.py index 19197cbd7..096d3efd2 100644 --- a/freedombox/modules/avahi/urls.py +++ b/freedombox/modules/avahi/urls.py @@ -5,7 +5,7 @@ URLs for the service discovery module. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^sys/avahi/$', AppView.as_view(app_id='avahi'), name='index'), diff --git a/freedombox/modules/backups/__init__.py b/freedombox/modules/backups/__init__.py index 2704e0bdb..e018c0cba 100644 --- a/freedombox/modules/backups/__init__.py +++ b/freedombox/modules/backups/__init__.py @@ -14,10 +14,10 @@ from django.utils.text import get_valid_filename from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import cfg, glib, menu -from plinth.modules.names.components import DomainName -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import cfg, glib, menu +from freedombox.modules.names.components import DomainName +from freedombox.package import Packages from . import api, errors, manifest, privileged @@ -239,7 +239,7 @@ def split_path(path): def _show_schedule_setup_notification(): """Show a notification hinting to setup a remote backup schedule.""" - from plinth.notification import Notification + from freedombox.notification import Notification message = gettext_noop( 'Enable an automatic backup schedule for data safety. Prefer an ' 'encrypted remote backup location or an extra attached disk.') @@ -267,7 +267,7 @@ def on_schedule_save(repository): if not repository.schedule.enabled: return - from plinth.notification import Notification + from freedombox.notification import Notification try: note = Notification.get('backups-remote-schedule') note.dismiss() @@ -277,7 +277,7 @@ def on_schedule_save(repository): def _show_schedule_error_notification(repository, is_error, exception=None): """Show or hide a notification related scheduled backup operation.""" - from plinth.notification import Notification + from freedombox.notification import Notification id_ = 'backups-schedule-error-' + repository.uuid try: note = Notification.get(id_) diff --git a/freedombox/modules/backups/api.py b/freedombox/modules/backups/api.py index 2213b3d4e..c7d358da0 100644 --- a/freedombox/modules/backups/api.py +++ b/freedombox/modules/backups/api.py @@ -12,11 +12,11 @@ TODO: import logging -from plinth import action_utils -from plinth import app as app_module -from plinth import setup -from plinth.modules.apache import privileged as apache_privileged -from plinth.privileged import service as service_privileged +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import setup +from freedombox.modules.apache import privileged as apache_privileged +from freedombox.privileged import service as service_privileged from .components import BackupRestore diff --git a/freedombox/modules/backups/components.py b/freedombox/modules/backups/components.py index e06a6a012..cea8c885f 100644 --- a/freedombox/modules/backups/components.py +++ b/freedombox/modules/backups/components.py @@ -3,7 +3,7 @@ import copy -from plinth import app +from freedombox import app from . import privileged @@ -157,7 +157,7 @@ class BackupRestore(app.FollowerComponent): if not self.settings: return - from plinth import kvstore + from freedombox import kvstore data = {} for key in self.settings: try: @@ -181,6 +181,6 @@ class BackupRestore(app.FollowerComponent): data = privileged.load_settings(self.app_id) - from plinth import kvstore + from freedombox import kvstore for key, value in data.items(): kvstore.set(key, value) diff --git a/freedombox/modules/backups/errors.py b/freedombox/modules/backups/errors.py index d2cd56358..a1a2d6a48 100644 --- a/freedombox/modules/backups/errors.py +++ b/freedombox/modules/backups/errors.py @@ -2,7 +2,7 @@ import subprocess -from plinth.errors import PlinthError +from freedombox.errors import PlinthError class BorgError(PlinthError): diff --git a/freedombox/modules/backups/forms.py b/freedombox/modules/backups/forms.py index faf5e0e2e..f14252c5d 100644 --- a/freedombox/modules/backups/forms.py +++ b/freedombox/modules/backups/forms.py @@ -15,9 +15,9 @@ from django.core.validators import (FileExtensionValidator, from django.utils.translation import gettext from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.modules.storage import get_mounts -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.modules.storage import get_mounts +from freedombox.utils import format_lazy from . import api, split_path from .repository import get_repositories diff --git a/freedombox/modules/backups/privileged.py b/freedombox/modules/backups/privileged.py index 234ab8dcc..50df02d2a 100644 --- a/freedombox/modules/backups/privileged.py +++ b/freedombox/modules/backups/privileged.py @@ -12,11 +12,11 @@ import tarfile from django.utils.translation import gettext_lazy as _ -from plinth import action_utils, actions -from plinth import app as app_module -from plinth import module_loader -from plinth.actions import privileged, secret_str -from plinth.utils import Version +from freedombox import action_utils, actions +from freedombox import app as app_module +from freedombox import module_loader +from freedombox.actions import privileged, secret_str +from freedombox.utils import Version from . import errors @@ -492,7 +492,7 @@ def delete_before_restore(app_id: str): app_module.apps_init() app = app_module.App.get(app_id) - from plinth.modules.backups.components import BackupRestore + from freedombox.modules.backups.components import BackupRestore components = app.get_components_of_type(BackupRestore) for component in components: for path in component.delete_before_restore: diff --git a/freedombox/modules/backups/repository.py b/freedombox/modules/backups/repository.py index 89b64b26d..bb1c1a25d 100644 --- a/freedombox/modules/backups/repository.py +++ b/freedombox/modules/backups/repository.py @@ -10,8 +10,8 @@ from uuid import uuid1 from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.utils import format_lazy from . import (_backup_handler, api, copy_ssh_client_public_key, errors, generate_ssh_client_auth_key, get_known_hosts_path, diff --git a/freedombox/modules/backups/store.py b/freedombox/modules/backups/store.py index eaf7e30eb..645cdd626 100644 --- a/freedombox/modules/backups/store.py +++ b/freedombox/modules/backups/store.py @@ -6,7 +6,7 @@ Manage storage of repository information in KVStore table in database. import json from uuid import uuid1 -from plinth import kvstore +from freedombox import kvstore # kvstore key for repository store STORAGE_KEY = 'network_storage' diff --git a/freedombox/modules/backups/tests/test_api.py b/freedombox/modules/backups/tests/test_api.py index 484de1c70..37a0fce4a 100644 --- a/freedombox/modules/backups/tests/test_api.py +++ b/freedombox/modules/backups/tests/test_api.py @@ -8,7 +8,7 @@ from unittest.mock import MagicMock, call, patch import pytest from django.core.files.uploadedfile import SimpleUploadedFile -from plinth.app import App +from freedombox.app import App from .. import api, forms, repository from ..components import BackupRestore diff --git a/freedombox/modules/backups/tests/test_backups.py b/freedombox/modules/backups/tests/test_backups.py index b6d3aa707..2c675384e 100644 --- a/freedombox/modules/backups/tests/test_backups.py +++ b/freedombox/modules/backups/tests/test_backups.py @@ -10,10 +10,10 @@ import uuid import pytest -from plinth.modules import backups -from plinth.modules.backups import privileged -from plinth.modules.backups.repository import BorgRepository, SshBorgRepository -from plinth.tests import config as test_config +from freedombox.modules import backups +from freedombox.modules.backups import privileged +from freedombox.modules.backups.repository import BorgRepository, SshBorgRepository +from freedombox.tests import config as test_config pytestmark = pytest.mark.usefixtures('needs_root', 'needs_borg', 'load_cfg', 'mock_privileged') diff --git a/freedombox/modules/backups/tests/test_components.py b/freedombox/modules/backups/tests/test_components.py index 1772f0f38..e8759a8e6 100644 --- a/freedombox/modules/backups/tests/test_components.py +++ b/freedombox/modules/backups/tests/test_components.py @@ -7,7 +7,7 @@ from unittest.mock import call, patch import pytest -from plinth import kvstore +from freedombox import kvstore from .. import components from ..components import BackupRestore diff --git a/freedombox/modules/backups/tests/test_functional.py b/freedombox/modules/backups/tests/test_functional.py index 0377239b2..74c4985b9 100644 --- a/freedombox/modules/backups/tests/test_functional.py +++ b/freedombox/modules/backups/tests/test_functional.py @@ -11,7 +11,7 @@ import urllib.parse import pytest import requests -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.backups] diff --git a/freedombox/modules/backups/tests/test_schedule.py b/freedombox/modules/backups/tests/test_schedule.py index d8520f438..4a8c64642 100644 --- a/freedombox/modules/backups/tests/test_schedule.py +++ b/freedombox/modules/backups/tests/test_schedule.py @@ -10,7 +10,7 @@ from unittest.mock import MagicMock, call, patch import pytest import plinth.modules.backups.repository as repository_module -from plinth.app import App +from freedombox.app import App from ..components import BackupRestore from ..schedule import Schedule diff --git a/freedombox/modules/backups/tests/test_ssh_remotes.py b/freedombox/modules/backups/tests/test_ssh_remotes.py index cae0c2f36..bd13cb036 100644 --- a/freedombox/modules/backups/tests/test_ssh_remotes.py +++ b/freedombox/modules/backups/tests/test_ssh_remotes.py @@ -11,7 +11,7 @@ import subprocess import pytest from django.forms import ValidationError -from plinth.utils import generate_password, random_string +from freedombox.utils import generate_password, random_string from .. import forms diff --git a/freedombox/modules/backups/tests/test_store.py b/freedombox/modules/backups/tests/test_store.py index ee18ed0dd..53515d15e 100644 --- a/freedombox/modules/backups/tests/test_store.py +++ b/freedombox/modules/backups/tests/test_store.py @@ -5,7 +5,7 @@ Test network storage. import pytest -from plinth.modules.backups import store +from freedombox.modules.backups import store pytestmark = pytest.mark.django_db diff --git a/freedombox/modules/backups/views.py b/freedombox/modules/backups/views.py index 36accb365..cf7c92b72 100644 --- a/freedombox/modules/backups/views.py +++ b/freedombox/modules/backups/views.py @@ -19,9 +19,9 @@ from django.utils.translation import gettext_lazy from django.views.decorators.http import require_POST from django.views.generic import FormView, TemplateView, View -from plinth.errors import PlinthError -from plinth.modules import backups, storage -from plinth.views import AppView +from freedombox.errors import PlinthError +from freedombox.modules import backups, storage +from freedombox.views import AppView from . import (SESSION_PATH_VARIABLE, api, errors, forms, generate_ssh_client_auth_key, get_known_hosts_path, diff --git a/freedombox/modules/bepasty/__init__.py b/freedombox/modules/bepasty/__init__.py index ea814ab1b..40a7996d6 100644 --- a/freedombox/modules/bepasty/__init__.py +++ b/freedombox/modules/bepasty/__init__.py @@ -3,15 +3,15 @@ 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, RelatedDaemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.privileged import service as service_privileged +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, RelatedDaemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged from . import manifest, privileged diff --git a/freedombox/modules/bepasty/forms.py b/freedombox/modules/bepasty/forms.py index 51352bc96..98c3f8c9d 100644 --- a/freedombox/modules/bepasty/forms.py +++ b/freedombox/modules/bepasty/forms.py @@ -6,7 +6,7 @@ Django forms for bepasty app. from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.modules import bepasty +from freedombox.modules import bepasty class SetDefaultPermissionsForm(forms.Form): diff --git a/freedombox/modules/bepasty/privileged.py b/freedombox/modules/bepasty/privileged.py index b89833e6a..4af3031bf 100644 --- a/freedombox/modules/bepasty/privileged.py +++ b/freedombox/modules/bepasty/privileged.py @@ -10,9 +10,9 @@ import string import augeas -from plinth import action_utils -from plinth.actions import privileged, secret_str -from plinth.modules import bepasty +from freedombox import action_utils +from freedombox.actions import privileged, secret_str +from freedombox.modules import bepasty CONF_FILE = pathlib.Path('/etc/bepasty-freedombox.conf') DATA_DIR = '/var/lib/private/bepasty' diff --git a/freedombox/modules/bepasty/tests/test_functional.py b/freedombox/modules/bepasty/tests/test_functional.py index a1e0dc1c5..c754fee57 100644 --- a/freedombox/modules/bepasty/tests/test_functional.py +++ b/freedombox/modules/bepasty/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for bepasty app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.bepasty] diff --git a/freedombox/modules/bepasty/views.py b/freedombox/modules/bepasty/views.py index 58347099c..ae9e2dc84 100644 --- a/freedombox/modules/bepasty/views.py +++ b/freedombox/modules/bepasty/views.py @@ -9,7 +9,7 @@ from django.utils.translation import gettext_lazy as _ from django.views.decorators.http import require_POST from django.views.generic import FormView -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import AddPasswordForm, SetDefaultPermissionsForm diff --git a/freedombox/modules/bind/__init__.py b/freedombox/modules/bind/__init__.py index ff34d927e..436e6b870 100644 --- a/freedombox/modules/bind/__init__.py +++ b/freedombox/modules/bind/__init__.py @@ -3,13 +3,13 @@ from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages, install -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages, install +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/bind/privileged.py b/freedombox/modules/bind/privileged.py index 3c94f4e96..f47e65a56 100644 --- a/freedombox/modules/bind/privileged.py +++ b/freedombox/modules/bind/privileged.py @@ -8,8 +8,8 @@ from pathlib import Path import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged CONFIG_FILE = '/etc/bind/named.conf.options' ZONES_DIR = '/var/bind/pri' diff --git a/freedombox/modules/bind/tests/test_bind.py b/freedombox/modules/bind/tests/test_bind.py index 6131893a9..93c633327 100644 --- a/freedombox/modules/bind/tests/test_bind.py +++ b/freedombox/modules/bind/tests/test_bind.py @@ -6,7 +6,7 @@ from pathlib import Path import pytest -from plinth.modules import bind +from freedombox.modules import bind @pytest.fixture(name='configuration_file') diff --git a/freedombox/modules/bind/tests/test_functional.py b/freedombox/modules/bind/tests/test_functional.py index 99f2c1e0c..d8c253bdb 100644 --- a/freedombox/modules/bind/tests/test_functional.py +++ b/freedombox/modules/bind/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for bind app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.bind] diff --git a/freedombox/modules/bind/urls.py b/freedombox/modules/bind/urls.py index bd472ef9f..ce9427ae4 100644 --- a/freedombox/modules/bind/urls.py +++ b/freedombox/modules/bind/urls.py @@ -5,7 +5,7 @@ URLs for the BIND module. from django.urls import re_path -from plinth.modules.bind.views import BindAppView +from freedombox.modules.bind.views import BindAppView urlpatterns = [ re_path(r'^sys/bind/$', BindAppView.as_view(), name='index'), diff --git a/freedombox/modules/bind/views.py b/freedombox/modules/bind/views.py index d5de97387..747570d27 100644 --- a/freedombox/modules/bind/views.py +++ b/freedombox/modules/bind/views.py @@ -4,8 +4,8 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.modules import names -from plinth.views import AppView +from freedombox.modules import names +from freedombox.views import AppView from . import privileged from .forms import BindForm diff --git a/freedombox/modules/calibre/__init__.py b/freedombox/modules/calibre/__init__.py index 27a5da627..65d337e17 100644 --- a/freedombox/modules/calibre/__init__.py +++ b/freedombox/modules/calibre/__init__.py @@ -5,17 +5,17 @@ import re 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/calibre/privileged.py b/freedombox/modules/calibre/privileged.py index 75829b569..5a6192bb2 100644 --- a/freedombox/modules/calibre/privileged.py +++ b/freedombox/modules/calibre/privileged.py @@ -4,9 +4,9 @@ import pathlib import shutil -from plinth import action_utils -from plinth.actions import privileged -from plinth.modules import calibre +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.modules import calibre LIBRARIES_PATH = pathlib.Path('/var/lib/calibre-server-freedombox/libraries') diff --git a/freedombox/modules/calibre/tests/test_functional.py b/freedombox/modules/calibre/tests/test_functional.py index 0c8237eb6..c440aa666 100644 --- a/freedombox/modules/calibre/tests/test_functional.py +++ b/freedombox/modules/calibre/tests/test_functional.py @@ -8,7 +8,7 @@ import time import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.calibre] diff --git a/freedombox/modules/calibre/tests/test_privileged.py b/freedombox/modules/calibre/tests/test_privileged.py index 346897e25..ed9e5a865 100644 --- a/freedombox/modules/calibre/tests/test_privileged.py +++ b/freedombox/modules/calibre/tests/test_privileged.py @@ -6,7 +6,7 @@ from unittest.mock import call, patch import pytest -from plinth.modules.calibre import privileged +from freedombox.modules.calibre import privileged pytestmark = pytest.mark.usefixtures('mock_privileged') privileged_modules_to_mock = ['plinth.modules.calibre.privileged'] diff --git a/freedombox/modules/calibre/tests/test_views.py b/freedombox/modules/calibre/tests/test_views.py index c7076ac91..13ff4c46b 100644 --- a/freedombox/modules/calibre/tests/test_views.py +++ b/freedombox/modules/calibre/tests/test_views.py @@ -10,8 +10,8 @@ from django import urls from django.contrib.messages.storage.fallback import FallbackStorage from django.http.response import Http404 -from plinth import module_loader -from plinth.modules.calibre import views +from freedombox import module_loader +from freedombox.modules.calibre import views # For all tests, use plinth.urls instead of urls configured for testing pytestmark = pytest.mark.urls('plinth.urls') diff --git a/freedombox/modules/calibre/views.py b/freedombox/modules/calibre/views.py index 3db0fbfb5..74a2be0d3 100644 --- a/freedombox/modules/calibre/views.py +++ b/freedombox/modules/calibre/views.py @@ -10,8 +10,8 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic.edit import FormView -from plinth import app as app_module -from plinth import views +from freedombox import app as app_module +from freedombox import views from . import forms, privileged diff --git a/freedombox/modules/cockpit/__init__.py b/freedombox/modules/cockpit/__init__.py index 466716a39..94fd20585 100644 --- a/freedombox/modules/cockpit/__init__.py +++ b/freedombox/modules/cockpit/__init__.py @@ -6,15 +6,15 @@ FreedomBox app to configure Cockpit. from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/cockpit/privileged.py b/freedombox/modules/cockpit/privileged.py index e7cfdfaec..3cfbef899 100644 --- a/freedombox/modules/cockpit/privileged.py +++ b/freedombox/modules/cockpit/privileged.py @@ -5,8 +5,8 @@ Configure Cockpit. import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged CONFIG_FILE = '/etc/cockpit/cockpit.conf' diff --git a/freedombox/modules/cockpit/tests/test_functional.py b/freedombox/modules/cockpit/tests/test_functional.py index 9b07b3b2f..2e2fd17f3 100644 --- a/freedombox/modules/cockpit/tests/test_functional.py +++ b/freedombox/modules/cockpit/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for cockpit app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.cockpit] diff --git a/freedombox/modules/cockpit/urls.py b/freedombox/modules/cockpit/urls.py index 0b888270a..903aa7986 100644 --- a/freedombox/modules/cockpit/urls.py +++ b/freedombox/modules/cockpit/urls.py @@ -5,7 +5,7 @@ URLs for Cockpit module. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^sys/cockpit/$', AppView.as_view(app_id='cockpit'), diff --git a/freedombox/modules/config/__init__.py b/freedombox/modules/config/__init__.py index 3981a25e5..dacc65938 100644 --- a/freedombox/modules/config/__init__.py +++ b/freedombox/modules/config/__init__.py @@ -6,13 +6,13 @@ import pathlib import augeas from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.daemon import RelatedDaemon -from plinth.modules.apache import (get_users_with_website, user_of_uws_url, - uws_url_of_user) -from plinth.package import Packages -from plinth.privileged import service as service_privileged +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.daemon import RelatedDaemon +from freedombox.modules.apache import (get_users_with_website, user_of_uws_url, + uws_url_of_user) +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged from . import manifest, privileged @@ -170,11 +170,11 @@ def change_home_page(shortcut_id: str): def get_advanced_mode(): """Get whether option is enabled.""" - from plinth import kvstore + from freedombox import kvstore return kvstore.get_default(ADVANCED_MODE_KEY, False) def set_advanced_mode(advanced_mode): """Turn on/off advanced mode.""" - from plinth import kvstore + from freedombox import kvstore kvstore.set(ADVANCED_MODE_KEY, advanced_mode) diff --git a/freedombox/modules/config/forms.py b/freedombox/modules/config/forms.py index 107905652..d4a903b8c 100644 --- a/freedombox/modules/config/forms.py +++ b/freedombox/modules/config/forms.py @@ -7,9 +7,9 @@ from django import forms from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy -from plinth import cfg, frontpage -from plinth.modules.apache import get_users_with_website -from plinth.utils import format_lazy +from freedombox import cfg, frontpage +from freedombox.modules.apache import get_users_with_website +from freedombox.utils import format_lazy from . import home_page_url2scid diff --git a/freedombox/modules/config/privileged.py b/freedombox/modules/config/privileged.py index 521e3de9d..9f14cabbe 100644 --- a/freedombox/modules/config/privileged.py +++ b/freedombox/modules/config/privileged.py @@ -6,8 +6,8 @@ import pathlib import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged APACHE_CONF_ENABLED_DIR = '/etc/apache2/conf-enabled' APACHE_HOMEPAGE_CONF_FILE_NAME = 'freedombox-apache-homepage.conf' diff --git a/freedombox/modules/config/tests/test_config.py b/freedombox/modules/config/tests/test_config.py index 0d576e3f3..9037d8396 100644 --- a/freedombox/modules/config/tests/test_config.py +++ b/freedombox/modules/config/tests/test_config.py @@ -9,10 +9,10 @@ from unittest.mock import Mock, patch import pytest -from plinth import __main__ as plinth_main -from plinth import utils -from plinth.modules.apache import uws_directory_of_user, uws_url_of_user -from plinth.modules.config import (_home_page_scid2url, change_home_page, +from freedombox import __main__ as plinth_main +from freedombox import utils +from freedombox.modules.apache import uws_directory_of_user, uws_url_of_user +from freedombox.modules.config import (_home_page_scid2url, change_home_page, get_home_page, home_page_url2scid) diff --git a/freedombox/modules/config/tests/test_functional.py b/freedombox/modules/config/tests/test_functional.py index 3296b4c87..886171cf6 100644 --- a/freedombox/modules/config/tests/test_functional.py +++ b/freedombox/modules/config/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for config app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.config] diff --git a/freedombox/modules/config/views.py b/freedombox/modules/config/views.py index 6c07c3008..22144f46f 100644 --- a/freedombox/modules/config/views.py +++ b/freedombox/modules/config/views.py @@ -4,8 +4,8 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import views -from plinth.modules import config +from freedombox import views +from freedombox.modules import config from . import privileged from .forms import ConfigurationForm diff --git a/freedombox/modules/coturn/__init__.py b/freedombox/modules/coturn/__init__.py index 190777058..2a69bd791 100644 --- a/freedombox/modules/coturn/__init__.py +++ b/freedombox/modules/coturn/__init__.py @@ -8,17 +8,18 @@ from typing import Iterator from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import menu -from plinth.daemon import Daemon -from plinth.modules import names -from plinth.modules.backups.components import BackupRestore -from plinth.modules.coturn.components import TurnConfiguration, TurnConsumer -from plinth.modules.firewall.components import Firewall -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import menu +from freedombox.daemon import Daemon +from freedombox.modules import names +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.coturn.components import (TurnConfiguration, + TurnConsumer) +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/coturn/components.py b/freedombox/modules/coturn/components.py index ae05267bf..1985c759e 100644 --- a/freedombox/modules/coturn/components.py +++ b/freedombox/modules/coturn/components.py @@ -11,7 +11,7 @@ from dataclasses import dataclass, field from time import time from typing import ClassVar, Iterable -from plinth import app +from freedombox import app TURN_REST_TTL = 24 * 3600 @@ -129,7 +129,7 @@ class TurnConsumer(app.FollowerComponent): def get_configuration(self) -> TurnConfiguration: """Return current coturn configuration.""" - from plinth.modules import coturn + from freedombox.modules import coturn return coturn.get_config() @@ -145,7 +145,7 @@ class TurnTimeLimitedConsumer(TurnConsumer): def get_configuration(self) -> UserTurnConfiguration: """Return user coturn configuration.""" - from plinth.modules import coturn + from freedombox.modules import coturn static_config = coturn.get_config() timestamp = int(time()) + TURN_REST_TTL username = str(timestamp) + ':' + TURN_REST_USER diff --git a/freedombox/modules/coturn/forms.py b/freedombox/modules/coturn/forms.py index 0f6f93608..2e085630c 100644 --- a/freedombox/modules/coturn/forms.py +++ b/freedombox/modules/coturn/forms.py @@ -7,8 +7,8 @@ from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ -from plinth.modules import coturn -from plinth.modules.coturn.components import TurnConfiguration +from freedombox.modules import coturn +from freedombox.modules.coturn.components import TurnConfiguration def get_domain_choices(): diff --git a/freedombox/modules/coturn/privileged.py b/freedombox/modules/coturn/privileged.py index fdf8fbfd9..f575467f7 100644 --- a/freedombox/modules/coturn/privileged.py +++ b/freedombox/modules/coturn/privileged.py @@ -8,8 +8,8 @@ import string import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged CONFIG_FILE = pathlib.Path('/etc/coturn/freedombox.conf') diff --git a/freedombox/modules/coturn/tests/test_components.py b/freedombox/modules/coturn/tests/test_components.py index 524cad258..b12ef53db 100644 --- a/freedombox/modules/coturn/tests/test_components.py +++ b/freedombox/modules/coturn/tests/test_components.py @@ -8,7 +8,7 @@ from unittest.mock import call, patch import pytest -from plinth.utils import random_string +from freedombox.utils import random_string from .. import notify_configuration_change from ..components import (TurnConfiguration, TurnConsumer, diff --git a/freedombox/modules/coturn/tests/test_functional.py b/freedombox/modules/coturn/tests/test_functional.py index 7228ba589..3024b1320 100644 --- a/freedombox/modules/coturn/tests/test_functional.py +++ b/freedombox/modules/coturn/tests/test_functional.py @@ -4,7 +4,7 @@ Functional, browser based tests for coturn app. """ import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.coturn] diff --git a/freedombox/modules/coturn/views.py b/freedombox/modules/coturn/views.py index 383e7f150..4c44230c5 100644 --- a/freedombox/modules/coturn/views.py +++ b/freedombox/modules/coturn/views.py @@ -5,8 +5,8 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ import plinth.modules.coturn as coturn -from plinth import app as app_module -from plinth import views +from freedombox import app as app_module +from freedombox import views from . import forms diff --git a/freedombox/modules/datetime/__init__.py b/freedombox/modules/datetime/__init__.py index fde7a2d39..5d7840be2 100644 --- a/freedombox/modules/datetime/__init__.py +++ b/freedombox/modules/datetime/__init__.py @@ -8,12 +8,12 @@ import subprocess from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import menu -from plinth.daemon import Daemon, RelatedDaemon -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import menu +from freedombox.daemon import Daemon, RelatedDaemon +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages from . import manifest diff --git a/freedombox/modules/datetime/privileged.py b/freedombox/modules/datetime/privileged.py index 666f79245..d5548fafa 100644 --- a/freedombox/modules/datetime/privileged.py +++ b/freedombox/modules/datetime/privileged.py @@ -1,8 +1,8 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """Set time zone with timedatectl.""" -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged @privileged diff --git a/freedombox/modules/datetime/tests/test_functional.py b/freedombox/modules/datetime/tests/test_functional.py index 9aefa784a..adab04716 100644 --- a/freedombox/modules/datetime/tests/test_functional.py +++ b/freedombox/modules/datetime/tests/test_functional.py @@ -4,7 +4,7 @@ Functional, browser based tests for datetime app. """ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.datetime] diff --git a/freedombox/modules/datetime/views.py b/freedombox/modules/datetime/views.py index c10f3b284..276d5570d 100644 --- a/freedombox/modules/datetime/views.py +++ b/freedombox/modules/datetime/views.py @@ -7,7 +7,7 @@ import subprocess from django.contrib import messages from django.utils.translation import gettext as _ -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import DateTimeForm diff --git a/freedombox/modules/deluge/__init__.py b/freedombox/modules/deluge/__init__.py index ff30b39bd..db35c92a4 100644 --- a/freedombox/modules/deluge/__init__.py +++ b/freedombox/modules/deluge/__init__.py @@ -3,18 +3,18 @@ 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.modules.upgrades.utils import get_current_release -from plinth.modules.users import add_user_to_share_group -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.modules.upgrades.utils import get_current_release +from freedombox.modules.users import add_user_to_share_group +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages from . import manifest, privileged diff --git a/freedombox/modules/deluge/forms.py b/freedombox/modules/deluge/forms.py index 195cfb158..b13414b8a 100644 --- a/freedombox/modules/deluge/forms.py +++ b/freedombox/modules/deluge/forms.py @@ -5,8 +5,8 @@ Forms for Deluge app. from django.utils.translation import gettext_lazy as _ -from plinth.modules.storage.forms import (DirectorySelectForm, - DirectoryValidator) +from freedombox.modules.storage.forms import (DirectorySelectForm, + DirectoryValidator) from . import SYSTEM_USER diff --git a/freedombox/modules/deluge/privileged.py b/freedombox/modules/deluge/privileged.py index dfdaed84f..e686b47f9 100644 --- a/freedombox/modules/deluge/privileged.py +++ b/freedombox/modules/deluge/privileged.py @@ -5,9 +5,9 @@ import pathlib import shutil import time -from plinth import action_utils -from plinth.actions import privileged -from plinth.modules.deluge.utils import Config +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.modules.deluge.utils import Config DELUGE_CONF_DIR = pathlib.Path('/var/lib/deluged/config/') diff --git a/freedombox/modules/deluge/tests/test_functional.py b/freedombox/modules/deluge/tests/test_functional.py index 56ce7d5ac..58a5e82f5 100644 --- a/freedombox/modules/deluge/tests/test_functional.py +++ b/freedombox/modules/deluge/tests/test_functional.py @@ -7,7 +7,7 @@ import os import time import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.deluge] diff --git a/freedombox/modules/deluge/tests/test_utils.py b/freedombox/modules/deluge/tests/test_utils.py index 7d159eab8..4dcf06956 100644 --- a/freedombox/modules/deluge/tests/test_utils.py +++ b/freedombox/modules/deluge/tests/test_utils.py @@ -5,7 +5,7 @@ Tests for utilities that edit Deluge configuration files. import pytest -from plinth.modules.deluge.utils import Config +from freedombox.modules.deluge.utils import Config test_content = '''{ "file": 3, diff --git a/freedombox/modules/deluge/views.py b/freedombox/modules/deluge/views.py index d8f6edc8b..554812674 100644 --- a/freedombox/modules/deluge/views.py +++ b/freedombox/modules/deluge/views.py @@ -4,7 +4,7 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import views +from freedombox import views from . import privileged from .forms import DelugeForm diff --git a/freedombox/modules/diagnostics/__init__.py b/freedombox/modules/diagnostics/__init__.py index 5163c7940..3006762ec 100644 --- a/freedombox/modules/diagnostics/__init__.py +++ b/freedombox/modules/diagnostics/__init__.py @@ -16,16 +16,16 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import cfg, glib, kvstore, menu -from plinth import operation as operation_module -from plinth.daemon import RelatedDaemon, diagnose_port_listening -from plinth.diagnostic_check import (CheckJSONDecoder, CheckJSONEncoder, - DiagnosticCheck, Result) -from plinth.modules.apache.components import diagnose_url_on_all -from plinth.modules.backups.components import BackupRestore -from plinth.setup import run_repair_on_app -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, glib, kvstore, menu +from freedombox import operation as operation_module +from freedombox.daemon import RelatedDaemon, diagnose_port_listening +from freedombox.diagnostic_check import (CheckJSONDecoder, CheckJSONEncoder, + DiagnosticCheck, Result) +from freedombox.modules.apache.components import diagnose_url_on_all +from freedombox.modules.backups.components import BackupRestore +from freedombox.setup import run_repair_on_app +from freedombox.utils import format_lazy from . import manifest @@ -213,7 +213,7 @@ def _get_memory_info(): def _warn_about_low_ram_space(request): """Warn about insufficient RAM space.""" - from plinth.notification import Notification + from freedombox.notification import Notification memory_info = _get_memory_info() if memory_info['free_bytes'] < 1024**3: @@ -291,7 +291,7 @@ def start_diagnostics(): def _run_diagnostics(): """Run diagnostics and notify for failures.""" - from plinth.notification import Notification + from freedombox.notification import Notification _run_on_all_enabled_modules() apps_with_issues = set() diff --git a/freedombox/modules/diagnostics/tests/test_diagnostics.py b/freedombox/modules/diagnostics/tests/test_diagnostics.py index f056167aa..51107c782 100644 --- a/freedombox/modules/diagnostics/tests/test_diagnostics.py +++ b/freedombox/modules/diagnostics/tests/test_diagnostics.py @@ -4,8 +4,8 @@ from collections import OrderedDict from unittest.mock import patch -from plinth.app import App, Info -from plinth.modules.diagnostics import get_results +from freedombox.app import App, Info +from freedombox.modules.diagnostics import get_results class AppTest(App): diff --git a/freedombox/modules/diagnostics/views.py b/freedombox/modules/diagnostics/views.py index bac8c0b2d..43435e6fe 100644 --- a/freedombox/modules/diagnostics/views.py +++ b/freedombox/modules/diagnostics/views.py @@ -14,12 +14,12 @@ from django.utils.translation import gettext_lazy as _ from django.views.decorators.http import require_POST from django.views.generic import TemplateView -from plinth import operation -from plinth.app import App -from plinth.diagnostic_check import Result -from plinth.modules import diagnostics -from plinth.setup import run_repair_on_app -from plinth.views import AppView +from freedombox import operation +from freedombox.app import App +from freedombox.diagnostic_check import Result +from freedombox.modules import diagnostics +from freedombox.setup import run_repair_on_app +from freedombox.views import AppView from .forms import ConfigureForm diff --git a/freedombox/modules/dynamicdns/__init__.py b/freedombox/modules/dynamicdns/__init__.py index a99a67665..d22ca508a 100644 --- a/freedombox/modules/dynamicdns/__init__.py +++ b/freedombox/modules/dynamicdns/__init__.py @@ -11,14 +11,14 @@ from typing import Any, Literal, Tuple from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, glib, kvstore, menu -from plinth.modules.backups.components import BackupRestore -from plinth.modules.names.components import DomainType -from plinth.modules.privacy import lookup_public_address -from plinth.modules.users.components import UsersAndGroups -from plinth.signals import domain_added, domain_removed -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, glib, kvstore, menu +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.names.components import DomainType +from freedombox.modules.privacy import lookup_public_address +from freedombox.modules.users.components import UsersAndGroups +from freedombox.signals import domain_added, domain_removed +from freedombox.utils import format_lazy from . import generic, gnudip, manifest diff --git a/freedombox/modules/dynamicdns/forms.py b/freedombox/modules/dynamicdns/forms.py index 0d9f7a7a5..46ec5402a 100644 --- a/freedombox/modules/dynamicdns/forms.py +++ b/freedombox/modules/dynamicdns/forms.py @@ -9,9 +9,9 @@ from django.core.exceptions import ValidationError from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy -from plinth import cfg -from plinth.modules.dynamicdns import get_config -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.modules.dynamicdns import get_config +from freedombox.utils import format_lazy class DomainForm(forms.Form): diff --git a/freedombox/modules/dynamicdns/tests/test_functional.py b/freedombox/modules/dynamicdns/tests/test_functional.py index 743a4ca04..8fdcbf90f 100644 --- a/freedombox/modules/dynamicdns/tests/test_functional.py +++ b/freedombox/modules/dynamicdns/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for dynamicdns app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [ pytest.mark.system, pytest.mark.essential, pytest.mark.domain, diff --git a/freedombox/modules/dynamicdns/tests/test_gnudip.py b/freedombox/modules/dynamicdns/tests/test_gnudip.py index 1546096e1..6cc2bbe09 100644 --- a/freedombox/modules/dynamicdns/tests/test_gnudip.py +++ b/freedombox/modules/dynamicdns/tests/test_gnudip.py @@ -7,7 +7,7 @@ from unittest.mock import Mock, patch import pytest -from plinth.modules.dynamicdns import gnudip +from freedombox.modules.dynamicdns import gnudip response_to_salt_request = """ diff --git a/freedombox/modules/dynamicdns/views.py b/freedombox/modules/dynamicdns/views.py index 5d688a333..f0a4bb32f 100644 --- a/freedombox/modules/dynamicdns/views.py +++ b/freedombox/modules/dynamicdns/views.py @@ -10,8 +10,8 @@ from django.utils.translation import gettext_lazy as _ from django.views.generic import TemplateView from django.views.generic.edit import FormView -from plinth import views -from plinth.modules import dynamicdns +from freedombox import views +from freedombox.modules import dynamicdns from .forms import DomainForm diff --git a/freedombox/modules/ejabberd/__init__.py b/freedombox/modules/ejabberd/__init__.py index 9e846ab06..92e9e36e7 100644 --- a/freedombox/modules/ejabberd/__init__.py +++ b/freedombox/modules/ejabberd/__init__.py @@ -7,21 +7,22 @@ import logging from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.coturn.components import TurnConfiguration, TurnConsumer -from plinth.modules.firewall.components import Firewall -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.modules.names.components import DomainName -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.signals import (domain_added, post_hostname_change, - pre_hostname_change) -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.coturn.components import (TurnConfiguration, + TurnConsumer) +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.modules.names.components import DomainName +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.signals import (domain_added, post_hostname_change, + pre_hostname_change) +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/ejabberd/forms.py b/freedombox/modules/ejabberd/forms.py index afa76cfd7..2658cab9e 100644 --- a/freedombox/modules/ejabberd/forms.py +++ b/freedombox/modules/ejabberd/forms.py @@ -7,11 +7,11 @@ from django import forms from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.modules import ejabberd -from plinth.modules.coturn.forms import turn_uris_validator -from plinth.modules.names.components import DomainName -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.modules import ejabberd +from freedombox.modules.coturn.forms import turn_uris_validator +from freedombox.modules.names.components import DomainName +from freedombox.utils import format_lazy class EjabberdForm(forms.Form): diff --git a/freedombox/modules/ejabberd/manifest.py b/freedombox/modules/ejabberd/manifest.py index 825ac2e6c..0ad2f907a 100644 --- a/freedombox/modules/ejabberd/manifest.py +++ b/freedombox/modules/ejabberd/manifest.py @@ -2,8 +2,8 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url -from plinth.modules.jsxc import manifest as jsxc_manifest +from freedombox.clients import store_url +from freedombox.modules.jsxc import manifest as jsxc_manifest _clients = [{ 'name': diff --git a/freedombox/modules/ejabberd/privileged.py b/freedombox/modules/ejabberd/privileged.py index 24b6321bf..974b40948 100644 --- a/freedombox/modules/ejabberd/privileged.py +++ b/freedombox/modules/ejabberd/privileged.py @@ -12,9 +12,9 @@ from typing import Any from ruamel.yaml import YAML, scalarstring -from plinth import action_utils -from plinth.actions import privileged -from plinth.version import Version +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.version import Version logger = logging.getLogger(__name__) diff --git a/freedombox/modules/ejabberd/tests/test_functional.py b/freedombox/modules/ejabberd/tests/test_functional.py index edd0e387b..9842cc718 100644 --- a/freedombox/modules/ejabberd/tests/test_functional.py +++ b/freedombox/modules/ejabberd/tests/test_functional.py @@ -3,7 +3,7 @@ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.ejabberd] diff --git a/freedombox/modules/ejabberd/tests/test_turn_config.py b/freedombox/modules/ejabberd/tests/test_turn_config.py index f88618c47..5a709d355 100644 --- a/freedombox/modules/ejabberd/tests/test_turn_config.py +++ b/freedombox/modules/ejabberd/tests/test_turn_config.py @@ -9,9 +9,9 @@ from unittest.mock import Mock, patch import pytest -from plinth.modules import ejabberd -from plinth.modules.coturn.components import TurnConfiguration -from plinth.modules.ejabberd import privileged +from freedombox.modules import ejabberd +from freedombox.modules.coturn.components import TurnConfiguration +from freedombox.modules.ejabberd import privileged managed_configuration = TurnConfiguration( 'freedombox.local', [], diff --git a/freedombox/modules/ejabberd/views.py b/freedombox/modules/ejabberd/views.py index 56aae022e..cc5c0cc14 100644 --- a/freedombox/modules/ejabberd/views.py +++ b/freedombox/modules/ejabberd/views.py @@ -4,9 +4,9 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth.modules import coturn, ejabberd -from plinth.modules.coturn.components import TurnConfiguration -from plinth.views import AppView +from freedombox.modules import coturn, ejabberd +from freedombox.modules.coturn.components import TurnConfiguration +from freedombox.views import AppView from . import privileged from .forms import EjabberdForm diff --git a/freedombox/modules/email/__init__.py b/freedombox/modules/email/__init__.py index 0bc6763a1..95ea57d89 100644 --- a/freedombox/modules/email/__init__.py +++ b/freedombox/modules/email/__init__.py @@ -7,18 +7,18 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ import plinth.app -from plinth import cfg, frontpage, menu -from plinth.config import DropinConfigs -from plinth.daemon import Daemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, FirewallLocalProtection) -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.signals import domain_added, domain_removed -from plinth.utils import format_lazy, gettext_noop +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.signals import domain_added, domain_removed +from freedombox.utils import format_lazy, gettext_noop from . import aliases, dovecot, manifest, privileged diff --git a/freedombox/modules/email/dns.py b/freedombox/modules/email/dns.py index 095ea071d..c22f2fff4 100644 --- a/freedombox/modules/email/dns.py +++ b/freedombox/modules/email/dns.py @@ -14,7 +14,7 @@ import ipaddress import typing from dataclasses import dataclass -from plinth.modules.privacy import lookup_public_address +from freedombox.modules.privacy import lookup_public_address from . import privileged diff --git a/freedombox/modules/email/dovecot.py b/freedombox/modules/email/dovecot.py index 6aa462830..458174906 100644 --- a/freedombox/modules/email/dovecot.py +++ b/freedombox/modules/email/dovecot.py @@ -3,7 +3,7 @@ import apt -from plinth.utils import Version +from freedombox.utils import Version def is_version_24(): diff --git a/freedombox/modules/email/forms.py b/freedombox/modules/email/forms.py index ff57caa86..d803e5d38 100644 --- a/freedombox/modules/email/forms.py +++ b/freedombox/modules/email/forms.py @@ -8,7 +8,7 @@ from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ -from plinth.modules.names.components import DomainName +from freedombox.modules.names.components import DomainName from . import aliases as aliases_module diff --git a/freedombox/modules/email/manifest.py b/freedombox/modules/email/manifest.py index 0a8ef49d4..aded15fa0 100644 --- a/freedombox/modules/email/manifest.py +++ b/freedombox/modules/email/manifest.py @@ -5,7 +5,7 @@ Application manifest for email. from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [ { diff --git a/freedombox/modules/email/postfix.py b/freedombox/modules/email/postfix.py index f0700546c..97f2b6731 100644 --- a/freedombox/modules/email/postfix.py +++ b/freedombox/modules/email/postfix.py @@ -11,7 +11,7 @@ import re import subprocess from dataclasses import dataclass -from plinth import action_utils +from freedombox import action_utils @dataclass diff --git a/freedombox/modules/email/privileged/aliases.py b/freedombox/modules/email/privileged/aliases.py index 208a622b9..c13194c34 100644 --- a/freedombox/modules/email/privileged/aliases.py +++ b/freedombox/modules/email/privileged/aliases.py @@ -4,7 +4,7 @@ import pathlib import shutil -from plinth.actions import privileged +from freedombox.actions import privileged @privileged diff --git a/freedombox/modules/email/privileged/dkim.py b/freedombox/modules/email/privileged/dkim.py index 3ffec7aba..0db4e0712 100644 --- a/freedombox/modules/email/privileged/dkim.py +++ b/freedombox/modules/email/privileged/dkim.py @@ -8,9 +8,9 @@ import pathlib import re import shutil -from plinth import action_utils -from plinth.actions import privileged -from plinth.privileged import service as service_privileged +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.privileged import service as service_privileged _keys_dir = pathlib.Path('/var/lib/rspamd/dkim/') diff --git a/freedombox/modules/email/privileged/domain.py b/freedombox/modules/email/privileged/domain.py index f5ac41b40..c2b370219 100644 --- a/freedombox/modules/email/privileged/domain.py +++ b/freedombox/modules/email/privileged/domain.py @@ -10,10 +10,10 @@ See: http://www.postfix.org/postconf.5.html#myhostname import pathlib import re -from plinth.actions import privileged -from plinth.app import App -from plinth.modules.email import postfix -from plinth.modules.names.components import DomainName +from freedombox.actions import privileged +from freedombox.app import App +from freedombox.modules.email import postfix +from freedombox.modules.names.components import DomainName from . import dkim, tls diff --git a/freedombox/modules/email/privileged/home.py b/freedombox/modules/email/privileged/home.py index 05a9f974e..bbeff6215 100644 --- a/freedombox/modules/email/privileged/home.py +++ b/freedombox/modules/email/privileged/home.py @@ -6,8 +6,8 @@ See: https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/ """ -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged @privileged diff --git a/freedombox/modules/email/privileged/postfix.py b/freedombox/modules/email/privileged/postfix.py index fe8aab279..505bc6817 100644 --- a/freedombox/modules/email/privileged/postfix.py +++ b/freedombox/modules/email/privileged/postfix.py @@ -10,7 +10,7 @@ See: https://doc.dovecot.org/configuration_manual/howto/postfix_dovecot_lmtp/ See: http://www.postfix.org/TLS_README.html """ -from plinth.actions import privileged +from freedombox.actions import privileged from .. import postfix as postconf diff --git a/freedombox/modules/email/privileged/spam.py b/freedombox/modules/email/privileged/spam.py index 6205f2d7f..34cffe316 100644 --- a/freedombox/modules/email/privileged/spam.py +++ b/freedombox/modules/email/privileged/spam.py @@ -11,9 +11,9 @@ For testing DKIM signatures: https://www.mail-tester.com/ import pathlib import re -from plinth import action_utils -from plinth.actions import privileged -from plinth.modules.email import postfix +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.modules.email import postfix _milter_config = { 'smtpd_milters': 'inet:127.0.0.1:11332', diff --git a/freedombox/modules/email/tests/test_functional.py b/freedombox/modules/email/tests/test_functional.py index 9d654b1c5..d9b0d6b99 100644 --- a/freedombox/modules/email/tests/test_functional.py +++ b/freedombox/modules/email/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for email app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.email] diff --git a/freedombox/modules/email/urls.py b/freedombox/modules/email/urls.py index 8607f7d61..0dce84071 100644 --- a/freedombox/modules/email/urls.py +++ b/freedombox/modules/email/urls.py @@ -6,7 +6,7 @@ URLs for the email module. from django.urls import path, re_path from stronghold.decorators import public -from plinth.utils import non_admin_view +from freedombox.utils import non_admin_view from . import views diff --git a/freedombox/modules/email/views.py b/freedombox/modules/email/views.py index 29e7fb46a..236816736 100644 --- a/freedombox/modules/email/views.py +++ b/freedombox/modules/email/views.py @@ -9,8 +9,8 @@ from django.utils.translation import gettext_lazy as _ from django.views.generic.base import TemplateView from django.views.generic.edit import FormView -from plinth.modules.email import dns -from plinth.views import AppView +from freedombox.modules.email import dns +from freedombox.views import AppView from . import aliases as aliases_module from . import forms, privileged diff --git a/freedombox/modules/featherwiki/__init__.py b/freedombox/modules/featherwiki/__init__.py index 30fd0de1a..fbd2adc95 100644 --- a/freedombox/modules/featherwiki/__init__.py +++ b/freedombox/modules/featherwiki/__init__.py @@ -9,14 +9,14 @@ This app doesn't install any Debian packages. from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/featherwiki/privileged.py b/freedombox/modules/featherwiki/privileged.py index 33e27b615..2a529a138 100644 --- a/freedombox/modules/featherwiki/privileged.py +++ b/freedombox/modules/featherwiki/privileged.py @@ -6,8 +6,8 @@ import re import shutil import urllib.request -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged EMPTY_WIKI_FILE = 'https://ftp.freedombox.org/pub/featherwiki/empty.html' diff --git a/freedombox/modules/featherwiki/tests/test_functional.py b/freedombox/modules/featherwiki/tests/test_functional.py index 4bc7dfb9a..24cd378ac 100644 --- a/freedombox/modules/featherwiki/tests/test_functional.py +++ b/freedombox/modules/featherwiki/tests/test_functional.py @@ -5,7 +5,7 @@ import pathlib import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.featherwiki] diff --git a/freedombox/modules/featherwiki/views.py b/freedombox/modules/featherwiki/views.py index 27006d779..bb1d66e9a 100644 --- a/freedombox/modules/featherwiki/views.py +++ b/freedombox/modules/featherwiki/views.py @@ -9,10 +9,10 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView -from plinth import app as app_module -from plinth import views -from plinth.modules import featherwiki -from plinth.views import messages_error +from freedombox import app as app_module +from freedombox import views +from freedombox.modules import featherwiki +from freedombox.views import messages_error from . import privileged from .forms import CreateWikiForm, RenameWikiForm, UploadWikiForm diff --git a/freedombox/modules/firewall/__init__.py b/freedombox/modules/firewall/__init__.py index 038091eb4..bb1def10b 100644 --- a/freedombox/modules/firewall/__init__.py +++ b/freedombox/modules/firewall/__init__.py @@ -7,13 +7,13 @@ import logging from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import cfg, menu -from plinth.daemon import Daemon -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages, install -from plinth.utils import Version, format_lazy, import_from_gi +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.daemon import Daemon +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages, install +from freedombox.utils import Version, format_lazy, import_from_gi from . import manifest, privileged diff --git a/freedombox/modules/firewall/components.py b/freedombox/modules/firewall/components.py index b0f7239b7..349c309af 100644 --- a/freedombox/modules/firewall/components.py +++ b/freedombox/modules/firewall/components.py @@ -9,10 +9,10 @@ from typing import ClassVar, TypeAlias from django.utils.translation import gettext_noop -from plinth import app -from plinth.diagnostic_check import (DiagnosticCheck, +from freedombox import app +from freedombox.diagnostic_check import (DiagnosticCheck, DiagnosticCheckParameters, Result) -from plinth.modules import firewall +from freedombox.modules import firewall logger = logging.getLogger(__name__) @@ -223,7 +223,7 @@ class FirewallLocalProtection(app.FollowerComponent): def get_port_forwarding_info(app_): """Return a list of ports to be forwarded for this app to work.""" - from plinth.modules import networks + from freedombox.modules import networks info = { 'network_topology_type': networks.get_network_topology_type(), 'router_configuration_type': networks.get_router_configuration_type(), diff --git a/freedombox/modules/firewall/privileged.py b/freedombox/modules/firewall/privileged.py index 54ccb5e93..202fd3982 100644 --- a/freedombox/modules/firewall/privileged.py +++ b/freedombox/modules/firewall/privileged.py @@ -6,8 +6,8 @@ from typing import TypeAlias import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged FirewallConfig: TypeAlias = dict[str, str | list[str]] diff --git a/freedombox/modules/firewall/tests/test_components.py b/freedombox/modules/firewall/tests/test_components.py index 4d0668f21..2ab218016 100644 --- a/freedombox/modules/firewall/tests/test_components.py +++ b/freedombox/modules/firewall/tests/test_components.py @@ -7,9 +7,9 @@ from unittest.mock import call, patch import pytest -from plinth.app import App -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules.firewall.components import (Firewall, +from freedombox.app import App +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules.firewall.components import (Firewall, FirewallLocalProtection) diff --git a/freedombox/modules/firewall/views.py b/freedombox/modules/firewall/views.py index 69fc1d366..5513ed277 100644 --- a/freedombox/modules/firewall/views.py +++ b/freedombox/modules/firewall/views.py @@ -1,8 +1,8 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """FreedomBox app to configure a firewall.""" -from plinth import views -from plinth.modules import firewall +from freedombox import views +from freedombox.modules import firewall from . import components diff --git a/freedombox/modules/first_boot/__init__.py b/freedombox/modules/first_boot/__init__.py index 146b9ff8e..ab072447a 100644 --- a/freedombox/modules/first_boot/__init__.py +++ b/freedombox/modules/first_boot/__init__.py @@ -14,10 +14,10 @@ from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import action_utils -from plinth import app as app_module -from plinth import cfg -from plinth.signals import post_setup +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg +from freedombox.signals import post_setup first_boot_steps = [ { @@ -64,7 +64,7 @@ class FirstBootApp(app_module.App): def _show_next_steps_notification(self): """After first setup, show notification for next steps.""" - from plinth.notification import Notification + from freedombox.notification import Notification title = gettext_noop('Setup complete! Next steps:') message = gettext_noop( 'Initial setup has been completed. Perform the next steps to make ' @@ -138,7 +138,7 @@ def next_step_or_none(): If there are no more step remaining, return None. """ - from plinth import kvstore + from freedombox import kvstore for step in _get_steps(): done = kvstore.get_default(step['id'], 0) @@ -151,7 +151,7 @@ def mark_step_done(id): :param id: id of the firstboot step """ - from plinth import kvstore + from freedombox import kvstore kvstore.set(id, 1) if not next_step_or_none(): @@ -160,7 +160,7 @@ def mark_step_done(id): def is_completed(): """Return whether first boot process is completed.""" - from plinth import kvstore + from freedombox import kvstore global _is_completed if _is_completed is None: @@ -171,7 +171,7 @@ def is_completed(): def set_completed(): """Set the first boot process as completed.""" - from plinth import kvstore + from freedombox import kvstore global _is_completed _is_completed = True diff --git a/freedombox/modules/first_boot/forms.py b/freedombox/modules/first_boot/forms.py index a2d9e557d..b86c0e87a 100644 --- a/freedombox/modules/first_boot/forms.py +++ b/freedombox/modules/first_boot/forms.py @@ -3,8 +3,8 @@ from django import forms from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.modules import first_boot +from freedombox import cfg +from freedombox.modules import first_boot class FirstbootWizardSecretForm(forms.Form): diff --git a/freedombox/modules/first_boot/middleware.py b/freedombox/modules/first_boot/middleware.py index bec324f7c..db73e8fa0 100644 --- a/freedombox/modules/first_boot/middleware.py +++ b/freedombox/modules/first_boot/middleware.py @@ -11,9 +11,9 @@ from django.http.response import HttpResponseRedirect from django.urls import reverse from django.utils.deprecation import MiddlewareMixin -from plinth import setup -from plinth.modules import first_boot -from plinth.utils import is_user_admin +from freedombox import setup +from freedombox.modules import first_boot +from freedombox.utils import is_user_admin LOGGER = logging.getLogger(__name__) diff --git a/freedombox/modules/first_boot/templatetags/firstboot_extras.py b/freedombox/modules/first_boot/templatetags/firstboot_extras.py index eedb2d4bd..8ae5a0af0 100644 --- a/freedombox/modules/first_boot/templatetags/firstboot_extras.py +++ b/freedombox/modules/first_boot/templatetags/firstboot_extras.py @@ -5,7 +5,7 @@ Template tags for first boot module. from django import template -from plinth.modules import first_boot +from freedombox.modules import first_boot register = template.Library() diff --git a/freedombox/modules/first_boot/views.py b/freedombox/modules/first_boot/views.py index b66c0adac..f88c206a3 100644 --- a/freedombox/modules/first_boot/views.py +++ b/freedombox/modules/first_boot/views.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext as _ from django.views.generic import TemplateView from django.views.generic.edit import FormView -from plinth.modules import first_boot +from freedombox.modules import first_boot from .forms import FirstbootWizardSecretForm diff --git a/freedombox/modules/gitweb/__init__.py b/freedombox/modules/gitweb/__init__.py index 2ebd419d8..8000422bb 100644 --- a/freedombox/modules/gitweb/__init__.py +++ b/freedombox/modules/gitweb/__init__.py @@ -3,14 +3,14 @@ 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages from . import manifest, privileged from .forms import is_repo_url diff --git a/freedombox/modules/gitweb/forms.py b/freedombox/modules/gitweb/forms.py index 76ba8a314..43a37f2c4 100644 --- a/freedombox/modules/gitweb/forms.py +++ b/freedombox/modules/gitweb/forms.py @@ -11,7 +11,7 @@ from django.core.exceptions import ValidationError from django.core.validators import URLValidator from django.utils.translation import gettext_lazy as _ -from plinth.modules import gitweb +from freedombox.modules import gitweb from . import privileged diff --git a/freedombox/modules/gitweb/privileged.py b/freedombox/modules/gitweb/privileged.py index 332d42af5..843695f67 100644 --- a/freedombox/modules/gitweb/privileged.py +++ b/freedombox/modules/gitweb/privileged.py @@ -12,10 +12,11 @@ import time from typing import Any from urllib import parse -from plinth import action_utils -from plinth.actions import privileged, secret_str -from plinth.modules.gitweb.forms import RepositoryValidator, get_name_from_url -from plinth.modules.gitweb.manifest import GIT_REPO_PATH, REPO_DIR_OWNER +from freedombox import action_utils +from freedombox.actions import privileged, secret_str +from freedombox.modules.gitweb.forms import (RepositoryValidator, + get_name_from_url) +from freedombox.modules.gitweb.manifest import GIT_REPO_PATH, REPO_DIR_OWNER logger = logging.getLogger(__name__) diff --git a/freedombox/modules/gitweb/tests/test_functional.py b/freedombox/modules/gitweb/tests/test_functional.py index 96147cc6f..510451569 100644 --- a/freedombox/modules/gitweb/tests/test_functional.py +++ b/freedombox/modules/gitweb/tests/test_functional.py @@ -10,7 +10,7 @@ import tempfile import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.gitweb] diff --git a/freedombox/modules/gitweb/tests/test_privileged.py b/freedombox/modules/gitweb/tests/test_privileged.py index cc884c501..95ca93dd4 100644 --- a/freedombox/modules/gitweb/tests/test_privileged.py +++ b/freedombox/modules/gitweb/tests/test_privileged.py @@ -8,7 +8,7 @@ from unittest.mock import call, patch import pytest from django.forms import ValidationError -from plinth.modules.gitweb import privileged +from freedombox.modules.gitweb import privileged REPO_NAME = 'Test-repo' REPO_DATA = { diff --git a/freedombox/modules/gitweb/tests/test_views.py b/freedombox/modules/gitweb/tests/test_views.py index eae5da05f..80cc3f8f2 100644 --- a/freedombox/modules/gitweb/tests/test_views.py +++ b/freedombox/modules/gitweb/tests/test_views.py @@ -10,8 +10,8 @@ from django import urls from django.contrib.messages.storage.fallback import FallbackStorage from django.http.response import Http404 -from plinth import module_loader -from plinth.modules.gitweb import views +from freedombox import module_loader +from freedombox.modules.gitweb import views # For all tests, use plinth.urls instead of urls configured for testing pytestmark = pytest.mark.urls('plinth.urls') diff --git a/freedombox/modules/gitweb/views.py b/freedombox/modules/gitweb/views.py index 01f13f74f..15c1bdb48 100644 --- a/freedombox/modules/gitweb/views.py +++ b/freedombox/modules/gitweb/views.py @@ -10,9 +10,9 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import FormView -from plinth import app as app_module -from plinth import views -from plinth.modules import gitweb +from freedombox import app as app_module +from freedombox import views +from freedombox.modules import gitweb from . import privileged from .forms import CreateRepoForm, EditRepoForm diff --git a/freedombox/modules/gnome/__init__.py b/freedombox/modules/gnome/__init__.py index b26a39948..e75a9cad3 100644 --- a/freedombox/modules/gnome/__init__.py +++ b/freedombox/modules/gnome/__init__.py @@ -4,13 +4,13 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import action_utils -from plinth import app as app_module -from plinth import cfg, menu -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.utils import format_lazy +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.utils import format_lazy from . import manifest diff --git a/freedombox/modules/gnome/urls.py b/freedombox/modules/gnome/urls.py index a4a4fa0f4..f3af6d660 100644 --- a/freedombox/modules/gnome/urls.py +++ b/freedombox/modules/gnome/urls.py @@ -3,7 +3,7 @@ from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^apps/gnome/$', AppView.as_view(app_id='gnome'), name='index'), diff --git a/freedombox/modules/help/__init__.py b/freedombox/modules/help/__init__.py index 97ae90513..63297f3ce 100644 --- a/freedombox/modules/help/__init__.py +++ b/freedombox/modules/help/__init__.py @@ -9,8 +9,8 @@ import os from django.utils.translation import gettext_lazy as _ from django.utils.translation import pgettext_lazy -from plinth import app as app_module -from plinth import cfg, menu, web_server +from freedombox import app as app_module +from freedombox import cfg, menu, web_server logger = logging.getLogger(__name__) diff --git a/freedombox/modules/help/tests/test_views.py b/freedombox/modules/help/tests/test_views.py index 573415816..cf0457786 100644 --- a/freedombox/modules/help/tests/test_views.py +++ b/freedombox/modules/help/tests/test_views.py @@ -20,9 +20,9 @@ from django.conf import settings from django.http import Http404 from django.urls import re_path -from plinth import cfg, module_loader -from plinth.modules import help as help_module -from plinth.modules.help import views +from freedombox import cfg, module_loader +from freedombox.modules import help as help_module +from freedombox.modules.help import views # For all tests, use plinth.urls instead of urls configured for testing pytestmark = pytest.mark.urls('plinth.urls') diff --git a/freedombox/modules/help/urls.py b/freedombox/modules/help/urls.py index 001f1b953..679968f63 100644 --- a/freedombox/modules/help/urls.py +++ b/freedombox/modules/help/urls.py @@ -6,7 +6,7 @@ URLs for the Help module from django.urls import re_path from stronghold.decorators import public -from plinth.utils import non_admin_view +from freedombox.utils import non_admin_view from . import views diff --git a/freedombox/modules/help/views.py b/freedombox/modules/help/views.py index da13242cd..4403b8082 100644 --- a/freedombox/modules/help/views.py +++ b/freedombox/modules/help/views.py @@ -16,8 +16,8 @@ from django.urls import reverse from django.utils.translation import get_language_from_request from django.utils.translation import gettext as _ -from plinth import __version__, cfg, menu -from plinth.modules.upgrades import views as upgrades_views +from freedombox import __version__, cfg, menu +from freedombox.modules.upgrades import views as upgrades_views def index(request): diff --git a/freedombox/modules/homeassistant/__init__.py b/freedombox/modules/homeassistant/__init__.py index d8b2180d1..1ea2a1917 100644 --- a/freedombox/modules/homeassistant/__init__.py +++ b/freedombox/modules/homeassistant/__init__.py @@ -4,16 +4,16 @@ from django.utils.functional import lazy 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.container import Container -from plinth.modules.apache.components import WebserverRoot -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.container import Container +from freedombox.modules.apache.components import WebserverRoot +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/homeassistant/manifest.py b/freedombox/modules/homeassistant/manifest.py index 1588717dc..8fe8f0dfe 100644 --- a/freedombox/modules/homeassistant/manifest.py +++ b/freedombox/modules/homeassistant/manifest.py @@ -3,7 +3,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _android_package_id = 'io.homeassistant.companion.android' diff --git a/freedombox/modules/homeassistant/privileged.py b/freedombox/modules/homeassistant/privileged.py index f1abd0e8d..5295614a2 100644 --- a/freedombox/modules/homeassistant/privileged.py +++ b/freedombox/modules/homeassistant/privileged.py @@ -9,7 +9,7 @@ from dataclasses import dataclass import yaml -from plinth.actions import privileged +from freedombox.actions import privileged _settings_file = pathlib.Path( '/var/lib/home-assistant-freedombox/config/configuration.yaml') diff --git a/freedombox/modules/homeassistant/tests/test_functional.py b/freedombox/modules/homeassistant/tests/test_functional.py index 3555fe17c..b1fc5286a 100644 --- a/freedombox/modules/homeassistant/tests/test_functional.py +++ b/freedombox/modules/homeassistant/tests/test_functional.py @@ -3,7 +3,7 @@ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.homeassistant] diff --git a/freedombox/modules/homeassistant/views.py b/freedombox/modules/homeassistant/views.py index 32d875c7c..c5d984371 100644 --- a/freedombox/modules/homeassistant/views.py +++ b/freedombox/modules/homeassistant/views.py @@ -6,8 +6,8 @@ import logging from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.forms import DomainSelectionForm -from plinth.views import AppView +from freedombox.forms import DomainSelectionForm +from freedombox.views import AppView logger = logging.getLogger(__name__) diff --git a/freedombox/modules/ikiwiki/__init__.py b/freedombox/modules/ikiwiki/__init__.py index dac1d284d..130672a7f 100644 --- a/freedombox/modules/ikiwiki/__init__.py +++ b/freedombox/modules/ikiwiki/__init__.py @@ -4,15 +4,15 @@ from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/ikiwiki/privileged.py b/freedombox/modules/ikiwiki/privileged.py index 92b3bb086..66e51e2ea 100644 --- a/freedombox/modules/ikiwiki/privileged.py +++ b/freedombox/modules/ikiwiki/privileged.py @@ -6,8 +6,8 @@ import pathlib import re import shutil -from plinth import action_utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils +from freedombox.actions import privileged, secret_str SETUP_WIKI = '/etc/ikiwiki/plinth-wiki.setup' SETUP_BLOG = '/etc/ikiwiki/plinth-blog.setup' diff --git a/freedombox/modules/ikiwiki/tests/test_functional.py b/freedombox/modules/ikiwiki/tests/test_functional.py index dc5908fe1..c64748815 100644 --- a/freedombox/modules/ikiwiki/tests/test_functional.py +++ b/freedombox/modules/ikiwiki/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for ikiwiki app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.ikiwiki] diff --git a/freedombox/modules/ikiwiki/views.py b/freedombox/modules/ikiwiki/views.py index 4635cae8a..c83f83e2c 100644 --- a/freedombox/modules/ikiwiki/views.py +++ b/freedombox/modules/ikiwiki/views.py @@ -7,8 +7,8 @@ from django.template.response import TemplateResponse from django.urls import reverse_lazy from django.utils.translation import gettext as _ -from plinth import app as app_module -from plinth import views +from freedombox import app as app_module +from freedombox import views from . import privileged from .forms import IkiwikiCreateForm diff --git a/freedombox/modules/infinoted/__init__.py b/freedombox/modules/infinoted/__init__.py index 17fb6d430..8ba9a434a 100644 --- a/freedombox/modules/infinoted/__init__.py +++ b/freedombox/modules/infinoted/__init__.py @@ -6,13 +6,13 @@ FreedomBox app for infinoted. from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/infinoted/manifest.py b/freedombox/modules/infinoted/manifest.py index cc27ca983..ba3e3fdf2 100644 --- a/freedombox/modules/infinoted/manifest.py +++ b/freedombox/modules/infinoted/manifest.py @@ -2,8 +2,8 @@ from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.utils import format_lazy clients = [{ 'name': diff --git a/freedombox/modules/infinoted/privileged.py b/freedombox/modules/infinoted/privileged.py index e65d49c10..664d939ed 100644 --- a/freedombox/modules/infinoted/privileged.py +++ b/freedombox/modules/infinoted/privileged.py @@ -7,8 +7,8 @@ import shutil import subprocess import time -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged DATA_DIR = '/var/lib/infinoted' KEY_DIR = '/etc/infinoted' diff --git a/freedombox/modules/infinoted/tests/test_functional.py b/freedombox/modules/infinoted/tests/test_functional.py index 34bd578f8..856f00f5e 100644 --- a/freedombox/modules/infinoted/tests/test_functional.py +++ b/freedombox/modules/infinoted/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for infinoted app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.infinoted] diff --git a/freedombox/modules/infinoted/urls.py b/freedombox/modules/infinoted/urls.py index 117896f59..ec54f3e7c 100644 --- a/freedombox/modules/infinoted/urls.py +++ b/freedombox/modules/infinoted/urls.py @@ -5,7 +5,7 @@ URLs for the infinoted module. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^apps/infinoted/$', AppView.as_view(app_id='infinoted'), diff --git a/freedombox/modules/janus/__init__.py b/freedombox/modules/janus/__init__.py index 36faa6fc3..2a0bfe679 100644 --- a/freedombox/modules/janus/__init__.py +++ b/freedombox/modules/janus/__init__.py @@ -6,16 +6,16 @@ FreedomBox app for janus. from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.coturn.components import TurnTimeLimitedConsumer -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages, install -from plinth.utils import Version, format_lazy +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.coturn.components import TurnTimeLimitedConsumer +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages, install +from freedombox.utils import Version, format_lazy from . import manifest, privileged diff --git a/freedombox/modules/janus/privileged.py b/freedombox/modules/janus/privileged.py index 0ff50d556..619aaab4f 100644 --- a/freedombox/modules/janus/privileged.py +++ b/freedombox/modules/janus/privileged.py @@ -3,8 +3,8 @@ Configure Janus server. """ -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged JANUS_CONF_PATH = '/etc/janus/janus.jcfg' diff --git a/freedombox/modules/janus/tests/test_functional.py b/freedombox/modules/janus/tests/test_functional.py index 5f2e11ba4..19cc869f0 100644 --- a/freedombox/modules/janus/tests/test_functional.py +++ b/freedombox/modules/janus/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for Janus app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.janus] diff --git a/freedombox/modules/janus/urls.py b/freedombox/modules/janus/urls.py index 428ed66d5..c94120af7 100644 --- a/freedombox/modules/janus/urls.py +++ b/freedombox/modules/janus/urls.py @@ -6,7 +6,7 @@ URLs for the janus app. from django.urls import re_path from stronghold.decorators import public -from plinth.views import AppView +from freedombox.views import AppView from .views import JanusRoomView diff --git a/freedombox/modules/janus/views.py b/freedombox/modules/janus/views.py index b0b8e73dd..0102a4a5b 100644 --- a/freedombox/modules/janus/views.py +++ b/freedombox/modules/janus/views.py @@ -7,8 +7,8 @@ import copy from django.views.generic import TemplateView -from plinth import app as app_module -from plinth.middleware import CONTENT_SECURITY_POLICY +from freedombox import app as app_module +from freedombox.middleware import CONTENT_SECURITY_POLICY class JanusRoomView(TemplateView): diff --git a/freedombox/modules/jsxc/__init__.py b/freedombox/modules/jsxc/__init__.py index 74f7c03ff..c94539403 100644 --- a/freedombox/modules/jsxc/__init__.py +++ b/freedombox/modules/jsxc/__init__.py @@ -6,12 +6,12 @@ import logging from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.web_server import StaticFiles +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.web_server import StaticFiles from . import manifest diff --git a/freedombox/modules/jsxc/tests/test_functional.py b/freedombox/modules/jsxc/tests/test_functional.py index f6f9bda40..5f439e9c5 100644 --- a/freedombox/modules/jsxc/tests/test_functional.py +++ b/freedombox/modules/jsxc/tests/test_functional.py @@ -3,7 +3,7 @@ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.jsxc] diff --git a/freedombox/modules/jsxc/urls.py b/freedombox/modules/jsxc/urls.py index e9667d2aa..7d8b044c8 100644 --- a/freedombox/modules/jsxc/urls.py +++ b/freedombox/modules/jsxc/urls.py @@ -6,7 +6,7 @@ URLs for the JSXC module from django.urls import re_path from stronghold.decorators import public -from plinth.views import AppView +from freedombox.views import AppView from .views import JsxcView diff --git a/freedombox/modules/jsxc/views.py b/freedombox/modules/jsxc/views.py index 9cda09bec..cbf7161f7 100644 --- a/freedombox/modules/jsxc/views.py +++ b/freedombox/modules/jsxc/views.py @@ -7,8 +7,8 @@ from django.http import Http404 from django.views.generic import TemplateView import plinth.app as app_module -from plinth.middleware import CONTENT_SECURITY_POLICY -from plinth.modules.names.components import DomainName +from freedombox.middleware import CONTENT_SECURITY_POLICY +from freedombox.modules.names.components import DomainName class JsxcView(TemplateView): diff --git a/freedombox/modules/kiwix/__init__.py b/freedombox/modules/kiwix/__init__.py index 36b0a60ca..716b0c0b0 100644 --- a/freedombox/modules/kiwix/__init__.py +++ b/freedombox/modules/kiwix/__init__.py @@ -5,15 +5,15 @@ FreedomBox app for Kiwix content server. from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import frontpage, menu, package -from plinth.config import DropinConfigs -from plinth.daemon import Daemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.modules.users.components import UsersAndGroups +from freedombox import app as app_module +from freedombox import frontpage, menu, package +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.modules.users.components import UsersAndGroups from . import manifest, privileged diff --git a/freedombox/modules/kiwix/forms.py b/freedombox/modules/kiwix/forms.py index d41629d24..00d2c0abc 100644 --- a/freedombox/modules/kiwix/forms.py +++ b/freedombox/modules/kiwix/forms.py @@ -7,8 +7,8 @@ from django import forms from django.core import validators from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.utils import format_lazy from .privileged import KIWIX_HOME diff --git a/freedombox/modules/kiwix/manifest.py b/freedombox/modules/kiwix/manifest.py index cc0fcd7b1..227d898ce 100644 --- a/freedombox/modules/kiwix/manifest.py +++ b/freedombox/modules/kiwix/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import validate +from freedombox.clients import validate clients = validate([{ 'name': _('Kiwix'), diff --git a/freedombox/modules/kiwix/privileged.py b/freedombox/modules/kiwix/privileged.py index 8dd5ae750..d01c7c1e5 100644 --- a/freedombox/modules/kiwix/privileged.py +++ b/freedombox/modules/kiwix/privileged.py @@ -8,9 +8,9 @@ import shutil import subprocess from xml.etree import ElementTree -from plinth import action_utils -from plinth.actions import privileged -from plinth.modules import kiwix +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.modules import kiwix # Only one central library is supported. KIWIX_HOME = pathlib.Path('/var/lib/kiwix-server-freedombox') diff --git a/freedombox/modules/kiwix/tests/test_functional.py b/freedombox/modules/kiwix/tests/test_functional.py index 938887944..08d080db4 100644 --- a/freedombox/modules/kiwix/tests/test_functional.py +++ b/freedombox/modules/kiwix/tests/test_functional.py @@ -8,7 +8,7 @@ from time import sleep import pytest -from plinth.tests import functional +from freedombox.tests import functional from .test_privileged import ZIM_ID diff --git a/freedombox/modules/kiwix/tests/test_privileged.py b/freedombox/modules/kiwix/tests/test_privileged.py index 5342e5b31..5e2efc71b 100644 --- a/freedombox/modules/kiwix/tests/test_privileged.py +++ b/freedombox/modules/kiwix/tests/test_privileged.py @@ -10,7 +10,7 @@ from unittest.mock import patch import pytest import plinth.settings -from plinth.modules.kiwix import privileged +from freedombox.modules.kiwix import privileged pytestmark = pytest.mark.usefixtures('mock_privileged') privileged_modules_to_mock = ['plinth.modules.kiwix.privileged'] diff --git a/freedombox/modules/kiwix/tests/test_validations.py b/freedombox/modules/kiwix/tests/test_validations.py index 5be411a25..5ee9b7d68 100644 --- a/freedombox/modules/kiwix/tests/test_validations.py +++ b/freedombox/modules/kiwix/tests/test_validations.py @@ -5,7 +5,7 @@ Test module for Kiwix validations. import pytest -from plinth.modules import kiwix +from freedombox.modules import kiwix def test_add_file_with_invalid_extension(): diff --git a/freedombox/modules/kiwix/tests/test_views.py b/freedombox/modules/kiwix/tests/test_views.py index 4d58372a1..8e213817c 100644 --- a/freedombox/modules/kiwix/tests/test_views.py +++ b/freedombox/modules/kiwix/tests/test_views.py @@ -11,8 +11,8 @@ from django.contrib.messages.storage.fallback import FallbackStorage from django.core.files.uploadedfile import SimpleUploadedFile from django.http.response import Http404 -from plinth import module_loader -from plinth.modules.kiwix import views +from freedombox import module_loader +from freedombox.modules.kiwix import views # For all tests, use plinth.urls instead of urls configured for testing pytestmark = pytest.mark.urls('plinth.urls') diff --git a/freedombox/modules/kiwix/views.py b/freedombox/modules/kiwix/views.py index a5d6503e5..fbd56ca6d 100644 --- a/freedombox/modules/kiwix/views.py +++ b/freedombox/modules/kiwix/views.py @@ -14,12 +14,12 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic.edit import FormView -from plinth import app as app_module -from plinth import views -from plinth.errors import PlinthError -from plinth.modules import storage -from plinth.modules.kiwix import privileged -from plinth.views import messages_error +from freedombox import app as app_module +from freedombox import views +from freedombox.errors import PlinthError +from freedombox.modules import storage +from freedombox.modules.kiwix import privileged +from freedombox.views import messages_error from . import forms diff --git a/freedombox/modules/letsencrypt/__init__.py b/freedombox/modules/letsencrypt/__init__.py index 83c1a49cf..0d7eabc20 100644 --- a/freedombox/modules/letsencrypt/__init__.py +++ b/freedombox/modules/letsencrypt/__init__.py @@ -7,18 +7,18 @@ import pathlib from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, menu -from plinth.config import DropinConfigs -from plinth.diagnostic_check import DiagnosticCheck -from plinth.modules import names -from plinth.modules.apache.components import diagnose_url -from plinth.modules.backups.components import BackupRestore -from plinth.modules.names.components import DomainType -from plinth.package import Packages -from plinth.setup import store_error_message -from plinth.signals import domain_added, domain_removed, post_app_loading -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.config import DropinConfigs +from freedombox.diagnostic_check import DiagnosticCheck +from freedombox.modules import names +from freedombox.modules.apache.components import diagnose_url +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.names.components import DomainType +from freedombox.package import Packages +from freedombox.setup import store_error_message +from freedombox.signals import domain_added, domain_removed, post_app_loading +from freedombox.utils import format_lazy from . import components, manifest, privileged @@ -253,7 +253,7 @@ def _certificate_handle_modified_internal(): def certificate_get_last_seen_modified_time(lineage): """Return the last seen expiry date of a certificate.""" - from plinth import kvstore + from freedombox import kvstore info = kvstore.get_default('letsencrypt_certificate_info', '{}') info = json.loads(info) try: @@ -267,7 +267,7 @@ def certificate_set_last_seen_modified_time(lineage): lineage = pathlib.Path(lineage) modified_time = privileged.get_modified_time(lineage.name) - from plinth import kvstore + from freedombox import kvstore info = kvstore.get_default('letsencrypt_certificate_info', '{}') info = json.loads(info) diff --git a/freedombox/modules/letsencrypt/components.py b/freedombox/modules/letsencrypt/components.py index 3903f233d..f1075229b 100644 --- a/freedombox/modules/letsencrypt/components.py +++ b/freedombox/modules/letsencrypt/components.py @@ -6,9 +6,9 @@ import pathlib import threading from typing import ClassVar -from plinth import app -from plinth.modules.names.components import DomainName -from plinth.privileged import service as service_privileged +from freedombox import app +from freedombox.modules.names.components import DomainName +from freedombox.privileged import service as service_privileged from . import privileged @@ -276,7 +276,7 @@ class LetsEncrypt(app.FollowerComponent): @staticmethod def _get_letsencrypt_domains(): """Return the list of domains with LE certificates.""" - from plinth.modules import letsencrypt + from freedombox.modules import letsencrypt status = letsencrypt.get_status() domains = { domain @@ -406,5 +406,5 @@ def on_certificate_event_sync(event, domains, lineage): component.component_id, event, domains, lineage, exception) if event in ('obtained', 'renewed'): - from plinth.modules import letsencrypt + from freedombox.modules import letsencrypt letsencrypt.certificate_set_last_seen_modified_time(lineage) diff --git a/freedombox/modules/letsencrypt/dbus.py b/freedombox/modules/letsencrypt/dbus.py index 3d9625dc9..02cd178f1 100644 --- a/freedombox/modules/letsencrypt/dbus.py +++ b/freedombox/modules/letsencrypt/dbus.py @@ -5,7 +5,7 @@ Expose API over D-Bus to receive renewal notifications. import logging -from plinth.utils import import_from_gi +from freedombox.utils import import_from_gi gio = import_from_gi('Gio', '2.0') @@ -62,6 +62,6 @@ class LetsEncrypt: logger.info('LE certificate renewed (deployed): %s, %s.', renewed_domains, renewed_lineage) - from plinth.modules.letsencrypt import components + from freedombox.modules.letsencrypt import components components.on_certificate_event('renewed', renewed_domains, renewed_lineage) diff --git a/freedombox/modules/letsencrypt/privileged.py b/freedombox/modules/letsencrypt/privileged.py index 6c673f2f8..c161cd7ad 100644 --- a/freedombox/modules/letsencrypt/privileged.py +++ b/freedombox/modules/letsencrypt/privileged.py @@ -11,11 +11,11 @@ import shutil import sys from typing import Any -from plinth import action_utils -from plinth import app as app_module -from plinth import module_loader -from plinth.actions import privileged -from plinth.modules import letsencrypt as le +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import module_loader +from freedombox.actions import privileged +from freedombox.modules import letsencrypt as le TEST_MODE = False LE_DIRECTORY = '/etc/letsencrypt/' @@ -230,7 +230,7 @@ def _assert_managed_path(module, path): managed_paths = [] for cls in app_classes: app = cls() - from plinth.modules.letsencrypt.components import LetsEncrypt + from freedombox.modules.letsencrypt.components import LetsEncrypt components = app.get_components_of_type(LetsEncrypt) for component in components: if component.private_key_path: diff --git a/freedombox/modules/letsencrypt/tests/test_components.py b/freedombox/modules/letsencrypt/tests/test_components.py index c4076c686..deeff90d0 100644 --- a/freedombox/modules/letsencrypt/tests/test_components.py +++ b/freedombox/modules/letsencrypt/tests/test_components.py @@ -9,8 +9,8 @@ from unittest.mock import call, patch import pytest -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.modules.names.components import DomainName, DomainType +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.modules.names.components import DomainName, DomainType @pytest.fixture(name='empty_letsencrypt_list', autouse=True) diff --git a/freedombox/modules/letsencrypt/tests/test_domain_name_changes.py b/freedombox/modules/letsencrypt/tests/test_domain_name_changes.py index 2d9f6bdd6..daacb0f39 100644 --- a/freedombox/modules/letsencrypt/tests/test_domain_name_changes.py +++ b/freedombox/modules/letsencrypt/tests/test_domain_name_changes.py @@ -7,7 +7,7 @@ from unittest.mock import call, patch import pytest -from plinth.modules.names.components import DomainType +from freedombox.modules.names.components import DomainType from .. import on_domain_added, on_domain_removed diff --git a/freedombox/modules/letsencrypt/views.py b/freedombox/modules/letsencrypt/views.py index 2dbae35d2..74b41c82b 100644 --- a/freedombox/modules/letsencrypt/views.py +++ b/freedombox/modules/letsencrypt/views.py @@ -11,8 +11,8 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.decorators.http import require_POST -from plinth.modules import letsencrypt -from plinth.views import AppView, messages_error +from freedombox.modules import letsencrypt +from freedombox.views import AppView, messages_error logger = logging.getLogger(__name__) diff --git a/freedombox/modules/matrixsynapse/__init__.py b/freedombox/modules/matrixsynapse/__init__.py index 1241c9ff7..2287f1304 100644 --- a/freedombox/modules/matrixsynapse/__init__.py +++ b/freedombox/modules/matrixsynapse/__init__.py @@ -8,17 +8,18 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from ruamel.yaml.util import load_yaml_guess_indent -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.config import DropinConfigs -from plinth.daemon import Daemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.coturn.components import TurnConfiguration, TurnConsumer -from plinth.modules.firewall.components import Firewall -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.package import Packages, install -from plinth.utils import format_lazy, is_non_empty_file +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.coturn.components import (TurnConfiguration, + TurnConsumer) +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.package import Packages, install +from freedombox.utils import format_lazy, is_non_empty_file from . import manifest, privileged diff --git a/freedombox/modules/matrixsynapse/forms.py b/freedombox/modules/matrixsynapse/forms.py index f780fb75f..c3f8fea53 100644 --- a/freedombox/modules/matrixsynapse/forms.py +++ b/freedombox/modules/matrixsynapse/forms.py @@ -7,8 +7,8 @@ from django import forms from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth.modules.coturn.forms import turn_uris_validator -from plinth.utils import format_lazy +from freedombox.modules.coturn.forms import turn_uris_validator +from freedombox.utils import format_lazy _registration_verification_choices = [ ('disabled', diff --git a/freedombox/modules/matrixsynapse/manifest.py b/freedombox/modules/matrixsynapse/manifest.py index 009529ea2..885339b66 100644 --- a/freedombox/modules/matrixsynapse/manifest.py +++ b/freedombox/modules/matrixsynapse/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _element_android_package_id = 'im.vector.app' _element_desktop_download_url = 'https://element.io/get-started' diff --git a/freedombox/modules/matrixsynapse/privileged.py b/freedombox/modules/matrixsynapse/privileged.py index c6cd62fe0..8d9bc2901 100644 --- a/freedombox/modules/matrixsynapse/privileged.py +++ b/freedombox/modules/matrixsynapse/privileged.py @@ -11,8 +11,8 @@ import shutil import requests import yaml -from plinth import action_utils, utils -from plinth.actions import privileged +from freedombox import action_utils, utils +from freedombox.actions import privileged CONF_DIR = "/etc/matrix-synapse/conf.d/" diff --git a/freedombox/modules/matrixsynapse/tests/test_functional.py b/freedombox/modules/matrixsynapse/tests/test_functional.py index 4bab0c4c8..685ca3933 100644 --- a/freedombox/modules/matrixsynapse/tests/test_functional.py +++ b/freedombox/modules/matrixsynapse/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for matrixsynapse app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.matrixsynapse] diff --git a/freedombox/modules/matrixsynapse/tests/test_turn_config.py b/freedombox/modules/matrixsynapse/tests/test_turn_config.py index 9971e070b..5a12cdb20 100644 --- a/freedombox/modules/matrixsynapse/tests/test_turn_config.py +++ b/freedombox/modules/matrixsynapse/tests/test_turn_config.py @@ -7,9 +7,9 @@ from unittest.mock import patch, Mock import pytest -from plinth.modules import matrixsynapse -from plinth.modules.coturn.components import TurnConfiguration -from plinth.modules.matrixsynapse import privileged +from freedombox.modules import matrixsynapse +from freedombox.modules.coturn.components import TurnConfiguration +from freedombox.modules.matrixsynapse import privileged pytestmark = pytest.mark.usefixtures('mock_privileged') privileged_modules_to_mock = ['plinth.modules.matrixsynapse.privileged'] diff --git a/freedombox/modules/matrixsynapse/views.py b/freedombox/modules/matrixsynapse/views.py index bb1143c6d..597c6a68d 100644 --- a/freedombox/modules/matrixsynapse/views.py +++ b/freedombox/modules/matrixsynapse/views.py @@ -9,11 +9,11 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView -from plinth import app as app_module -from plinth.forms import DomainSelectionForm -from plinth.modules import matrixsynapse, names -from plinth.modules.coturn.components import TurnConfiguration -from plinth.views import AppView +from freedombox import app as app_module +from freedombox.forms import DomainSelectionForm +from freedombox.modules import matrixsynapse, names +from freedombox.modules.coturn.components import TurnConfiguration +from freedombox.views import AppView from . import get_turn_configuration, privileged from .forms import MatrixSynapseForm diff --git a/freedombox/modules/mediawiki/__init__.py b/freedombox/modules/mediawiki/__init__.py index 5afaf52ba..f43b1b1e9 100644 --- a/freedombox/modules/mediawiki/__init__.py +++ b/freedombox/modules/mediawiki/__init__.py @@ -6,14 +6,14 @@ from urllib.parse import urlparse 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages from . import manifest, privileged diff --git a/freedombox/modules/mediawiki/privileged.py b/freedombox/modules/mediawiki/privileged.py index 06004922a..de4fe82a8 100644 --- a/freedombox/modules/mediawiki/privileged.py +++ b/freedombox/modules/mediawiki/privileged.py @@ -7,9 +7,9 @@ import shutil import subprocess import tempfile -from plinth import action_utils -from plinth.actions import privileged, secret_str -from plinth.utils import generate_password +from freedombox import action_utils +from freedombox.actions import privileged, secret_str +from freedombox.utils import generate_password MAINTENANCE_SCRIPTS_DIR = "/usr/share/mediawiki/maintenance" CONF_FILE = '/etc/mediawiki/FreedomBoxSettings.php' diff --git a/freedombox/modules/mediawiki/tests/test_functional.py b/freedombox/modules/mediawiki/tests/test_functional.py index 2cbb40950..14eaaeb6c 100644 --- a/freedombox/modules/mediawiki/tests/test_functional.py +++ b/freedombox/modules/mediawiki/tests/test_functional.py @@ -9,8 +9,8 @@ from urllib.parse import urlparse import pytest import requests -from plinth.tests import functional -from plinth.tests.functional import config +from freedombox.tests import functional +from freedombox.tests.functional import config pytestmark = [pytest.mark.apps, pytest.mark.mediawiki] diff --git a/freedombox/modules/mediawiki/tests/test_settings.py b/freedombox/modules/mediawiki/tests/test_settings.py index 6565da6cb..68c4cb5bb 100644 --- a/freedombox/modules/mediawiki/tests/test_settings.py +++ b/freedombox/modules/mediawiki/tests/test_settings.py @@ -8,8 +8,8 @@ from unittest.mock import patch import pytest -from plinth.modules import mediawiki -from plinth.modules.mediawiki import privileged +from freedombox.modules import mediawiki +from freedombox.modules.mediawiki import privileged pytestmark = pytest.mark.usefixtures('mock_privileged') current_directory = pathlib.Path(__file__).parent diff --git a/freedombox/modules/mediawiki/views.py b/freedombox/modules/mediawiki/views.py index c012c68fc..4814ae54d 100644 --- a/freedombox/modules/mediawiki/views.py +++ b/freedombox/modules/mediawiki/views.py @@ -6,9 +6,9 @@ import logging from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import app as app_module -from plinth import views -from plinth.modules import mediawiki +from freedombox import app as app_module +from freedombox import views +from freedombox.modules import mediawiki from . import privileged from .forms import MediaWikiForm diff --git a/freedombox/modules/minetest/__init__.py b/freedombox/modules/minetest/__init__.py index 20b11b102..31b7c9dd5 100644 --- a/freedombox/modules/minetest/__init__.py +++ b/freedombox/modules/minetest/__init__.py @@ -5,14 +5,14 @@ import augeas from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Package, Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Package, Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/minetest/manifest.py b/freedombox/modules/minetest/manifest.py index 737a7bc75..a5b4147f3 100644 --- a/freedombox/modules/minetest/manifest.py +++ b/freedombox/modules/minetest/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': diff --git a/freedombox/modules/minetest/privileged.py b/freedombox/modules/minetest/privileged.py index 17745f4d1..c81ce751b 100644 --- a/freedombox/modules/minetest/privileged.py +++ b/freedombox/modules/minetest/privileged.py @@ -6,8 +6,8 @@ import shutil import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged old_config_file = pathlib.Path('/etc/minetest/minetest.conf') config_file = pathlib.Path('/etc/luanti/default.conf') diff --git a/freedombox/modules/minetest/tests/test_functional.py b/freedombox/modules/minetest/tests/test_functional.py index dd7f79212..d7a79b3b1 100644 --- a/freedombox/modules/minetest/tests/test_functional.py +++ b/freedombox/modules/minetest/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for minetest app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.minetest] diff --git a/freedombox/modules/minetest/urls.py b/freedombox/modules/minetest/urls.py index 9f5f166cb..3b4ffc3ac 100644 --- a/freedombox/modules/minetest/urls.py +++ b/freedombox/modules/minetest/urls.py @@ -5,7 +5,7 @@ URLs for the minetest module. from django.urls import re_path -from plinth.modules.minetest.views import MinetestAppView +from freedombox.modules.minetest.views import MinetestAppView urlpatterns = [ re_path(r'^apps/minetest/$', MinetestAppView.as_view(), name='index-old'), diff --git a/freedombox/modules/minetest/views.py b/freedombox/modules/minetest/views.py index 3701c1f91..1ef4cddab 100644 --- a/freedombox/modules/minetest/views.py +++ b/freedombox/modules/minetest/views.py @@ -4,8 +4,8 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.modules import names -from plinth.views import AppView +from freedombox.modules import names +from freedombox.views import AppView from . import get_configuration, privileged from .forms import MinetestForm diff --git a/freedombox/modules/minidlna/__init__.py b/freedombox/modules/minidlna/__init__.py index 47d9383ce..77d39ba8e 100644 --- a/freedombox/modules/minidlna/__init__.py +++ b/freedombox/modules/minidlna/__init__.py @@ -5,14 +5,14 @@ FreedomBox app to configure minidlna. from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.daemon import Daemon -from plinth.modules import firewall -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages, install -from plinth.utils import Version +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules import firewall +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages, install +from freedombox.utils import Version from . import manifest, privileged @@ -90,8 +90,9 @@ class MiniDLNAApp(app_module.App): if old_version and old_version <= 5: # Remove minidlna LDAP group and disable minidlna apache config - from plinth.modules.apache import privileged as apache_privileged - from plinth.modules.users import privileged as users_privileged + from freedombox.modules.apache import \ + privileged as apache_privileged + from freedombox.modules.users import privileged as users_privileged users_privileged.remove_group('minidlna') apache_privileged.disable('minidlna-freedombox', 'config') diff --git a/freedombox/modules/minidlna/forms.py b/freedombox/modules/minidlna/forms.py index 388cb19be..4a2d4051c 100644 --- a/freedombox/modules/minidlna/forms.py +++ b/freedombox/modules/minidlna/forms.py @@ -5,8 +5,8 @@ FreedomBox configuration form for MiniDLNA server. from django.utils.translation import gettext_lazy as _ -from plinth.modules.storage.forms import (DirectorySelectForm, - DirectoryValidator) +from freedombox.modules.storage.forms import (DirectorySelectForm, + DirectoryValidator) from . import SYSTEM_USER diff --git a/freedombox/modules/minidlna/manifest.py b/freedombox/modules/minidlna/manifest.py index 8f0f4d3e8..3f0cda8ed 100644 --- a/freedombox/modules/minidlna/manifest.py +++ b/freedombox/modules/minidlna/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [ { diff --git a/freedombox/modules/minidlna/privileged.py b/freedombox/modules/minidlna/privileged.py index e57058770..e3000dda0 100644 --- a/freedombox/modules/minidlna/privileged.py +++ b/freedombox/modules/minidlna/privileged.py @@ -7,9 +7,9 @@ from tempfile import mkstemp import augeas -from plinth import action_utils -from plinth.actions import privileged -from plinth.utils import grep +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.utils import grep CONFIG_PATH = '/etc/minidlna.conf' diff --git a/freedombox/modules/minidlna/tests/test_functional.py b/freedombox/modules/minidlna/tests/test_functional.py index 904864b3e..0c7ed2db2 100644 --- a/freedombox/modules/minidlna/tests/test_functional.py +++ b/freedombox/modules/minidlna/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for minidlna app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.minidlna] diff --git a/freedombox/modules/minidlna/urls.py b/freedombox/modules/minidlna/urls.py index 952852b91..d7e16a966 100644 --- a/freedombox/modules/minidlna/urls.py +++ b/freedombox/modules/minidlna/urls.py @@ -5,7 +5,7 @@ URLs for the minidlna Server module. from django.urls import re_path -from plinth.modules.minidlna.views import MiniDLNAAppView +from freedombox.modules.minidlna.views import MiniDLNAAppView urlpatterns = [ re_path(r'^apps/minidlna/$', MiniDLNAAppView.as_view(), name='index'), diff --git a/freedombox/modules/minidlna/views.py b/freedombox/modules/minidlna/views.py index df2529fa9..2609f13fb 100644 --- a/freedombox/modules/minidlna/views.py +++ b/freedombox/modules/minidlna/views.py @@ -4,7 +4,7 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import MiniDLNAServerForm diff --git a/freedombox/modules/miniflux/__init__.py b/freedombox/modules/miniflux/__init__.py index 509d8a48d..aeaab1a34 100644 --- a/freedombox/modules/miniflux/__init__.py +++ b/freedombox/modules/miniflux/__init__.py @@ -3,14 +3,14 @@ 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, SharedDaemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, SharedDaemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages from . import manifest, privileged diff --git a/freedombox/modules/miniflux/manifest.py b/freedombox/modules/miniflux/manifest.py index 7082fb720..6f1782228 100644 --- a/freedombox/modules/miniflux/manifest.py +++ b/freedombox/modules/miniflux/manifest.py @@ -3,7 +3,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [ { diff --git a/freedombox/modules/miniflux/privileged.py b/freedombox/modules/miniflux/privileged.py index 4a0b5f4c3..5752be9ba 100644 --- a/freedombox/modules/miniflux/privileged.py +++ b/freedombox/modules/miniflux/privileged.py @@ -8,10 +8,10 @@ from typing import Tuple import pexpect -from plinth import action_utils -from plinth.actions import privileged, secret_str -from plinth.db import postgres, dbconfig -from plinth.utils import is_non_empty_file +from freedombox import action_utils +from freedombox.actions import privileged, secret_str +from freedombox.db import postgres, dbconfig +from freedombox.utils import is_non_empty_file STATIC_SETTINGS = { 'BASE_URL': 'http://localhost/miniflux/', diff --git a/freedombox/modules/miniflux/tests/test_functional.py b/freedombox/modules/miniflux/tests/test_functional.py index f3e5e685f..7d3866bba 100644 --- a/freedombox/modules/miniflux/tests/test_functional.py +++ b/freedombox/modules/miniflux/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for Miniflux app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.miniflux] diff --git a/freedombox/modules/miniflux/tests/test_views.py b/freedombox/modules/miniflux/tests/test_views.py index 131f03e87..833750a5d 100644 --- a/freedombox/modules/miniflux/tests/test_views.py +++ b/freedombox/modules/miniflux/tests/test_views.py @@ -7,8 +7,8 @@ import pytest from django import urls from django.contrib.messages.storage.fallback import FallbackStorage -from plinth import module_loader -from plinth.modules.miniflux import views +from freedombox import module_loader +from freedombox.modules.miniflux import views # For all tests, use plinth.urls instead of urls configured for testing pytestmark = pytest.mark.urls('plinth.urls') diff --git a/freedombox/modules/miniflux/views.py b/freedombox/modules/miniflux/views.py index ca0408cf0..123884039 100644 --- a/freedombox/modules/miniflux/views.py +++ b/freedombox/modules/miniflux/views.py @@ -9,7 +9,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic.edit import FormView -from plinth import views +from freedombox import views from . import privileged from .forms import UserCredentialsForm diff --git a/freedombox/modules/mumble/__init__.py b/freedombox/modules/mumble/__init__.py index ad7592f13..8dcf59c00 100644 --- a/freedombox/modules/mumble/__init__.py +++ b/freedombox/modules/mumble/__init__.py @@ -8,17 +8,17 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.daemon import Daemon -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules import names -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages, install -from plinth.utils import Version +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.daemon import Daemon +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules import names +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages, install +from freedombox.utils import Version from . import manifest, privileged diff --git a/freedombox/modules/mumble/forms.py b/freedombox/modules/mumble/forms.py index d6a9c2319..dbc4f0ac1 100644 --- a/freedombox/modules/mumble/forms.py +++ b/freedombox/modules/mumble/forms.py @@ -6,7 +6,7 @@ Mumble server configuration form from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.modules import mumble +from freedombox.modules import mumble def get_domain_choices(): diff --git a/freedombox/modules/mumble/manifest.py b/freedombox/modules/mumble/manifest.py index bd987690a..4c091a43c 100644 --- a/freedombox/modules/mumble/manifest.py +++ b/freedombox/modules/mumble/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': diff --git a/freedombox/modules/mumble/privileged.py b/freedombox/modules/mumble/privileged.py index ff51d111f..37894c407 100644 --- a/freedombox/modules/mumble/privileged.py +++ b/freedombox/modules/mumble/privileged.py @@ -7,8 +7,8 @@ import pathlib import augeas -from plinth import action_utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils +from freedombox.actions import privileged, secret_str CONFIG_FILE = '/etc/mumble/mumble-server.ini' OLD_CONFIG_FILE = '/etc/mumble-server.ini' diff --git a/freedombox/modules/mumble/tests/test_functional.py b/freedombox/modules/mumble/tests/test_functional.py index 83cd6ef91..be6c6d337 100644 --- a/freedombox/modules/mumble/tests/test_functional.py +++ b/freedombox/modules/mumble/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for mumble app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.mumble] diff --git a/freedombox/modules/mumble/urls.py b/freedombox/modules/mumble/urls.py index 67e6ccbdb..73a32b777 100644 --- a/freedombox/modules/mumble/urls.py +++ b/freedombox/modules/mumble/urls.py @@ -5,7 +5,7 @@ URLs for the Mumble module from django.urls import re_path -from plinth.modules.mumble.views import MumbleAppView +from freedombox.modules.mumble.views import MumbleAppView urlpatterns = [ re_path(r'^apps/mumble/$', MumbleAppView.as_view(), name='index'), diff --git a/freedombox/modules/mumble/views.py b/freedombox/modules/mumble/views.py index a6c96dabb..0dabf966c 100644 --- a/freedombox/modules/mumble/views.py +++ b/freedombox/modules/mumble/views.py @@ -6,10 +6,10 @@ Views for mumble app. from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth.modules import mumble -from plinth.modules.mumble.forms import MumbleForm -from plinth.views import AppView +from freedombox import app as app_module +from freedombox.modules import mumble +from freedombox.modules.mumble.forms import MumbleForm +from freedombox.views import AppView from . import privileged diff --git a/freedombox/modules/names/__init__.py b/freedombox/modules/names/__init__.py index 8e1e309ba..54202e4cf 100644 --- a/freedombox/modules/names/__init__.py +++ b/freedombox/modules/names/__init__.py @@ -12,18 +12,18 @@ from typing import Iterator from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import cfg, glib, kvstore, menu, network, setup -from plinth.daemon import Daemon -from plinth.diagnostic_check import (DiagnosticCheck, - DiagnosticCheckParameters, Result) -from plinth.modules.backups.components import BackupRestore -from plinth.modules.names.components import DomainType -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.signals import (domain_added, domain_removed, post_hostname_change, - pre_hostname_change) -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, glib, kvstore, menu, network, setup +from freedombox.daemon import Daemon +from freedombox.diagnostic_check import (DiagnosticCheck, + DiagnosticCheckParameters, Result) +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.names.components import DomainType +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.signals import (domain_added, domain_removed, + post_hostname_change, pre_hostname_change) +from freedombox.utils import format_lazy from . import components, manifest, privileged @@ -256,7 +256,7 @@ def on_domain_added(sender: str, domain_type: str, name: str = '', # won't happen if in the signal calling order, oidc module get notified # first. A proper fix is being worked on as a complete overhaul to domain # change notification mechanism. - from plinth.modules import oidc + from freedombox.modules import oidc oidc.on_domain_added(sender, domain_type, name, description, services, **kwargs) @@ -273,7 +273,7 @@ def on_domain_removed(sender: str, domain_type: str, name: str = '', **kwargs): # domains. This won't happen if in the signal calling order, oidc # module get notified first. A proper fix is being worked on as a # complete overhaul to domain change notification mechanism. - from plinth.modules import oidc + from freedombox.modules import oidc oidc.on_domain_removed(sender, domain_type, name, **kwargs) else: for domain_name in components.DomainName.list(): diff --git a/freedombox/modules/names/components.py b/freedombox/modules/names/components.py index 617abb527..487e50d5e 100644 --- a/freedombox/modules/names/components.py +++ b/freedombox/modules/names/components.py @@ -7,7 +7,7 @@ from typing import ClassVar from django.utils.translation import gettext_lazy as _ -from plinth import app +from freedombox import app _SERVICES = { '__all__': { diff --git a/freedombox/modules/names/forms.py b/freedombox/modules/names/forms.py index 64ede00ae..d876c9ceb 100644 --- a/freedombox/modules/names/forms.py +++ b/freedombox/modules/names/forms.py @@ -8,9 +8,9 @@ from django.core import validators from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.modules import names -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.modules import names +from freedombox.utils import format_lazy HOSTNAME_REGEX = r'^[a-zA-Z0-9]([-a-zA-Z0-9]{,61}[a-zA-Z0-9])?$' diff --git a/freedombox/modules/names/privileged.py b/freedombox/modules/names/privileged.py index f9f7fa248..cae712c68 100644 --- a/freedombox/modules/names/privileged.py +++ b/freedombox/modules/names/privileged.py @@ -5,8 +5,8 @@ import pathlib import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged fallback_conf = pathlib.Path( '/etc/systemd/resolved.conf.d/freedombox-fallback.conf') diff --git a/freedombox/modules/names/resolved.py b/freedombox/modules/names/resolved.py index 531da83d1..0efe330d8 100644 --- a/freedombox/modules/names/resolved.py +++ b/freedombox/modules/names/resolved.py @@ -7,7 +7,7 @@ import subprocess from django.utils.translation import gettext_lazy as _ -from plinth.utils import import_from_gi +from freedombox.utils import import_from_gi gio = import_from_gi('Gio', '2.0') diff --git a/freedombox/modules/names/tests/test_functional.py b/freedombox/modules/names/tests/test_functional.py index c5d0b09c4..27929d7c1 100644 --- a/freedombox/modules/names/tests/test_functional.py +++ b/freedombox/modules/names/tests/test_functional.py @@ -3,7 +3,7 @@ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [ pytest.mark.system, pytest.mark.essential, pytest.mark.domain, diff --git a/freedombox/modules/names/views.py b/freedombox/modules/names/views.py index 5fd84be6e..03e4da467 100644 --- a/freedombox/modules/names/views.py +++ b/freedombox/modules/names/views.py @@ -12,9 +12,9 @@ from django.utils.translation import gettext_lazy as _ from django.views.generic import TemplateView from django.views.generic.edit import FormView -from plinth.modules import names -from plinth.signals import domain_added, domain_removed -from plinth.views import AppView +from freedombox.modules import names +from freedombox.signals import domain_added, domain_removed +from freedombox.views import AppView from . import components, privileged, resolved from .forms import DomainAddForm, HostnameForm, NamesConfigurationForm diff --git a/freedombox/modules/networks/__init__.py b/freedombox/modules/networks/__init__.py index 879e95451..9f38cdf86 100644 --- a/freedombox/modules/networks/__init__.py +++ b/freedombox/modules/networks/__init__.py @@ -6,12 +6,12 @@ from logging import Logger from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import daemon, kvstore, menu, network -from plinth.config import DropinConfigs -from plinth.diagnostic_check import DiagnosticCheck -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import daemon, kvstore, menu, network +from freedombox.config import DropinConfigs +from freedombox.diagnostic_check import DiagnosticCheck +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages from . import manifest, privileged diff --git a/freedombox/modules/networks/forms.py b/freedombox/modules/networks/forms.py index 79bb045f0..fa382f94b 100644 --- a/freedombox/modules/networks/forms.py +++ b/freedombox/modules/networks/forms.py @@ -6,9 +6,9 @@ from django.urls import reverse_lazy from django.utils.functional import lazy from django.utils.translation import gettext_lazy as _ -from plinth import cfg, network -from plinth.modules import names -from plinth.utils import format_lazy, import_from_gi +from freedombox import cfg, network +from freedombox.modules import names +from freedombox.utils import format_lazy, import_from_gi nm = import_from_gi('NM', '1.0') @@ -19,7 +19,7 @@ def _get_dns_over_tls(): return str(_('unknown')) try: - from plinth.modules.names import privileged + from freedombox.modules.names import privileged dns_over_tls = privileged.get_resolved_configuration()['dns_over_tls'] except Exception: return str(_('unknown')) @@ -166,7 +166,7 @@ class ConnectionForm(forms.Form): def __init__(self, *args, **kwargs): """Disable DNS fallback field if necessary.""" - from plinth.modules import names + from freedombox.modules import names super().__init__(*args, **kwargs) if 'dns_over_tls' in self.fields: self.fields['dns_over_tls'].disabled = ( diff --git a/freedombox/modules/networks/privileged.py b/freedombox/modules/networks/privileged.py index 05eaf2be6..d89cae99e 100644 --- a/freedombox/modules/networks/privileged.py +++ b/freedombox/modules/networks/privileged.py @@ -11,8 +11,8 @@ import logging import re import subprocess -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged def _sort_interfaces(interfaces: list[str]) -> list[str]: diff --git a/freedombox/modules/networks/views.py b/freedombox/modules/networks/views.py index ba327fd42..96e7870af 100644 --- a/freedombox/modules/networks/views.py +++ b/freedombox/modules/networks/views.py @@ -11,9 +11,9 @@ from django.utils.translation import gettext_lazy from django.views.decorators.http import require_POST from django.views.generic.edit import FormView -from plinth import network -from plinth.modules import names, networks -from plinth.views import AppView +from freedombox import network +from freedombox.modules import names, networks +from freedombox.views import AppView from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm, InternetConnectionTypeForm, NetworkTopologyForm, PPPoEForm, diff --git a/freedombox/modules/nextcloud/__init__.py b/freedombox/modules/nextcloud/__init__.py index d51e6859a..2df2c09d3 100644 --- a/freedombox/modules/nextcloud/__init__.py +++ b/freedombox/modules/nextcloud/__init__.py @@ -5,19 +5,19 @@ import contextlib 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, SharedDaemon -from plinth.modules.apache.components import (Webserver, diagnose_url, - diagnose_url_on_all) -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.modules.names.components import DomainName -from plinth.package import Packages -from plinth.signals import domain_added, domain_removed -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, SharedDaemon +from freedombox.modules.apache.components import (Webserver, diagnose_url, + diagnose_url_on_all) +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.modules.names.components import DomainName +from freedombox.package import Packages +from freedombox.signals import domain_added, domain_removed +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/nextcloud/manifest.py b/freedombox/modules/nextcloud/manifest.py index 3b1e7172b..622110ca7 100644 --- a/freedombox/modules/nextcloud/manifest.py +++ b/freedombox/modules/nextcloud/manifest.py @@ -3,7 +3,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _nextcloud_android_package_id = 'com.nextcloud.client' diff --git a/freedombox/modules/nextcloud/privileged.py b/freedombox/modules/nextcloud/privileged.py index 1bfdd6bb5..887090433 100644 --- a/freedombox/modules/nextcloud/privileged.py +++ b/freedombox/modules/nextcloud/privileged.py @@ -12,8 +12,8 @@ import time import augeas -from plinth import action_utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils +from freedombox.actions import privileged, secret_str CONTAINER_NAME = 'nextcloud-freedombox' SERVICE_NAME = 'nextcloud-freedombox' diff --git a/freedombox/modules/nextcloud/tests/test_functional.py b/freedombox/modules/nextcloud/tests/test_functional.py index 6bce73eb2..302a7fe37 100644 --- a/freedombox/modules/nextcloud/tests/test_functional.py +++ b/freedombox/modules/nextcloud/tests/test_functional.py @@ -7,7 +7,7 @@ import urllib import pytest from selenium.webdriver.common.keys import Keys -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.nextcloud] diff --git a/freedombox/modules/nextcloud/views.py b/freedombox/modules/nextcloud/views.py index eac1fc9cb..7ad316849 100644 --- a/freedombox/modules/nextcloud/views.py +++ b/freedombox/modules/nextcloud/views.py @@ -6,8 +6,8 @@ import logging from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.modules.nextcloud.forms import NextcloudForm -from plinth.views import AppView +from freedombox.modules.nextcloud.forms import NextcloudForm +from freedombox.views import AppView from . import privileged diff --git a/freedombox/modules/oidc/__init__.py b/freedombox/modules/oidc/__init__.py index 5c593cd0d..d074b3e38 100644 --- a/freedombox/modules/oidc/__init__.py +++ b/freedombox/modules/oidc/__init__.py @@ -33,7 +33,7 @@ import logging from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module +from freedombox import app as app_module from . import components diff --git a/freedombox/modules/oidc/components.py b/freedombox/modules/oidc/components.py index 8449e960f..7adf5d051 100644 --- a/freedombox/modules/oidc/components.py +++ b/freedombox/modules/oidc/components.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """App component for other apps to authenticate with OpenID Connect.""" -from plinth import app as app_module +from freedombox import app as app_module class OpenIDConnect(app_module.FollowerComponent): @@ -143,7 +143,7 @@ class OpenIDConnect(app_module.FollowerComponent): def _get_redirect_uris(self) -> str: """Return an expanded list of redirect URIs.""" - from plinth.modules.names.components import DomainName + from freedombox.modules.names.components import DomainName final_uris = [] # redirect_uris list can't be empty. Otherwise, validations for # 'localhost' and IP addresses won't work. @@ -159,7 +159,7 @@ class OpenIDConnect(app_module.FollowerComponent): def _get_allowed_origins(self) -> str: """Return a list of all allowed origins for CORS header.""" - from plinth.modules.names.components import DomainName + from freedombox.modules.names.components import DomainName # redirect_uris list can't be empty. Otherwise, validations for # 'localhost' and IP addresses won't work. Keep origins in line with diff --git a/freedombox/modules/oidc/validators.py b/freedombox/modules/oidc/validators.py index 3ef3900a1..555f396ba 100644 --- a/freedombox/modules/oidc/validators.py +++ b/freedombox/modules/oidc/validators.py @@ -5,7 +5,7 @@ import urllib.parse from oauth2_provider import oauth2_validators -from plinth import action_utils +from freedombox import action_utils class OAuth2Validator(oauth2_validators.OAuth2Validator): diff --git a/freedombox/modules/openvpn/__init__.py b/freedombox/modules/openvpn/__init__.py index 3811f504a..69d1f0383 100644 --- a/freedombox/modules/openvpn/__init__.py +++ b/freedombox/modules/openvpn/__init__.py @@ -4,14 +4,14 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/openvpn/manifest.py b/freedombox/modules/openvpn/manifest.py index 68abee13d..738bb7e76 100644 --- a/freedombox/modules/openvpn/manifest.py +++ b/freedombox/modules/openvpn/manifest.py @@ -5,7 +5,7 @@ Application manifest for OpenVPN. from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _package_id = 'de.blinkt.openvpn' _download_url = 'https://openvpn.net/community-downloads' diff --git a/freedombox/modules/openvpn/privileged.py b/freedombox/modules/openvpn/privileged.py index 9fb620a85..d39ebb830 100644 --- a/freedombox/modules/openvpn/privileged.py +++ b/freedombox/modules/openvpn/privileged.py @@ -9,8 +9,8 @@ import subprocess import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged KEYS_DIRECTORY = pathlib.Path('/etc/openvpn/freedombox-keys') CA_CERTIFICATE_PATH = KEYS_DIRECTORY / 'pki' / 'ca.crt' diff --git a/freedombox/modules/openvpn/tests/test_functional.py b/freedombox/modules/openvpn/tests/test_functional.py index dd901c5e1..b5adfae1e 100644 --- a/freedombox/modules/openvpn/tests/test_functional.py +++ b/freedombox/modules/openvpn/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for openvpn app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.openvpn] diff --git a/freedombox/modules/openvpn/urls.py b/freedombox/modules/openvpn/urls.py index e9382644b..5896d4000 100644 --- a/freedombox/modules/openvpn/urls.py +++ b/freedombox/modules/openvpn/urls.py @@ -3,7 +3,7 @@ from django.urls import re_path -from plinth.utils import user_group_view +from freedombox.utils import user_group_view from . import views diff --git a/freedombox/modules/openvpn/views.py b/freedombox/modules/openvpn/views.py index 63cdd5189..8a5e77bf5 100644 --- a/freedombox/modules/openvpn/views.py +++ b/freedombox/modules/openvpn/views.py @@ -5,8 +5,8 @@ import logging from django.http import HttpResponse -from plinth.modules.names.components import DomainName -from plinth.views import AppView +from freedombox.modules.names.components import DomainName +from freedombox.views import AppView from . import privileged diff --git a/freedombox/modules/pagekite/__init__.py b/freedombox/modules/pagekite/__init__.py index e9b5aa867..974081bcf 100644 --- a/freedombox/modules/pagekite/__init__.py +++ b/freedombox/modules/pagekite/__init__.py @@ -3,14 +3,14 @@ from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.names.components import DomainType -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.names.components import DomainType +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.utils import format_lazy from . import manifest, utils diff --git a/freedombox/modules/pagekite/privileged.py b/freedombox/modules/pagekite/privileged.py index a151ac7f6..c2a859e1f 100644 --- a/freedombox/modules/pagekite/privileged.py +++ b/freedombox/modules/pagekite/privileged.py @@ -5,9 +5,9 @@ import os import augeas -from plinth import action_utils -from plinth.actions import privileged, secret_str -from plinth.modules.pagekite import utils +from freedombox import action_utils +from freedombox.actions import privileged, secret_str +from freedombox.modules.pagekite import utils PATHS = { 'service_on': diff --git a/freedombox/modules/pagekite/tests/test_functional.py b/freedombox/modules/pagekite/tests/test_functional.py index cc5087f83..cda14f9c2 100644 --- a/freedombox/modules/pagekite/tests/test_functional.py +++ b/freedombox/modules/pagekite/tests/test_functional.py @@ -4,7 +4,7 @@ Functional, browser based tests for pagekite app. """ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.domain, pytest.mark.pagekite] diff --git a/freedombox/modules/pagekite/tests/test_pagekite.py b/freedombox/modules/pagekite/tests/test_pagekite.py index 536df3673..d25da5c1a 100644 --- a/freedombox/modules/pagekite/tests/test_pagekite.py +++ b/freedombox/modules/pagekite/tests/test_pagekite.py @@ -3,7 +3,7 @@ Test modules for Pagekite functions. """ -from plinth.modules.pagekite import utils +from freedombox.modules.pagekite import utils _tests = [ { diff --git a/freedombox/modules/pagekite/utils.py b/freedombox/modules/pagekite/utils.py index 77d5058e1..d67123fb7 100644 --- a/freedombox/modules/pagekite/utils.py +++ b/freedombox/modules/pagekite/utils.py @@ -6,8 +6,8 @@ import os from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth.signals import domain_added, domain_removed +from freedombox import app as app_module +from freedombox.signals import domain_added, domain_removed LOGGER = logging.getLogger(__name__) diff --git a/freedombox/modules/pagekite/views.py b/freedombox/modules/pagekite/views.py index c5dde2e59..29c70d264 100644 --- a/freedombox/modules/pagekite/views.py +++ b/freedombox/modules/pagekite/views.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext as _ from django.views.generic import View from django.views.generic.edit import FormView -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import (AddCustomServiceForm, ConfigurationForm, diff --git a/freedombox/modules/performance/__init__.py b/freedombox/modules/performance/__init__.py index 70b80f0d4..cf3fc31cd 100644 --- a/freedombox/modules/performance/__init__.py +++ b/freedombox/modules/performance/__init__.py @@ -5,11 +5,11 @@ FreedomBox app for System Monitoring (cockpit-pcp) in ‘System’. from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.package import Package, Packages +from freedombox import app as app_module +from freedombox import menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Package, Packages from . import manifest diff --git a/freedombox/modules/performance/tests/test_functional.py b/freedombox/modules/performance/tests/test_functional.py index 15f57ecfa..011c03a37 100644 --- a/freedombox/modules/performance/tests/test_functional.py +++ b/freedombox/modules/performance/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for performance app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.system, pytest.mark.performance] diff --git a/freedombox/modules/performance/urls.py b/freedombox/modules/performance/urls.py index 2dd41bf10..beede79a3 100644 --- a/freedombox/modules/performance/urls.py +++ b/freedombox/modules/performance/urls.py @@ -5,7 +5,7 @@ FreedomBox app for System Monitoring (cockpit-pcp) in ‘System’. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^sys/performance/$', AppView.as_view(app_id='performance'), diff --git a/freedombox/modules/power/__init__.py b/freedombox/modules/power/__init__.py index b14ddabf3..659e719b9 100644 --- a/freedombox/modules/power/__init__.py +++ b/freedombox/modules/power/__init__.py @@ -5,9 +5,9 @@ FreedomBox app for power controls. from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import menu -from plinth.modules.backups.components import BackupRestore +from freedombox import app as app_module +from freedombox import menu +from freedombox.modules.backups.components import BackupRestore from . import manifest diff --git a/freedombox/modules/power/privileged.py b/freedombox/modules/power/privileged.py index 4f468d9c9..692c6a320 100644 --- a/freedombox/modules/power/privileged.py +++ b/freedombox/modules/power/privileged.py @@ -1,8 +1,8 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """Shutdown/restart the system.""" -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged @privileged diff --git a/freedombox/modules/power/views.py b/freedombox/modules/power/views.py index c4198f09e..042015e8b 100644 --- a/freedombox/modules/power/views.py +++ b/freedombox/modules/power/views.py @@ -6,9 +6,9 @@ from django.shortcuts import redirect from django.template.response import TemplateResponse from django.urls import reverse -from plinth import app as app_module -from plinth import package -from plinth.views import AppView +from freedombox import app as app_module +from freedombox import package +from freedombox.views import AppView from . import privileged diff --git a/freedombox/modules/privacy/__init__.py b/freedombox/modules/privacy/__init__.py index 7b5567954..e03404ccb 100644 --- a/freedombox/modules/privacy/__init__.py +++ b/freedombox/modules/privacy/__init__.py @@ -8,11 +8,11 @@ from typing import Literal from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import kvstore, menu -from plinth.config import DropinConfigs -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import kvstore, menu +from freedombox.config import DropinConfigs +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages from . import manifest, privileged @@ -70,7 +70,7 @@ class PrivacyApp(app_module.App): def _show_privacy_notification(): """Show a notification asking user to review privacy settings.""" - from plinth.notification import Notification + from freedombox.notification import Notification message = gettext_noop( 'Please update privacy settings to match your preferences.') data = { diff --git a/freedombox/modules/privacy/forms.py b/freedombox/modules/privacy/forms.py index 7312e2835..26c8cafa1 100644 --- a/freedombox/modules/privacy/forms.py +++ b/freedombox/modules/privacy/forms.py @@ -5,9 +5,9 @@ from django import forms from django.core import validators from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.modules import names -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.modules import names +from freedombox.utils import format_lazy class PrivacyForm(forms.Form): diff --git a/freedombox/modules/privacy/privileged.py b/freedombox/modules/privacy/privileged.py index 0a5782258..e1bfc11e8 100644 --- a/freedombox/modules/privacy/privileged.py +++ b/freedombox/modules/privacy/privileged.py @@ -5,7 +5,7 @@ import pathlib import augeas -from plinth.actions import privileged +from freedombox.actions import privileged CONFIG_FILE = pathlib.Path('/etc/popularity-contest.d/freedombox.conf') diff --git a/freedombox/modules/privacy/tests/test_functional.py b/freedombox/modules/privacy/tests/test_functional.py index 21b0ee1f4..1e92e0990 100644 --- a/freedombox/modules/privacy/tests/test_functional.py +++ b/freedombox/modules/privacy/tests/test_functional.py @@ -3,7 +3,7 @@ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.privacy] diff --git a/freedombox/modules/privacy/views.py b/freedombox/modules/privacy/views.py index b6fb7490d..a33d16126 100644 --- a/freedombox/modules/privacy/views.py +++ b/freedombox/modules/privacy/views.py @@ -5,9 +5,9 @@ from django.contrib import messages from django.utils.translation import gettext as _ import plinth.modules.names.privileged as names_privileged -from plinth.modules import names, privacy -from plinth.modules.privacy.forms import PrivacyForm -from plinth.views import AppView +from freedombox.modules import names, privacy +from freedombox.modules.privacy.forms import PrivacyForm +from freedombox.views import AppView from . import privileged diff --git a/freedombox/modules/privoxy/__init__.py b/freedombox/modules/privoxy/__init__.py index c909a9734..4e1c11238 100644 --- a/freedombox/modules/privoxy/__init__.py +++ b/freedombox/modules/privoxy/__init__.py @@ -7,17 +7,17 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import action_utils -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.diagnostic_check import DiagnosticCheck -from plinth.modules.apache.components import diagnose_url -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.diagnostic_check import DiagnosticCheck +from freedombox.modules.apache.components import diagnose_url +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/privoxy/privileged.py b/freedombox/modules/privoxy/privileged.py index 2c50cafb6..ceacf540c 100644 --- a/freedombox/modules/privoxy/privileged.py +++ b/freedombox/modules/privoxy/privileged.py @@ -5,8 +5,8 @@ import pathlib import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged PRIVOXY_CONF_PATH = pathlib.Path('/etc/privoxy/config') diff --git a/freedombox/modules/privoxy/tests/test_functional.py b/freedombox/modules/privoxy/tests/test_functional.py index b0d0ca2fd..ab0f79f64 100644 --- a/freedombox/modules/privoxy/tests/test_functional.py +++ b/freedombox/modules/privoxy/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for privoxy app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.privoxy] diff --git a/freedombox/modules/privoxy/urls.py b/freedombox/modules/privoxy/urls.py index 137aeab8d..3491a2844 100644 --- a/freedombox/modules/privoxy/urls.py +++ b/freedombox/modules/privoxy/urls.py @@ -5,7 +5,7 @@ URLs for the Privoxy module. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^apps/privoxy/$', AppView.as_view(app_id='privoxy'), diff --git a/freedombox/modules/quassel/__init__.py b/freedombox/modules/quassel/__init__.py index 3ae0de6f0..81741a0bd 100644 --- a/freedombox/modules/quassel/__init__.py +++ b/freedombox/modules/quassel/__init__.py @@ -6,16 +6,16 @@ import pathlib from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.modules import names -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.letsencrypt.components import LetsEncrypt -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules import names +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.letsencrypt.components import LetsEncrypt +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/quassel/manifest.py b/freedombox/modules/quassel/manifest.py index df7c69112..a5d1906ed 100644 --- a/freedombox/modules/quassel/manifest.py +++ b/freedombox/modules/quassel/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': diff --git a/freedombox/modules/quassel/privileged.py b/freedombox/modules/quassel/privileged.py index c5b4e29e3..340cd8301 100644 --- a/freedombox/modules/quassel/privileged.py +++ b/freedombox/modules/quassel/privileged.py @@ -3,7 +3,7 @@ import pathlib -from plinth.actions import privileged +from freedombox.actions import privileged @privileged diff --git a/freedombox/modules/quassel/tests/test_functional.py b/freedombox/modules/quassel/tests/test_functional.py index 07752537a..5297067ce 100644 --- a/freedombox/modules/quassel/tests/test_functional.py +++ b/freedombox/modules/quassel/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for quassel app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.quassel] diff --git a/freedombox/modules/quassel/views.py b/freedombox/modules/quassel/views.py index 8636cfdbb..ef5a3c5da 100644 --- a/freedombox/modules/quassel/views.py +++ b/freedombox/modules/quassel/views.py @@ -3,10 +3,10 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth.forms import TLSDomainForm -from plinth.modules import quassel -from plinth.views import AppView +from freedombox import app as app_module +from freedombox.forms import TLSDomainForm +from freedombox.modules import quassel +from freedombox.views import AppView class QuasselAppView(AppView): diff --git a/freedombox/modules/radicale/__init__.py b/freedombox/modules/radicale/__init__.py index f21f4bdaf..02d7aa0cf 100644 --- a/freedombox/modules/radicale/__init__.py +++ b/freedombox/modules/radicale/__init__.py @@ -7,17 +7,17 @@ import logging 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, RelatedDaemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages, install -from plinth.privileged import service as service_privileged -from plinth.utils import Version, format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, RelatedDaemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages, install +from freedombox.privileged import service as service_privileged +from freedombox.utils import Version, format_lazy from . import manifest, privileged diff --git a/freedombox/modules/radicale/forms.py b/freedombox/modules/radicale/forms.py index 569dcc81b..1aeb9f63b 100644 --- a/freedombox/modules/radicale/forms.py +++ b/freedombox/modules/radicale/forms.py @@ -6,8 +6,8 @@ Forms for radicale module. from django import forms from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.utils import format_lazy CHOICES = [ ('owner_only', diff --git a/freedombox/modules/radicale/manifest.py b/freedombox/modules/radicale/manifest.py index 0b6f0f7b9..6cd35ff3b 100644 --- a/freedombox/modules/radicale/manifest.py +++ b/freedombox/modules/radicale/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': diff --git a/freedombox/modules/radicale/privileged.py b/freedombox/modules/radicale/privileged.py index 5799bac67..e119923a2 100644 --- a/freedombox/modules/radicale/privileged.py +++ b/freedombox/modules/radicale/privileged.py @@ -6,8 +6,8 @@ import shutil import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged CONFIG_FILE = '/etc/radicale/config' LOG_PATH = '/var/log/radicale' diff --git a/freedombox/modules/radicale/tests/test_functional.py b/freedombox/modules/radicale/tests/test_functional.py index a35dde93e..7a242aa65 100644 --- a/freedombox/modules/radicale/tests/test_functional.py +++ b/freedombox/modules/radicale/tests/test_functional.py @@ -8,7 +8,7 @@ import logging import pytest import requests -from plinth.tests import functional +from freedombox.tests import functional logger = logging.getLogger(__name__) diff --git a/freedombox/modules/radicale/views.py b/freedombox/modules/radicale/views.py index 2aa36cedc..d6945ca97 100644 --- a/freedombox/modules/radicale/views.py +++ b/freedombox/modules/radicale/views.py @@ -6,7 +6,7 @@ Views for radicale module. from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import RadicaleForm diff --git a/freedombox/modules/roundcube/__init__.py b/freedombox/modules/roundcube/__init__.py index 0287064a5..9db33d3ea 100644 --- a/freedombox/modules/roundcube/__init__.py +++ b/freedombox/modules/roundcube/__init__.py @@ -5,13 +5,13 @@ FreedomBox app to configure Roundcube. 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages, install +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages, install from . import manifest, privileged diff --git a/freedombox/modules/roundcube/forms.py b/freedombox/modules/roundcube/forms.py index 41f560930..f659bc2d6 100644 --- a/freedombox/modules/roundcube/forms.py +++ b/freedombox/modules/roundcube/forms.py @@ -6,8 +6,8 @@ Configuration forms for roundcube. from django import forms from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.utils import format_lazy class RoundcubeForm(forms.Form): diff --git a/freedombox/modules/roundcube/privileged.py b/freedombox/modules/roundcube/privileged.py index 403e1e591..96ca197af 100644 --- a/freedombox/modules/roundcube/privileged.py +++ b/freedombox/modules/roundcube/privileged.py @@ -4,8 +4,8 @@ import pathlib import re -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged _config_file = pathlib.Path('/etc/roundcube/freedombox-config.php') _rc_db_file = pathlib.Path('/var/lib/dbconfig-common/sqlite3/' diff --git a/freedombox/modules/roundcube/tests/test_functional.py b/freedombox/modules/roundcube/tests/test_functional.py index 1737f5fc8..d2f15ce3d 100644 --- a/freedombox/modules/roundcube/tests/test_functional.py +++ b/freedombox/modules/roundcube/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for roundcube app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.apps, pytest.mark.roundcube] diff --git a/freedombox/modules/roundcube/views.py b/freedombox/modules/roundcube/views.py index 2f6a6aa1c..391c8beff 100644 --- a/freedombox/modules/roundcube/views.py +++ b/freedombox/modules/roundcube/views.py @@ -6,7 +6,7 @@ Views for roundcube. from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import RoundcubeForm diff --git a/freedombox/modules/rssbridge/__init__.py b/freedombox/modules/rssbridge/__init__.py index aefb95c95..da4d97e81 100644 --- a/freedombox/modules/rssbridge/__init__.py +++ b/freedombox/modules/rssbridge/__init__.py @@ -5,15 +5,15 @@ FreedomBox app to configure RSS-Bridge. from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/rssbridge/privileged.py b/freedombox/modules/rssbridge/privileged.py index 741326ee9..afbfcc485 100644 --- a/freedombox/modules/rssbridge/privileged.py +++ b/freedombox/modules/rssbridge/privileged.py @@ -3,8 +3,8 @@ import pathlib -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged PUBLIC_ACCESS_FILE = pathlib.Path('/etc/rss-bridge/is_public') ENABLE_LIST = pathlib.Path('/etc/rss-bridge/whitelist.txt') diff --git a/freedombox/modules/rssbridge/tests/test_functional.py b/freedombox/modules/rssbridge/tests/test_functional.py index 39931ac79..e29e94d11 100644 --- a/freedombox/modules/rssbridge/tests/test_functional.py +++ b/freedombox/modules/rssbridge/tests/test_functional.py @@ -6,7 +6,7 @@ Functional, browser based tests for RSS-Bridge app. import json import subprocess -from plinth.tests import functional +from freedombox.tests import functional class TestRSSBridgeApp(functional.BaseAppTests): diff --git a/freedombox/modules/rssbridge/views.py b/freedombox/modules/rssbridge/views.py index 3b5dc19ad..5c6c889e9 100644 --- a/freedombox/modules/rssbridge/views.py +++ b/freedombox/modules/rssbridge/views.py @@ -4,7 +4,7 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import views +from freedombox import views from . import privileged from .forms import RSSBridgeForm diff --git a/freedombox/modules/samba/__init__.py b/freedombox/modules/samba/__init__.py index f1ed37f3a..a44991b98 100644 --- a/freedombox/modules/samba/__init__.py +++ b/freedombox/modules/samba/__init__.py @@ -8,14 +8,14 @@ import socket from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/samba/manifest.py b/freedombox/modules/samba/manifest.py index 67f357b4a..41bcfa38b 100644 --- a/freedombox/modules/samba/manifest.py +++ b/freedombox/modules/samba/manifest.py @@ -5,7 +5,7 @@ Application manifest for Samba. from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': diff --git a/freedombox/modules/samba/privileged.py b/freedombox/modules/samba/privileged.py index 3e2e1d6e1..8df946d4d 100644 --- a/freedombox/modules/samba/privileged.py +++ b/freedombox/modules/samba/privileged.py @@ -7,8 +7,8 @@ import pathlib import shutil import subprocess -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged DEFAULT_FILE = '/etc/default/samba' @@ -280,7 +280,7 @@ def get_users() -> list[str]: @privileged def setup(): """Configure samba, use custom samba config file.""" - from plinth import action_utils + from freedombox import action_utils with open(CONF_PATH, 'w', encoding='utf-8') as file_handle: file_handle.write(CONF) _use_config_file(CONF_PATH) diff --git a/freedombox/modules/samba/tests/test_functional.py b/freedombox/modules/samba/tests/test_functional.py index 2e02bb878..054a6e022 100644 --- a/freedombox/modules/samba/tests/test_functional.py +++ b/freedombox/modules/samba/tests/test_functional.py @@ -10,7 +10,7 @@ import urllib import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.samba] diff --git a/freedombox/modules/samba/tests/test_views.py b/freedombox/modules/samba/tests/test_views.py index 741419ceb..93514f26d 100644 --- a/freedombox/modules/samba/tests/test_views.py +++ b/freedombox/modules/samba/tests/test_views.py @@ -11,8 +11,8 @@ import pytest from django import urls from django.contrib.messages.storage.fallback import FallbackStorage -from plinth import module_loader -from plinth.modules.samba import views +from freedombox import module_loader +from freedombox.modules.samba import views # For all tests, use plinth.urls instead of urls configured for testing pytestmark = pytest.mark.urls('plinth.urls') diff --git a/freedombox/modules/samba/views.py b/freedombox/modules/samba/views.py index 5df8f70b5..9e110c15f 100644 --- a/freedombox/modules/samba/views.py +++ b/freedombox/modules/samba/views.py @@ -12,8 +12,8 @@ from django.urls import reverse from django.utils.translation import gettext as _ from django.views.decorators.http import require_POST -from plinth import views -from plinth.modules import samba, storage +from freedombox import views +from freedombox.modules import samba, storage from . import privileged diff --git a/freedombox/modules/searx/__init__.py b/freedombox/modules/searx/__init__.py index e81e0ade9..936896d38 100644 --- a/freedombox/modules/searx/__init__.py +++ b/freedombox/modules/searx/__init__.py @@ -5,16 +5,16 @@ import os 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, RelatedDaemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.privileged import service as service_privileged +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, RelatedDaemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged from . import manifest, privileged diff --git a/freedombox/modules/searx/privileged.py b/freedombox/modules/searx/privileged.py index 16b4a3972..0e3584869 100644 --- a/freedombox/modules/searx/privileged.py +++ b/freedombox/modules/searx/privileged.py @@ -10,10 +10,10 @@ import shutil import augeas import yaml -from plinth import action_utils -from plinth.actions import privileged -from plinth.modules.searx.manifest import PUBLIC_ACCESS_SETTING_FILE -from plinth.utils import gunzip +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.modules.searx.manifest import PUBLIC_ACCESS_SETTING_FILE +from freedombox.utils import gunzip SETTINGS_FILE = '/etc/searx/settings.yml' diff --git a/freedombox/modules/searx/tests/test_functional.py b/freedombox/modules/searx/tests/test_functional.py index 3fb5a3235..0ddb10523 100644 --- a/freedombox/modules/searx/tests/test_functional.py +++ b/freedombox/modules/searx/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for searx app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.searx] diff --git a/freedombox/modules/searx/views.py b/freedombox/modules/searx/views.py index f71e3a641..afbf73e4b 100644 --- a/freedombox/modules/searx/views.py +++ b/freedombox/modules/searx/views.py @@ -4,8 +4,8 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import views -from plinth.modules import searx +from freedombox import views +from freedombox.modules import searx from . import privileged from .forms import SearxForm diff --git a/freedombox/modules/security/__init__.py b/freedombox/modules/security/__init__.py index b692f27a3..a5410c245 100644 --- a/freedombox/modules/security/__init__.py +++ b/freedombox/modules/security/__init__.py @@ -7,13 +7,13 @@ from collections import defaultdict from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import menu -from plinth.config import DropinConfigs -from plinth.daemon import Daemon, RelatedDaemon -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages -from plinth.privileged import service as service_privileged +from freedombox import app as app_module +from freedombox import menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, RelatedDaemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged from . import manifest, privileged diff --git a/freedombox/modules/security/privileged.py b/freedombox/modules/security/privileged.py index 8e34a21c9..babbb2688 100644 --- a/freedombox/modules/security/privileged.py +++ b/freedombox/modules/security/privileged.py @@ -3,7 +3,7 @@ import os -from plinth.actions import privileged +from freedombox.actions import privileged ACCESS_CONF_FILE = '/etc/security/access.d/50freedombox.conf' ACCESS_CONF_FILE_OLD = '/etc/security/access.conf' diff --git a/freedombox/modules/security/tests/test_functional.py b/freedombox/modules/security/tests/test_functional.py index c98ae056a..468a8d60b 100644 --- a/freedombox/modules/security/tests/test_functional.py +++ b/freedombox/modules/security/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for security app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.security] diff --git a/freedombox/modules/security/views.py b/freedombox/modules/security/views.py index 32ae91f87..6602514cd 100644 --- a/freedombox/modules/security/views.py +++ b/freedombox/modules/security/views.py @@ -5,11 +5,11 @@ from django.contrib import messages from django.template.response import TemplateResponse from django.utils.translation import gettext as _ -from plinth import action_utils -from plinth.modules import security -from plinth.modules.upgrades import is_backports_requested -from plinth.privileged import service as service_privileged -from plinth.views import AppView +from freedombox import action_utils +from freedombox.modules import security +from freedombox.modules.upgrades import is_backports_requested +from freedombox.privileged import service as service_privileged +from freedombox.views import AppView from .forms import SecurityForm diff --git a/freedombox/modules/shaarli/__init__.py b/freedombox/modules/shaarli/__init__.py index c26d61596..4bea84ad2 100644 --- a/freedombox/modules/shaarli/__init__.py +++ b/freedombox/modules/shaarli/__init__.py @@ -5,12 +5,12 @@ FreedomBox app to configure Shaarli. from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import frontpage, menu +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages from . import manifest diff --git a/freedombox/modules/shaarli/manifest.py b/freedombox/modules/shaarli/manifest.py index 6e34a337a..95cf51f57 100644 --- a/freedombox/modules/shaarli/manifest.py +++ b/freedombox/modules/shaarli/manifest.py @@ -5,7 +5,7 @@ Application manifest for Shaarli. from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': diff --git a/freedombox/modules/shaarli/tests/test_functional.py b/freedombox/modules/shaarli/tests/test_functional.py index b756a8bf9..771e4ba17 100644 --- a/freedombox/modules/shaarli/tests/test_functional.py +++ b/freedombox/modules/shaarli/tests/test_functional.py @@ -7,7 +7,7 @@ import time import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.shaarli] diff --git a/freedombox/modules/shaarli/urls.py b/freedombox/modules/shaarli/urls.py index 4aa82a258..a80df9fd3 100644 --- a/freedombox/modules/shaarli/urls.py +++ b/freedombox/modules/shaarli/urls.py @@ -5,7 +5,7 @@ URLs for the Shaarli module. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^apps/shaarli/$', AppView.as_view(app_id='shaarli'), diff --git a/freedombox/modules/shadowsocks/__init__.py b/freedombox/modules/shadowsocks/__init__.py index e08819ed8..b6e7c278f 100644 --- a/freedombox/modules/shadowsocks/__init__.py +++ b/freedombox/modules/shadowsocks/__init__.py @@ -4,13 +4,13 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/shadowsocks/forms.py b/freedombox/modules/shadowsocks/forms.py index 076864889..983cb41ae 100644 --- a/freedombox/modules/shadowsocks/forms.py +++ b/freedombox/modules/shadowsocks/forms.py @@ -4,7 +4,7 @@ from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.modules.shadowsocksserver.forms import METHODS +from freedombox.modules.shadowsocksserver.forms import METHODS class TrimmedCharField(forms.CharField): diff --git a/freedombox/modules/shadowsocks/privileged.py b/freedombox/modules/shadowsocks/privileged.py index 97b38d112..84fdb1bd7 100644 --- a/freedombox/modules/shadowsocks/privileged.py +++ b/freedombox/modules/shadowsocks/privileged.py @@ -8,8 +8,8 @@ import random import string from shutil import move -from plinth import action_utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils +from freedombox.actions import privileged, secret_str SHADOWSOCKS_CONFIG_SYMLINK = '/etc/shadowsocks-libev/freedombox.json' SHADOWSOCKS_CONFIG_ACTUAL = \ @@ -57,7 +57,7 @@ def setup(): if not wrong_state_dir.is_symlink() and wrong_state_dir.is_dir(): wrong_state_dir.rmdir() - from plinth.modules.shadowsocks import ShadowsocksApp + from freedombox.modules.shadowsocks import ShadowsocksApp if action_utils.service_is_enabled(ShadowsocksApp.DAEMON): action_utils.service_restart(ShadowsocksApp.DAEMON) diff --git a/freedombox/modules/shadowsocks/tests/test_functional.py b/freedombox/modules/shadowsocks/tests/test_functional.py index 14a50d6f8..0d3369424 100644 --- a/freedombox/modules/shadowsocks/tests/test_functional.py +++ b/freedombox/modules/shadowsocks/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for Shadowsocks Client app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.shadowsocks] diff --git a/freedombox/modules/shadowsocks/views.py b/freedombox/modules/shadowsocks/views.py index e9c41b833..69e92b498 100644 --- a/freedombox/modules/shadowsocks/views.py +++ b/freedombox/modules/shadowsocks/views.py @@ -4,7 +4,7 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth import views +from freedombox import views from . import privileged from .forms import ShadowsocksForm diff --git a/freedombox/modules/shadowsocksserver/__init__.py b/freedombox/modules/shadowsocksserver/__init__.py index 49df83ee4..8500deb50 100644 --- a/freedombox/modules/shadowsocksserver/__init__.py +++ b/freedombox/modules/shadowsocksserver/__init__.py @@ -4,13 +4,13 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/shadowsocksserver/forms.py b/freedombox/modules/shadowsocksserver/forms.py index e4c993850..26e26dfe2 100644 --- a/freedombox/modules/shadowsocksserver/forms.py +++ b/freedombox/modules/shadowsocksserver/forms.py @@ -4,7 +4,7 @@ from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.utils import format_lazy +from freedombox.utils import format_lazy METHODS = [('chacha20-ietf-poly1305', format_lazy('chacha20-ietf-poly1305 ({})', _('Recommended'))), diff --git a/freedombox/modules/shadowsocksserver/privileged.py b/freedombox/modules/shadowsocksserver/privileged.py index 45406a8fc..0ab383549 100644 --- a/freedombox/modules/shadowsocksserver/privileged.py +++ b/freedombox/modules/shadowsocksserver/privileged.py @@ -7,8 +7,8 @@ import pathlib import random import string -from plinth import action_utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils +from freedombox.actions import privileged, secret_str SHADOWSOCKS_CONFIG_SYMLINK = '/etc/shadowsocks-libev/fbxserver.json' SHADOWSOCKS_CONFIG_ACTUAL = \ @@ -40,7 +40,7 @@ def setup(): } _merge_config(initial_config) - from plinth.modules.shadowsocksserver import ShadowsocksServerApp + from freedombox.modules.shadowsocksserver import ShadowsocksServerApp if action_utils.service_is_enabled(ShadowsocksServerApp.DAEMON): action_utils.service_restart(ShadowsocksServerApp.DAEMON) diff --git a/freedombox/modules/shadowsocksserver/tests/test_functional.py b/freedombox/modules/shadowsocksserver/tests/test_functional.py index 02e302d37..546013ec6 100644 --- a/freedombox/modules/shadowsocksserver/tests/test_functional.py +++ b/freedombox/modules/shadowsocksserver/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for Shadowsocks Server app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.shadowsocksserver] diff --git a/freedombox/modules/shadowsocksserver/views.py b/freedombox/modules/shadowsocksserver/views.py index 2166c9825..6d987b0c8 100644 --- a/freedombox/modules/shadowsocksserver/views.py +++ b/freedombox/modules/shadowsocksserver/views.py @@ -7,7 +7,7 @@ import string from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth import views +from freedombox import views from . import privileged from .forms import ShadowsocksServerForm diff --git a/freedombox/modules/sharing/__init__.py b/freedombox/modules/sharing/__init__.py index 5161f84b1..6122406eb 100644 --- a/freedombox/modules/sharing/__init__.py +++ b/freedombox/modules/sharing/__init__.py @@ -3,12 +3,12 @@ from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, menu -from plinth.config import DropinConfigs -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/sharing/forms.py b/freedombox/modules/sharing/forms.py index 1416a0e27..b820d5ebb 100644 --- a/freedombox/modules/sharing/forms.py +++ b/freedombox/modules/sharing/forms.py @@ -5,7 +5,7 @@ from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ -from plinth.modules.users.components import UsersAndGroups +from freedombox.modules.users.components import UsersAndGroups from . import privileged diff --git a/freedombox/modules/sharing/privileged.py b/freedombox/modules/sharing/privileged.py index 1a9462199..66ffc8db4 100644 --- a/freedombox/modules/sharing/privileged.py +++ b/freedombox/modules/sharing/privileged.py @@ -7,8 +7,8 @@ import re import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged APACHE_CONFIGURATION = '/etc/apache2/conf-available/sharing-freedombox.conf' diff --git a/freedombox/modules/sharing/tests/test_functional.py b/freedombox/modules/sharing/tests/test_functional.py index 77aab943b..87183867e 100644 --- a/freedombox/modules/sharing/tests/test_functional.py +++ b/freedombox/modules/sharing/tests/test_functional.py @@ -6,7 +6,7 @@ Functional, browser based tests for sharing app. import pytest import splinter -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.sharing] diff --git a/freedombox/modules/sharing/views.py b/freedombox/modules/sharing/views.py index 28d75deff..eb3fd4839 100644 --- a/freedombox/modules/sharing/views.py +++ b/freedombox/modules/sharing/views.py @@ -10,7 +10,7 @@ from django.utils.translation import gettext_lazy as _ from django.views.decorators.http import require_POST from django.views.generic import FormView -from plinth.views import AppView +from freedombox.views import AppView from . import privileged from .forms import AddShareForm diff --git a/freedombox/modules/snapshot/__init__.py b/freedombox/modules/snapshot/__init__.py index 7dca6336a..aaba0dd02 100644 --- a/freedombox/modules/snapshot/__init__.py +++ b/freedombox/modules/snapshot/__init__.py @@ -6,11 +6,11 @@ import pathlib import augeas from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import menu -from plinth.modules import storage -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import menu +from freedombox.modules import storage +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages from . import manifest, privileged diff --git a/freedombox/modules/snapshot/privileged.py b/freedombox/modules/snapshot/privileged.py index f899b86ee..a0cd14c30 100644 --- a/freedombox/modules/snapshot/privileged.py +++ b/freedombox/modules/snapshot/privileged.py @@ -8,8 +8,8 @@ import signal import augeas import dbus -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged FSTAB = '/etc/fstab' DEFAULT_FILE = '/etc/default/snapper' diff --git a/freedombox/modules/snapshot/tests/test_functional.py b/freedombox/modules/snapshot/tests/test_functional.py index 88664a3b8..1115fa82e 100644 --- a/freedombox/modules/snapshot/tests/test_functional.py +++ b/freedombox/modules/snapshot/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for snapshot app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.snapshot] diff --git a/freedombox/modules/snapshot/tests/test_privileged.py b/freedombox/modules/snapshot/tests/test_privileged.py index fafbd3eb9..68d4d98e9 100644 --- a/freedombox/modules/snapshot/tests/test_privileged.py +++ b/freedombox/modules/snapshot/tests/test_privileged.py @@ -7,7 +7,7 @@ import pathlib import pytest -from plinth.modules.snapshot import privileged +from freedombox.modules.snapshot import privileged systemctl_path = pathlib.Path('/usr/bin/systemctl') systemd_installed = pytest.mark.skipif(not systemctl_path.exists(), diff --git a/freedombox/modules/snapshot/views.py b/freedombox/modules/snapshot/views.py index 55581c5a0..d8e894b33 100644 --- a/freedombox/modules/snapshot/views.py +++ b/freedombox/modules/snapshot/views.py @@ -11,10 +11,10 @@ from django.urls import reverse, reverse_lazy from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy -from plinth import app as app_module -from plinth.modules import snapshot as snapshot_module -from plinth.modules import storage -from plinth.views import AppView, messages_error +from freedombox import app as app_module +from freedombox.modules import snapshot as snapshot_module +from freedombox.modules import storage +from freedombox.views import AppView, messages_error from . import get_configuration, privileged from .forms import SnapshotForm diff --git a/freedombox/modules/sogo/__init__.py b/freedombox/modules/sogo/__init__.py index ba4935ad5..79ea4468b 100644 --- a/freedombox/modules/sogo/__init__.py +++ b/freedombox/modules/sogo/__init__.py @@ -4,16 +4,16 @@ from django.urls import reverse_lazy 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, SharedDaemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, SharedDaemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/sogo/forms.py b/freedombox/modules/sogo/forms.py index dadfb4d75..15f874131 100644 --- a/freedombox/modules/sogo/forms.py +++ b/freedombox/modules/sogo/forms.py @@ -4,7 +4,7 @@ from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.modules.names.components import DomainName +from freedombox.modules.names.components import DomainName def _get_domain_choices(): diff --git a/freedombox/modules/sogo/manifest.py b/freedombox/modules/sogo/manifest.py index 9e1e0a0c6..346899343 100644 --- a/freedombox/modules/sogo/manifest.py +++ b/freedombox/modules/sogo/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url from . import privileged diff --git a/freedombox/modules/sogo/privileged.py b/freedombox/modules/sogo/privileged.py index 5e22cee61..80c639450 100644 --- a/freedombox/modules/sogo/privileged.py +++ b/freedombox/modules/sogo/privileged.py @@ -6,10 +6,10 @@ import re import shutil import tempfile -from plinth import action_utils, utils -from plinth.actions import privileged -from plinth.db import postgres -from plinth.modules.email.privileged.domain import \ +from freedombox import action_utils, utils +from freedombox.actions import privileged +from freedombox.db import postgres +from freedombox.modules.email.privileged.domain import \ get_domains as get_email_domains DB_HOST = 'localhost' diff --git a/freedombox/modules/sogo/tests/test_functional.py b/freedombox/modules/sogo/tests/test_functional.py index 03fdd3436..10612b62a 100644 --- a/freedombox/modules/sogo/tests/test_functional.py +++ b/freedombox/modules/sogo/tests/test_functional.py @@ -5,7 +5,7 @@ import time import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.sogo] diff --git a/freedombox/modules/sogo/views.py b/freedombox/modules/sogo/views.py index 34feb45fa..455e114a7 100644 --- a/freedombox/modules/sogo/views.py +++ b/freedombox/modules/sogo/views.py @@ -4,8 +4,8 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.privileged import service as service_privileged -from plinth.views import AppView +from freedombox.privileged import service as service_privileged +from freedombox.views import AppView from . import forms, privileged diff --git a/freedombox/modules/ssh/__init__.py b/freedombox/modules/ssh/__init__.py index be0e7a52a..c57ce0bf8 100644 --- a/freedombox/modules/ssh/__init__.py +++ b/freedombox/modules/ssh/__init__.py @@ -8,14 +8,14 @@ import subprocess from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import menu -from plinth.config import DropinConfigs -from plinth.daemon import Daemon -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages +from freedombox import app as app_module +from freedombox import menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages from . import manifest, privileged diff --git a/freedombox/modules/ssh/privileged.py b/freedombox/modules/ssh/privileged.py index 7cb0a07f5..583a7ea1f 100644 --- a/freedombox/modules/ssh/privileged.py +++ b/freedombox/modules/ssh/privileged.py @@ -10,8 +10,8 @@ import stat import augeas -from plinth import action_utils, utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils, utils +from freedombox.actions import privileged, secret_str config_file = pathlib.Path('/etc/ssh/sshd_config.d/freedombox.conf') diff --git a/freedombox/modules/ssh/tests/test_functional.py b/freedombox/modules/ssh/tests/test_functional.py index 5c7e051bf..459f77cfa 100644 --- a/freedombox/modules/ssh/tests/test_functional.py +++ b/freedombox/modules/ssh/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for ssh app. import pytest -from plinth.tests.functional import BaseAppTests +from freedombox.tests.functional import BaseAppTests pytestmark = [pytest.mark.system, pytest.mark.ssh] diff --git a/freedombox/modules/ssh/urls.py b/freedombox/modules/ssh/urls.py index 49032a6bf..30d9ddf99 100644 --- a/freedombox/modules/ssh/urls.py +++ b/freedombox/modules/ssh/urls.py @@ -5,7 +5,7 @@ URLs for the Secure Shell Server module. from django.urls import re_path -from plinth.modules.ssh.views import SshAppView +from freedombox.modules.ssh.views import SshAppView urlpatterns = [ re_path(r'^sys/ssh/$', SshAppView.as_view(), name='index'), diff --git a/freedombox/modules/ssh/views.py b/freedombox/modules/ssh/views.py index 844779e41..0ef434ba4 100644 --- a/freedombox/modules/ssh/views.py +++ b/freedombox/modules/ssh/views.py @@ -4,9 +4,9 @@ from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth.modules import ssh -from plinth.privileged import service as service_privileged -from plinth.views import AppView +from freedombox.modules import ssh +from freedombox.privileged import service as service_privileged +from freedombox.views import AppView from . import privileged from .forms import SSHServerForm diff --git a/freedombox/modules/storage/__init__.py b/freedombox/modules/storage/__init__.py index 526049146..6cdd90b08 100644 --- a/freedombox/modules/storage/__init__.py +++ b/freedombox/modules/storage/__init__.py @@ -9,13 +9,13 @@ import psutil from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import cfg, glib, menu -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.errors import PlinthError -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, glib, menu +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.errors import PlinthError +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged, udisks2 @@ -288,7 +288,7 @@ def get_error_message(error): def warn_about_low_disk_space(_data): """Warn about insufficient space on root partition.""" - from plinth.notification import Notification + from freedombox.notification import Notification try: root_info = get_mount_info('/') @@ -340,7 +340,7 @@ def report_failing_drive(id, is_failing): notification_id = 'storage-disk-failure-' + base64.b32encode( id.encode()).decode() - from plinth.notification import Notification + from freedombox.notification import Notification title = gettext_noop('Disk failure imminent') message = gettext_noop( 'Disk {id} is reporting that it is likely to fail in the near future. ' @@ -372,7 +372,7 @@ def _warn_about_read_only_filesystem(_data): Remove the notification (if any) if the root filesystem is writable. """ - from plinth.notification import Notification + from freedombox.notification import Notification show = is_partition_read_only() notification_id = 'storage-read-only-root-filesystem' diff --git a/freedombox/modules/storage/forms.py b/freedombox/modules/storage/forms.py index 5fff0ad26..6504cc87b 100644 --- a/freedombox/modules/storage/forms.py +++ b/freedombox/modules/storage/forms.py @@ -7,9 +7,9 @@ from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth.modules import storage -from plinth.modules.samba import privileged as samba_privileged +from freedombox import app as app_module +from freedombox.modules import storage +from freedombox.modules.samba import privileged as samba_privileged from . import privileged diff --git a/freedombox/modules/storage/privileged.py b/freedombox/modules/storage/privileged.py index 04f4e10d1..719b34a1b 100644 --- a/freedombox/modules/storage/privileged.py +++ b/freedombox/modules/storage/privileged.py @@ -6,8 +6,8 @@ import re import stat import subprocess -from plinth import action_utils, utils -from plinth.actions import privileged +from freedombox import action_utils, utils +from freedombox.actions import privileged @privileged diff --git a/freedombox/modules/storage/tests/test_functional.py b/freedombox/modules/storage/tests/test_functional.py index d0dd20bfb..788094b2f 100644 --- a/freedombox/modules/storage/tests/test_functional.py +++ b/freedombox/modules/storage/tests/test_functional.py @@ -4,7 +4,7 @@ Functional, browser based tests for storage app. """ import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.storage] diff --git a/freedombox/modules/storage/tests/test_storage.py b/freedombox/modules/storage/tests/test_storage.py index 2b6f01e8a..ae1f5d56d 100644 --- a/freedombox/modules/storage/tests/test_storage.py +++ b/freedombox/modules/storage/tests/test_storage.py @@ -14,9 +14,9 @@ import psutil import pytest from django.utils.translation import gettext_noop -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules import storage -from plinth.modules.storage import privileged +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules import storage +from freedombox.modules.storage import privileged def _is_container(): diff --git a/freedombox/modules/storage/udisks2.py b/freedombox/modules/storage/udisks2.py index 6b5f2d704..a1abfbb87 100644 --- a/freedombox/modules/storage/udisks2.py +++ b/freedombox/modules/storage/udisks2.py @@ -5,8 +5,8 @@ import logging import threading from typing import Any -from plinth import cfg -from plinth.utils import import_from_gi +from freedombox import cfg +from freedombox.utils import import_from_gi from . import privileged diff --git a/freedombox/modules/storage/views.py b/freedombox/modules/storage/views.py index 8a05cdf52..4b198317d 100644 --- a/freedombox/modules/storage/views.py +++ b/freedombox/modules/storage/views.py @@ -11,8 +11,8 @@ from django.urls import reverse from django.utils.translation import gettext as _ from django.views.decorators.http import require_POST -from plinth import views -from plinth.modules import storage +from freedombox import views +from freedombox.modules import storage from . import privileged diff --git a/freedombox/modules/syncthing/__init__.py b/freedombox/modules/syncthing/__init__.py index 57a789d83..bcbc05e9d 100644 --- a/freedombox/modules/syncthing/__init__.py +++ b/freedombox/modules/syncthing/__init__.py @@ -3,19 +3,19 @@ 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.modules.users import add_user_to_share_group -from plinth.modules.users import privileged as users_privileged -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.modules.users import add_user_to_share_group +from freedombox.modules.users import privileged as users_privileged +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged @@ -136,7 +136,7 @@ class SyncthingApp(app_module.App): Group.objects.filter(name=old_groupname).update(name=new_groupname) # update web shares to have new group name - from plinth.modules import sharing + from freedombox.modules import sharing shares = sharing.list_shares() for share in shares: if old_groupname in share['groups']: diff --git a/freedombox/modules/syncthing/manifest.py b/freedombox/modules/syncthing/manifest.py index a04487165..9155263aa 100644 --- a/freedombox/modules/syncthing/manifest.py +++ b/freedombox/modules/syncthing/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _package_id = 'com.github.catfriend1.syncthingandroid' _download_url = 'https://syncthing.net/' diff --git a/freedombox/modules/syncthing/privileged.py b/freedombox/modules/syncthing/privileged.py index 0fa6bbd67..4b328b86c 100644 --- a/freedombox/modules/syncthing/privileged.py +++ b/freedombox/modules/syncthing/privileged.py @@ -7,8 +7,8 @@ import time import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged DATA_DIR = '/var/lib/syncthing' # legacy configuration file diff --git a/freedombox/modules/syncthing/tests/test_functional.py b/freedombox/modules/syncthing/tests/test_functional.py index 561638245..e62943d5e 100644 --- a/freedombox/modules/syncthing/tests/test_functional.py +++ b/freedombox/modules/syncthing/tests/test_functional.py @@ -7,7 +7,7 @@ import time import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.syncthing] diff --git a/freedombox/modules/syncthing/urls.py b/freedombox/modules/syncthing/urls.py index 178a244c7..1ae23bf02 100644 --- a/freedombox/modules/syncthing/urls.py +++ b/freedombox/modules/syncthing/urls.py @@ -5,7 +5,7 @@ URLs for the Syncthing module. from django.urls import re_path -from plinth.views import AppView +from freedombox.views import AppView urlpatterns = [ re_path(r'^apps/syncthing/$', AppView.as_view(app_id='syncthing'), diff --git a/freedombox/modules/tiddlywiki/__init__.py b/freedombox/modules/tiddlywiki/__init__.py index e4de62ffd..b248aacb0 100644 --- a/freedombox/modules/tiddlywiki/__init__.py +++ b/freedombox/modules/tiddlywiki/__init__.py @@ -9,14 +9,14 @@ This app doesn't install any Debian packages. from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/tiddlywiki/privileged.py b/freedombox/modules/tiddlywiki/privileged.py index 7ea875f72..2bbf2b04b 100644 --- a/freedombox/modules/tiddlywiki/privileged.py +++ b/freedombox/modules/tiddlywiki/privileged.py @@ -6,8 +6,8 @@ import re import shutil import urllib.request -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged EMPTY_WIKI_FILE = 'https://ftp.freedombox.org/pub/tiddlywiki/empty.html' diff --git a/freedombox/modules/tiddlywiki/tests/test_functional.py b/freedombox/modules/tiddlywiki/tests/test_functional.py index a8c222ade..abf1bf819 100644 --- a/freedombox/modules/tiddlywiki/tests/test_functional.py +++ b/freedombox/modules/tiddlywiki/tests/test_functional.py @@ -5,7 +5,7 @@ import pathlib import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.tiddlywiki] diff --git a/freedombox/modules/tiddlywiki/views.py b/freedombox/modules/tiddlywiki/views.py index e27d44439..52e27ce3a 100644 --- a/freedombox/modules/tiddlywiki/views.py +++ b/freedombox/modules/tiddlywiki/views.py @@ -9,10 +9,10 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView -from plinth import app as app_module -from plinth import views -from plinth.modules import tiddlywiki -from plinth.views import messages_error +from freedombox import app as app_module +from freedombox import views +from freedombox.modules import tiddlywiki +from freedombox.views import messages_error from . import privileged from .forms import CreateWikiForm, RenameWikiForm, UploadWikiForm diff --git a/freedombox/modules/tor/__init__.py b/freedombox/modules/tor/__init__.py index 980488f51..9353be3c1 100644 --- a/freedombox/modules/tor/__init__.py +++ b/freedombox/modules/tor/__init__.py @@ -7,24 +7,24 @@ import logging from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import action_utils -from plinth import app as app_module -from plinth import cfg, kvstore, menu -from plinth import setup as setup_module_ # Not setup_module, for pytest -from plinth.daemon import (Daemon, app_is_running, diagnose_netcat, - diagnose_port_listening) -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules import torproxy -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.names.components import DomainType -from plinth.modules.torproxy.utils import is_apt_transport_tor_enabled -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.signals import domain_added, domain_removed -from plinth.utils import format_lazy +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg, kvstore, menu +from freedombox import setup as setup_module_ # Not setup_module, for pytest +from freedombox.daemon import (Daemon, app_is_running, diagnose_netcat, + diagnose_port_listening) +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules import torproxy +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.names.components import DomainType +from freedombox.modules.torproxy.utils import is_apt_transport_tor_enabled +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.signals import domain_added, domain_removed +from freedombox.utils import format_lazy from . import manifest, privileged, utils diff --git a/freedombox/modules/tor/forms.py b/freedombox/modules/tor/forms.py index d09684064..1d8299805 100644 --- a/freedombox/modules/tor/forms.py +++ b/freedombox/modules/tor/forms.py @@ -11,8 +11,8 @@ from django.core.validators import validate_ipv46_address from django.forms import widgets from django.utils.translation import gettext_lazy as _ -from plinth import cfg -from plinth.utils import format_lazy +from freedombox import cfg +from freedombox.utils import format_lazy class TrimmedCharField(forms.CharField): diff --git a/freedombox/modules/tor/manifest.py b/freedombox/modules/tor/manifest.py index 93f70fc8b..78ca7bf49 100644 --- a/freedombox/modules/tor/manifest.py +++ b/freedombox/modules/tor/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url from . import privileged diff --git a/freedombox/modules/tor/privileged.py b/freedombox/modules/tor/privileged.py index 230b00aac..e2efe6ee4 100644 --- a/freedombox/modules/tor/privileged.py +++ b/freedombox/modules/tor/privileged.py @@ -13,8 +13,8 @@ from typing import Any import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged INSTANCE_NAME = 'plinth' SERVICE_FILE = '/etc/firewalld/services/tor-{0}.xml' diff --git a/freedombox/modules/tor/tests/test_functional.py b/freedombox/modules/tor/tests/test_functional.py index 6ab77831c..43bb463e3 100644 --- a/freedombox/modules/tor/tests/test_functional.py +++ b/freedombox/modules/tor/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for tor app. import pytest -from plinth.tests import functional +from freedombox.tests import functional _TOR_FEATURE_TO_ELEMENT = { 'relay': 'tor-relay_enabled', diff --git a/freedombox/modules/tor/tests/test_tor.py b/freedombox/modules/tor/tests/test_tor.py index 260672728..5ee595f43 100644 --- a/freedombox/modules/tor/tests/test_tor.py +++ b/freedombox/modules/tor/tests/test_tor.py @@ -8,7 +8,7 @@ from unittest.mock import patch import pytest from django.core.exceptions import ValidationError -from plinth.modules.tor import forms, utils +from freedombox.modules.tor import forms, utils @patch('plinth.app.App.get') diff --git a/freedombox/modules/tor/utils.py b/freedombox/modules/tor/utils.py index 0f16251e7..625be99d5 100644 --- a/freedombox/modules/tor/utils.py +++ b/freedombox/modules/tor/utils.py @@ -1,9 +1,9 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """Tor utility functions.""" -from plinth import app as app_module -from plinth.daemon import app_is_running -from plinth.modules.names.components import DomainName +from freedombox import app as app_module +from freedombox.daemon import app_is_running +from freedombox.modules.names.components import DomainName from . import privileged diff --git a/freedombox/modules/tor/views.py b/freedombox/modules/tor/views.py index f5ca2e01d..a636247c8 100644 --- a/freedombox/modules/tor/views.py +++ b/freedombox/modules/tor/views.py @@ -6,10 +6,10 @@ import logging from django.utils.translation import gettext_noop from django.views.generic.edit import FormView -from plinth import app as app_module -from plinth import operation as operation_module -from plinth.modules import tor -from plinth.views import AppView +from freedombox import app as app_module +from freedombox import operation as operation_module +from freedombox.modules import tor +from freedombox.views import AppView from . import privileged from . import utils as tor_utils diff --git a/freedombox/modules/torproxy/__init__.py b/freedombox/modules/torproxy/__init__.py index 53ca2aaf7..9768cea30 100644 --- a/freedombox/modules/torproxy/__init__.py +++ b/freedombox/modules/torproxy/__init__.py @@ -8,17 +8,17 @@ from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import app as app_module -from plinth import cfg, frontpage, kvstore, menu -from plinth.daemon import Daemon -from plinth.diagnostic_check import DiagnosticCheck -from plinth.modules.apache.components import diagnose_url -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, kvstore, menu +from freedombox.daemon import Daemon +from freedombox.diagnostic_check import DiagnosticCheck +from freedombox.modules.apache.components import diagnose_url +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/torproxy/forms.py b/freedombox/modules/torproxy/forms.py index 1f70e212f..62ec373c6 100644 --- a/freedombox/modules/torproxy/forms.py +++ b/freedombox/modules/torproxy/forms.py @@ -6,7 +6,7 @@ Forms for configuring Tor Proxy. from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.modules.tor.forms import TorCommonForm +from freedombox.modules.tor.forms import TorCommonForm class TorProxyForm(TorCommonForm): diff --git a/freedombox/modules/torproxy/manifest.py b/freedombox/modules/torproxy/manifest.py index 7d51fee96..61355fd62 100644 --- a/freedombox/modules/torproxy/manifest.py +++ b/freedombox/modules/torproxy/manifest.py @@ -3,7 +3,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _ORBOT_PACKAGE_ID = 'org.torproject.android' _TOR_BROWSER_DOWNLOAD_URL = \ diff --git a/freedombox/modules/torproxy/privileged.py b/freedombox/modules/torproxy/privileged.py index 056b32316..58da19f3d 100644 --- a/freedombox/modules/torproxy/privileged.py +++ b/freedombox/modules/torproxy/privileged.py @@ -8,10 +8,10 @@ from typing import Any import augeas -from plinth import action_utils -from plinth.actions import privileged -from plinth.modules.torproxy.utils import (APT_TOR_PREFIX, get_augeas, - iter_apt_uris) +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.modules.torproxy.utils import (APT_TOR_PREFIX, get_augeas, + iter_apt_uris) logger = logging.getLogger(__name__) diff --git a/freedombox/modules/torproxy/tests/test_functional.py b/freedombox/modules/torproxy/tests/test_functional.py index 12e91af65..68dfbca70 100644 --- a/freedombox/modules/torproxy/tests/test_functional.py +++ b/freedombox/modules/torproxy/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for Tor Proxy app. import pytest -from plinth.tests import functional +from freedombox.tests import functional _TOR_FEATURE_TO_ELEMENT = {'software': 'torproxy-apt_transport_tor_enabled'} diff --git a/freedombox/modules/torproxy/tests/test_torproxy.py b/freedombox/modules/torproxy/tests/test_torproxy.py index 8bd2970d5..0c9e42947 100644 --- a/freedombox/modules/torproxy/tests/test_torproxy.py +++ b/freedombox/modules/torproxy/tests/test_torproxy.py @@ -7,7 +7,7 @@ from unittest.mock import patch import pytest -from plinth.modules.torproxy import utils +from freedombox.modules.torproxy import utils class TestTorProxy: diff --git a/freedombox/modules/torproxy/utils.py b/freedombox/modules/torproxy/utils.py index 9a582625a..8e6ddf928 100644 --- a/freedombox/modules/torproxy/utils.py +++ b/freedombox/modules/torproxy/utils.py @@ -5,8 +5,8 @@ import itertools import augeas -from plinth import app as app_module -from plinth.daemon import app_is_running +from freedombox import app as app_module +from freedombox.daemon import app_is_running from . import privileged diff --git a/freedombox/modules/torproxy/views.py b/freedombox/modules/torproxy/views.py index 31fca07dc..1181fe19b 100644 --- a/freedombox/modules/torproxy/views.py +++ b/freedombox/modules/torproxy/views.py @@ -6,9 +6,9 @@ import logging from django.utils.translation import gettext_noop from django.views.generic.edit import FormView -from plinth import app as app_module -from plinth import operation as operation_module -from plinth.views import AppView +from freedombox import app as app_module +from freedombox import operation as operation_module +from freedombox.views import AppView from . import privileged from . import utils as tor_utils diff --git a/freedombox/modules/transmission/__init__.py b/freedombox/modules/transmission/__init__.py index 5c31c6ed7..a3b688626 100644 --- a/freedombox/modules/transmission/__init__.py +++ b/freedombox/modules/transmission/__init__.py @@ -6,18 +6,18 @@ FreedomBox app to configure Transmission server. from django.urls import reverse_lazy 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.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import (Firewall, - FirewallLocalProtection) -from plinth.modules.users import add_user_to_share_group -from plinth.modules.users.components import UsersAndGroups -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import (Firewall, + FirewallLocalProtection) +from freedombox.modules.users import add_user_to_share_group +from freedombox.modules.users.components import UsersAndGroups +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/transmission/forms.py b/freedombox/modules/transmission/forms.py index 5fcf869b4..8d739fcde 100644 --- a/freedombox/modules/transmission/forms.py +++ b/freedombox/modules/transmission/forms.py @@ -5,8 +5,8 @@ FreedomBox app for configuring Transmission. from django.utils.translation import gettext_lazy as _ -from plinth.modules.storage.forms import (DirectorySelectForm, - DirectoryValidator) +from freedombox.modules.storage.forms import (DirectorySelectForm, + DirectoryValidator) from . import SYSTEM_USER diff --git a/freedombox/modules/transmission/manifest.py b/freedombox/modules/transmission/manifest.py index 76e960db3..18ac9cbd0 100644 --- a/freedombox/modules/transmission/manifest.py +++ b/freedombox/modules/transmission/manifest.py @@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url clients = [{ 'name': _('Transmission'), diff --git a/freedombox/modules/transmission/privileged.py b/freedombox/modules/transmission/privileged.py index fbadd312a..3f4d9cfb5 100644 --- a/freedombox/modules/transmission/privileged.py +++ b/freedombox/modules/transmission/privileged.py @@ -6,8 +6,8 @@ Configuration helper for Transmission daemon. import json import pathlib -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged _transmission_config = pathlib.Path('/etc/transmission-daemon/settings.json') diff --git a/freedombox/modules/transmission/tests/test_functional.py b/freedombox/modules/transmission/tests/test_functional.py index 6ef88f7ae..526c46f27 100644 --- a/freedombox/modules/transmission/tests/test_functional.py +++ b/freedombox/modules/transmission/tests/test_functional.py @@ -8,7 +8,7 @@ import os import pytest from splinter.exceptions import ElementDoesNotExist -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.transmission] diff --git a/freedombox/modules/transmission/views.py b/freedombox/modules/transmission/views.py index 8f0561c53..255e90df2 100644 --- a/freedombox/modules/transmission/views.py +++ b/freedombox/modules/transmission/views.py @@ -9,7 +9,7 @@ import socket from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import views +from freedombox import views from . import get_download_dir, privileged from .forms import TransmissionForm diff --git a/freedombox/modules/upgrades/__init__.py b/freedombox/modules/upgrades/__init__.py index 101d71c95..d15be4268 100644 --- a/freedombox/modules/upgrades/__init__.py +++ b/freedombox/modules/upgrades/__init__.py @@ -11,14 +11,14 @@ from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop import plinth -from plinth import action_utils -from plinth import app as app_module -from plinth import cfg, glib, kvstore, menu, package -from plinth.config import DropinConfigs -from plinth.daemon import RelatedDaemon -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.modules.backups.components import BackupRestore -from plinth.package import Packages +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg, glib, kvstore, menu, package +from freedombox.config import DropinConfigs +from freedombox.daemon import RelatedDaemon +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.modules.backups.components import BackupRestore +from freedombox.package import Packages from . import distupgrade, manifest, privileged, utils @@ -108,7 +108,7 @@ class UpgradesApp(app_module.App): def _show_new_release_notification(self): """When upgraded to new release, show a notification.""" - from plinth.notification import Notification + from freedombox.notification import Notification try: note = Notification.get('upgrades-new-release') if note.data['version'] == plinth.__version__: @@ -137,7 +137,7 @@ class UpgradesApp(app_module.App): def _show_first_manual_update_notification(self): """After first setup, show notification to manually run updates.""" - from plinth.notification import Notification + from freedombox.notification import Notification title = gettext_noop('Run software update manually') message = gettext_noop( 'Automatic software update runs daily by default. For the first ' @@ -250,7 +250,7 @@ def dist_upgrade_show_notification(status: dict, starting: bool): days before next distribution upgrade. If user dismisses the notification, don't show it again. """ - from plinth.notification import Notification + from freedombox.notification import Notification try: note = Notification.get('upgrades-dist-upgrade') diff --git a/freedombox/modules/upgrades/distupgrade.py b/freedombox/modules/upgrades/distupgrade.py index fbc689e4a..059dada06 100644 --- a/freedombox/modules/upgrades/distupgrade.py +++ b/freedombox/modules/upgrades/distupgrade.py @@ -10,8 +10,8 @@ from typing import Generator import augeas -from plinth import action_utils -from plinth.modules import snapshot as snapshot_module +from freedombox import action_utils +from freedombox.modules import snapshot as snapshot_module from . import utils @@ -128,7 +128,7 @@ def get_status() -> dict[str, bool | str | None]: - On old stable, ready to do dist upgrade. Manual upgrade possible. """ - from plinth.modules import upgrades + from freedombox.modules import upgrades updates_enabled = utils.check_auto() dist_upgrade_enabled = upgrades.is_dist_upgrade_enabled() has_free_space = utils.is_sufficient_free_space() diff --git a/freedombox/modules/upgrades/forms.py b/freedombox/modules/upgrades/forms.py index 390963512..1d4c44d47 100644 --- a/freedombox/modules/upgrades/forms.py +++ b/freedombox/modules/upgrades/forms.py @@ -6,7 +6,7 @@ Forms for configuring unattended-upgrades. from django import forms from django.utils.translation import gettext_lazy as _ -from plinth.modules import upgrades +from freedombox.modules import upgrades class ConfigureForm(forms.Form): diff --git a/freedombox/modules/upgrades/privileged.py b/freedombox/modules/upgrades/privileged.py index 018670376..97b23f945 100644 --- a/freedombox/modules/upgrades/privileged.py +++ b/freedombox/modules/upgrades/privileged.py @@ -7,11 +7,11 @@ import pathlib import re import subprocess -from plinth import action_utils -from plinth.action_utils import (apt_hold_flag, apt_unhold_freedombox, - is_package_manager_busy, run_apt_command, - service_is_running) -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.action_utils import (apt_hold_flag, apt_unhold_freedombox, + is_package_manager_busy, run_apt_command, + service_is_running) +from freedombox.actions import privileged from . import distupgrade, utils @@ -231,7 +231,7 @@ def _check_and_backports_sources(develop=False): if os.path.exists(old_sources_list): os.remove(old_sources_list) - from plinth.modules.upgrades import is_backports_current + from freedombox.modules.upgrades import is_backports_current if is_backports_current(): logging.info('Repositories list up-to-date. Skipping update.') return diff --git a/freedombox/modules/upgrades/tests/test_distupgrade.py b/freedombox/modules/upgrades/tests/test_distupgrade.py index 7fa8dc739..0c4c74437 100644 --- a/freedombox/modules/upgrades/tests/test_distupgrade.py +++ b/freedombox/modules/upgrades/tests/test_distupgrade.py @@ -11,7 +11,7 @@ from unittest.mock import Mock, call, patch import pytest -from plinth.modules.upgrades import distupgrade +from freedombox.modules.upgrades import distupgrade # pylint: disable=protected-access diff --git a/freedombox/modules/upgrades/tests/test_functional.py b/freedombox/modules/upgrades/tests/test_functional.py index 61a64375d..7ea20c27e 100644 --- a/freedombox/modules/upgrades/tests/test_functional.py +++ b/freedombox/modules/upgrades/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for upgrades app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.upgrades] diff --git a/freedombox/modules/upgrades/utils.py b/freedombox/modules/upgrades/utils.py index bc48cfeab..02d04fedf 100644 --- a/freedombox/modules/upgrades/utils.py +++ b/freedombox/modules/upgrades/utils.py @@ -6,8 +6,8 @@ import re import augeas -from plinth import action_utils -from plinth.modules.apache.components import check_url +from freedombox import action_utils +from freedombox.modules.apache.components import check_url RELEASE_FILE_URL = \ 'https://deb.debian.org/debian/dists/{}/Release' @@ -35,7 +35,7 @@ def check_auto() -> bool: def get_http_protocol() -> str: """Return the protocol to use for newly added repository sources.""" try: - from plinth.modules.torproxy import utils + from freedombox.modules.torproxy import utils if utils.is_apt_transport_tor_enabled(): return 'tor+http' except Exception: diff --git a/freedombox/modules/upgrades/views.py b/freedombox/modules/upgrades/views.py index 67ed3952a..a94f7e6d0 100644 --- a/freedombox/modules/upgrades/views.py +++ b/freedombox/modules/upgrades/views.py @@ -12,10 +12,10 @@ from django.utils.translation import gettext as _ from django.views.generic import TemplateView from django.views.generic.edit import FormView -from plinth import __version__ -from plinth.modules import first_boot, upgrades -from plinth.privileged import packages as packages_privileged -from plinth.views import AppView, messages_error +from freedombox import __version__ +from freedombox.modules import first_boot, upgrades +from freedombox.privileged import packages as packages_privileged +from freedombox.views import AppView, messages_error from . import distupgrade, privileged from .forms import BackportsFirstbootForm, ConfigureForm diff --git a/freedombox/modules/users/__init__.py b/freedombox/modules/users/__init__.py index c8318f8e4..15469b036 100644 --- a/freedombox/modules/users/__init__.py +++ b/freedombox/modules/users/__init__.py @@ -9,15 +9,15 @@ from django.utils.text import format_lazy from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop -from plinth import action_utils -from plinth import app as app_module -from plinth import cfg, menu -from plinth.config import DropinConfigs -from plinth.daemon import Daemon -from plinth.diagnostic_check import (DiagnosticCheck, - DiagnosticCheckParameters, Result) -from plinth.package import Packages -from plinth.privileged import service as service_privileged +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import cfg, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon +from freedombox.diagnostic_check import (DiagnosticCheck, + DiagnosticCheckParameters, Result) +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged from . import manifest, privileged from .components import UsersAndGroups diff --git a/freedombox/modules/users/components.py b/freedombox/modules/users/components.py index d0216accb..6901b28f8 100644 --- a/freedombox/modules/users/components.py +++ b/freedombox/modules/users/components.py @@ -6,7 +6,7 @@ App component to manage users and groups. import itertools from typing import ClassVar -from plinth import app +from freedombox import app class UsersAndGroups(app.FollowerComponent): diff --git a/freedombox/modules/users/forms.py b/freedombox/modules/users/forms.py index 5dab50054..f33cef58f 100644 --- a/freedombox/modules/users/forms.py +++ b/freedombox/modules/users/forms.py @@ -20,9 +20,9 @@ from django.utils.translation import gettext_lazy import plinth.forms import plinth.modules.ssh.privileged as ssh_privileged -from plinth.modules import first_boot -from plinth.utils import is_user_admin -from plinth.views import messages_error +from freedombox.modules import first_boot +from freedombox.utils import is_user_admin +from freedombox.views import messages_error from . import get_last_admin_user, privileged from .components import UsersAndGroups diff --git a/freedombox/modules/users/privileged.py b/freedombox/modules/users/privileged.py index a676f2c65..efb2acb73 100644 --- a/freedombox/modules/users/privileged.py +++ b/freedombox/modules/users/privileged.py @@ -10,8 +10,8 @@ import subprocess import augeas -from plinth import action_utils, utils -from plinth.actions import privileged, secret_str +from freedombox import action_utils, utils +from freedombox.actions import privileged, secret_str INPUT_LINES = None ACCESS_CONF = '/etc/security/access.conf' diff --git a/freedombox/modules/users/tests/test_functional.py b/freedombox/modules/users/tests/test_functional.py index f11511f67..903574c53 100644 --- a/freedombox/modules/users/tests/test_functional.py +++ b/freedombox/modules/users/tests/test_functional.py @@ -11,7 +11,7 @@ import urllib import pytest -from plinth.tests import functional +from freedombox.tests import functional _admin_password = functional.config['DEFAULT']['password'] diff --git a/freedombox/modules/users/tests/test_privileged.py b/freedombox/modules/users/tests/test_privileged.py index 907b1f96f..879727b76 100644 --- a/freedombox/modules/users/tests/test_privileged.py +++ b/freedombox/modules/users/tests/test_privileged.py @@ -12,9 +12,9 @@ import subprocess import pytest -from plinth import action_utils -from plinth.modules.users import privileged -from plinth.tests import config as test_config +from freedombox import action_utils +from freedombox.modules.users import privileged +from freedombox.tests import config as test_config _cleanup_users = None _cleanup_groups = None diff --git a/freedombox/modules/users/tests/test_views.py b/freedombox/modules/users/tests/test_views.py index fdbd6de30..d5d395f70 100644 --- a/freedombox/modules/users/tests/test_views.py +++ b/freedombox/modules/users/tests/test_views.py @@ -11,8 +11,8 @@ from django.contrib.auth.models import User from django.contrib.messages.storage.fallback import FallbackStorage from django.core.exceptions import PermissionDenied -from plinth import module_loader -from plinth.modules.users import views +from freedombox import module_loader +from freedombox.modules.users import views from ..components import UsersAndGroups diff --git a/freedombox/modules/users/urls.py b/freedombox/modules/users/urls.py index 448e671c6..8895e9ac1 100644 --- a/freedombox/modules/users/urls.py +++ b/freedombox/modules/users/urls.py @@ -6,7 +6,7 @@ URLs for the Users module from django.urls import re_path from stronghold.decorators import public -from plinth.utils import non_admin_view +from freedombox.utils import non_admin_view from . import views diff --git a/freedombox/modules/users/views.py b/freedombox/modules/users/views.py index 42bcbbc82..46c44eb20 100644 --- a/freedombox/modules/users/views.py +++ b/freedombox/modules/users/views.py @@ -36,12 +36,12 @@ from fido2.server import Fido2Server from fido2.webauthn import AttestedCredentialData, AuthenticationResponse import plinth.modules.ssh.privileged as ssh_privileged -from plinth import translation -from plinth.models import UserPasskey -from plinth.modules import first_boot -from plinth.utils import is_user_admin -from plinth.version import Version -from plinth.views import AppView, json_exception +from freedombox import translation +from freedombox.models import UserPasskey +from freedombox.modules import first_boot +from freedombox.utils import is_user_admin +from freedombox.version import Version +from freedombox.views import AppView, json_exception from . import privileged from .forms import (AuthenticationForm, CaptchaForm, CreateUserForm, diff --git a/freedombox/modules/wireguard/__init__.py b/freedombox/modules/wireguard/__init__.py index 50c9fb444..284f77076 100644 --- a/freedombox/modules/wireguard/__init__.py +++ b/freedombox/modules/wireguard/__init__.py @@ -6,11 +6,11 @@ FreedomBox app for wireguard. from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import app as app_module -from plinth import cfg, frontpage, menu -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.utils import format_lazy, import_from_gi +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.utils import format_lazy, import_from_gi from . import manifest, utils @@ -74,21 +74,21 @@ class WireguardApp(app_module.App): def enable(self): """Enable the app by simply storing a flag in key/value store.""" - from plinth import kvstore + from freedombox import kvstore super().enable() kvstore.set('wireguard-enabled', True) utils.enable_connections(True) def disable(self): """Disable the app by simply storing a flag in key/value store.""" - from plinth import kvstore + from freedombox import kvstore super().disable() kvstore.set('wireguard-enabled', False) utils.enable_connections(False) def is_enabled(self): """Return whether all leader components are enabled and flag is set.""" - from plinth import kvstore + from freedombox import kvstore enabled = super().is_enabled() return enabled and kvstore.get_default('wireguard-enabled', False) diff --git a/freedombox/modules/wireguard/manifest.py b/freedombox/modules/wireguard/manifest.py index 027807174..71cc06e56 100644 --- a/freedombox/modules/wireguard/manifest.py +++ b/freedombox/modules/wireguard/manifest.py @@ -5,7 +5,7 @@ Application manifest for WireGuard. from django.utils.translation import gettext_lazy as _ -from plinth.clients import store_url +from freedombox.clients import store_url _wireguard_package_id = 'com.wireguard.android' diff --git a/freedombox/modules/wireguard/privileged.py b/freedombox/modules/wireguard/privileged.py index fc37ca833..668c3ce28 100644 --- a/freedombox/modules/wireguard/privileged.py +++ b/freedombox/modules/wireguard/privileged.py @@ -1,8 +1,8 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """Configuration helper for WireGuard.""" -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged SERVER_INTERFACE = 'wg0' diff --git a/freedombox/modules/wireguard/tests/test_forms.py b/freedombox/modules/wireguard/tests/test_forms.py index 70f986469..7a2afae53 100644 --- a/freedombox/modules/wireguard/tests/test_forms.py +++ b/freedombox/modules/wireguard/tests/test_forms.py @@ -6,9 +6,8 @@ Tests for wireguard module forms. import pytest from django.core.exceptions import ValidationError -from plinth.modules.wireguard.forms import (validate_endpoint, - validate_ip_address_with_network, - validate_key) +from freedombox.modules.wireguard.forms import ( + validate_endpoint, validate_ip_address_with_network, validate_key) @pytest.mark.parametrize('key', [ diff --git a/freedombox/modules/wireguard/tests/test_functional.py b/freedombox/modules/wireguard/tests/test_functional.py index 071d4c51a..55dfe1be3 100644 --- a/freedombox/modules/wireguard/tests/test_functional.py +++ b/freedombox/modules/wireguard/tests/test_functional.py @@ -7,7 +7,7 @@ import urllib import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.wireguard] diff --git a/freedombox/modules/wireguard/urls.py b/freedombox/modules/wireguard/urls.py index e2730580d..07c287c1b 100644 --- a/freedombox/modules/wireguard/urls.py +++ b/freedombox/modules/wireguard/urls.py @@ -5,7 +5,7 @@ URLs for the wireguard module. from django.urls import re_path -from plinth.modules.wireguard import views +from freedombox.modules.wireguard import views urlpatterns = [ re_path(r'^apps/wireguard/$', views.WireguardView.as_view(), name='index'), diff --git a/freedombox/modules/wireguard/utils.py b/freedombox/modules/wireguard/utils.py index 0fe35c324..53b1a4624 100644 --- a/freedombox/modules/wireguard/utils.py +++ b/freedombox/modules/wireguard/utils.py @@ -6,9 +6,9 @@ import logging import subprocess import time -from plinth import app as app_module -from plinth import network -from plinth.utils import import_from_gi +from freedombox import app as app_module +from freedombox import network +from freedombox.utils import import_from_gi from . import privileged diff --git a/freedombox/modules/wireguard/views.py b/freedombox/modules/wireguard/views.py index ad8e2df35..6cf909ab7 100644 --- a/freedombox/modules/wireguard/views.py +++ b/freedombox/modules/wireguard/views.py @@ -14,9 +14,9 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import FormView, TemplateView, View -from plinth import network -from plinth.modules.names.components import DomainName -from plinth.views import AppView +from freedombox import network +from freedombox.modules.names.components import DomainName +from freedombox.views import AppView from . import forms, utils diff --git a/freedombox/modules/wordpress/__init__.py b/freedombox/modules/wordpress/__init__.py index 481187e53..85247fb28 100644 --- a/freedombox/modules/wordpress/__init__.py +++ b/freedombox/modules/wordpress/__init__.py @@ -3,16 +3,16 @@ 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, SharedDaemon -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.privileged import service as service_privileged -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import Daemon, SharedDaemon +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.privileged import service as service_privileged +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/wordpress/privileged.py b/freedombox/modules/wordpress/privileged.py index dbbd34255..a0ba85639 100644 --- a/freedombox/modules/wordpress/privileged.py +++ b/freedombox/modules/wordpress/privileged.py @@ -9,8 +9,8 @@ import string import augeas -from plinth import action_utils -from plinth.actions import privileged +from freedombox import action_utils +from freedombox.actions import privileged _public_access_file = pathlib.Path('/etc/wordpress/is_public') _config_file_path = pathlib.Path('/etc/wordpress/config-default.php') diff --git a/freedombox/modules/wordpress/tests/test_functional.py b/freedombox/modules/wordpress/tests/test_functional.py index 040e7337a..e9f3a7d1d 100644 --- a/freedombox/modules/wordpress/tests/test_functional.py +++ b/freedombox/modules/wordpress/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for WordPress. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.wordpress] diff --git a/freedombox/modules/wordpress/views.py b/freedombox/modules/wordpress/views.py index 049f515e5..7186df464 100644 --- a/freedombox/modules/wordpress/views.py +++ b/freedombox/modules/wordpress/views.py @@ -4,7 +4,7 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import views +from freedombox import views from . import privileged from .forms import WordPressForm diff --git a/freedombox/modules/zoph/__init__.py b/freedombox/modules/zoph/__init__.py index e7e2e0579..a78c0613b 100644 --- a/freedombox/modules/zoph/__init__.py +++ b/freedombox/modules/zoph/__init__.py @@ -5,16 +5,16 @@ import logging 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 SharedDaemon -from plinth.modules.apache import privileged as apache_privileged -from plinth.modules.apache.components import Webserver -from plinth.modules.backups.components import BackupRestore -from plinth.modules.firewall.components import Firewall -from plinth.package import Packages -from plinth.utils import format_lazy +from freedombox import app as app_module +from freedombox import cfg, frontpage, menu +from freedombox.config import DropinConfigs +from freedombox.daemon import SharedDaemon +from freedombox.modules.apache import privileged as apache_privileged +from freedombox.modules.apache.components import Webserver +from freedombox.modules.backups.components import BackupRestore +from freedombox.modules.firewall.components import Firewall +from freedombox.package import Packages +from freedombox.utils import format_lazy from . import manifest, privileged diff --git a/freedombox/modules/zoph/privileged.py b/freedombox/modules/zoph/privileged.py index 4198d7b18..13bd4c0bd 100644 --- a/freedombox/modules/zoph/privileged.py +++ b/freedombox/modules/zoph/privileged.py @@ -6,9 +6,9 @@ import pathlib import re import subprocess -from plinth import action_utils -from plinth.actions import privileged -from plinth.db import mariadb +from freedombox import action_utils +from freedombox.actions import privileged +from freedombox.db import mariadb APACHE_CONF = '/etc/apache2/conf-available/zoph.conf' DB_CONF = pathlib.Path('/etc/zoph.ini') diff --git a/freedombox/modules/zoph/tests/test_functional.py b/freedombox/modules/zoph/tests/test_functional.py index 1b34c2abe..bb24e6b87 100644 --- a/freedombox/modules/zoph/tests/test_functional.py +++ b/freedombox/modules/zoph/tests/test_functional.py @@ -5,7 +5,7 @@ Functional, browser based tests for zoph app. import pytest -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.apps, pytest.mark.zoph] diff --git a/freedombox/modules/zoph/views.py b/freedombox/modules/zoph/views.py index 9e9cabb1b..4958fe818 100644 --- a/freedombox/modules/zoph/views.py +++ b/freedombox/modules/zoph/views.py @@ -10,8 +10,8 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import TemplateView -from plinth import app as app_module -from plinth import views +from freedombox import app as app_module +from freedombox import views from . import privileged from .forms import ZophForm diff --git a/freedombox/network.py b/freedombox/network.py index 657d73363..ba9963cb7 100644 --- a/freedombox/network.py +++ b/freedombox/network.py @@ -13,7 +13,7 @@ import uuid from django.utils.translation import gettext_lazy as _ -from plinth.utils import import_from_gi +from freedombox.utils import import_from_gi glib = import_from_gi('GLib', '2.0') nm = import_from_gi('NM', '1.0') diff --git a/freedombox/notification.py b/freedombox/notification.py index 2711df750..f454b37a9 100644 --- a/freedombox/notification.py +++ b/freedombox/notification.py @@ -11,8 +11,8 @@ from django.template.response import SimpleTemplateResponse from django.utils import timezone from django.utils.translation import gettext -from plinth import cfg -from plinth.utils import SafeFormatter +from freedombox import cfg +from freedombox.utils import SafeFormatter from . import db, models diff --git a/freedombox/operation.py b/freedombox/operation.py index e6f9be658..50d395378 100644 --- a/freedombox/operation.py +++ b/freedombox/operation.py @@ -7,7 +7,7 @@ import threading from collections import OrderedDict from typing import Callable -from plinth.utils import SafeFormatter +from freedombox.utils import SafeFormatter from . import app as app_module @@ -156,7 +156,7 @@ class Operation: if not self.show_notification: return - from plinth.notification import Notification + from freedombox.notification import Notification severity = 'info' if not self.exception else 'error' app = app_module.App.get(self.app_id) data = { diff --git a/freedombox/package.py b/freedombox/package.py index ab2edcc9b..523a88a0c 100644 --- a/freedombox/package.py +++ b/freedombox/package.py @@ -12,11 +12,11 @@ from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy, gettext_noop import plinth.privileged.packages as privileged -from plinth import app as app_module -from plinth.diagnostic_check import (DiagnosticCheck, +from freedombox import app as app_module +from freedombox.diagnostic_check import (DiagnosticCheck, DiagnosticCheckParameters, Result) -from plinth.errors import MissingPackageError -from plinth.utils import format_lazy +from freedombox.errors import MissingPackageError +from freedombox.utils import format_lazy from . import kvstore from . import operation as operation_module diff --git a/freedombox/privileged/config.py b/freedombox/privileged/config.py index 403b82e4b..965c65e27 100644 --- a/freedombox/privileged/config.py +++ b/freedombox/privileged/config.py @@ -5,9 +5,9 @@ import importlib import inspect import shutil -from plinth import app as app_module -from plinth import module_loader -from plinth.actions import privileged +from freedombox import app as app_module +from freedombox import module_loader +from freedombox.actions import privileged def _get_managed_dropin_config(app_id: str, path: str): @@ -21,7 +21,7 @@ def _get_managed_dropin_config(app_id: str, path: str): for cls in app_classes: app = cls() - from plinth.config import DropinConfigs + from freedombox.config import DropinConfigs components = app.get_components_of_type(DropinConfigs) for component in components: if path in component.etc_paths: diff --git a/freedombox/privileged/container.py b/freedombox/privileged/container.py index 14a3513f9..4d944ba30 100644 --- a/freedombox/privileged/container.py +++ b/freedombox/privileged/container.py @@ -1,10 +1,10 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """Handle container run using podman.""" -from plinth import action_utils -from plinth import app as app_module -from plinth import module_loader -from plinth.actions import privileged +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import module_loader +from freedombox.actions import privileged @privileged @@ -55,7 +55,7 @@ def container_uninstall(container: str, image_name: str, volume_name: str, def _get_managed_containers() -> set[str]: """Get a set of all containers managed by FreedomBox.""" - from plinth.container import Container + from freedombox.container import Container containers = set() module_loader.load_modules() diff --git a/freedombox/privileged/packages.py b/freedombox/privileged/packages.py index 68928fd04..ff105d06b 100644 --- a/freedombox/privileged/packages.py +++ b/freedombox/privileged/packages.py @@ -10,11 +10,11 @@ import apt.cache import apt_inst import apt_pkg -from plinth import action_utils -from plinth import app as app_module -from plinth import module_loader -from plinth.action_utils import run, run_apt_command -from plinth.actions import privileged +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import module_loader +from freedombox.action_utils import run, run_apt_command +from freedombox.actions import privileged logger = logging.getLogger(__name__) @@ -91,7 +91,7 @@ def remove(app_id: str, packages: list[str], purge: bool): def _assert_managed_packages(app_id, packages): """Check that list of packages are in fact managed by module.""" - from plinth.package import Packages + from freedombox.package import Packages module_loader.load_modules() app_module.apps_init() diff --git a/freedombox/privileged/service.py b/freedombox/privileged/service.py index 7386dc54e..955e8789a 100644 --- a/freedombox/privileged/service.py +++ b/freedombox/privileged/service.py @@ -1,11 +1,11 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """List and handle system services.""" -from plinth import action_utils -from plinth import app as app_module -from plinth import module_loader -from plinth.actions import privileged -from plinth.daemon import Daemon, RelatedDaemon +from freedombox import action_utils +from freedombox import app as app_module +from freedombox import module_loader +from freedombox.actions import privileged +from freedombox.daemon import Daemon, RelatedDaemon @privileged @@ -116,7 +116,7 @@ def get_logs(service: str) -> dict[str, str]: def _get_managed_services(): """Get a set of all services managed by FreedomBox.""" - from plinth.container import Container + from freedombox.container import Container services = set() module_loader.load_modules() diff --git a/freedombox/setup.py b/freedombox/setup.py index 9676eadcb..93e935d4d 100644 --- a/freedombox/setup.py +++ b/freedombox/setup.py @@ -14,11 +14,11 @@ import apt from django.utils.translation import gettext_noop import plinth -from plinth import app as app_module -from plinth.diagnostic_check import Result -from plinth.errors import MissingPackageError -from plinth.package import Packages -from plinth.signals import post_setup +from freedombox import app as app_module +from freedombox.diagnostic_check import Result +from freedombox.errors import MissingPackageError +from freedombox.package import Packages +from freedombox.signals import post_setup from . import operation as operation_module from . import package diff --git a/freedombox/templatetags/extras.py b/freedombox/templatetags/extras.py index 701cd4326..d363b27d4 100644 --- a/freedombox/templatetags/extras.py +++ b/freedombox/templatetags/extras.py @@ -6,8 +6,8 @@ from urllib.parse import urlparse from django import template from django.utils.safestring import mark_safe -from plinth import clients as clients_module -from plinth import utils, web_server +from freedombox import clients as clients_module +from freedombox import utils, web_server register = template.Library() @@ -73,7 +73,7 @@ def _is_internal_url(url): if not parsed_url.netloc: return True - from plinth.modules.names.components import DomainName + from freedombox.modules.names.components import DomainName return parsed_url.netloc in DomainName.list_names() diff --git a/freedombox/tests/conftest.py b/freedombox/tests/conftest.py index ee2bfb5e5..07b9950a9 100644 --- a/freedombox/tests/conftest.py +++ b/freedombox/tests/conftest.py @@ -8,7 +8,7 @@ from unittest.mock import patch import pytest -from plinth import cfg +from freedombox import cfg @pytest.fixture(name='shortcuts_file') diff --git a/freedombox/tests/tags/test_functional.py b/freedombox/tests/tags/test_functional.py index 66cda787b..eebb55961 100644 --- a/freedombox/tests/tags/test_functional.py +++ b/freedombox/tests/tags/test_functional.py @@ -6,7 +6,7 @@ Functional, browser based tests for transmission app. import pytest from selenium.webdriver.common.keys import Keys -from plinth.tests import functional +from freedombox.tests import functional pytestmark = [pytest.mark.tags] diff --git a/freedombox/tests/test_action_utils.py b/freedombox/tests/test_action_utils.py index e190a19ba..fba2b43c8 100644 --- a/freedombox/tests/test_action_utils.py +++ b/freedombox/tests/test_action_utils.py @@ -11,7 +11,7 @@ from unittest.mock import Mock, call, patch import pytest -from plinth.action_utils import (get_addresses, get_hostname, +from freedombox.action_utils import (get_addresses, get_hostname, is_systemd_running, move_uploaded_file, run, run_as_user, service_action, service_disable, service_enable, service_is_enabled, diff --git a/freedombox/tests/test_actions.py b/freedombox/tests/test_actions.py index 78cb4dd7e..3c0c756ee 100644 --- a/freedombox/tests/test_actions.py +++ b/freedombox/tests/test_actions.py @@ -13,8 +13,8 @@ from unittest.mock import Mock, call, patch import pytest -from plinth import actions -from plinth.actions import privileged, secret_str +from freedombox import actions +from freedombox.actions import privileged, secret_str actions_name = 'actions' diff --git a/freedombox/tests/test_app.py b/freedombox/tests/test_app.py index a9a1649be..b6469a705 100644 --- a/freedombox/tests/test_app.py +++ b/freedombox/tests/test_app.py @@ -8,10 +8,10 @@ from unittest.mock import Mock, call, patch import pytest -from plinth import log -from plinth.app import (App, Component, EnableState, FollowerComponent, Info, +from freedombox import log +from freedombox.app import (App, Component, EnableState, FollowerComponent, Info, LeaderComponent, apps_init) -from plinth.diagnostic_check import DiagnosticCheck, Result +from freedombox.diagnostic_check import DiagnosticCheck, Result # pylint: disable=protected-access @@ -197,7 +197,7 @@ def test_get_set_setup_version(): """Setting and getting the setup version of the app.""" app = AppSetupTest() - from plinth import models + from freedombox import models try: models.Module.objects.get(pk=app.app_id).delete() except models.Module.DoesNotExist: diff --git a/freedombox/tests/test_cfg.py b/freedombox/tests/test_cfg.py index 9dddf5c56..ef05b04ee 100644 --- a/freedombox/tests/test_cfg.py +++ b/freedombox/tests/test_cfg.py @@ -11,7 +11,7 @@ from unittest.mock import patch import pytest -from plinth import cfg +from freedombox import cfg TEST_CONFIG_DIR = \ os.path.join(os.path.dirname(os.path.realpath(__file__)), diff --git a/freedombox/tests/test_clients.py b/freedombox/tests/test_clients.py index 99531603d..b4816d2c3 100644 --- a/freedombox/tests/test_clients.py +++ b/freedombox/tests/test_clients.py @@ -3,12 +3,12 @@ Test module for clients module. """ -from plinth import clients -from plinth.modules.deluge.manifest import clients as deluge_clients -from plinth.modules.infinoted.manifest import clients as infinoted_clients -from plinth.modules.quassel.manifest import clients as quassel_clients -from plinth.modules.syncthing.manifest import clients as syncthing_clients -from plinth.modules.tor.manifest import clients as tor_clients +from freedombox import clients +from freedombox.modules.deluge.manifest import clients as deluge_clients +from freedombox.modules.infinoted.manifest import clients as infinoted_clients +from freedombox.modules.quassel.manifest import clients as quassel_clients +from freedombox.modules.syncthing.manifest import clients as syncthing_clients +from freedombox.modules.tor.manifest import clients as tor_clients def test_of_type_web(): diff --git a/freedombox/tests/test_config.py b/freedombox/tests/test_config.py index 86e235410..2e56a6911 100644 --- a/freedombox/tests/test_config.py +++ b/freedombox/tests/test_config.py @@ -7,9 +7,9 @@ from unittest.mock import Mock, patch import pytest -from plinth.app import App -from plinth.config import DropinConfigs -from plinth.diagnostic_check import DiagnosticCheck, Result +from freedombox.app import App +from freedombox.config import DropinConfigs +from freedombox.diagnostic_check import DiagnosticCheck, Result pytestmark = pytest.mark.usefixtures('mock_privileged') privileged_modules_to_mock = ['plinth.privileged.config'] diff --git a/freedombox/tests/test_container.py b/freedombox/tests/test_container.py index 46da46a3d..e8bcccbda 100644 --- a/freedombox/tests/test_container.py +++ b/freedombox/tests/test_container.py @@ -5,9 +5,9 @@ from unittest.mock import call, patch import pytest -from plinth.app import App, Info -from plinth.container import Container -from plinth.diagnostic_check import DiagnosticCheck, Result +from freedombox.app import App, Info +from freedombox.container import Container +from freedombox.diagnostic_check import DiagnosticCheck, Result pytestmark = pytest.mark.usefixtures('mock_privileged') privileged_modules_to_mock = [ diff --git a/freedombox/tests/test_context_processors.py b/freedombox/tests/test_context_processors.py index 32a0face7..245615bb7 100644 --- a/freedombox/tests/test_context_processors.py +++ b/freedombox/tests/test_context_processors.py @@ -7,7 +7,7 @@ from unittest.mock import MagicMock, Mock, patch from django.urls import resolve -from plinth import context_processors as cp +from freedombox import context_processors as cp @patch('plinth.notification.Notification') diff --git a/freedombox/tests/test_custom_shortcuts.py b/freedombox/tests/test_custom_shortcuts.py index cac2dc42c..8ab2ce2a1 100644 --- a/freedombox/tests/test_custom_shortcuts.py +++ b/freedombox/tests/test_custom_shortcuts.py @@ -6,7 +6,7 @@ Test module for custom shortcuts. import json import pathlib -from plinth.modules.api.views import get_shortcuts_as_json +from freedombox.modules.api.views import get_shortcuts_as_json def test_non_existent_custom_shortcuts_file(shortcuts_file): diff --git a/freedombox/tests/test_daemon.py b/freedombox/tests/test_daemon.py index 879774db2..2ea5904c5 100644 --- a/freedombox/tests/test_daemon.py +++ b/freedombox/tests/test_daemon.py @@ -9,10 +9,10 @@ from unittest.mock import Mock, call, patch import pytest -from plinth.app import App, FollowerComponent, Info -from plinth.daemon import (Daemon, RelatedDaemon, SharedDaemon, app_is_running, +from freedombox.app import App, FollowerComponent, Info +from freedombox.daemon import (Daemon, RelatedDaemon, SharedDaemon, app_is_running, diagnose_netcat, diagnose_port_listening) -from plinth.diagnostic_check import DiagnosticCheck, Result +from freedombox.diagnostic_check import DiagnosticCheck, Result privileged_modules_to_mock = ['plinth.privileged.service'] diff --git a/freedombox/tests/test_diagnostic_check.py b/freedombox/tests/test_diagnostic_check.py index 66bbf3261..d763a5eb1 100644 --- a/freedombox/tests/test_diagnostic_check.py +++ b/freedombox/tests/test_diagnostic_check.py @@ -5,8 +5,8 @@ import json import pytest -from plinth.diagnostic_check import (CheckJSONDecoder, CheckJSONEncoder, - DiagnosticCheck, Result) +from freedombox.diagnostic_check import (CheckJSONDecoder, CheckJSONEncoder, + DiagnosticCheck, Result) def test_result(): diff --git a/freedombox/tests/test_frontpage.py b/freedombox/tests/test_frontpage.py index 43f2f9d61..083bf7fe9 100644 --- a/freedombox/tests/test_frontpage.py +++ b/freedombox/tests/test_frontpage.py @@ -7,7 +7,7 @@ from unittest.mock import patch import pytest -from plinth.frontpage import Shortcut, add_custom_shortcuts +from freedombox.frontpage import Shortcut, add_custom_shortcuts # pylint: disable=protected-access diff --git a/freedombox/tests/test_kvstore.py b/freedombox/tests/test_kvstore.py index e29b71c73..f81e21e0d 100644 --- a/freedombox/tests/test_kvstore.py +++ b/freedombox/tests/test_kvstore.py @@ -5,8 +5,8 @@ Test module for key/value store. import pytest -from plinth import kvstore -from plinth.models import KVStore +from freedombox import kvstore +from freedombox.models import KVStore pytestmark = pytest.mark.django_db diff --git a/freedombox/tests/test_menu.py b/freedombox/tests/test_menu.py index 4ca8af574..f840aba20 100644 --- a/freedombox/tests/test_menu.py +++ b/freedombox/tests/test_menu.py @@ -9,8 +9,8 @@ import pytest from django.http import HttpRequest from django.urls import reverse -from plinth import menu as menu_module -from plinth.menu import Menu +from freedombox import menu as menu_module +from freedombox.menu import Menu URL_TEMPLATE = '/test{}/{}/{}/{}/' diff --git a/freedombox/tests/test_middleware.py b/freedombox/tests/test_middleware.py index 7895ba51a..323ef62a4 100644 --- a/freedombox/tests/test_middleware.py +++ b/freedombox/tests/test_middleware.py @@ -15,8 +15,8 @@ from django.test.client import RequestFactory from django.urls import resolve from stronghold.decorators import public -from plinth import app as app_module -from plinth.middleware import (AdminRequiredMiddleware, CommonErrorMiddleware, +from freedombox import app as app_module +from freedombox.middleware import (AdminRequiredMiddleware, CommonErrorMiddleware, SetupMiddleware) diff --git a/freedombox/tests/test_module_loader.py b/freedombox/tests/test_module_loader.py index 90e8f27bc..fbbcb05b9 100644 --- a/freedombox/tests/test_module_loader.py +++ b/freedombox/tests/test_module_loader.py @@ -5,7 +5,7 @@ Test module for module loading mechanism. from unittest.mock import mock_open, patch -from plinth import module_loader +from freedombox import module_loader @patch('pathlib.Path.open', mock_open(read_data='plinth.modules.apache\n')) diff --git a/freedombox/tests/test_network.py b/freedombox/tests/test_network.py index 7ec388bee..e0f05812b 100644 --- a/freedombox/tests/test_network.py +++ b/freedombox/tests/test_network.py @@ -9,7 +9,7 @@ import time import pytest -from plinth.utils import import_from_gi +from freedombox.utils import import_from_gi ethernet_settings = { 'common': { @@ -76,7 +76,7 @@ pppoe_settings = { @pytest.fixture(autouse=True, scope='module') def fixture_network_module_init(): """Initialize network module in a separate thread.""" - from plinth import network as network_module + from freedombox import network as network_module glib = import_from_gi('GLib', '2.0') main_loop = glib.MainLoop() @@ -102,7 +102,7 @@ def fixture_network_module_init(): @pytest.fixture(name='network') def fixture_network(needs_root): """Return the network module. Load it conservatively.""" - from plinth import network as network_module + from freedombox import network as network_module return network_module diff --git a/freedombox/tests/test_notification.py b/freedombox/tests/test_notification.py index c8f9abbb1..e08d8c012 100644 --- a/freedombox/tests/test_notification.py +++ b/freedombox/tests/test_notification.py @@ -10,7 +10,7 @@ import pytest from django.contrib.auth.models import Group, User from django.core.exceptions import ValidationError -from plinth.notification import Notification +from freedombox.notification import Notification pytestmark = pytest.mark.django_db diff --git a/freedombox/tests/test_operation.py b/freedombox/tests/test_operation.py index f30a97e9b..0d795702b 100644 --- a/freedombox/tests/test_operation.py +++ b/freedombox/tests/test_operation.py @@ -8,7 +8,7 @@ from unittest.mock import Mock, call, patch import pytest -from plinth import app +from freedombox import app from .. import operation as operation_module from ..notification import Notification diff --git a/freedombox/tests/test_package.py b/freedombox/tests/test_package.py index 40baad205..3fb5d57a8 100644 --- a/freedombox/tests/test_package.py +++ b/freedombox/tests/test_package.py @@ -9,10 +9,10 @@ from unittest.mock import Mock, call, patch import pytest -from plinth.app import App -from plinth.diagnostic_check import DiagnosticCheck, Result -from plinth.errors import MissingPackageError -from plinth.package import Package, Packages, packages_installed +from freedombox.app import App +from freedombox.diagnostic_check import DiagnosticCheck, Result +from freedombox.errors import MissingPackageError +from freedombox.package import Package, Packages, packages_installed @pytest.fixture(autouse=True) diff --git a/freedombox/tests/test_setup.py b/freedombox/tests/test_setup.py index c8ca312b1..a5e8b5c43 100644 --- a/freedombox/tests/test_setup.py +++ b/freedombox/tests/test_setup.py @@ -3,7 +3,7 @@ Test module for setup module. """ -from plinth.setup import store_error_message, retrieve_error_messages +from freedombox.setup import store_error_message, retrieve_error_messages def test_store_retrieve_error_message(): diff --git a/freedombox/tests/test_templatetags.py b/freedombox/tests/test_templatetags.py index 20227087a..32bcb5990 100644 --- a/freedombox/tests/test_templatetags.py +++ b/freedombox/tests/test_templatetags.py @@ -5,7 +5,7 @@ Test module for custom Django template tags. from unittest.mock import patch -from plinth.templatetags import extras +from freedombox.templatetags import extras def _assert_active_url(menu, url): diff --git a/freedombox/tests/test_utils.py b/freedombox/tests/test_utils.py index 8f0a612db..10dcf065e 100644 --- a/freedombox/tests/test_utils.py +++ b/freedombox/tests/test_utils.py @@ -11,8 +11,8 @@ import ruamel.yaml from django.test.client import RequestFactory from ruamel.yaml.compat import StringIO -from plinth.utils import (SafeFormatter, YAMLFile, is_user_admin, - is_valid_user_name) +from freedombox.utils import (SafeFormatter, YAMLFile, is_user_admin, + is_valid_user_name) def test_is_valid_user_name(): diff --git a/freedombox/tests/test_version.py b/freedombox/tests/test_version.py index 954839bd1..2a4da1793 100644 --- a/freedombox/tests/test_version.py +++ b/freedombox/tests/test_version.py @@ -3,7 +3,7 @@ Tests for Version class. """ -from plinth.version import Version +from freedombox.version import Version def test_version_comparisons(): diff --git a/freedombox/tests/test_views.py b/freedombox/tests/test_views.py index e0092ebc0..31048a26a 100644 --- a/freedombox/tests/test_views.py +++ b/freedombox/tests/test_views.py @@ -9,7 +9,7 @@ import pytest from django.http import JsonResponse from django.urls import resolve -from plinth.views import get_breadcrumbs, is_safe_url, json_exception +from freedombox.views import get_breadcrumbs, is_safe_url, json_exception def test_get_breadcrumbs(rf, test_menu): diff --git a/freedombox/tests/test_web_server.py b/freedombox/tests/test_web_server.py index 50ecb5d60..fd90cef23 100644 --- a/freedombox/tests/test_web_server.py +++ b/freedombox/tests/test_web_server.py @@ -8,7 +8,7 @@ from unittest.mock import Mock, call, patch import pytest -from plinth.web_server import StaticFiles, resolve_static_path +from freedombox.web_server import StaticFiles, resolve_static_path @pytest.fixture(autouse=True) diff --git a/freedombox/utils.py b/freedombox/utils.py index c7a8906d7..86b6e866a 100644 --- a/freedombox/utils.py +++ b/freedombox/utils.py @@ -14,7 +14,7 @@ import markupsafe import ruamel.yaml from django.utils.functional import lazy -from plinth.version import Version # noqa +from freedombox.version import Version # noqa def import_from_gi(library, version): diff --git a/freedombox/views.py b/freedombox/views.py index 9ed0305e6..aa2283559 100644 --- a/freedombox/views.py +++ b/freedombox/views.py @@ -26,13 +26,13 @@ from django.views.generic import TemplateView from django.views.generic.edit import FormView from stronghold.decorators import public -from plinth import app as app_module -from plinth import menu -from plinth.daemon import app_is_running -from plinth.modules.config import get_advanced_mode -from plinth.modules.firewall.components import get_port_forwarding_info -from plinth.package import Packages -from plinth.translation import get_language_from_request, set_language +from freedombox import app as app_module +from freedombox import menu +from freedombox.daemon import app_is_running +from freedombox.modules.config import get_advanced_mode +from freedombox.modules.firewall.components import get_port_forwarding_info +from freedombox.package import Packages +from freedombox.translation import get_language_from_request, set_language from . import forms, frontpage, operation, setup @@ -156,7 +156,7 @@ def _get_redirect_url_from_param(request): def _has_backup_restore(app): """Return whether an app implements backup/restore.""" - from plinth.modules.backups.components import BackupRestore + from freedombox.modules.backups.components import BackupRestore return any([ component.has_data for component in app.get_components_of_type(BackupRestore) @@ -535,7 +535,7 @@ class AppView(FormView): context['show_uninstall'] = not self.app.info.is_essential context['refresh_page_sec'] = None - from plinth.modules.firewall.components import Firewall + from freedombox.modules.firewall.components import Firewall context['firewall'] = self.app.get_components_of_type(Firewall) context['has_backup_restore'] = _has_backup_restore(self.app)