From 40eecb644628f8e9104b3d65ad888012fbc452c7 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 4 May 2023 17:56:17 -0700 Subject: [PATCH] *: Move modules-enabled files to /usr/share - This will leave /etc/{plinth,freedombox} empty by default making service more robust to run across various environments and situations. See systemd's explanation for more details. - Use Debian maintainer scripts remove all the existing files in /etc/plinth/modules-enabled. - Read from /usr/share/freedombox/modules-enabled then from /etc/plinth/modules-enabled and finally from /etc/freedombox/modules-enabled. Later read ones override previously read files. Any file pointing to /dev/null will mean the module must be ignored. Tests: - Clean up /etc/plinth, /etc/freedombox and /usr/share/freedombox/modules-enabled. Run service and notice that files are getting loaded from development folder using a debug message. - Run setup.py and notice that files get installed in /usr/share/freedombox/modules-enabled/ and in the next run they get loaded from there. - Create a override file in /etc/plinth/modules-enabled/transmission and notice that overriden file gets priority over the one in /usr/share/freedombox/modules-enabled. - Link the file /etc/plinth/modules-enabled/transmission to /dev/null and notice that is not loaded. - Create another file in /etc/freedombox/modules-enabled/transmission and notice that it overrides the previous two files. - All affected modules are loaded. - Build a new Debian package and ensure that upgrading 23.8 to new version removes are all configuration files. - Build developer documentation and test that Tutorial -> Full Code and Tutorial -> Skeleton sections have been updated with references to -.../modules-enabled/... paths. - Install quassel and notice that certificates were copied to /var/lib/quassel directory. Change domain to another domain and notice that certificates were copied again to that directory. Reviewed-by: James Valleroy --- debian/freedombox.install | 1 + debian/freedombox.maintscript | 62 ++++++++++++++ doc/dev/tutorial/code.rst | 6 +- doc/dev/tutorial/skeleton.rst | 33 +++---- plinth/module_loader.py | 85 ++++++++++++++----- .../share/freedombox}/modules-enabled/apache | 0 .../share/freedombox}/modules-enabled/api | 0 .../share/freedombox}/modules-enabled/avahi | 0 .../share/freedombox}/modules-enabled/backups | 0 .../share/freedombox}/modules-enabled/bepasty | 0 .../share/freedombox}/modules-enabled/bind | 0 .../share/freedombox}/modules-enabled/calibre | 0 .../share/freedombox}/modules-enabled/cockpit | 0 .../share/freedombox}/modules-enabled/config | 0 .../share/freedombox}/modules-enabled/coturn | 0 .../freedombox}/modules-enabled/datetime | 0 .../share/freedombox}/modules-enabled/deluge | 0 .../freedombox}/modules-enabled/diagnostics | 0 .../freedombox}/modules-enabled/dynamicdns | 0 .../freedombox}/modules-enabled/ejabberd | 0 .../share/freedombox}/modules-enabled/email | 0 .../freedombox}/modules-enabled/firewall | 0 .../freedombox}/modules-enabled/first_boot | 0 .../share/freedombox}/modules-enabled/gitweb | 0 .../share/freedombox}/modules-enabled/help | 0 .../share/freedombox}/modules-enabled/i2p | 0 .../share/freedombox}/modules-enabled/ikiwiki | 0 .../freedombox}/modules-enabled/infinoted | 0 .../share/freedombox}/modules-enabled/janus | 0 .../share/freedombox}/modules-enabled/jsxc | 0 .../freedombox}/modules-enabled/letsencrypt | 0 plinth/modules/letsencrypt/privileged.py | 7 +- .../freedombox}/modules-enabled/matrixsynapse | 0 .../freedombox}/modules-enabled/mediawiki | 0 .../freedombox}/modules-enabled/minetest | 0 .../freedombox}/modules-enabled/minidlna | 0 .../share/freedombox}/modules-enabled/mumble | 0 .../share/freedombox}/modules-enabled/names | 0 .../freedombox}/modules-enabled/networks | 0 .../share/freedombox}/modules-enabled/openvpn | 0 .../freedombox}/modules-enabled/pagekite | 0 .../freedombox}/modules-enabled/performance | 0 .../share/freedombox}/modules-enabled/power | 0 .../share/freedombox}/modules-enabled/privacy | 0 .../share/freedombox}/modules-enabled/privoxy | 0 .../share/freedombox}/modules-enabled/quassel | 0 .../freedombox}/modules-enabled/radicale | 0 .../freedombox}/modules-enabled/roundcube | 0 .../freedombox}/modules-enabled/rssbridge | 0 .../share/freedombox}/modules-enabled/samba | 0 .../share/freedombox}/modules-enabled/searx | 0 .../freedombox}/modules-enabled/security | 0 .../share/freedombox}/modules-enabled/shaarli | 0 .../freedombox}/modules-enabled/shadowsocks | 0 .../share/freedombox}/modules-enabled/sharing | 0 .../freedombox}/modules-enabled/snapshot | 0 .../share/freedombox}/modules-enabled/ssh | 0 .../share/freedombox}/modules-enabled/sso | 0 .../share/freedombox}/modules-enabled/storage | 0 .../freedombox}/modules-enabled/syncthing | 0 .../share/freedombox}/modules-enabled/tor | 0 .../freedombox}/modules-enabled/transmission | 0 .../share/freedombox}/modules-enabled/ttrss | 0 .../freedombox}/modules-enabled/upgrades | 0 .../share/freedombox}/modules-enabled/users | 0 .../freedombox}/modules-enabled/wireguard | 0 .../freedombox}/modules-enabled/wordpress | 0 .../share/freedombox}/modules-enabled/zoph | 0 plinth/privileged/service.py | 7 +- setup.py | 2 +- 70 files changed, 153 insertions(+), 50 deletions(-) rename plinth/modules/apache/data/{etc/plinth => usr/share/freedombox}/modules-enabled/apache (100%) rename plinth/modules/api/data/{etc/plinth => usr/share/freedombox}/modules-enabled/api (100%) rename plinth/modules/avahi/data/{etc/plinth => usr/share/freedombox}/modules-enabled/avahi (100%) rename plinth/modules/backups/data/{etc/plinth => usr/share/freedombox}/modules-enabled/backups (100%) rename plinth/modules/bepasty/data/{etc/plinth => usr/share/freedombox}/modules-enabled/bepasty (100%) rename plinth/modules/bind/data/{etc/plinth => usr/share/freedombox}/modules-enabled/bind (100%) rename plinth/modules/calibre/data/{etc/plinth => usr/share/freedombox}/modules-enabled/calibre (100%) rename plinth/modules/cockpit/data/{etc/plinth => usr/share/freedombox}/modules-enabled/cockpit (100%) rename plinth/modules/config/data/{etc/plinth => usr/share/freedombox}/modules-enabled/config (100%) rename plinth/modules/coturn/data/{etc/plinth => usr/share/freedombox}/modules-enabled/coturn (100%) rename plinth/modules/datetime/data/{etc/plinth => usr/share/freedombox}/modules-enabled/datetime (100%) rename plinth/modules/deluge/data/{etc/plinth => usr/share/freedombox}/modules-enabled/deluge (100%) rename plinth/modules/diagnostics/data/{etc/plinth => usr/share/freedombox}/modules-enabled/diagnostics (100%) rename plinth/modules/dynamicdns/data/{etc/plinth => usr/share/freedombox}/modules-enabled/dynamicdns (100%) rename plinth/modules/ejabberd/data/{etc/plinth => usr/share/freedombox}/modules-enabled/ejabberd (100%) rename plinth/modules/email/data/{etc/plinth => usr/share/freedombox}/modules-enabled/email (100%) rename plinth/modules/firewall/data/{etc/plinth => usr/share/freedombox}/modules-enabled/firewall (100%) rename plinth/modules/first_boot/data/{etc/plinth => usr/share/freedombox}/modules-enabled/first_boot (100%) rename plinth/modules/gitweb/data/{etc/plinth => usr/share/freedombox}/modules-enabled/gitweb (100%) rename plinth/modules/help/data/{etc/plinth => usr/share/freedombox}/modules-enabled/help (100%) rename plinth/modules/i2p/data/{etc/plinth => usr/share/freedombox}/modules-enabled/i2p (100%) rename plinth/modules/ikiwiki/data/{etc/plinth => usr/share/freedombox}/modules-enabled/ikiwiki (100%) rename plinth/modules/infinoted/data/{etc/plinth => usr/share/freedombox}/modules-enabled/infinoted (100%) rename plinth/modules/janus/data/{etc/plinth => usr/share/freedombox}/modules-enabled/janus (100%) rename plinth/modules/jsxc/data/{etc/plinth => usr/share/freedombox}/modules-enabled/jsxc (100%) rename plinth/modules/letsencrypt/data/{etc/plinth => usr/share/freedombox}/modules-enabled/letsencrypt (100%) rename plinth/modules/matrixsynapse/data/{etc/plinth => usr/share/freedombox}/modules-enabled/matrixsynapse (100%) rename plinth/modules/mediawiki/data/{etc/plinth => usr/share/freedombox}/modules-enabled/mediawiki (100%) rename plinth/modules/minetest/data/{etc/plinth => usr/share/freedombox}/modules-enabled/minetest (100%) rename plinth/modules/minidlna/data/{etc/plinth => usr/share/freedombox}/modules-enabled/minidlna (100%) rename plinth/modules/mumble/data/{etc/plinth => usr/share/freedombox}/modules-enabled/mumble (100%) rename plinth/modules/names/data/{etc/plinth => usr/share/freedombox}/modules-enabled/names (100%) rename plinth/modules/networks/data/{etc/plinth => usr/share/freedombox}/modules-enabled/networks (100%) rename plinth/modules/openvpn/data/{etc/plinth => usr/share/freedombox}/modules-enabled/openvpn (100%) rename plinth/modules/pagekite/data/{etc/plinth => usr/share/freedombox}/modules-enabled/pagekite (100%) rename plinth/modules/performance/data/{etc/plinth => usr/share/freedombox}/modules-enabled/performance (100%) rename plinth/modules/power/data/{etc/plinth => usr/share/freedombox}/modules-enabled/power (100%) rename plinth/modules/privacy/data/{etc/plinth => usr/share/freedombox}/modules-enabled/privacy (100%) rename plinth/modules/privoxy/data/{etc/plinth => usr/share/freedombox}/modules-enabled/privoxy (100%) rename plinth/modules/quassel/data/{etc/plinth => usr/share/freedombox}/modules-enabled/quassel (100%) rename plinth/modules/radicale/data/{etc/plinth => usr/share/freedombox}/modules-enabled/radicale (100%) rename plinth/modules/roundcube/data/{etc/plinth => usr/share/freedombox}/modules-enabled/roundcube (100%) rename plinth/modules/rssbridge/data/{etc/plinth => usr/share/freedombox}/modules-enabled/rssbridge (100%) rename plinth/modules/samba/data/{etc/plinth => usr/share/freedombox}/modules-enabled/samba (100%) rename plinth/modules/searx/data/{etc/plinth => usr/share/freedombox}/modules-enabled/searx (100%) rename plinth/modules/security/data/{etc/plinth => usr/share/freedombox}/modules-enabled/security (100%) rename plinth/modules/shaarli/data/{etc/plinth => usr/share/freedombox}/modules-enabled/shaarli (100%) rename plinth/modules/shadowsocks/data/{etc/plinth => usr/share/freedombox}/modules-enabled/shadowsocks (100%) rename plinth/modules/sharing/data/{etc/plinth => usr/share/freedombox}/modules-enabled/sharing (100%) rename plinth/modules/snapshot/data/{etc/plinth => usr/share/freedombox}/modules-enabled/snapshot (100%) rename plinth/modules/ssh/data/{etc/plinth => usr/share/freedombox}/modules-enabled/ssh (100%) rename plinth/modules/sso/data/{etc/plinth => usr/share/freedombox}/modules-enabled/sso (100%) rename plinth/modules/storage/data/{etc/plinth => usr/share/freedombox}/modules-enabled/storage (100%) rename plinth/modules/syncthing/data/{etc/plinth => usr/share/freedombox}/modules-enabled/syncthing (100%) rename plinth/modules/tor/data/{etc/plinth => usr/share/freedombox}/modules-enabled/tor (100%) rename plinth/modules/transmission/data/{etc/plinth => usr/share/freedombox}/modules-enabled/transmission (100%) rename plinth/modules/ttrss/data/{etc/plinth => usr/share/freedombox}/modules-enabled/ttrss (100%) rename plinth/modules/upgrades/data/{etc/plinth => usr/share/freedombox}/modules-enabled/upgrades (100%) rename plinth/modules/users/data/{etc/plinth => usr/share/freedombox}/modules-enabled/users (100%) rename plinth/modules/wireguard/data/{etc/plinth => usr/share/freedombox}/modules-enabled/wireguard (100%) rename plinth/modules/wordpress/data/{etc/plinth => usr/share/freedombox}/modules-enabled/wordpress (100%) rename plinth/modules/zoph/data/{etc/plinth => usr/share/freedombox}/modules-enabled/zoph (100%) diff --git a/debian/freedombox.install b/debian/freedombox.install index 3da41ad28..f2c9ae61d 100644 --- a/debian/freedombox.install +++ b/debian/freedombox.install @@ -3,6 +3,7 @@ usr/bin usr/lib usr/share/augeas usr/share/dbus-1 +usr/share/freedombox/modules-enabled usr/share/man usr/share/mediawiki usr/share/pam-configs diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index b23bff1c2..5727e68f5 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -25,3 +25,65 @@ rm_conffile /etc/fail2ban/jail.d/wordpress-auth-freedombox.conf 22.22~ rm_conffile /etc/fail2ban/filter.d/wordpress-auth-freedombox.conf 22.22~ rm_conffile /etc/security/access.d/10freedombox-performance.conf 22.25~ rm_conffile /etc/security/access.d/10freedombox-security.conf 22.25~ +rm_conffile /etc/plinth/modules-enabled/apache 23.10~ +rm_conffile /etc/plinth/modules-enabled/api 23.10~ +rm_conffile /etc/plinth/modules-enabled/avahi 23.10~ +rm_conffile /etc/plinth/modules-enabled/backups 23.10~ +rm_conffile /etc/plinth/modules-enabled/bepasty 23.10~ +rm_conffile /etc/plinth/modules-enabled/bind 23.10~ +rm_conffile /etc/plinth/modules-enabled/calibre 23.10~ +rm_conffile /etc/plinth/modules-enabled/cockpit 23.10~ +rm_conffile /etc/plinth/modules-enabled/config 23.10~ +rm_conffile /etc/plinth/modules-enabled/coturn 23.10~ +rm_conffile /etc/plinth/modules-enabled/datetime 23.10~ +rm_conffile /etc/plinth/modules-enabled/deluge 23.10~ +rm_conffile /etc/plinth/modules-enabled/diagnostics 23.10~ +rm_conffile /etc/plinth/modules-enabled/dynamicdns 23.10~ +rm_conffile /etc/plinth/modules-enabled/ejabberd 23.10~ +rm_conffile /etc/plinth/modules-enabled/email 23.10~ +rm_conffile /etc/plinth/modules-enabled/firewall 23.10~ +rm_conffile /etc/plinth/modules-enabled/first_boot 23.10~ +rm_conffile /etc/plinth/modules-enabled/gitweb 23.10~ +rm_conffile /etc/plinth/modules-enabled/help 23.10~ +rm_conffile /etc/plinth/modules-enabled/i2p 23.10~ +rm_conffile /etc/plinth/modules-enabled/ikiwiki 23.10~ +rm_conffile /etc/plinth/modules-enabled/infinoted 23.10~ +rm_conffile /etc/plinth/modules-enabled/janus 23.10~ +rm_conffile /etc/plinth/modules-enabled/jsxc 23.10~ +rm_conffile /etc/plinth/modules-enabled/letsencrypt 23.10~ +rm_conffile /etc/plinth/modules-enabled/matrixsynapse 23.10~ +rm_conffile /etc/plinth/modules-enabled/mediawiki 23.10~ +rm_conffile /etc/plinth/modules-enabled/minetest 23.10~ +rm_conffile /etc/plinth/modules-enabled/minidlna 23.10~ +rm_conffile /etc/plinth/modules-enabled/mumble 23.10~ +rm_conffile /etc/plinth/modules-enabled/names 23.10~ +rm_conffile /etc/plinth/modules-enabled/networks 23.10~ +rm_conffile /etc/plinth/modules-enabled/openvpn 23.10~ +rm_conffile /etc/plinth/modules-enabled/pagekite 23.10~ +rm_conffile /etc/plinth/modules-enabled/performance 23.10~ +rm_conffile /etc/plinth/modules-enabled/power 23.10~ +rm_conffile /etc/plinth/modules-enabled/privacy 23.10~ +rm_conffile /etc/plinth/modules-enabled/privoxy 23.10~ +rm_conffile /etc/plinth/modules-enabled/quassel 23.10~ +rm_conffile /etc/plinth/modules-enabled/radicale 23.10~ +rm_conffile /etc/plinth/modules-enabled/roundcube 23.10~ +rm_conffile /etc/plinth/modules-enabled/rssbridge 23.10~ +rm_conffile /etc/plinth/modules-enabled/samba 23.10~ +rm_conffile /etc/plinth/modules-enabled/searx 23.10~ +rm_conffile /etc/plinth/modules-enabled/security 23.10~ +rm_conffile /etc/plinth/modules-enabled/shaarli 23.10~ +rm_conffile /etc/plinth/modules-enabled/shadowsocks 23.10~ +rm_conffile /etc/plinth/modules-enabled/sharing 23.10~ +rm_conffile /etc/plinth/modules-enabled/snapshot 23.10~ +rm_conffile /etc/plinth/modules-enabled/ssh 23.10~ +rm_conffile /etc/plinth/modules-enabled/sso 23.10~ +rm_conffile /etc/plinth/modules-enabled/storage 23.10~ +rm_conffile /etc/plinth/modules-enabled/syncthing 23.10~ +rm_conffile /etc/plinth/modules-enabled/tor 23.10~ +rm_conffile /etc/plinth/modules-enabled/transmission 23.10~ +rm_conffile /etc/plinth/modules-enabled/ttrss 23.10~ +rm_conffile /etc/plinth/modules-enabled/upgrades 23.10~ +rm_conffile /etc/plinth/modules-enabled/users 23.10~ +rm_conffile /etc/plinth/modules-enabled/wireguard 23.10~ +rm_conffile /etc/plinth/modules-enabled/wordpress 23.10~ +rm_conffile /etc/plinth/modules-enabled/zoph 23.10~ diff --git a/doc/dev/tutorial/code.rst b/doc/dev/tutorial/code.rst index 0d4281b7a..056d3ea1d 100644 --- a/doc/dev/tutorial/code.rst +++ b/doc/dev/tutorial/code.rst @@ -42,10 +42,10 @@ plinth/modules/transmission/views.py .. literalinclude:: ../../../plinth/modules/transmission/views.py :language: python3 -plinth/modules/transmission/data/etc/plinth/modules-enabled/transmission -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +plinth/modules/transmission/data/usr/share/freedombox/modules-enabled/transmission +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. literalinclude:: ../../../plinth/modules/transmission/data/etc/plinth/modules-enabled/transmission +.. literalinclude:: ../../../plinth/modules/transmission/data/usr/share/freedombox/modules-enabled/transmission :language: text plinth/modules/transmission/data/etc/apache2/conf-available/transmission-plinth.conf diff --git a/doc/dev/tutorial/skeleton.rst b/doc/dev/tutorial/skeleton.rst index e79071838..3e52dcc4d 100644 --- a/doc/dev/tutorial/skeleton.rst +++ b/doc/dev/tutorial/skeleton.rst @@ -22,13 +22,15 @@ in a step-by-step manner:: ├─ urls.py ├─ views.py ├─┬ data/ - │ └─┬ etc/ - │ ├─┬ plinth/ - │ │ └─┬ modules-enabled/ - │ │ └─ transmission - │ └─┬ apache2/ - │ └─┬ conf-available/ - │ └─ transmission-freedombox.conf + │ ├─┬ etc/ + │ │ └─┬ apache2/ + │ │ └─┬ conf-available/ + │ │ └─ transmission-freedombox.conf + │ └─┬ usr/ + │ └─┬ share/ + │ └─┬ freedombox/ + │ └─┬ modules-enabled/ + │ └─ transmission └─┬ tests └─ __init__.py @@ -50,19 +52,20 @@ Tell FreedomBox that our app exists The first thing to do is tell FreedomBox that our app exists. This is done by writing a small file with the Python import path to our app and placing it in -``plinth/modules/transmission/data/etc/plinth/modules-enabled/``. Let us create -this file ``transmission``: +``plinth/modules/transmission/data/usr/share/freedombox/modules-enabled/``. Let +us create this file ``transmission``: .. code-block:: text - :caption: ``plinth/modules/transmission/data/etc/plinth/modules-enabled/transmission`` + :caption: ``plinth/modules/transmission/data/usr/share/freedombox/modules-enabled/transmission`` plinth.modules.transmission -This file is automatically installed to ``/etc/plinth/modules-enabled/`` by -FreedomBox's installation script ``setup.py``. If we are writing a module that -resides independently outside the FreedomBox's source code, the setup script -will need to copy it to the target location. Further, it is not necessary for -the app to be part of the ``plinth.modules`` namespace. It can, for example, be +This file is automatically installed to +``/usr/share/freedombox/modules-enabled/`` by FreedomBox's installation script +``setup.py``. If we are writing a module that resides independently outside the +FreedomBox's source code, the setup script will need to copy it to the target +location. Further, it is not necessary for the app to be part of the +``plinth.modules`` namespace. It can, for example, be ``freedombox_transmission``. Creating the App class diff --git a/plinth/module_loader.py b/plinth/module_loader.py index 190601520..4e4992851 100644 --- a/plinth/module_loader.py +++ b/plinth/module_loader.py @@ -61,30 +61,51 @@ def _include_module_urls(module_import_path, module_name): raise +def _get_modules_enabled_paths(): + """Return list of paths from which enabled modules list must be read.""" + return [ + pathlib.Path('/usr/share/freedombox/modules-enabled/'), + pathlib.Path('/etc/plinth/modules-enabled/'), # For compatibility + pathlib.Path('/etc/freedombox/modules-enabled/'), + ] + + +def _get_modules_enabled_files_to_read(): + """Return the list of files containing modules import paths.""" + module_files = {} + for path in _get_modules_enabled_paths(): + directory = pathlib.Path(path) + files = list(directory.glob('*')) + for file_ in files: + # Omit hidden or backup files + if file_.name.startswith('.') or '.dpkg' in file_.name: + continue + + if file_.is_symlink() and str(file_.resolve()) == '/dev/null': + module_files.pop(file_.name, None) + continue + + module_files[file_.name] = file_ + + if module_files: + return module_files.values() + + # './setup.py install' has not been executed yet. Pickup files to load + # from local module directories. + directory = pathlib.Path(__file__).parent + glob_pattern = 'modules/*/data/usr/share/freedombox/modules-enabled/*' + return list(directory.glob(glob_pattern)) + + def get_modules_to_load(): """Get the list of modules to be loaded""" global _modules_to_load if _modules_to_load is not None: return _modules_to_load - directory = pathlib.Path(cfg.config_dir) / 'modules-enabled' - files = list(directory.glob('*')) - if not files: - # './setup.py install' has not been executed yet. Pickup files to load - # from local module directories. - directory = pathlib.Path(__file__).parent - files = list( - directory.glob('modules/*/data/etc/plinth/modules-enabled/*')) - - # Omit hidden files - files = [ - file_ for file_ in files - if not file_.name.startswith('.') and '.dpkg' not in file_.name - ] - modules = [] - for file_ in files: - module = _get_module_import_paths_from_file(file_) + for file_ in _get_modules_enabled_files_to_read(): + module = _read_module_import_paths_from_file(file_) if module: modules.append(module) @@ -94,11 +115,35 @@ def get_modules_to_load(): def get_module_import_path(module_name: str) -> str: """Return the import path for a module.""" - file_path = pathlib.Path(cfg.config_dir) / 'modules-enabled' / module_name - return _get_module_import_paths_from_file(file_path) + import_path_file = None + for path in _get_modules_enabled_paths(): + file_ = path / module_name + if file_.exists(): + import_path_file = file_ + + if file_.is_symlink() and str(file_.resolve()) == '/dev/null': + import_path_file = None + + if not import_path_file: + # './setup.py install' has not been executed yet. Pickup files to load + # from local module directories. + directory = pathlib.Path(__file__).parent + import_path_file = (directory / + f'modules/{module_name}/data/usr/share/' + f'freedombox/modules-enabled/{module_name}') + + if not import_path_file: + raise ValueError('Unknown module') + + import_path = _read_module_import_paths_from_file(import_path_file) + if not import_path: + raise ValueError('Module disabled') + + return import_path -def _get_module_import_paths_from_file(file_path: str) -> Optional[str]: +def _read_module_import_paths_from_file( + file_path: pathlib.Path) -> Optional[str]: """Read a module's import path from a file.""" with file_path.open() as file_handle: for line in file_handle: diff --git a/plinth/modules/apache/data/etc/plinth/modules-enabled/apache b/plinth/modules/apache/data/usr/share/freedombox/modules-enabled/apache similarity index 100% rename from plinth/modules/apache/data/etc/plinth/modules-enabled/apache rename to plinth/modules/apache/data/usr/share/freedombox/modules-enabled/apache diff --git a/plinth/modules/api/data/etc/plinth/modules-enabled/api b/plinth/modules/api/data/usr/share/freedombox/modules-enabled/api similarity index 100% rename from plinth/modules/api/data/etc/plinth/modules-enabled/api rename to plinth/modules/api/data/usr/share/freedombox/modules-enabled/api diff --git a/plinth/modules/avahi/data/etc/plinth/modules-enabled/avahi b/plinth/modules/avahi/data/usr/share/freedombox/modules-enabled/avahi similarity index 100% rename from plinth/modules/avahi/data/etc/plinth/modules-enabled/avahi rename to plinth/modules/avahi/data/usr/share/freedombox/modules-enabled/avahi diff --git a/plinth/modules/backups/data/etc/plinth/modules-enabled/backups b/plinth/modules/backups/data/usr/share/freedombox/modules-enabled/backups similarity index 100% rename from plinth/modules/backups/data/etc/plinth/modules-enabled/backups rename to plinth/modules/backups/data/usr/share/freedombox/modules-enabled/backups diff --git a/plinth/modules/bepasty/data/etc/plinth/modules-enabled/bepasty b/plinth/modules/bepasty/data/usr/share/freedombox/modules-enabled/bepasty similarity index 100% rename from plinth/modules/bepasty/data/etc/plinth/modules-enabled/bepasty rename to plinth/modules/bepasty/data/usr/share/freedombox/modules-enabled/bepasty diff --git a/plinth/modules/bind/data/etc/plinth/modules-enabled/bind b/plinth/modules/bind/data/usr/share/freedombox/modules-enabled/bind similarity index 100% rename from plinth/modules/bind/data/etc/plinth/modules-enabled/bind rename to plinth/modules/bind/data/usr/share/freedombox/modules-enabled/bind diff --git a/plinth/modules/calibre/data/etc/plinth/modules-enabled/calibre b/plinth/modules/calibre/data/usr/share/freedombox/modules-enabled/calibre similarity index 100% rename from plinth/modules/calibre/data/etc/plinth/modules-enabled/calibre rename to plinth/modules/calibre/data/usr/share/freedombox/modules-enabled/calibre diff --git a/plinth/modules/cockpit/data/etc/plinth/modules-enabled/cockpit b/plinth/modules/cockpit/data/usr/share/freedombox/modules-enabled/cockpit similarity index 100% rename from plinth/modules/cockpit/data/etc/plinth/modules-enabled/cockpit rename to plinth/modules/cockpit/data/usr/share/freedombox/modules-enabled/cockpit diff --git a/plinth/modules/config/data/etc/plinth/modules-enabled/config b/plinth/modules/config/data/usr/share/freedombox/modules-enabled/config similarity index 100% rename from plinth/modules/config/data/etc/plinth/modules-enabled/config rename to plinth/modules/config/data/usr/share/freedombox/modules-enabled/config diff --git a/plinth/modules/coturn/data/etc/plinth/modules-enabled/coturn b/plinth/modules/coturn/data/usr/share/freedombox/modules-enabled/coturn similarity index 100% rename from plinth/modules/coturn/data/etc/plinth/modules-enabled/coturn rename to plinth/modules/coturn/data/usr/share/freedombox/modules-enabled/coturn diff --git a/plinth/modules/datetime/data/etc/plinth/modules-enabled/datetime b/plinth/modules/datetime/data/usr/share/freedombox/modules-enabled/datetime similarity index 100% rename from plinth/modules/datetime/data/etc/plinth/modules-enabled/datetime rename to plinth/modules/datetime/data/usr/share/freedombox/modules-enabled/datetime diff --git a/plinth/modules/deluge/data/etc/plinth/modules-enabled/deluge b/plinth/modules/deluge/data/usr/share/freedombox/modules-enabled/deluge similarity index 100% rename from plinth/modules/deluge/data/etc/plinth/modules-enabled/deluge rename to plinth/modules/deluge/data/usr/share/freedombox/modules-enabled/deluge diff --git a/plinth/modules/diagnostics/data/etc/plinth/modules-enabled/diagnostics b/plinth/modules/diagnostics/data/usr/share/freedombox/modules-enabled/diagnostics similarity index 100% rename from plinth/modules/diagnostics/data/etc/plinth/modules-enabled/diagnostics rename to plinth/modules/diagnostics/data/usr/share/freedombox/modules-enabled/diagnostics diff --git a/plinth/modules/dynamicdns/data/etc/plinth/modules-enabled/dynamicdns b/plinth/modules/dynamicdns/data/usr/share/freedombox/modules-enabled/dynamicdns similarity index 100% rename from plinth/modules/dynamicdns/data/etc/plinth/modules-enabled/dynamicdns rename to plinth/modules/dynamicdns/data/usr/share/freedombox/modules-enabled/dynamicdns diff --git a/plinth/modules/ejabberd/data/etc/plinth/modules-enabled/ejabberd b/plinth/modules/ejabberd/data/usr/share/freedombox/modules-enabled/ejabberd similarity index 100% rename from plinth/modules/ejabberd/data/etc/plinth/modules-enabled/ejabberd rename to plinth/modules/ejabberd/data/usr/share/freedombox/modules-enabled/ejabberd diff --git a/plinth/modules/email/data/etc/plinth/modules-enabled/email b/plinth/modules/email/data/usr/share/freedombox/modules-enabled/email similarity index 100% rename from plinth/modules/email/data/etc/plinth/modules-enabled/email rename to plinth/modules/email/data/usr/share/freedombox/modules-enabled/email diff --git a/plinth/modules/firewall/data/etc/plinth/modules-enabled/firewall b/plinth/modules/firewall/data/usr/share/freedombox/modules-enabled/firewall similarity index 100% rename from plinth/modules/firewall/data/etc/plinth/modules-enabled/firewall rename to plinth/modules/firewall/data/usr/share/freedombox/modules-enabled/firewall diff --git a/plinth/modules/first_boot/data/etc/plinth/modules-enabled/first_boot b/plinth/modules/first_boot/data/usr/share/freedombox/modules-enabled/first_boot similarity index 100% rename from plinth/modules/first_boot/data/etc/plinth/modules-enabled/first_boot rename to plinth/modules/first_boot/data/usr/share/freedombox/modules-enabled/first_boot diff --git a/plinth/modules/gitweb/data/etc/plinth/modules-enabled/gitweb b/plinth/modules/gitweb/data/usr/share/freedombox/modules-enabled/gitweb similarity index 100% rename from plinth/modules/gitweb/data/etc/plinth/modules-enabled/gitweb rename to plinth/modules/gitweb/data/usr/share/freedombox/modules-enabled/gitweb diff --git a/plinth/modules/help/data/etc/plinth/modules-enabled/help b/plinth/modules/help/data/usr/share/freedombox/modules-enabled/help similarity index 100% rename from plinth/modules/help/data/etc/plinth/modules-enabled/help rename to plinth/modules/help/data/usr/share/freedombox/modules-enabled/help diff --git a/plinth/modules/i2p/data/etc/plinth/modules-enabled/i2p b/plinth/modules/i2p/data/usr/share/freedombox/modules-enabled/i2p similarity index 100% rename from plinth/modules/i2p/data/etc/plinth/modules-enabled/i2p rename to plinth/modules/i2p/data/usr/share/freedombox/modules-enabled/i2p diff --git a/plinth/modules/ikiwiki/data/etc/plinth/modules-enabled/ikiwiki b/plinth/modules/ikiwiki/data/usr/share/freedombox/modules-enabled/ikiwiki similarity index 100% rename from plinth/modules/ikiwiki/data/etc/plinth/modules-enabled/ikiwiki rename to plinth/modules/ikiwiki/data/usr/share/freedombox/modules-enabled/ikiwiki diff --git a/plinth/modules/infinoted/data/etc/plinth/modules-enabled/infinoted b/plinth/modules/infinoted/data/usr/share/freedombox/modules-enabled/infinoted similarity index 100% rename from plinth/modules/infinoted/data/etc/plinth/modules-enabled/infinoted rename to plinth/modules/infinoted/data/usr/share/freedombox/modules-enabled/infinoted diff --git a/plinth/modules/janus/data/etc/plinth/modules-enabled/janus b/plinth/modules/janus/data/usr/share/freedombox/modules-enabled/janus similarity index 100% rename from plinth/modules/janus/data/etc/plinth/modules-enabled/janus rename to plinth/modules/janus/data/usr/share/freedombox/modules-enabled/janus diff --git a/plinth/modules/jsxc/data/etc/plinth/modules-enabled/jsxc b/plinth/modules/jsxc/data/usr/share/freedombox/modules-enabled/jsxc similarity index 100% rename from plinth/modules/jsxc/data/etc/plinth/modules-enabled/jsxc rename to plinth/modules/jsxc/data/usr/share/freedombox/modules-enabled/jsxc diff --git a/plinth/modules/letsencrypt/data/etc/plinth/modules-enabled/letsencrypt b/plinth/modules/letsencrypt/data/usr/share/freedombox/modules-enabled/letsencrypt similarity index 100% rename from plinth/modules/letsencrypt/data/etc/plinth/modules-enabled/letsencrypt rename to plinth/modules/letsencrypt/data/usr/share/freedombox/modules-enabled/letsencrypt diff --git a/plinth/modules/letsencrypt/privileged.py b/plinth/modules/letsencrypt/privileged.py index 516957bd3..843515472 100644 --- a/plinth/modules/letsencrypt/privileged.py +++ b/plinth/modules/letsencrypt/privileged.py @@ -17,7 +17,7 @@ import configobj from plinth import action_utils from plinth import app as app_module -from plinth import cfg +from plinth import module_loader from plinth.actions import privileged from plinth.modules import letsencrypt as le @@ -302,10 +302,7 @@ def _get_managed_path(path): def _assert_managed_path(module, path): """Check that path is in fact managed by module.""" - cfg.read() - module_file = pathlib.Path(cfg.config_dir) / 'modules-enabled' / module - module_path = module_file.read_text().strip() - + module_path = module_loader.get_module_import_path(module) module = importlib.import_module(module_path) module_classes = inspect.getmembers(module, inspect.isclass) app_classes = [ diff --git a/plinth/modules/matrixsynapse/data/etc/plinth/modules-enabled/matrixsynapse b/plinth/modules/matrixsynapse/data/usr/share/freedombox/modules-enabled/matrixsynapse similarity index 100% rename from plinth/modules/matrixsynapse/data/etc/plinth/modules-enabled/matrixsynapse rename to plinth/modules/matrixsynapse/data/usr/share/freedombox/modules-enabled/matrixsynapse diff --git a/plinth/modules/mediawiki/data/etc/plinth/modules-enabled/mediawiki b/plinth/modules/mediawiki/data/usr/share/freedombox/modules-enabled/mediawiki similarity index 100% rename from plinth/modules/mediawiki/data/etc/plinth/modules-enabled/mediawiki rename to plinth/modules/mediawiki/data/usr/share/freedombox/modules-enabled/mediawiki diff --git a/plinth/modules/minetest/data/etc/plinth/modules-enabled/minetest b/plinth/modules/minetest/data/usr/share/freedombox/modules-enabled/minetest similarity index 100% rename from plinth/modules/minetest/data/etc/plinth/modules-enabled/minetest rename to plinth/modules/minetest/data/usr/share/freedombox/modules-enabled/minetest diff --git a/plinth/modules/minidlna/data/etc/plinth/modules-enabled/minidlna b/plinth/modules/minidlna/data/usr/share/freedombox/modules-enabled/minidlna similarity index 100% rename from plinth/modules/minidlna/data/etc/plinth/modules-enabled/minidlna rename to plinth/modules/minidlna/data/usr/share/freedombox/modules-enabled/minidlna diff --git a/plinth/modules/mumble/data/etc/plinth/modules-enabled/mumble b/plinth/modules/mumble/data/usr/share/freedombox/modules-enabled/mumble similarity index 100% rename from plinth/modules/mumble/data/etc/plinth/modules-enabled/mumble rename to plinth/modules/mumble/data/usr/share/freedombox/modules-enabled/mumble diff --git a/plinth/modules/names/data/etc/plinth/modules-enabled/names b/plinth/modules/names/data/usr/share/freedombox/modules-enabled/names similarity index 100% rename from plinth/modules/names/data/etc/plinth/modules-enabled/names rename to plinth/modules/names/data/usr/share/freedombox/modules-enabled/names diff --git a/plinth/modules/networks/data/etc/plinth/modules-enabled/networks b/plinth/modules/networks/data/usr/share/freedombox/modules-enabled/networks similarity index 100% rename from plinth/modules/networks/data/etc/plinth/modules-enabled/networks rename to plinth/modules/networks/data/usr/share/freedombox/modules-enabled/networks diff --git a/plinth/modules/openvpn/data/etc/plinth/modules-enabled/openvpn b/plinth/modules/openvpn/data/usr/share/freedombox/modules-enabled/openvpn similarity index 100% rename from plinth/modules/openvpn/data/etc/plinth/modules-enabled/openvpn rename to plinth/modules/openvpn/data/usr/share/freedombox/modules-enabled/openvpn diff --git a/plinth/modules/pagekite/data/etc/plinth/modules-enabled/pagekite b/plinth/modules/pagekite/data/usr/share/freedombox/modules-enabled/pagekite similarity index 100% rename from plinth/modules/pagekite/data/etc/plinth/modules-enabled/pagekite rename to plinth/modules/pagekite/data/usr/share/freedombox/modules-enabled/pagekite diff --git a/plinth/modules/performance/data/etc/plinth/modules-enabled/performance b/plinth/modules/performance/data/usr/share/freedombox/modules-enabled/performance similarity index 100% rename from plinth/modules/performance/data/etc/plinth/modules-enabled/performance rename to plinth/modules/performance/data/usr/share/freedombox/modules-enabled/performance diff --git a/plinth/modules/power/data/etc/plinth/modules-enabled/power b/plinth/modules/power/data/usr/share/freedombox/modules-enabled/power similarity index 100% rename from plinth/modules/power/data/etc/plinth/modules-enabled/power rename to plinth/modules/power/data/usr/share/freedombox/modules-enabled/power diff --git a/plinth/modules/privacy/data/etc/plinth/modules-enabled/privacy b/plinth/modules/privacy/data/usr/share/freedombox/modules-enabled/privacy similarity index 100% rename from plinth/modules/privacy/data/etc/plinth/modules-enabled/privacy rename to plinth/modules/privacy/data/usr/share/freedombox/modules-enabled/privacy diff --git a/plinth/modules/privoxy/data/etc/plinth/modules-enabled/privoxy b/plinth/modules/privoxy/data/usr/share/freedombox/modules-enabled/privoxy similarity index 100% rename from plinth/modules/privoxy/data/etc/plinth/modules-enabled/privoxy rename to plinth/modules/privoxy/data/usr/share/freedombox/modules-enabled/privoxy diff --git a/plinth/modules/quassel/data/etc/plinth/modules-enabled/quassel b/plinth/modules/quassel/data/usr/share/freedombox/modules-enabled/quassel similarity index 100% rename from plinth/modules/quassel/data/etc/plinth/modules-enabled/quassel rename to plinth/modules/quassel/data/usr/share/freedombox/modules-enabled/quassel diff --git a/plinth/modules/radicale/data/etc/plinth/modules-enabled/radicale b/plinth/modules/radicale/data/usr/share/freedombox/modules-enabled/radicale similarity index 100% rename from plinth/modules/radicale/data/etc/plinth/modules-enabled/radicale rename to plinth/modules/radicale/data/usr/share/freedombox/modules-enabled/radicale diff --git a/plinth/modules/roundcube/data/etc/plinth/modules-enabled/roundcube b/plinth/modules/roundcube/data/usr/share/freedombox/modules-enabled/roundcube similarity index 100% rename from plinth/modules/roundcube/data/etc/plinth/modules-enabled/roundcube rename to plinth/modules/roundcube/data/usr/share/freedombox/modules-enabled/roundcube diff --git a/plinth/modules/rssbridge/data/etc/plinth/modules-enabled/rssbridge b/plinth/modules/rssbridge/data/usr/share/freedombox/modules-enabled/rssbridge similarity index 100% rename from plinth/modules/rssbridge/data/etc/plinth/modules-enabled/rssbridge rename to plinth/modules/rssbridge/data/usr/share/freedombox/modules-enabled/rssbridge diff --git a/plinth/modules/samba/data/etc/plinth/modules-enabled/samba b/plinth/modules/samba/data/usr/share/freedombox/modules-enabled/samba similarity index 100% rename from plinth/modules/samba/data/etc/plinth/modules-enabled/samba rename to plinth/modules/samba/data/usr/share/freedombox/modules-enabled/samba diff --git a/plinth/modules/searx/data/etc/plinth/modules-enabled/searx b/plinth/modules/searx/data/usr/share/freedombox/modules-enabled/searx similarity index 100% rename from plinth/modules/searx/data/etc/plinth/modules-enabled/searx rename to plinth/modules/searx/data/usr/share/freedombox/modules-enabled/searx diff --git a/plinth/modules/security/data/etc/plinth/modules-enabled/security b/plinth/modules/security/data/usr/share/freedombox/modules-enabled/security similarity index 100% rename from plinth/modules/security/data/etc/plinth/modules-enabled/security rename to plinth/modules/security/data/usr/share/freedombox/modules-enabled/security diff --git a/plinth/modules/shaarli/data/etc/plinth/modules-enabled/shaarli b/plinth/modules/shaarli/data/usr/share/freedombox/modules-enabled/shaarli similarity index 100% rename from plinth/modules/shaarli/data/etc/plinth/modules-enabled/shaarli rename to plinth/modules/shaarli/data/usr/share/freedombox/modules-enabled/shaarli diff --git a/plinth/modules/shadowsocks/data/etc/plinth/modules-enabled/shadowsocks b/plinth/modules/shadowsocks/data/usr/share/freedombox/modules-enabled/shadowsocks similarity index 100% rename from plinth/modules/shadowsocks/data/etc/plinth/modules-enabled/shadowsocks rename to plinth/modules/shadowsocks/data/usr/share/freedombox/modules-enabled/shadowsocks diff --git a/plinth/modules/sharing/data/etc/plinth/modules-enabled/sharing b/plinth/modules/sharing/data/usr/share/freedombox/modules-enabled/sharing similarity index 100% rename from plinth/modules/sharing/data/etc/plinth/modules-enabled/sharing rename to plinth/modules/sharing/data/usr/share/freedombox/modules-enabled/sharing diff --git a/plinth/modules/snapshot/data/etc/plinth/modules-enabled/snapshot b/plinth/modules/snapshot/data/usr/share/freedombox/modules-enabled/snapshot similarity index 100% rename from plinth/modules/snapshot/data/etc/plinth/modules-enabled/snapshot rename to plinth/modules/snapshot/data/usr/share/freedombox/modules-enabled/snapshot diff --git a/plinth/modules/ssh/data/etc/plinth/modules-enabled/ssh b/plinth/modules/ssh/data/usr/share/freedombox/modules-enabled/ssh similarity index 100% rename from plinth/modules/ssh/data/etc/plinth/modules-enabled/ssh rename to plinth/modules/ssh/data/usr/share/freedombox/modules-enabled/ssh diff --git a/plinth/modules/sso/data/etc/plinth/modules-enabled/sso b/plinth/modules/sso/data/usr/share/freedombox/modules-enabled/sso similarity index 100% rename from plinth/modules/sso/data/etc/plinth/modules-enabled/sso rename to plinth/modules/sso/data/usr/share/freedombox/modules-enabled/sso diff --git a/plinth/modules/storage/data/etc/plinth/modules-enabled/storage b/plinth/modules/storage/data/usr/share/freedombox/modules-enabled/storage similarity index 100% rename from plinth/modules/storage/data/etc/plinth/modules-enabled/storage rename to plinth/modules/storage/data/usr/share/freedombox/modules-enabled/storage diff --git a/plinth/modules/syncthing/data/etc/plinth/modules-enabled/syncthing b/plinth/modules/syncthing/data/usr/share/freedombox/modules-enabled/syncthing similarity index 100% rename from plinth/modules/syncthing/data/etc/plinth/modules-enabled/syncthing rename to plinth/modules/syncthing/data/usr/share/freedombox/modules-enabled/syncthing diff --git a/plinth/modules/tor/data/etc/plinth/modules-enabled/tor b/plinth/modules/tor/data/usr/share/freedombox/modules-enabled/tor similarity index 100% rename from plinth/modules/tor/data/etc/plinth/modules-enabled/tor rename to plinth/modules/tor/data/usr/share/freedombox/modules-enabled/tor diff --git a/plinth/modules/transmission/data/etc/plinth/modules-enabled/transmission b/plinth/modules/transmission/data/usr/share/freedombox/modules-enabled/transmission similarity index 100% rename from plinth/modules/transmission/data/etc/plinth/modules-enabled/transmission rename to plinth/modules/transmission/data/usr/share/freedombox/modules-enabled/transmission diff --git a/plinth/modules/ttrss/data/etc/plinth/modules-enabled/ttrss b/plinth/modules/ttrss/data/usr/share/freedombox/modules-enabled/ttrss similarity index 100% rename from plinth/modules/ttrss/data/etc/plinth/modules-enabled/ttrss rename to plinth/modules/ttrss/data/usr/share/freedombox/modules-enabled/ttrss diff --git a/plinth/modules/upgrades/data/etc/plinth/modules-enabled/upgrades b/plinth/modules/upgrades/data/usr/share/freedombox/modules-enabled/upgrades similarity index 100% rename from plinth/modules/upgrades/data/etc/plinth/modules-enabled/upgrades rename to plinth/modules/upgrades/data/usr/share/freedombox/modules-enabled/upgrades diff --git a/plinth/modules/users/data/etc/plinth/modules-enabled/users b/plinth/modules/users/data/usr/share/freedombox/modules-enabled/users similarity index 100% rename from plinth/modules/users/data/etc/plinth/modules-enabled/users rename to plinth/modules/users/data/usr/share/freedombox/modules-enabled/users diff --git a/plinth/modules/wireguard/data/etc/plinth/modules-enabled/wireguard b/plinth/modules/wireguard/data/usr/share/freedombox/modules-enabled/wireguard similarity index 100% rename from plinth/modules/wireguard/data/etc/plinth/modules-enabled/wireguard rename to plinth/modules/wireguard/data/usr/share/freedombox/modules-enabled/wireguard diff --git a/plinth/modules/wordpress/data/etc/plinth/modules-enabled/wordpress b/plinth/modules/wordpress/data/usr/share/freedombox/modules-enabled/wordpress similarity index 100% rename from plinth/modules/wordpress/data/etc/plinth/modules-enabled/wordpress rename to plinth/modules/wordpress/data/usr/share/freedombox/modules-enabled/wordpress diff --git a/plinth/modules/zoph/data/etc/plinth/modules-enabled/zoph b/plinth/modules/zoph/data/usr/share/freedombox/modules-enabled/zoph similarity index 100% rename from plinth/modules/zoph/data/etc/plinth/modules-enabled/zoph rename to plinth/modules/zoph/data/usr/share/freedombox/modules-enabled/zoph diff --git a/plinth/privileged/service.py b/plinth/privileged/service.py index 500871c8d..f9e5ffad9 100644 --- a/plinth/privileged/service.py +++ b/plinth/privileged/service.py @@ -1,17 +1,12 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """List and handle system services.""" -import os - from plinth import action_utils from plinth import app as app_module -from plinth import cfg, module_loader +from plinth import module_loader from plinth.actions import privileged from plinth.daemon import Daemon, RelatedDaemon -cfg.read() -module_config_path = os.path.join(cfg.config_dir, 'modules-enabled') - @privileged def start(service: str): diff --git a/setup.py b/setup.py index b16337e14..aae4ce7d8 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ DIRECTORIES_TO_COPY = [ ('/usr/share/plinth/static', 'static'), ] -ENABLED_APPS_PATH = "/etc/plinth/modules-enabled/" +ENABLED_APPS_PATH = "/usr/share/freedombox/modules-enabled/" DISABLED_APPS_TO_REMOVE = [ 'apps',