Disco - Interactive Shell Discourse Management Tool with Telegram Notifications

AI-generated summary

DigneZzZ introduces disco, an interactive command-line tool for managing Discourse forums with Telegram notifications. The tool provides a menu-driven interface for common operations like updates, restarts, and backups, while automatically sending status updates to a Telegram group. It includes safety features like confirmation prompts for critical actions and real-time monitoring. The project is hosted on GitHub with documentation for installation, quick start, and examples. Key features include automated Telegram notifications, an intuitive menu system, and integration with Discourse containers. Repository and documentation are provided.

disco - Interactive Shell Discourse Management Tool with Telegram Notifications

:information_source: Summary A command-line wrapper for Discourse management with interactive menu interface and automatic Telegram notifications for maintenance operations
:hammer_and_wrench: Repository Link GitHub - DigneZzZ/discourse-cli: Discourse CLI interface with TG events when rebuild Β· GitHub
:open_book: Documentation Installation Guide Β· Quick Start Β· Examples

:wave: Introduction

Hey everyone!

I want to share a solution I created while managing my community forum. Like many of you, I have a Telegram group for my community, and I was constantly getting questions about β€œIs the forum down?” or β€œWhen will maintenance be finished?” whenever I needed to update or restart Discourse.

To solve this (and make my life easier), I built disco - a command-line wrapper for Discourse management that includes automatic Telegram notifications and an interactive menu interface.


:dart: What Problem It Solves

  • No more β€œIs the forum down?” questions - automatic notifications to your Telegram group
  • Simplified management - interactive menu instead of remembering launcher commands
  • Safety first - confirmations for dangerous operations (rebuild, stop, cleanup)
  • Better visibility - real-time status, logs, and resource monitoring
  • Faster troubleshooting - all operations in one place with clear output

:sparkles: Features

:video_game: Interactive Menu Interface

Launch disco without arguments to get a beautiful numbered menu:

╔════════════════════════════════════════════════════════════╗
β•‘  πŸš€ Discourse Manager v1.2.0                        β•‘
β•‘  πŸ“¦ Container: app | Status: 🟒 Running          β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

 1.  πŸ“Š Show Status
 2.  πŸ”„ Restart Container
 3.  πŸ“ View Logs (last 100 lines)
 4.  πŸ“Ί Live Monitor
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 5.  πŸ”§ Full Rebuild (with updates) ⚠
 6.  ⚑ Fast Rebuild
 7.  πŸ’Ύ Create Backup
 8.  🧹 Cleanup Docker Resources ⚠
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 9.  ▢️  Start Container
10.  ⏸️  Stop Container ⚠
11.  🐚 Enter Container Shell
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12.  πŸ“₯ Update Launcher
13.  πŸ“± Test Telegram Notifications
14.  βš™οΈ  Show Configuration
15.  πŸ”„ Update disco
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 0.  ❌ Exit

Features:

  • Just type a number (1-15) to select action
  • Real-time container status in header
  • Visual warnings (:warning:) for critical operations
  • Safety confirmations - type β€œyes” to confirm dangerous actions
  • Smart sudo detection - warns when root privileges needed

:iphone: Telegram Notifications

Automatic notifications keep your community informed:

When rebuild starts:

πŸ”§ Forum is going into maintenance

⏱ Expected time: ~10 minutes

We apologize for the temporary inconvenience.

When complete:

βœ… Forum is back online!

⏱ Maintenance time: 7m 57s
πŸ”– Version: 3.2.0.beta4

Thank you for your patience! πŸš€

On errors:

❌ Forum update failed

⏱ Attempt duration: 3m 12s

⚠️ Administrator attention required!
Check logs: disco logs

:bar_chart: Monitoring & Diagnostics

Status Overview:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“Š Discourse Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ“¦ Container: app
🟒 Status: Running
⏱  Uptime: Up 3 days
πŸ”– Version: 3.2.0.beta4
πŸ’» CPU: 2.5%
🧠 Memory: 1.2GB / 4GB

Features:

  • Real-time CPU and memory usage
  • Container uptime tracking
  • Automatic version detection via API
  • Live log monitoring with follow mode
  • Resource monitoring dashboard

:shield: Safety Features

  • Confirmation prompts for critical operations (rebuild, stop, cleanup)
  • Sudo detection - warns when privileges are needed
  • Version display - always know what version is running
  • Detailed warnings - explains exactly what each critical action will do

:zap: Quick Operations

