Installation

This guide will walk you through the process of installing Cyber Bot on your system. Follow these steps to set up the bot and prepare it for operation.

Prerequisites

Before you begin, ensure you have the following:

  • Node.js - Version 16.x or higher is recommended
  • npm - Usually comes with Node.js
  • Git - For cloning the repository
  • Telegram Bot Token - Created through BotFather
  • Mistral AI API Key - Obtained from Mistral AI
  • Optional: MySQL Database - For message logging (optional feature)

Installation Steps

1. Clone the Repository

git clone git@github.com:kOaDT/cyber-bot.git
cd cyber-bot

2. Create Tracking Files

These files are used to track which content has already been processed to avoid duplicates:

mkdir -p assets
touch assets/processedNotes.json       # GithubNotes tracking
touch assets/processedArticles.json    # News tracking
touch assets/processedShorts.json      # Shorts tracking
touch assets/processedDD.json          # Darknet Diaries Podcast tracking
touch assets/processedSnyk.json        # Snyk Podcast tracking
touch assets/processedYt.json          # YouTube tracking
touch assets/processedReddit.json      # Reddit post tracking
touch assets/processedCTF.json         # CTF tracking
touch assets/processedSecurityNow.json # Security Now Podcast tracking
touch assets/processedCyberShow.json   # The Cyber Show Podcast tracking

3. Install Dependencies

npm install

4. Configure Environment

Create a .env file in the root directory with your configuration:

# GitHub Settings
GITHUB_SECRET=your_github_token
GITHUB_USERNAME=your_github_username
GITHUB_REPO=your_repo_name
# Optional
EXCLUDED_GITHUB_FILES=file1.md,file2.md

# Telegram Settings
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
CHAT_ID=your_chat_id
# Optional Topic IDs for message organization
TELEGRAM_TOPIC_THM=12345
TELEGRAM_TOPIC_NEWS=12346
TELEGRAM_TOPIC_YOUTUBE=12347
TELEGRAM_TOPIC_PODCAST=12348
TELEGRAM_TOPIC_GITHUB=12349
TELEGRAM_TOPIC_REDDIT=12350
TELEGRAM_TOPIC_CVE=12351

# Mistral AI Settings
MISTRAL_API_KEY=your_mistral_api_key
# Optional, comma-separated
AUTHORIZED_LANGUAGES=en,fr

# AssemblyAI - Text-to-Speech
ASSEMBLYAI_API_KEY=your_assemblyai_api_key

# YouTube Settings
YOUTUBE_API_KEY=your_youtube_api_key

# Reddit
REDDIT_SUBREDDITS=cybersecurity,netsec,hacking
REDDIT_DAYS_LOOKBACK=7
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret

# CVE
CVSS_SEVERITY_THRESHOLD=7.0   # Default >= 7.0
HOURS_DELAY=24                # Default 24 hours
TECHNOLOGIES_OF_INTEREST=windows,linux,apache,nginx

# Optional Database Settings
MYSQL_HOST=localhost
MYSQL_USER=db_user
MYSQL_PASSWORD=db_password
MYSQL_DATABASE=cyber_bot
I_WANT_TO_SAVE_MESSAGES_IN_DB=true

Obtaining API Keys

Telegram Bot Token

  1. Open Telegram and search for @BotFather
  2. Start a chat with BotFather and send the command /newbot
  3. Follow the instructions to name your bot and choose a username (must end in 'bot')
  4. Once created, BotFather will provide you with a token
  5. Copy this token to your .env file as TELEGRAM_BOT_TOKEN

Mistral AI API Key

  1. Visit Mistral AI's website
  2. Sign up for an account or log in
  3. Navigate to your account settings or API section
  4. Generate a new API key
  5. Copy this key to your .env file as MISTRAL_API_KEY

YouTube API Key

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3
  4. Go to the Credentials section and create an API key
  5. Copy this key to your .env file as YOUTUBE_API_KEY

Reddit API Credentials

  1. Visit Reddit's app preferences
  2. Scroll down and click "create app" or "create another app"
  3. Fill in the required fields (name, app type, redirect URI)
  4. For app type, select "script"
  5. For redirect URI, you can use http://localhost:8000
  6. After creating the app, note the client ID and client secret
  7. Copy these values to your .env file as REDDIT_CLIENT_ID and REDDIT_CLIENT_SECRET

Verifying Installation

After completing the installation steps, you can verify that everything is working by running a simple test:

npm run cron -- -c sendTHM

This command will test the TryHackMe reminder functionality. If it runs without errors and you receive a message in your Telegram chat, the installation was successful.

Next Steps

Now that you've successfully installed Cyber Bot, you're ready to begin using it:

  • Learn how to run different cron jobs in the Getting Started guide
  • Explore customizing prompts and AI content generation
  • Set up automated scheduling through the Deployment documentation