{"id":26656212,"url":"https://github.com/startcloud/web-terminal","last_synced_at":"2025-03-25T07:18:58.568Z","repository":{"id":283138589,"uuid":"950764315","full_name":"STARTcloud/web-terminal","owner":"STARTcloud","description":"HTML5 Web Terminal","archived":false,"fork":false,"pushed_at":"2025-03-18T18:15:30.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T19:35:58.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/STARTcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-18T16:47:04.000Z","updated_at":"2025-03-18T18:15:33.000Z","dependencies_parsed_at":"2025-03-19T11:15:45.021Z","dependency_job_id":null,"html_url":"https://github.com/STARTcloud/web-terminal","commit_stats":null,"previous_names":["startcloud/web-terminal"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STARTcloud%2Fweb-terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STARTcloud%2Fweb-terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STARTcloud%2Fweb-terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STARTcloud%2Fweb-terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STARTcloud","download_url":"https://codeload.github.com/STARTcloud/web-terminal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245414567,"owners_count":20611369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-25T07:18:58.158Z","updated_at":"2025-03-25T07:18:58.559Z","avatar_url":"https://github.com/STARTcloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure Web Terminal\n\nA secure web-based terminal interface that provides shell access through a browser, featuring HTTPS/SSL encryption and multi-layer authentication.\n\n## Security Features\n\n- **HTTPS/SSL Encryption**: All traffic is encrypted using SSL certificates\n- **Multi-layer Authentication**:\n  - HTTP Basic Authentication for web access\n  - WebSocket authentication for terminal connections\n  - Both layers use the same credentials from config.yaml\n- **Configurable Users**: Multiple users can be defined in the config.yaml file\n- **Secure by Default**: Requires HTTPS and authentication to function\n\n## Installation\n\n1. Clone or copy the files to your target location:\n```bash\nsudo mkdir /opt/web-terminal\nsudo cp -r * /opt/web-terminal/\ncd /opt/web-terminal\n```\n\n2. Install dependencies:\n```bash\nsudo npm install\n```\n\n3. Configure the application:\n   - Copy the example config:\n     ```bash\n     sudo cp config.yaml.example config.yaml\n     ```\n   - Edit config.yaml to set:\n     - SSL certificate paths\n     - Server port\n     - User credentials\n     - Terminal preferences\n\n4. Set up SSL certificates:\n   - If using Let's Encrypt:\n     ```bash\n     sudo certbot certonly --standalone -d your-domain.com\n     ```\n   - Update config.yaml with your certificate paths:\n     ```yaml\n     server:\n       ssl:\n         cert: /etc/letsencrypt/live/your-domain.com/fullchain.pem\n         key: /etc/letsencrypt/live/your-domain.com/privkey.pem\n     ```\n\n5. Install the systemd service:\n```bash\nsudo cp web-terminal.service /etc/systemd/system/\nsudo systemctl daemon-reload\nsudo systemctl enable web-terminal\nsudo systemctl start web-terminal\n```\n\n## Configuration (config.yaml)\n\n```yaml\nserver:\n  port: 3000\n  ssl:\n    cert: /path/to/cert.pem\n    key: /path/to/key.pem\n\nusers:\n  admin: your_secure_password\n  user1: another_password\n\nterminal:\n  shell: bash\n  cols: 80\n  rows: 30\n```\n\n## Usage\n\n1. Access the terminal through your browser:\n```\nhttps://your-domain.com:3000\n```\n\n2. Enter your credentials when prompted (configured in config.yaml)\n\n3. You will now have access to a secure terminal session\n\n## Security Notes\n\n- Always use strong passwords in config.yaml\n- Keep config.yaml secure with appropriate file permissions:\n  ```bash\n  sudo chown root:root config.yaml\n  sudo chmod 600 config.yaml\n  ```\n- Regularly update SSL certificates\n- Monitor logs for unauthorized access attempts:\n  ```bash\n  sudo journalctl -u web-terminal\n  ```\n\n## Troubleshooting\n\n### Double Authentication Prompt\nThe system uses two layers of authentication for enhanced security:\n1. HTTP Basic Auth for initial web access\n2. WebSocket authentication for terminal connection\n\nBoth use the same credentials, so you can enter the same username/password for both prompts.\n\n### Common Issues\n\n1. SSL Certificate Problems:\n   ```bash\n   sudo systemctl status web-terminal\n   ```\n   Check if the SSL paths in config.yaml are correct\n\n2. Permission Issues:\n   ```bash\n   sudo chown -R root:root /opt/web-terminal\n   sudo chmod -R 755 /opt/web-terminal\n   sudo chmod 600 /opt/web-terminal/config.yaml\n   ```\n\n3. Port Already in Use:\n   ```bash\n   sudo netstat -tulpn | grep \u003cport\u003e\n   ```\n   Change the port in config.yaml if needed\n\n## Logs\n\nThe application maintains detailed logs of all connections, authentication attempts, and commands:\n\n1. System Service Logs:\n```bash\nsudo journalctl -u web-terminal -f\n```\n\n2. Application Logs:\n- Location: `/opt/web-terminal/logs/web-terminal-YYYY-MM-DD.log`\n- Rotated daily with 14-day retention\n- JSON formatted logs include:\n  * IP addresses of connections\n  * Authentication attempts (success/failure)\n  * WebSocket connections/disconnections\n  * Commands executed\n  \nView latest application logs:\n```bash\ntail -f /opt/web-terminal/logs/web-terminal-$(date +%Y-%m-%d).log\n```\n\nLog Format:\n```json\n{\n  \"event\": \"authentication|connection|command\",\n  \"ip\": \"client_ip_address\",\n  \"username\": \"user_who_connected\",\n  \"timestamp\": \"ISO-8601 timestamp\",\n  \"success\": true|false,  // for authentication events\n  \"command\": \"executed_command\",  // for command events\n  \"type\": \"http|websocket\",  // for connection events\n  \"status\": \"connected|disconnected\"  // for connection events\n}\n```\n\n## Updates\n\nTo update the application:\n1. Stop the service:\n   ```bash\n   sudo systemctl stop web-terminal\n   ```\n2. Update files\n3. Restart the service:\n   ```bash\n   sudo systemctl restart web-terminal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstartcloud%2Fweb-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstartcloud%2Fweb-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstartcloud%2Fweb-terminal/lists"}