cfg: Drop unused config_dir option

Tests:

- Unit tests pass.

- When file /usr/share/freedombox/freedombox.conf is created, we can see log
message 'Configuration loaded from file - /usr/share/freedombox/freedombox.conf'

- When running in develop mode, we can see log message 'Configuration loaded
from file - /freedombox/plinth/develop.conf'

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-11-17 11:52:04 -08:00 committed by James Valleroy
parent 778c35f2bc
commit a7ec37dbce
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
5 changed files with 3 additions and 8 deletions

View File

@ -12,7 +12,6 @@ logger = logging.getLogger(__name__)
# [Path] section
file_root = '/usr/share/plinth'
config_dir = '/etc/plinth'
data_dir = '/var/lib/plinth'
custom_static_dir = '/var/www/plinth/custom/static'
store_file = data_dir + '/plinth.sqlite3'
@ -111,7 +110,6 @@ def read_file(config_path):
config_items = (
('Path', 'file_root', 'string'),
('Path', 'config_dir', 'string'),
('Path', 'data_dir', 'string'),
('Path', 'custom_static_dir', 'string'),
('Path', 'store_file', 'string'),

View File

@ -64,9 +64,9 @@ def fixture_load_cfg():
"""Load test configuration."""
from plinth import cfg
keys = ('file_root', 'config_dir', 'data_dir', 'custom_static_dir',
'store_file', 'actions_dir', 'doc_dir', 'server_dir', 'host',
'port', 'use_x_forwarded_for', 'use_x_forwarded_host',
keys = ('file_root', 'data_dir', 'custom_static_dir', 'store_file',
'actions_dir', 'doc_dir', 'server_dir', 'host', 'port',
'use_x_forwarded_for', 'use_x_forwarded_host',
'secure_proxy_ssl_header', 'box_name', 'develop')
saved_state = {}
for key in keys:

View File

@ -1,5 +1,4 @@
[Path]
file_root = %(parent_parent_dir)s
config_dir = %(file_root)s/data/etc/plinth
actions_dir = %(file_root)s/actions
doc_dir = %(file_root)s/doc

View File

@ -1,6 +1,5 @@
[Path]
file_root = %(parent_dir)s
config_dir = %(file_root)s/data/etc/plinth
data_dir = %(file_root)s/data/var/lib/plinth
server_dir = /plinth
actions_dir = %(file_root)s/actions

View File

@ -102,7 +102,6 @@ def test_read_config_file_with_missing_options():
def compare_configurations(parser):
"""Compare two sets of configuration values."""
assert parser.get('Path', 'file_root') == cfg.file_root
assert parser.get('Path', 'config_dir') == cfg.config_dir
assert parser.get('Path', 'custom_static_dir') == cfg.custom_static_dir
assert parser.get('Path', 'data_dir') == cfg.data_dir
assert parser.get('Path', 'store_file') == cfg.store_file