87 lines
1.6 KiB
Markdown
87 lines
1.6 KiB
Markdown
# ttyd - Web Terminal
|
|
|
|
ttyd permite accesul la terminalul tmux prin browser web.
|
|
|
|
## Instalare
|
|
|
|
```bash
|
|
sudo apt install ttyd
|
|
```
|
|
|
|
## Configurație serviciu systemd
|
|
|
|
Creează `/etc/systemd/system/ttyd.service`:
|
|
|
|
```ini
|
|
[Unit]
|
|
Description=ttyd - Web Terminal for Claude Agent
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=claude
|
|
Group=claude
|
|
WorkingDirectory=/workspace
|
|
Environment="HOME=/home/claude"
|
|
Environment="NVM_DIR=/home/claude/.nvm"
|
|
Environment="PATH=/home/claude/.nvm/versions/node/v22.16.0/bin:/usr/local/bin:/usr/bin:/bin"
|
|
ExecStart=/usr/bin/ttyd -p 7681 -c claude:claude2025 -W /workspace/start-agent.sh
|
|
Restart=always
|
|
RestartSec=3
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
```
|
|
|
|
## Activare serviciu
|
|
|
|
```bash
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now ttyd
|
|
```
|
|
|
|
## Acces
|
|
|
|
- **URL:** `http://<IP>:7681`
|
|
- **Credențiale:** claude / claude2025
|
|
|
|
## Comenzi utile
|
|
|
|
```bash
|
|
# Status serviciu
|
|
sudo systemctl status ttyd
|
|
|
|
# Restart serviciu
|
|
sudo systemctl restart ttyd
|
|
|
|
# Logs în timp real
|
|
sudo journalctl -u ttyd -f
|
|
|
|
# Oprire serviciu
|
|
sudo systemctl stop ttyd
|
|
```
|
|
|
|
## Opțiuni ttyd
|
|
|
|
| Flag | Descriere |
|
|
|------|-----------|
|
|
| `-p PORT` | Portul web (default: 7681) |
|
|
| `-c user:pass` | Autentificare basic |
|
|
| `-W` | Permite write (client poate tasta) |
|
|
| `-t fontSize=N` | Dimensiune font |
|
|
| `-i INTERFACE` | Interfața de ascultare |
|
|
|
|
## Troubleshooting
|
|
|
|
### Serviciul nu pornește
|
|
Verifică logs: `sudo journalctl -u ttyd -e`
|
|
|
|
### Eroare autentificare
|
|
Verifică că user/parola sunt corecte în ExecStart.
|
|
|
|
### tmux session nu se creează
|
|
Verifică că `/workspace/start-agent.sh` este executabil:
|
|
```bash
|
|
chmod +x /workspace/start-agent.sh
|
|
```
|