All standard Discourse operations available:

  • Container management - start, stop, restart, enter shell
  • Maintenance - rebuild (full/fast), backup, cleanup
  • Monitoring - status, logs, live resource monitor
  • Updates - launcher updates with one command

:inbox_tray: Installation

Quick Install

# Download and install
curl -o disco https://raw.githubusercontent.com/DigneZzZ/discourse-cli/main/disco
chmod +x disco
sudo mv disco /usr/local/bin/

# Verify installation
disco version

# Launch interactive menu
disco

:gear: Configuration

Basic Setup

Create a configuration file in one of these locations:

  • ~/.disco.env (recommended)
  • /etc/disco/.env
  • Next to the script
# Copy example configuration
curl -o ~/.disco.env https://raw.githubusercontent.com/DigneZzZ/discourse-cli/main/.env.example

# Edit settings
nano ~/.disco.env

Configuration Example

# Basic settings
DISCOURSE_PATH=/var/discourse
CONFIG_NAME=app

# Telegram notifications (optional)
TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
TELEGRAM_CHAT_ID=-1001234567890
TELEGRAM_THREAD_ID=1

Setting up Telegram Notifications

1. Create a bot:

  • Message @BotFather on Telegram
  • Send /newbot command
  • Follow the instructions
  • Save the bot token

2. Get Chat ID:

  • Send any message to your bot
  • Visit: https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
  • Find "chat":{"id":...} in the response

3. Get Thread ID (for groups with topics):

  • Send a message to the desired topic in your group
  • In getUpdates response, find message_thread_id

4. Test notifications:

disco test-telegram

:rocket: Usage

Interactive Menu (Recommended)

# Launch interactive menu
disco

# With sudo for administrative actions
sudo disco

Simply type the number of the action you want to perform!

Command-Line Mode

For automation or quick operations:

# Status and monitoring
disco status                    # Show container status
disco logs                      # View last 100 lines
disco logs 500                  # View last 500 lines
disco monitor                   # Real-time resource monitoring

# Container management
sudo disco start                # Start container
sudo disco stop                 # Stop container
sudo disco restart              # Restart container
disco enter                     # Enter container shell

# Maintenance
sudo disco rebuild              # Full rebuild with updates
sudo disco fast-rebuild         # Quick rebuild (no launcher update)
sudo disco backup               # Create backup (auto name)
sudo disco backup my-name       # Create backup (custom name)
sudo disco cleanup              # Clean up Docker resources

# Utilities
sudo disco update-launcher      # Update Discourse launcher
disco test-telegram             # Test Telegram notifications
disco show-config               # Show disco configuration
disco version                   # Show version
disco help                      # Show help

:page_facing_up: Settings

Name Description Default Required
DISCOURSE_PATH Path to Discourse installation directory /var/discourse No
CONFIG_NAME Container configuration name app No
TELEGRAM_BOT_TOKEN Telegram bot token from @BotFather - No (for notifications)
TELEGRAM_CHAT_ID Telegram chat or group ID for notifications - No (for notifications)
TELEGRAM_THREAD_ID Thread ID in group with topics - No (optional)

:bulb: Use Cases

Community Manager

  • Keep community informed during maintenance automatically
  • No more β€œis the forum down?” questions
  • Professional maintenance notifications

System Administrator

  • Interactive menu for occasional management tasks
  • Safety confirmations prevent accidents
  • Quick access to logs and status

DevOps Teams

  • CLI mode for automation and scripts
  • Consistent operations across team members
  • Easy integration with monitoring systems

:chart_with_upwards_trend: Real-World Impact

Since deploying this tool:

  • :white_check_mark: Zero β€œis the forum down?” questions in our Telegram group
  • :white_check_mark: Faster maintenance operations - no context switching between terminal and messaging
  • :white_check_mark: Fewer mistakes during updates - safety confirmations work!
  • :white_check_mark: Better monitoring - quick access to logs and resource usage

:books: Documentation


:heart: Why I Built This

Managing Discourse through the standard launcher is powerful, but:

  • Commands are hard to remember
  • No built-in notification system for community
  • Easy to make mistakes with critical operations
  • Community members always asking about downtime

disco wraps the launcher with a user-friendly interface and keeps everyone informed automatically.


:handshake: Contributing

Contributions are welcome! If you have ideas or suggestions:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a Pull Request

Or simply open an issue with your feedback!


:page_with_curl: License

MIT License - completely free to use and modify.



GitHub Repository: GitHub - DigneZzZ/discourse-cli: Discourse CLI interface with TG events when rebuild Β· GitHub

3 Likes