diff --git a/frappe_manager/__init__.py b/frappe_manager/__init__.py index 618348cf..77df1e37 100644 --- a/frappe_manager/__init__.py +++ b/frappe_manager/__init__.py @@ -1,21 +1,21 @@ from pathlib import Path from enum import Enum +import frappe_manager.consts as consts # TODO configure this using config # sites_dir = Path().home() / __name__.split(".")[0] -CLI_DIR = Path.home() / "frappe" -CLI_FM_CONFIG_PATH = CLI_DIR / "fm_config.toml" -CLI_SITES_ARCHIVE = CLI_DIR / "archived" -CLI_LOG_DIRECTORY = CLI_DIR / 'logs' -CLI_BENCHES_DIRECTORY = CLI_DIR / 'sites' -CLI_SERVICES_DIRECTORY = CLI_DIR / 'services' - -CLI_SERVICES_NGINX_PROXY_DIR = CLI_SERVICES_DIRECTORY / 'nginx-proxy' -CLI_SERVICES_NGINX_PROXY_SSL_DIR = CLI_SERVICES_NGINX_PROXY_DIR / 'ssl' - -CLI_BENCH_CONFIG_FILE_NAME = 'bench_config.toml' -SSL_RENEW_BEFORE_DAYS = 30 - +CLI_DIR = Path.home() / consts.CONFIG_DIR_NAME +CLI_FM_CONFIG_PATH = CLI_DIR / consts.CONFIG_FM_FILE_NAME +CLI_SITES_ARCHIVE = CLI_DIR / consts.CONFIG_ARCHIEVE_DIR_NAME +CLI_LOG_DIRECTORY = CLI_DIR / consts.CONFIG_LOG_DIR_NAME +CLI_BENCHES_DIRECTORY = CLI_DIR / consts.CONFIG_SITES_DIR_NAME +CLI_SERVICES_DIRECTORY = CLI_DIR / consts.CONFIG_SERVICES_DIR_NAME + +CLI_SERVICES_NGINX_PROXY_DIR = CLI_SERVICES_DIRECTORY / consts.CONFIG_SERVICE_NGINX_DIR_NAME +CLI_SERVICES_NGINX_PROXY_SSL_DIR = CLI_SERVICES_NGINX_PROXY_DIR / consts.CONFIG_SERVICE_NGINX_SSL_DIR_NAME + +CLI_BENCH_CONFIG_FILE_NAME = consts.CONFIG_BENCH_CONFIG_FILE_NAME +SSL_RENEW_BEFORE_DAYS = consts.SSL_RENEW_BEFORE_DAYS DEFAULT_EXTENSIONS = [ "dbaeumer.vscode-eslint", diff --git a/frappe_manager/consts/__init__.py b/frappe_manager/consts/__init__.py new file mode 100644 index 00000000..fd36c4df --- /dev/null +++ b/frappe_manager/consts/__init__.py @@ -0,0 +1,16 @@ +from pathlib import Path +from typing import Final + +# TODO configure this using config +# sites_dir = Path().home() / __name__.split(".")[0] +CONFIG_DIR_NAME: Final[str] = "frappe" +CONFIG_FM_FILE_NAME: Final[str] = "fm_config.toml" +CONFIG_ARCHIEVE_DIR_NAME: Final[str] = "archived" +CONFIG_LOG_DIR_NAME: Final[str] = 'logs' +CONFIG_SITES_DIR_NAME: Final[str] = 'sites' + +CONFIG_SERVICES_DIR_NAME: Final[str] = 'services' +CONFIG_SERVICE_NGINX_DIR_NAME: Final[str] = 'nginx-proxy' +CONFIG_SERVICE_NGINX_SSL_DIR_NAME: Final[str] = 'ssl' +CONFIG_BENCH_CONFIG_FILE_NAME: Final[str] = 'bench_config.toml' +SSL_RENEW_BEFORE_DAYS: Final[int] = 30