#!/bin/bash

# shellcheck disable=SC2034
# ADMIN MAIL
CONFIG_DEB_INSTALL_SERVER_ADMIN_MAIL="admin@frogg.fr"
# SMTP INSTALLATION
CONFIG_DEB_INSTALL_SERVER_SMTP_HOST="smtp-auth.mailprotect.be"
CONFIG_DEB_INSTALL_SERVER_SMTP_PORT="587"
CONFIG_DEB_INSTALL_SERVER_SMTP_FROM="@frogg.fr"
CONFIG_DEB_INSTALL_SERVER_SMTP_LOGIN="admin@frogg.fr"
# ZABBIX CLIENT INSTALLATION
CONFIG_DEB_INSTALL_ZABBIX_SERVER_IP="zabbix.server.home"
# CA INSTALLATION
CONFIG_DEB_INSTALL_DEFAULT_CA_SERVER="ca.server.home"
CONFIG_DEB_INSTALL_DEFAULT_CA_WILDCARD="*.server.home"
CONFIG_DEB_INSTALL_DEFAULT_CA_SERVICES="gitea nginx apache2 mysql postgresql jellyfin"
CONFIG_DEB_INSTALL_DEFAULT_CA_STEP="step-cli_0.24.4_amd64.deb"
CONFIG_DEB_INSTALL_DEFAULT_CA_INSTALL_PATH="/etc/ssl/wildcard"
CONFIG_DEB_INSTALL_DEFAULT_CA_FILE_PFX="server.pfx"
CONFIG_DEB_INSTALL_DEFAULT_CA_FILE_CRT="server.crt"
CONFIG_DEB_INSTALL_DEFAULT_CA_FILE_KEY="server.key"
CONFIG_DEB_INSTALL_DEFAULT_CA_CRON="STEP-CA-RENEWAL"
CONFIG_DEB_INSTALL_DEFAULT_CA_FINGERPRINT="4873b9eaeb8a7643475939b4035221bd1bc3acd0db00e94df5a76d771459f439"
# SCRIPT UPDATE INSTALLATION
CONFIG_DEB_INSTALL_CRON_UPDATE="CONFIG_DEB_INSTALL_CRON_UPDATE"

CONFIG_DEB_INSTALL_JSON='[
  {"id": "jq_pkg", "label": "Installer JQ", "type": "pkg", "params": "jq"},
  {"id": "git_pkg", "label": "Installer Git", "type": "pkg", "params": "git"},
  {"id": "curl_pkg", "label": "Installer Curl", "type": "pkg", "params": "curl"},
  {"id": "systemd-timesyncd_pkg", "label": "Installer Time Sync", "type": "pkg", "params": "systemd-timesyncd"},
  {"id": "ncdu_pkg", "label": "Installer NCDU", "type": "pkg", "params": "ncdu"},
  {"id": "htop_pkg", "label": "Installer HTOP", "type": "pkg", "params": "htop"},
  {"id": "msmtp_pkg", "label": "Installer MSMTP", "type": "pkg", "params": "msmtp"},
  {"id": "net-tools_pkg", "label": "Installer net-tools", "type": "pkg", "params": "net-tools"},
  {"id": "nfs-common_pkg", "label": "Installer nfs-common", "type": "pkg", "params": "nfs-common"},
  {"id": "smbclient_pkg", "label": "Installer smbclient", "type": "pkg", "params": "smbclient"},
  {"id": "zabbix", "label": "Installer Zabbix Agent", "type": "sys", "params": "zabbix"},
  {"id": "apparmor_pkg", "label": "Installer AppArmor (Paquets)", "type": "pkg", "params": "apparmor"},
  {"id": "fail2ban_pkg", "label": "Installer Fail2Ban", "type": "pkg", "params": "fail2ban"},
  {"id": "ufw_pkg", "label": "Installer Firewall (UFW)", "type": "pkg", "params": "ufw"},
  {"id": "locale_install", "label": "Installer les locales En & Fr", "type": "sys", "params": "locale_install"},
  {"id": "script_update", "label": "Installer script de mise à jour automatique", "type": "sys", "params": "script_update"},
  {"id": "cert_install", "label": "Installer le certificat wildcard auto", "type": "sys", "params": "cert_install"},
  {"id": "ipv6", "label": "Désactiver IPv6", "type": "sys", "params": "ipv6"},
  {"id": "motd", "label": "Désactiver les messages MOTD", "type": "sys", "params": "motd"},
  {"id": "mail", "label": "Configurer ADMIN_MAIL", "type": "sys", "params": "mail"},
  {"id": "hostname", "label": "Configurer le Hostname", "type": "sys", "params": "hostname"},
  {"id": "static_ip", "label": "Configurer IP Statique (eth0)", "type": "sys", "params": "static_ip"},
  {"id": "msmtp", "label": "Configurer MSMTP (Relais Mail)", "type": "sys", "params": "msmtp"},
  {"id": "apparmor", "label": "Configurer AppArmor (Kernel)", "type": "sys", "params": "apparmor"},
  {"id": "fail2ban", "label": "Configurer Fail2Ban", "type": "sys", "params": "fail2ban"},
  {"id": "ufw", "label": "Configurer Firewall (UFW)", "type": "sys", "params": "ufw"},
  {"id": "zabbix_conf", "label": "Configurer le client ZABBIX", "type": "sys", "params": "zabbix_conf"},
  {"id": "ntp", "label": "Configurer Heure Française", "type": "sys", "params": "ntp"},
  {"id": "gen_ssh_key", "label": "Creer une clé RSA pour SSH", "type": "sys", "params": "gen_ssh_key"},
  {"id": "clone_ssh_key", "label": "Cloner la clé RSA sur un hôte distant", "type": "sys", "params": "clone_ssh_key"},
  {"id": "deploy_ssh_key", "label": "Autoriser la clé RSA sur un hôte distant", "type": "sys", "params": "deploy_ssh_key"}
]'
