|
| 1 | +--- |
| 2 | +name: Web Terminal |
| 3 | +slug: mwguerra-web-terminal |
| 4 | +author_slug: mwguerra |
| 5 | +categories: |
| 6 | + - developer-tool |
| 7 | + - admin-panel |
| 8 | +description: A secure web terminal for Laravel with Filament integration. Execute allowed commands on local systems or SSH servers with command whitelisting, audit logging, and multi-tenant support. |
| 9 | +docs_url: https://github.com/mwguerra/web-terminal#readme |
| 10 | +github_repository: mwguerra/web-terminal |
| 11 | +has_dark_theme: true |
| 12 | +has_translations: true |
| 13 | +versions: |
| 14 | + - 4 |
| 15 | +publish_date: 2025-12-01 |
| 16 | +--- |
| 17 | + |
| 18 | +A secure web terminal package for Laravel with Filament v4 integration. Execute allowed commands on local systems or SSH servers with comprehensive security features. |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +## Features |
| 23 | + |
| 24 | +- **Local & SSH connections**: Execute commands locally or connect to remote servers via SSH |
| 25 | +- **Command whitelisting**: Only allowed commands can be executed for security |
| 26 | +- **Preset configurations**: Quick presets for Git, Docker, Node.js, Laravel Artisan, and more |
| 27 | +- **Comprehensive logging**: Audit trail for connections, commands, and errors |
| 28 | +- **Multi-tenant support**: Built-in tenant isolation for SaaS applications |
| 29 | +- **Session management**: Inactivity timeout and disconnect-on-navigate options |
| 30 | +- **Filament integration**: Ready-to-use Terminal page and Terminal Logs resource |
| 31 | +- **Embeddable**: Use as standalone pages or embed in Filament forms |
| 32 | +- **Dark mode**: Full dark mode support via Filament |
| 33 | +- **Localization**: English and Portuguese (BR) translations included |
| 34 | + |
| 35 | +## Installation |
| 36 | + |
| 37 | +```bash |
| 38 | +composer require mwguerra/web-terminal |
| 39 | +``` |
| 40 | + |
| 41 | +Run the interactive installer: |
| 42 | + |
| 43 | +```bash |
| 44 | +php artisan terminal:install |
| 45 | +``` |
| 46 | + |
| 47 | +Register the plugin in your Panel Provider: |
| 48 | + |
| 49 | +```php |
| 50 | +use MWGuerra\WebTerminal\WebTerminalPlugin; |
| 51 | + |
| 52 | +public function panel(Panel $panel): Panel |
| 53 | +{ |
| 54 | + return $panel |
| 55 | + ->plugins([ |
| 56 | + WebTerminalPlugin::make(), |
| 57 | + ]); |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +## Quick Start |
| 62 | + |
| 63 | +After installation, access the terminal at `/admin/terminal`. |
| 64 | + |
| 65 | +For a custom terminal with specific commands: |
| 66 | + |
| 67 | +```php |
| 68 | +use MWGuerra\WebTerminal\Schemas\Components\WebTerminal; |
| 69 | + |
| 70 | +WebTerminal::make() |
| 71 | + ->local() |
| 72 | + ->allowedCommands(['ls', 'pwd', 'cd', 'cat', 'git *']) |
| 73 | + ->workingDirectory(base_path()) |
| 74 | + ->height('400px') |
| 75 | +``` |
| 76 | + |
| 77 | +## Plugin Configuration |
| 78 | + |
| 79 | +Customize navigation and disable components: |
| 80 | + |
| 81 | +```php |
| 82 | +use MWGuerra\WebTerminal\WebTerminalPlugin; |
| 83 | + |
| 84 | +WebTerminalPlugin::make() |
| 85 | + // Configure Terminal page navigation |
| 86 | + ->terminalNavigation( |
| 87 | + icon: 'heroicon-o-command-line', |
| 88 | + label: 'Terminal', |
| 89 | + sort: 100, |
| 90 | + group: 'Tools', |
| 91 | + ) |
| 92 | + // Configure Terminal Logs resource navigation |
| 93 | + ->terminalLogsNavigation( |
| 94 | + icon: 'heroicon-o-clipboard-document-list', |
| 95 | + label: 'Terminal Logs', |
| 96 | + sort: 101, |
| 97 | + group: 'Tools', |
| 98 | + ) |
| 99 | + |
| 100 | +// Disable components |
| 101 | +WebTerminalPlugin::make() |
| 102 | + ->withoutTerminalPage() // Only show logs |
| 103 | + ->withoutTerminalLogs() // Only show terminal |
| 104 | +``` |
| 105 | + |
| 106 | +## Connection Types |
| 107 | + |
| 108 | +### Local Connection |
| 109 | + |
| 110 | +```php |
| 111 | +WebTerminal::make() |
| 112 | + ->local() |
| 113 | + ->allowedCommands(['ls', 'pwd', 'cd']) |
| 114 | + ->workingDirectory(base_path()) |
| 115 | +``` |
| 116 | + |
| 117 | +### SSH Connection |
| 118 | + |
| 119 | +```php |
| 120 | +WebTerminal::make() |
| 121 | + ->ssh( |
| 122 | + host: 'server.example.com', |
| 123 | + username: 'deploy', |
| 124 | + key: file_get_contents('/path/to/private_key'), |
| 125 | + port: 22 |
| 126 | + ) |
| 127 | +``` |
| 128 | + |
| 129 | +## Preset Configurations |
| 130 | + |
| 131 | +Quick presets for common use cases: |
| 132 | + |
| 133 | +```php |
| 134 | +// Read-only file browser |
| 135 | +WebTerminal::make()->readOnly() |
| 136 | + |
| 137 | +// Git operations |
| 138 | +WebTerminal::make()->gitTerminal() |
| 139 | + |
| 140 | +// Docker management |
| 141 | +WebTerminal::make()->dockerTerminal() |
| 142 | + |
| 143 | +// Node.js development |
| 144 | +WebTerminal::make()->nodeTerminal() |
| 145 | + |
| 146 | +// Laravel Artisan commands |
| 147 | +WebTerminal::make()->artisanTerminal() |
| 148 | +``` |
| 149 | + |
| 150 | +## Logging |
| 151 | + |
| 152 | +Enable comprehensive audit logging: |
| 153 | + |
| 154 | +```php |
| 155 | +WebTerminal::make() |
| 156 | + ->local() |
| 157 | + ->log( |
| 158 | + enabled: true, |
| 159 | + commands: true, |
| 160 | + output: false, |
| 161 | + identifier: 'production-terminal', |
| 162 | + ) |
| 163 | +``` |
| 164 | + |
| 165 | +## Security |
| 166 | + |
| 167 | +- **Command whitelisting**: Only allowed commands can be executed |
| 168 | +- **Credential protection**: SSH credentials never exposed to the browser |
| 169 | +- **Input sanitization**: All user input is validated and escaped |
| 170 | +- **Rate limiting**: Configurable rate limits to prevent abuse |
| 171 | +- **Audit logging**: Track all terminal activity for compliance |
| 172 | + |
| 173 | +## Issues and Contributing |
| 174 | + |
| 175 | +Found a bug or have a feature request? Please open an issue on [GitHub Issues](https://github.com/mwguerra/web-terminal/issues). |
| 176 | + |
| 177 | +## License |
| 178 | + |
| 179 | +Web Terminal is open-sourced software licensed under the [MIT License](https://github.com/mwguerra/web-terminal/blob/main/LICENSE). |
0 commit comments