<commit_before>MIN_FREE_MEMORY=70
SAFE_MIN_FREE_MEMORY=90
REBOOT_FREE_MEMORY=40
FIREMAIN_MAX_MEMORY=280000
FIREMON_MAX_MEMORY=240000
FIREAPI_MAX_MEMORY=200000
MAX_NUM_OF_PROCESSES=4000
MAX_NUM_OF_THREADS=20000
MANAGED_BY_FIREBOOT=yes
CRONTAB_FILE=${FIREWALLA_HOME}/etc/crontab
REAL_PLATFORM='real.purple'
FW_PROBABILITY="0.99"
FW_SCHEDULE_BRO=false
STATUS_LED_PATH='/sys/devices/platform/leds/leds/blue'
IFB_SUPPORTED=yes
MANAGED_BY_FIREROUTER=yes
RAMFS_ROOT_PARTITION=yes

function get_openssl_cnf_file {
  echo '/etc/openvpn/easy-rsa/openssl-1.0.0.cnf'
}

function heartbeatLED {
  sudo sh -c "echo heartbeat > $STATUS_LED_PATH/trigger"
}

function turnOffLED {
  sudo sh -c "echo none > $STATUS_LED_PATH/trigger"
  sudo sh -c "echo 0 > $STATUS_LED_PATH/brightness"
}

function get_node_modules_url {
  echo "https://github.com/firewalla/fnm.node12.aarch64"
}

CURRENT_DIR=$(dirname $BASH_SOURCE)

function get_brofish_service {
  echo "${CURRENT_DIR}/files/brofish.service"
}

function get_openvpn_service {
  echo "${CURRENT_DIR}/files/openvpn@.service"
}

function get_sysctl_conf_path {
  echo "${CURRENT_DIR}/files/sysctl.conf"
}

function get_node_bin_path {
  echo "/home/pi/.nvm/versions/node/v12.18.3/bin/node"
}

function map_target_branch {
  case "$1" in
  "release_6_0")
    echo "release_8_0"
    ;;
  "beta_6_0")
    echo "beta_6_0"
    ;;
  *)
    echo $1
    ;;
  esac
}

function run_horse_light {
  return 0;
}

function fw_blink {
  sudo pkill -9 ethtool
  sudo timeout 3600s ethtool -p $1 &
}

function fw_unblink {
  sudo pkill -9 ethtool
}

function hook_server_route_up {
  # adjust rps_cpus for better performance
  sudo bash -c "echo 7 > /sys/class/net/tun_fwvpn/queues/rx-0/rps_cpus"
}

function hook_after_vpn_confgen {<commit_msg>define nothing rather than a dummy run_horse_light in purple<commit_after>MIN_FREE_MEMORY=70
SAFE_MIN_FREE_MEMORY=90
REBOOT_FREE_MEMORY=40
FIREMAIN_MAX_MEMORY=280000
FIREMON_MAX_MEMORY=240000
FIREAPI_MAX_MEMORY=200000
MAX_NUM_OF_PROCESSES=4000
MAX_NUM_OF_THREADS=20000
MANAGED_BY_FIREBOOT=yes
CRONTAB_FILE=${FIREWALLA_HOME}/etc/crontab
REAL_PLATFORM='real.purple'
FW_PROBABILITY="0.99"
FW_SCHEDULE_BRO=false
STATUS_LED_PATH='/sys/devices/platform/leds/leds/blue'
IFB_SUPPORTED=yes
MANAGED_BY_FIREROUTER=yes
RAMFS_ROOT_PARTITION=yes

function get_openssl_cnf_file {
  echo '/etc/openvpn/easy-rsa/openssl-1.0.0.cnf'
}

function heartbeatLED {
  sudo sh -c "echo heartbeat > $STATUS_LED_PATH/trigger"
}

function turnOffLED {
  sudo sh -c "echo none > $STATUS_LED_PATH/trigger"
  sudo sh -c "echo 0 > $STATUS_LED_PATH/brightness"
}

function get_node_modules_url {
  echo "https://github.com/firewalla/fnm.node12.aarch64"
}

CURRENT_DIR=$(dirname $BASH_SOURCE)

function get_brofish_service {
  echo "${CURRENT_DIR}/files/brofish.service"
}

function get_openvpn_service {
  echo "${CURRENT_DIR}/files/openvpn@.service"
}

function get_sysctl_conf_path {
  echo "${CURRENT_DIR}/files/sysctl.conf"
}

function get_node_bin_path {
  echo "/home/pi/.nvm/versions/node/v12.18.3/bin/node"
}

function map_target_branch {
  case "$1" in
  "release_6_0")
    echo "release_8_0"
    ;;
  "beta_6_0")
    echo "beta_6_0"
    ;;
  *)
    echo $1
    ;;
  esac
}

function fw_blink {
  sudo pkill -9 ethtool
  sudo timeout 3600s ethtool -p $1 &
}

function fw_unblink {
  sudo pkill -9 ethtool
}

function hook_server_route_up {
  # adjust rps_cpus for better performance
  sudo bash -c "echo 7 > /sys/class/net/tun_fwvpn/queues/rx-0/rps_cpus"
}

function hook_after_vpn_confgen {
{'fraction_non_alphanumeric': 0.10632265381343918, 'fraction_numerical': 0.038843209526509784, 'mean_word_length': 4.979661016949152, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5871498', 'n_tokens_mistral': 1574, 'n_tokens_neox': 1476, 'n_words': 236}