Disco - Herramienta interactiva de gestión de Discourse Shell con notificaciones de Telegram

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
: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

2 Me gusta