https://github.com/quickbox/rutorrent_hide-dotpaths
https://github.com/quickbox/rutorrent_hide-dotpaths
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/quickbox/rutorrent_hide-dotpaths
- Owner: QuickBox
- License: other
- Created: 2025-08-02T23:16:03.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-08-03T09:15:46.000Z (6 months ago)
- Last Synced: 2025-08-03T09:24:05.383Z (6 months ago)
- Language: JavaScript
- Size: 61.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ruTorrent hide-dotpaths Plugin

[](https://github.com/Novik/ruTorrent)
[](https://github.com/QuickBox/rutorrent_hide-dotpaths/blob/main/LICENSE)
**Instantly hide dot-prefixed files and directories from all ruTorrent path dropdowns**
[](https://github.com/QuickBox/rutorrent_hide-dotpaths#-installation)
[](https://github.com/QuickBox/rutorrent_hide-dotpaths#-table-of-contents)
[](https://discord.gg/mca7RSv5pa)
---
## ๐ Table of Contents
๐ Quick Start
- [Overview](#overview)
- [Why This Exists](#why-this-exists)
- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
๐ง Advanced Usage
- [Debug System](#debug-system)
- [Testing](#testing)
- [Troubleshooting](#troubleshooting)
---
## ๐ Overview
> [!NOTE]
> **hide-dotpaths Plugin** instantly hides dot-prefixed files and directories from all ruTorrent path dropdowns and file browsers. It uses advanced DOM interception technology to remove dot-prefixed items before they become visible to users.
### ๐ฏ Key Benefits
- **๐ Instant Filtering** - Items removed before they become visible
- **โก Real-time Interception** - Uses MutationObserver for immediate response
- **๐ก๏ธ Dual Protection** - Client-side filtering + server-side filemanager patch
- **๐ Multi-Language** - Support for 7 languages
- **๐ง Configurable** - Flexible settings for different environments
- **๐ Advanced Debug** - Intelligent logging with deduplication
---
## ๐ฏ Why This Exists
> [!IMPORTANT]
> **Server Admin Problem**: ruTorrent users can see and navigate into hidden directories (`.config`, `.cache`, `.ssh`, etc.) that contain sensitive system files, configuration data, and application settings. This creates security risks and cluttered navigation.
### ๐ก๏ธ **The Problem**
**Server administrators face a real challenge**: When users browse directories in ruTorrent's file manager, they can see and access hidden dot-prefixed files and directories like:
- `.config/` - Application configuration files
- `.cache/` - System cache directories
- `.ssh/` - SSH keys and configuration
- `.bashrc`, `.profile` - User shell configurations
- `.git/` - Git repositories
- `.htaccess` - Web server configuration
- `.env` - Environment variables and secrets
**This creates several issues:**
- **๐ Security Risk**: Users can access sensitive system files
- **๐๏ธ Cluttered Navigation**: Hidden files pollute the browsing experience
- **โ User Confusion**: Non-technical users see system files they shouldn't access
- **๐ ๏ธ Support Burden**: Admins deal with users accidentally modifying system files
> [!NOTE]
> **Important Clarification**: This plugin does **not** block legitimate access to hidden files. Users can still access their own hidden directories via CLI, SFTP, or other file access methods. This plugin simply reduces the **accidental exposure** and **clutter** in the ruTorrent web interface, providing a cleaner user experience while maintaining full file access capabilities.
### ๐ก **The Solution**
**hide-dotpaths Plugin** provides a **server admin solution** that:
1. **๐ Instantly Hides** dot-prefixed files and directories from all ruTorrent interfaces
2. **๐ก๏ธ Dual Protection** - Combines client-side filtering with server-side enforcement
3. **๐ Advanced Monitoring** - Detailed logging for server admins to audit what's being filtered
4. **๐ฏ Clean User Experience** - Users see only relevant files and directories
5. **๐ง Configurable** - Admins can fine-tune what gets hidden and what doesn't
### ๐จโ๐ผ **For Server Administrators**
**This plugin is designed for server admins who want to:**
- **Protect sensitive system files** from accidental access via web interface
- **Clean up the user experience** by hiding irrelevant system files
- **Monitor filtering activity** with detailed debug logging
- **Maintain control** over what users can see and access in the web interface
- **Reduce support tickets** from users confused by system files
**The advanced debug system allows admins to:**
- **Review exactly what files/directories are being filtered**
- **Catch any errors in detail** should they occur
- **Monitor filtering performance** and effectiveness
- **Troubleshoot issues** with comprehensive logging
- **Audit security** by seeing what hidden files exist
### ๐ฏ **Use Cases**
- **๐ Shared Hosting**: Reduce accidental exposure of system files in web interface
- **๐ข Enterprise Environments**: Protect sensitive configuration files from web access
- **๐ฅ Multi-User Servers**: Clean up navigation for non-technical users
- **๐ก๏ธ Security-Conscious Admins**: Reduce margin for unintentional errors
- **๐ Monitoring**: Track what hidden files exist and are being filtered (Debug Logging)
---
## โจ Features
### ๐ Instant Filtering
- **Real-time Removal**: Dot-prefixed items removed immediately
- **Comprehensive Coverage**: All ruTorrent browse dialogs, dropdowns, and menus
- **Generic Filtering**: Works with any dot-prefixed path (`.anything`, `.whatever`, etc.)
- **Preserves Navigation**: Keeps `..` parent directory references intact
### ๐ก๏ธ Dual Protection Technology
- **Client-Side**: Advanced DOM interception using MutationObserver
- **Server-Side**: Programmatic override of filemanager settings
- **Runtime Enforcement**: Forces hidden files to stay hidden
### ๐ง Advanced Debug System
- **Intelligent Deduplication**: Prevents duplicate log entries
- **Scoped Debugging**: Enable specific scopes (general, filter, patch, cache, performance)
- **Rate Limiting**: Configurable rate limiting to prevent spam
- **Memory Management**: Automatic cleanup prevents memory leaks
---
## ๐ Installation
### ๐ Prerequisites
> [!IMPORTANT]
> **Requirements:**
> - โ
ruTorrent v5.2+ installed and configured
> - โ
Modern web browser with ES6+ support
> - โ
Access to ruTorrent plugins directory
> - โ
Proper file permissions for web server
### โก QuickBox Installation (Recommended)
```bash
# Clone to QuickBox ruTorrent plugins directory
git clone "https://github.com/QuickBox/rutorrent_hide-dotpaths.git" "/srv/rutorrent/plugins/hide-dotpaths"
# Set permissions
chown www-data:www-data -R "/srv/rutorrent/plugins/hide-dotpaths"
chmod 755 "/srv/rutorrent/plugins/hide-dotpaths/"
chmod 644 "/srv/rutorrent/plugins/hide-dotpaths/"*.js
chmod 644 "/srv/rutorrent/plugins/hide-dotpaths/"*.php
chmod 644 "/srv/rutorrent/plugins/hide-dotpaths/"*.info
# Restart services
sudo systemctl restart php8.1-fpm nginx
source /opt/quickbox/config/system/mflibs/quickbox >/dev/null 2>&1
read -d '' -ra users_all <<<"$(quickbox::database "SELECT username FROM user_information")"
for user in "${users_all[@]:-}"; do
sudo systemctl restart rtorrent@"${user}"
done
```
### ๐ง Standard Installation
```bash
# Clone and copy to plugins directory
git clone https://github.com/QuickBox/rutorrent_hide-dotpaths.git
cp -r rutorrent_hide-dotpaths /path/to/rutorrent/plugins/hide-dotpaths
# Set permissions
chmod 755 /path/to/rutorrent/plugins/hide-dotpaths/
chmod 644 /path/to/rutorrent/plugins/hide-dotpaths/*.js
chmod 644 /path/to/rutorrent/plugins/hide-dotpaths/*.php
chmod 644 /path/to/rutorrent/plugins/hide-dotpaths/*.info
```
### ๐ฆ Manual Installation
1. Download from [GitHub Releases](https://github.com/QuickBox/rutorrent_hide-dotpaths/releases)
2. Extract and copy to ruTorrent plugins directory
3. Set permissions as shown above
---
## โ๏ธ Configuration
Edit `conf.php` to customize behavior:
```php
dropdowns
$filter_modals = true; // Filter modal file browsers
$filter_autocomplete = true; // Filter autocomplete dropdowns
$filter_ajax = true; // Filter AJAX responses
$filter_filemanager = true; // Filter filemanager plugin table rows
$preserve_parent_dirs = true; // Keep ".." parent directory references
$debug_mode = false; // Enable debug logging
$apply_filemanager_patch = true; // Apply server-side filemanager patch
// Advanced debug settings
$debug_scopes = 'general,filter'; // Debug scopes: general,filter,patch,cache,performance,all
$debug_rate_limit = 2000; // Rate limit in milliseconds
$debug_deduplication_window = 5000; // Deduplication window in milliseconds
$debug_enable_internal = false; // Enable internal cache debugging
?>
```
### ๐ Configuration Options
| Option | Default | Description |
|--------|---------|-------------|
| `$hide_dotpaths` | `true` | Main enable/disable switch |
| `$filter_selects` | `true` | Filter `` dropdowns |
| `$filter_modals` | `true` | Filter modal file browsers |
| `$filter_autocomplete` | `true` | Filter autocomplete dropdowns |
| `$filter_ajax` | `true` | Filter AJAX responses |
| `$filter_filemanager` | `true` | Filter filemanager plugin table rows |
| `$preserve_parent_dirs` | `true` | Keep `..` parent directory references |
| `$debug_mode` | `false` | Enable debug logging |
| `$apply_filemanager_patch` | `true` | Apply server-side filemanager patch |
| `$debug_scopes` | `'general,filter'` | Comma-separated debug scopes |
| `$debug_rate_limit` | `2000` | Rate limit in milliseconds |
| `$debug_deduplication_window` | `5000` | Deduplication window in milliseconds |
| `$debug_enable_internal` | `false` | Enable internal cache debugging |
---
## ๐ง Debug System
### Debug Scopes
- `general`: Default scope for general messages
- `filter`: Filtering-related messages
- `patch`: Filemanager patch messages
- `cache`: Cache operation messages
- `performance`: Performance and timing messages
- `all`: Enable all scopes
### Usage Examples
```javascript
// Get debug statistics
const stats = window.getDebugStats();
console.log('Deduplication rate:', stats.skippedDuplicates / stats.totalCalls);
// Test the deduplication system
window.testAdvancedDebug();
// Clear debug cache manually
window.clearDebugCache();
```
### Advanced Configuration
```php
// Enable specific scopes
$debug_scopes = 'general,filter,performance';
// Set custom rate limit (2 seconds)
$debug_rate_limit = 2000;
// Set deduplication window (5 seconds)
$debug_deduplication_window = 5000;
// Enable internal cache debugging
$debug_enable_internal = true;
```
## ๐งช Testing
### Enable Debug Mode
```php
$debug_mode = true;
```
### Test Dual Protection
```javascript
// Test client-side filtering
testHideDotpaths();
// Check if filemanager patch is applied
console.log('Filemanager patch applied:', window.flm?.settings?.getSettingValue('showhidden') === false);
```
### Manual Testing
Open browser console and run:
```javascript
testHideDotpaths();
```
---
## ๐ Compatibility
- **ruTorrent v5.2+** - Full support with enhanced features (tested:confirmed)
- **All browsers** - Modern browser support (ES6+)
- **QuickBox Pro v3** - Full integration support
- **Filemanager Plugin** - Compatible with filemanager plugin
---
## ๐ ๏ธ Troubleshooting
### โ Common Problems
#### ๐ Plugin Not Working
- **Problem**: Plugin doesn't filter dot-prefixed directories
- **Solution**: Check if plugin is enabled in ruTorrent Settings โ Plugins
- **Check**: Verify file permissions and browser console for errors
#### ๐๏ธ Still Seeing Dot-Prefixed Directories
- **Problem**: Dot-prefixed directories still visible after installation
- **Solution**: Refresh the page and clear browser cache
- **Check**: Verify configuration in `conf.php` and enable debug mode
#### โก Performance Issues
- **Problem**: Plugin causes performance issues or slow loading
- **Solution**: Reduce cleanup frequency or disable unused filters
- **Check**: Monitor browser performance and check for conflicts
### ๐ง Debug Mode
```php
$debug_mode = true;
$debug_enable_internal = true; // For detailed cache debugging
```
### ๐ Performance Optimization
```php
// Reduce debug output
$debug_rate_limit = 5000; // 5 seconds between logs
$debug_deduplication_window = 10000; // 10 seconds deduplication
// Disable unused filters
$filter_ajax = false; // If not using AJAX dropdowns
$filter_autocomplete = false; // If not using autocomplete
```
---
## ๐๏ธ Architecture
```
Plugin Structure
โโโ init.js # Main plugin logic (623 lines)
โโโ conf.php # Configuration (58 lines)
โโโ debug-utils.js # Advanced debug utilities (330 lines)
โโโ debug-cache.js # Smart debug logging cache (119 lines)
โโโ plugin.info # Plugin metadata
โโโ lang/ # Multi-language support (7 languages)
โโโ LICENSE # GPL v3 license
โโโ README.md # This documentation
```
### Key Components
- **MutationObserver** - Real-time element interception
- **Event Listeners** - Real-time DOM monitoring
- **Advanced Debug System** - Intelligent logging with deduplication
- **Configuration System** - Flexible settings management
- **Multi-Language Support** - Internationalization for 7 languages
## ๐ค Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
---
## ๐ License
[](https://www.gnu.org/licenses/gpl-3.0.html)
[GNU General Public License v3.0](LICENSE)
This project is licensed under the GNU General Public License v3.0.
**Parent Software:**
- **ruTorrent** - Copyright (C) 2009 novik65@gmail.com
- **License**: GNU General Public License v3.0
---
## ๐ Acknowledgments
**Made with โค๏ธ by the QuickBox Team**
- **๐๏ธ QuickBox Team**: For the amazing QuickBox Pro v3 framework
- **๐ญ ruTorrent Team**: For the excellent plugin system
- **๐ฅ Community**: For feedback, testing, and contributions
---
## ๐ Support
[](https://discord.gg/mca7RSv5pa)
[](https://github.com/QuickBox/rutorrent_hide-dotpaths/issues)
[](https://github.com/QuickBox/rutorrent_hide-dotpaths#-table-of-contents)
- **๐ฌ Community**: Join the [QuickBox Community](https://discord.gg/mca7RSv5pa)
- **๐ Issues**: Report bugs on [GitHub Issues](https://github.com/QuickBox/rutorrent_hide-dotpaths/issues)
- **๐ Documentation**: This README and inline code comments
**Version:** 2.5.210
---
[โฌ๏ธ Back to Top](#rutorrent-hide-dotpaths-plugin)