šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

autoft-bot-wildcard

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoft-bot-wildcard

🌐 Advanced Telegram Bot for Cloudflare Wildcard Domain Management with Telegram Notifications

1.2.3
latest
Source
npm
Version published
Weekly downloads
13
-48%
Maintainers
1
Weekly downloads
Ā 
Created
Source

🌐 AutoFT Bot Wildcard

npm version Downloads License: MIT Node.js GitHub stars

šŸš€ The most advanced Telegram bot for automated Cloudflare wildcard domain management

šŸ“– Documentation • šŸš€ Quick Start • šŸ’¬ Support • šŸ› Issues

šŸ“‹ Table of Contents

✨ Features

šŸŽÆ Core Functionality

  • 🌐 Wildcard Domain Management - Automated Cloudflare wildcard DNS setup
  • šŸ¤– Telegram Bot Interface - Complete bot management via Telegram
  • šŸ‘„ Multi-User Support - Each user manages their own domains
  • šŸ” Secure Configuration - Encrypted API key storage
  • šŸ“Š Real-time Analytics - Domain statistics and monitoring
  • ⚔ Lightning Fast - Optimized for performance
  • šŸ“¢ Telegram Notifications - Real-time alerts and updates

šŸ›”ļø Security & Management

  • šŸ‘‘ Admin Dashboard - Complete administrative control
  • šŸ”’ Permission System - Role-based access control
  • šŸ“¢ Broadcast System - Mass communication tools
  • šŸ›”ļø Rate Limiting - Built-in abuse protection
  • šŸ“ Comprehensive Logging - Detailed activity tracking

šŸ”§ Technical Features

  • šŸ“¦ NPM Package - Global installation support
  • šŸŽØ Interactive Setup - Beautiful CLI wizard
  • šŸ”„ Auto-restart - Process management ready
  • šŸ“± Simplified Setup - Only requires bot token and group ID
  • šŸŒ Environment Variables - Flexible configuration

šŸš€ Quick Start

Get your bot running in under 3 minutes!

1ļøāƒ£ Install Globally

npm install -g autoft-bot-wildcard

2ļøāƒ£ Run Interactive Setup

autoft-bot-wildcard

3ļøāƒ£ Start Your Bot

cd autoft-bot-wildcard
npm start

šŸŽ‰ That's it! Your bot is now live and ready to manage wildcard domains!

šŸ“¦ Installation

Prerequisites

# Install globally
npm install -g autoft-bot-wildcard

# Run setup wizard
autoft-bot-wildcard

Method 2: Local Installation

# Clone repository
git clone https://github.com/AutoFTbot/Wildcard-Bot.git
cd Wildcard-Bot

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit configuration
nano .env

# Start bot
npm start

Method 3: Docker (Coming Soon)

docker run -d --name autoft-bot-wildcard \
  -e BOT_TOKEN=your_token \
  -e ADMIN_IDS=your_id \
  autoft-bot-wildcard:latest

āš™ļø Configuration

Environment Variables

Create a .env file in your project root:

# šŸ¤– Bot Configuration
BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
ADMIN_IDS=123456789,987654321

# šŸ“¢ Notifications (Optional)
TELEGRAM_GROUP_ID=-1001234567890

# šŸ”§ Optional Settings
MAX_CUSTOM_DOMAINS=5
NODE_ENV=production
LOG_LEVEL=info

Configuration File

Customize your bot behavior in config/default.js:

module.exports = {
    // Admin Configuration
    ADMIN_IDS: [123456789, 987654321],

    // Domain Limits
    MAX_CUSTOM_DOMAINS: 5,
    MAX_DOMAINS_PER_USER: 10,

    // Available Domains
    DEFAULT_DOMAINS: [
        'yourdomain.com',
        'example.org',
        'demo.net'
    ],

    // Notification Settings - Only Telegram supported
    NOTIFICATIONS: {
        TELEGRAM: {
            enabled: true,
            groupId: process.env.TELEGRAM_GROUP_ID || '',
        },
    },

    // Security Settings
    FORBIDDEN_KEYWORDS: [
        'admin', 'root', 'api', 'mail'
    ],

    // Rate Limiting
    RATE_LIMITS: {
        SETUP_WILDCARD: {
            PER_USER: 3,
            COOLDOWN: 3600
        }
    }
};

šŸ“± Usage

For End Users

1. Initial Setup

/start → Welcome message and setup guide
/addcf <api_key> <email> → Register Cloudflare credentials

2. Domain Management

/listdomain → View available domains
/setupwildcard example.com → Setup wildcard for domain
/new subdomain.example.com → Create custom subdomain
/mysub → View your subdomains

3. Analytics & Monitoring

/analytics example.com → View domain statistics
/clearcache example.com → Clear Cloudflare cache

For Bot Owners (Admins)

1. User Management

/stats → Bot usage statistics
/userinfo 123456789 → View user details
/broadcast Hello everyone! → Message all users

2. System Management

/testnotif → Test notification system

šŸŽÆ Commands

šŸ”° Basic Commands

CommandDescriptionUsage
/startWelcome message & setup guide/start
/helpShow all available commands/help
/pingCheck bot responsiveness/ping

