import os.path

systemctl_binary = "@SYSTEMCTL@"
systemd_unit_path = "@SYSTEMD_UNIT_PATH@".split(":")
chkconfig_binary = "/sbin/chkconfig"
service_binary = "@SERVICE@"
# Used only in utils.py in deprecated funcion
pacemaker_binaries = "@PCMKEXECPREFIX@/sbin"
corosync_binaries = "@COROEXECPREFIX@/sbin"
corosync_qnet_binaries = "@COROQDEVEXECPREFIX@/bin"
corosync_qdevice_binaries = "@COROQDEVEXECPREFIX@/sbin"
corosync_conf_dir = "@COROCONFDIR@/corosync"
corosync_conf_file = os.path.join(corosync_conf_dir, "corosync.conf")
corosync_uidgid_dir = os.path.join(corosync_conf_dir, "uidgid.d")
corosync_qdevice_conf_dir = "@COROQDEVCONFDIR@"
corosync_qdevice_net_server_certs_dir = os.path.join(
    corosync_qdevice_conf_dir, "qnetd/nssdb"
)
corosync_qdevice_net_client_certs_dir = os.path.join(
    corosync_qdevice_conf_dir, "qdevice/net/nssdb"
)
corosync_qdevice_net_client_ca_file_name = "qnetd-cacert.crt"
corosync_authkey_file = os.path.join(corosync_conf_dir, "authkey")
# Must be set to 256 for corosync to work in FIPS environment.
corosync_authkey_bytes = 256
corosync_log_file = "@COROLOGDIR@/corosync.log"
pacemaker_authkey_file = "@PCMKCONFDIR@/pacemaker/authkey"
# Using the same value as for corosync. Higher values MAY work in FIPS.
pacemaker_authkey_bytes = 256
pcsd_token_max_bytes = 256
booth_authkey_file_mode = 0o600
# Booth does not support keys longer than 64 bytes.
booth_authkey_bytes = 64
# cluster conf is obsoleted and didn't support out-of-tree installation / run
# hence it can stay hardcoded
cluster_conf_file = "/etc/cluster/cluster.conf"
fence_agent_binaries = "@FASEXECPREFIX@/sbin"
pacemaker_local_state_dir = os.path.join(
    "/", "@PCMKLOCALSTATEDIR@", "lib/pacemaker"
)
pacemaker_daemon_dir = "@PCMK_DAEMON_DIR@"
pacemaker_schedulerd = os.path.join(
    pacemaker_daemon_dir, "pacemaker-schedulerd"
)
pacemaker_controld = os.path.join(pacemaker_daemon_dir, "pacemaker-controld")
pacemaker_based = os.path.join(pacemaker_daemon_dir, "pacemaker-based")
pacemaker_fenced = os.path.join(pacemaker_daemon_dir, "pacemaker-fenced")
pcs_version = "@VERSION@"
crm_resource_binary = "@PCMKEXECPREFIX@/sbin/crm_resource"
crm_mon = "@PCMKEXECPREFIX@/sbin/crm_mon"
crm_report = "@PCMKEXECPREFIX@/sbin/crm_report"
crm_rule = "@PCMKEXECPREFIX@/sbin/crm_rule"
crm_verify = "@PCMKEXECPREFIX@/sbin/crm_verify"
crm_diff = "@PCMKEXECPREFIX@/sbin/crm_diff"
cibadmin = "@PCMKEXECPREFIX@/sbin/cibadmin"
crm_mon_schema = "@PCMK_SCHEMA_DIR@/crm_mon.rng"
pacemaker_api_result_schema = "@PCMK_SCHEMA_DIR@/api/api-result.rng"
agent_metadata_schema = "@RA_API_DTD@"
pcsd_var_location = "@LOCALSTATEDIR@/lib/pcsd"
pcsd_ruby_socket = "@LOCALSTATEDIR@/run/pcsd-ruby.socket"
pcsd_cert_location = os.path.join(pcsd_var_location, "pcsd.crt")
pcsd_key_location = os.path.join(pcsd_var_location, "pcsd.key")
pcsd_known_hosts_location = os.path.join(pcsd_var_location, "known-hosts")
pcsd_users_conf_location = os.path.join(pcsd_var_location, "pcs_users.conf")
pcsd_settings_conf_location = os.path.join(
    pcsd_var_location, "pcs_settings.conf"
)
pcsd_dr_config_location = os.path.join(pcsd_var_location, "disaster-recovery")
pcsd_exec_location = "@LIB_DIR@/pcsd"
pcsd_log_location = "@LOCALSTATEDIR@/log/pcsd/pcsd.log"
pcsd_default_port = 2224
pcsd_config = "@CONF_DIR@/pcsd"
cib_dir = "@PCMK_CIB_DIR@"
pacemaker_uname = "@PCMK_USER@"
pacemaker_gname = "@PCMK_GROUP@"
sbd_binary = "@SBDEXECPREFIX@/sbin/sbd"
sbd_watchdog_default = "/dev/watchdog"
sbd_config = "@SBDCONFDIR@/sbd"
# this limit is also mentioned in docs, change there as well
sbd_max_device_num = 3
# message types are also mentioned in docs, change there as well
sbd_message_types = ["test", "reset", "off", "crashdump", "exit", "clear"]
pacemaker_wait_timeout_status = 124
booth_config_dir = "@BOOTHCONFDIR@"
booth_binary = "@BOOTHEXECPREFIX@/sbin/booth"
default_request_timeout = 60
pcs_bundled_dir = "@PCS_BUNDLED_DIR@"
pcs_bundled_packages_dir = os.path.join(pcs_bundled_dir, "packages")

default_ssl_ciphers = "DEFAULT:!RC4:!3DES:@STRENGTH"

# Ssl options are based on default options in python (maybe with some extra
# options). Format here is the same as the PCSD_SSL_OPTIONS environment
# variable format (string with coma as a delimiter).
default_ssl_options = ",".join(
    [
        "OP_NO_COMPRESSION",
        "OP_CIPHER_SERVER_PREFERENCE",
        "OP_SINGLE_DH_USE",
        "OP_SINGLE_ECDH_USE",
        "OP_NO_SSLv2",
        "OP_NO_SSLv3",
        "OP_NO_TLSv1",
        "OP_NO_TLSv1_1",
        "OP_NO_RENEGOTIATION",
    ]
)
# Set pcsd_gem_path to None if there are no bundled ruby gems and the path does
# not exists.
pcsd_gem_path = "@GEM_HOME@" or None
ruby_executable = "@RUBY@"

killall_executable = "@KILLALL@"
rm_executable = "@RM@"
find_executable = "@FIND@"

gui_session_lifetime_seconds = 60 * 60
