main: Allow setting development mode from environment

- Similar to freedombox-privileged daemon. It makes it easy to turn on
development mode from a systemd service override (without having to override the
entire command line).

Tests:

- With the changes to systemd service file in this patch series, changing source
code file leads to plinth getting restarted.

Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2025-10-27 20:50:04 -07:00 committed by Veiko Aasa
parent 623604649e
commit e5026282fe
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -3,6 +3,7 @@
import argparse
import logging
import os
import sys
import threading
@ -121,7 +122,8 @@ def main():
arguments = parse_arguments()
cfg.read()
if arguments.develop:
if arguments.develop or os.getenv('FREEDOMBOX_DEVELOP', '') == '1':
cfg.develop = True
# Use the config in the current working directory
cfg.read_file(cfg.get_develop_config_path())