#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
import os
DEFAULT_STORAGE_PATH = '/opt/cloudlinux/flags'
DEFAULT_FLAGS_STORAGE_PATH = os.path.join(DEFAULT_STORAGE_PATH, 'enabled-flags.d')
DEFAULT_META_STORAGE_PATH = os.path.join(DEFAULT_STORAGE_PATH, 'available-flags.d')
# Optional per-feature parameters, written alongside the flag by whatever
# manages it. Kept separate from the flag file so that answering "is this on?"
# stays a single stat() with nothing to parse - which is what lets a C feature
# read its own flag without linking a JSON parser.
DEFAULT_CONFIG_STORAGE_PATH = os.path.join(DEFAULT_STORAGE_PATH, 'config.d')
# An admin who wants a feature kept off on this server puts .flag here.
# clflags.is_enabled() then answers "off", and the remote settings
# (cloudlinux-flags-sync) never switch that feature on and switch it off if it
# is on - whatever the settings file or the package says. Only an admin writes
# here; nothing else ever creates or removes these.
DEFAULT_OPT_OUT_STORAGE_PATH = os.path.join(DEFAULT_STORAGE_PATH, 'opt-out.d')
# cloudlinux-flags-sync puts .flag here for every feature the remote
# settings switch off on this server, whether or not its package is installed
# yet, and removes it when they switch the feature back on. While it is here,
# clflags.is_enabled() answers "off" whatever enabled-flags.d says: a package
# that ships a feature on cannot bring it back on, not even until the next
# sync. Only cloudlinux-flags-sync writes here.
DEFAULT_REMOTE_OFF_STORAGE_PATH = os.path.join(DEFAULT_STORAGE_PATH, 'remote-off.d')
DEFAULT_FLAG_GLOB = '*.flag'