šŸ”§ Configuration Commands

CommandDescriptionUsage
/addcfAdd Cloudflare credentials/addcf <api_key> <email>
/cfconfigView current configuration/cfconfig
/updatecfUpdate Cloudflare credentials/updatecf <api_key> <email>
/deletecfRemove configuration/deletecf

🌐 Domain Management Commands

CommandDescriptionUsage
/listdomainShow available domains/listdomain
/setupwildcardSetup wildcard domain/setupwildcard <domain>
/newCreate custom subdomain/new <subdomain.domain.com>
/mysubView your subdomains/mysub
/searchdomainSearch domains/searchdomain <keyword>
/delsubDelete subdomain/delsub <subdomain>

šŸ“Š Analytics Commands

CommandDescriptionUsage
/analyticsView domain statistics/analytics <domain>
/clearcacheClear Cloudflare cache/clearcache <domain>

šŸ‘‘ Admin Features

šŸ“Š Statistics Dashboard

šŸ“Š BOT STATISTICS

šŸ‘„ Users & Domains:
• Registered Users: 150
• Active Domains: 45
• Total Subdomains: 1,234

⚔ System Status:
• Uptime: 7d 12h 30m
• Memory Usage: 45.2 MB
• Node.js Version: v20.10.0

šŸ¤– Bot Info:
• Bot Username: @YourWildcardBot
• Last Updated: 2024-01-15 14:30:25

šŸ“¢ Broadcast System

Send messages to all registered users:

/broadcast 🚨 Scheduled maintenance in 1 hour. All services will be temporarily unavailable.

šŸ‘¤ User Management

Get detailed user information:

/userinfo 123456789

šŸ‘¤ USER INFORMATION
šŸ†” User ID: 123456789
šŸ“± Telegram: @username (John Doe)
šŸ“§ Cloudflare Email: user@example.com
🌐 Custom Domains: 5
šŸ“… Registration: 2024-01-10 09:15:32

šŸ”§ Advanced Configuration

Custom Domain Setup

Add your own domains to the bot:

// config/default.js
DEFAULT_DOMAINS: [
    'your-domain.com',
    'another-domain.net',
    'example.org'
]

Notification Customization

Configure Telegram notifications:

NOTIFICATIONS: {
    TELEGRAM: {
        enabled: true,
        groupId: process.env.TELEGRAM_GROUP_ID,
        // Custom message templates
        templates: {
            welcome: 'šŸŽ‰ New user registered: {username}',
            domainSetup: '🌐 Wildcard setup: {domain} by {user}'
        }
    }
}

Rate Limiting Configuration

Prevent abuse with custom rate limits:

RATE_LIMITS: {
    SETUP_WILDCARD: {
        PER_USER: 5,        // Max 5 setups per user
        COOLDOWN: 3600      // 1 hour cooldown
    },
    ANALYTICS: {
        PER_USER: 10,       // Max 10 requests per hour
        COOLDOWN: 300       // 5 minutes between requests
    }
}

šŸš€ Deployment

Production Deployment with PM2

# Install PM2 globally
npm install -g pm2

# Start bot with PM2
pm2 start index.js --name "autoft-bot-wildcard"

# Enable auto-restart on server reboot
pm2 startup
pm2 save

# Monitor logs
pm2 logs autoft-bot-wildcard

# Restart bot
pm2 restart autoft-bot-wildcard

Environment Setup for Production

# Set production environment
export NODE_ENV=production

# Increase memory limit if needed
node --max-old-space-size=2048 index.js

Nginx Reverse Proxy (Optional)

If you plan to add webhooks:

