Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: addition of initial work on the consts #176

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions frappe_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
16 changes: 16 additions & 0 deletions frappe_manager/consts/__init__.py
Original file line number Diff line number Diff line change
@@ -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