disco - Interactive Shell Discourse Management Tool with Telegram Notifications
| Summary | A command-line wrapper for Discourse management with interactive menu interface and automatic Telegram notifications for maintenance operations | |
| Repository Link | GitHub - DigneZzZ/discourse-cli: Discourse CLI interface with TG events when rebuild | |
| Documentation | Installation Guide Β· Quick Start Β· Examples |
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.
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
Features
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 (
) for critical operations - Safety confirmations - type βyesβ to confirm dangerous actions
- Smart sudo detection - warns when root privileges needed
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
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
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
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
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
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
/newbotcommand - 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
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
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) |
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
Real-World Impact
Since deploying this tool:
Zero βis the forum down?β questions in our Telegram group
Faster maintenance operations - no context switching between terminal and messaging
Fewer mistakes during updates - safety confirmations work!
Better monitoring - quick access to logs and resource usage
Documentation
- Installation Guide - Detailed installation instructions
- Quick Start Guide - Get started in 5 minutes
- Features Documentation - Interactive menu features explained
- Usage Examples - Real-world workflows and scenarios
- Changelog - Version history
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.
Contributing
Contributions are welcome! If you have ideas or suggestions:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a Pull Request
Or simply open an issue with your feedback!
License
MIT License - completely free to use and modify.
GitHub Repository: GitHub - DigneZzZ/discourse-cli: Discourse CLI interface with TG events when rebuild