server {
    listen 80;
    server_name your-bot-domain.com;

    location /webhook {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

šŸ› ļø Development

Project Structure

autoft-bot-wildcard/
ā”œā”€ā”€ šŸ“ bin/
│   └── wildcard-bot.js         # CLI entry point
ā”œā”€ā”€ šŸ“ config/
│   ā”œā”€ā”€ constants.js            # Application constants
│   └── default.js              # Default configuration
ā”œā”€ā”€ šŸ“ handlers/
│   ā”œā”€ā”€ adminHandlers.js        # Admin command handlers
│   ā”œā”€ā”€ cloudflareHandlers.js   # Cloudflare operations
│   ā”œā”€ā”€ configHandlers.js       # Configuration management
│   ā”œā”€ā”€ domainHandlers.js       # Domain operations
│   └── generalHandlers.js      # General bot commands
ā”œā”€ā”€ šŸ“ lib/
│   └── WildcardBot.js          # Main bot class
ā”œā”€ā”€ šŸ“ services/
│   ā”œā”€ā”€ CloudflareManager.js    # Cloudflare API wrapper
│   └── NotificationService.js  # Notification system
ā”œā”€ā”€ šŸ“ utils/
│   ā”œā”€ā”€ fileUtils.js            # File operations
│   ā”œā”€ā”€ systemUtils.js          # System utilities
│   └── validation.js           # Input validation
ā”œā”€ā”€ šŸ“ data/                    # Bot data storage
ā”œā”€ā”€ .env.example                # Environment template
ā”œā”€ā”€ index.js                    # Application entry point
ā”œā”€ā”€ package.json                # Dependencies
└── README.md                   # Documentation

Running in Development Mode

# Clone repository
git clone https://github.com/AutoFTbot/Wildcard-Bot.git
cd Wildcard-Bot

# Install dependencies
npm install

# Copy environment file
cp .env.example .env

# Edit configuration
nano .env

# Start in development mode
npm run dev

Code Style and Linting

# Run linter
npm run lint

# Fix linting issues
npm run lint:fix

# Format code
npm run format

# Run all checks
npm run check

Testing

# Test configuration
npm run test:config

# Test notifications
npm run test:notifications

# Test Cloudflare connection
npm run test:cloudflare

ā“ FAQ

Q: How do I get a Telegram Bot Token?

A: Message @BotFather on Telegram, use /newbot command, and follow the instructions.

Q: Where do I find my Cloudflare Global API Key?

A: Go to Cloudflare Dashboard → My Profile → API Tokens → Global API Key → View

Q: How do I get my Telegram ID?

A: Message @userinfobot on Telegram to get your user ID.

Q: Can I use custom domains?

A: Yes! Add your domains to the DEFAULT_DOMAINS array in config/default.js.

Q: Is there a limit on users or domains?

A: You can configure limits in config/default.js. Default is 5 domains per user.

Q: How do I update the bot?

A: Run npm update -g autoft-bot-wildcard for global installations.

Q: "autoft-bot-wildcard command not found" error

This happens when the global installation didn't complete properly:

# Reinstall globally
npm install -g autoft-bot-wildcard --force

# Clear npm cache if needed
npm cache clean --force

# Check if command is available
which autoft-bot-wildcard

# Alternative: run directly with npx
npx autoft-bot-wildcard

šŸ†˜ Troubleshooting

Common Issues

šŸ”“ Bot not responding

# Check if bot is running
ps aux | grep node

# Check logs
pm2 logs autoft-bot-wildcard

# Restart bot
pm2 restart autoft-bot-wildcard

šŸ”“ "Bot token invalid" error

  • Verify your bot token in .env file
  • Make sure token format is correct: 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
  • Check if bot was deleted in @BotFather

šŸ”“ Cloudflare API errors

  • Verify Global API Key and email in user configuration
  • Check if domain is added to Cloudflare account
  • Ensure API key has necessary permissions

šŸ”“ Notifications not working

  • Verify TELEGRAM_GROUP_ID in environment variables
  • Make sure bot is added to the notification group
  • Check if bot has permission to send messages

šŸ”“ Domain setup fails

  • Ensure domain is registered in Cloudflare
  • Check DNS propagation status
  • Verify Cloudflare account permissions

šŸ”“ Installation fails

  • Make sure you have Node.js 16+ installed
  • Try clearing npm cache: npm cache clean --force
  • Use the latest npm version: npm install -g npm@latest

Debug Mode

Enable detailed logging:

export LOG_LEVEL=debug
npm start

Getting Help

šŸ¤ Contributing

We welcome contributions! Here's how you can help:

šŸ› Bug Reports

  • Use the issue template
  • Include detailed reproduction steps
  • Provide relevant logs and screenshots

✨ Feature Requests

šŸ’» Code Contributions

  • Fork the repository
  • Create a feature branch: git checkout -b feature/amazing-feature
  • Make your changes and test thoroughly
  • Follow our coding standards (run npm run lint)
  • Commit with clear messages: git commit -m 'Add amazing feature'
  • Push to your branch: git push origin feature/amazing-feature
  • Open a Pull Request

šŸ“š Documentation

  • Improve existing documentation
  • Add examples and use cases
  • Translate to other languages
  • Create video tutorials

šŸ“ˆ Roadmap

šŸš€ Upcoming Features

  • Web Dashboard - Browser-based management interface
  • Docker Support - Containerized deployment
  • Multi-language - Support for multiple languages
  • Advanced Analytics - Detailed usage statistics
  • Custom Commands - User-defined bot commands
  • Backup System - Automated data backups
  • Plugin System - Extensible architecture

šŸŽÆ Long-term Goals

  • Cloud Hosting - Managed hosting service
  • Mobile App - Native mobile application
  • Enterprise Features - Advanced business features
  • API Gateway - RESTful API interface

šŸ“Š Statistics

GitHub repo size GitHub code size Lines of code GitHub commit activity

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 AutoFTbot Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

šŸ™ Acknowledgments

  • Telegraf.js - Telegram Bot API framework
  • Cloudflare - DNS and CDN services
  • Node.js Community - Runtime environment
  • Contributors - Everyone who helped improve this project

šŸ“ž Support & Community

šŸ’¬ Get Help

Telegram GitHub Issues

🌟 Stay Updated

GitHub Watch GitHub Star GitHub Fork

⭐ If this project helped you, please give it a star!

Made with ā¤ļø by the AutoFTbot Team

šŸš€ Get Started Now • šŸ“– Read the Docs • šŸ’¬ Join Community

Keywords

telegram

FAQs

Package last updated on 01 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts