Compare commits
	
		
			1 Commits
		
	
	
		
			7a0d86a07b
			...
			784794649f
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 784794649f | 
|  | @ -1,8 +1,10 @@ | |||
| """Flaschengeist""" | ||||
| import logging | ||||
| from importlib.metadata import version | ||||
| from pathlib import Path | ||||
| 
 | ||||
| __version__ = version("flaschengeist") | ||||
| _module_path = Path(__file__).parent | ||||
| __pdoc__ = {} | ||||
| 
 | ||||
| logger = logging.getLogger(__name__) | ||||
|  |  | |||
|  | @ -1,12 +1,12 @@ | |||
| import os | ||||
| import toml | ||||
| import logging.config | ||||
| import collections.abc | ||||
| 
 | ||||
| from pathlib import Path | ||||
| from logging.config import dictConfig | ||||
| from werkzeug.middleware.proxy_fix import ProxyFix | ||||
| from flaschengeist import _module_path, logger | ||||
| 
 | ||||
| from flaschengeist import logger | ||||
| 
 | ||||
| # Default config: | ||||
| config = {"DATABASE": {"engine": "mysql", "port": 3306}} | ||||
|  | @ -23,7 +23,7 @@ def update_dict(d, u): | |||
| 
 | ||||
| def read_configuration(test_config): | ||||
|     global config | ||||
|     paths = [Path(__file__).parent] | ||||
|     paths = [_module_path] | ||||
| 
 | ||||
|     if not test_config: | ||||
|         paths.append(Path.home() / ".config") | ||||
|  | @ -56,7 +56,7 @@ def configure_logger(): | |||
|         logger_config["handlers"]["wsgi"]["level"] = level | ||||
| 
 | ||||
|     # Read default config | ||||
|     logger_config = toml.load(Path(__file__).parent /"logging.toml") | ||||
|     logger_config = toml.load(_module_path / "logging.toml") | ||||
|     if "LOGGING" in config: | ||||
|         # Override with user config | ||||
|         update_dict(logger_config, config.get("LOGGING")) | ||||
|  | @ -68,7 +68,7 @@ def configure_logger(): | |||
|     if "FG_LOGGING" in os.environ: | ||||
|         set_level(os.environ.get("FG_LOGGING", "CRITICAL")) | ||||
| 
 | ||||
|     dictConfig(logger_config) | ||||
|     logging.config.dictConfig(logger_config) | ||||
| 
 | ||||
| 
 | ||||
| def configure_app(app, test_config=None): | ||||
|  |  | |||
|  | @ -12,12 +12,10 @@ root = "/api" | |||
| secret_key = "V3ryS3cr3t" | ||||
| # Domain used by frontend | ||||
| 
 | ||||
| [DATABASE] | ||||
| # engine = "mysql" (default) | ||||
| host = "localhost" | ||||
| user = "flaschengeist" | ||||
| password = "flaschengeist" | ||||
| database = "flaschengeist" | ||||
| [scheduler] | ||||
| # Possible values are: "passive_web" (default), "active_web" and "system" | ||||
| # See documentation | ||||
| # cron = "passive_web" | ||||
| 
 | ||||
| [LOGGING] | ||||
| # You can override all settings from the logging.toml here | ||||
|  | @ -35,6 +33,14 @@ level = "DEBUG" | |||
| #    encoding = "utf8" | ||||
| #    filename = "flaschengeist.log" | ||||
| 
 | ||||
| 
 | ||||
| [DATABASE] | ||||
| # engine = "mysql" (default) | ||||
| host = "localhost" | ||||
| user = "flaschengeist" | ||||
| password = "flaschengeist" | ||||
| database = "flaschengeist" | ||||
| 
 | ||||
| [FILES] | ||||
| # Path for file / image uploads | ||||
| data_path = "./data" | ||||
|  | @ -48,11 +54,6 @@ allowed_mimetypes = [ | |||
|     "image/webp" | ||||
| ] | ||||
| 
 | ||||
| [scheduler] | ||||
| # Possible values are: "passive_web" (default), "active_web" and "system" | ||||
| # See documentation | ||||
| # cron = "passive_web" | ||||
| 
 | ||||
| [auth_ldap] | ||||
| # Full documentation https://flaschengeist.dev/Flaschengeist/flaschengeist/wiki/plugins_auth_ldap | ||||
| # host = "localhost" | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue