1. 16 Sep, 2025 15 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Fix critical architectural issue in wssshc tunnel handling · 0ecabb18
      Stefy Lanza (nextime / spora ) authored
      - Fixed wssshc to act as SSH client instead of SSH server
      - wssshc now connects to target SSH server (localhost:22) when receiving tunnel_request
      - Removed incorrect SSH server listening code that was binding to port 22
      - Implemented proper SSH client connection forwarding
      - Fixed 'Address already in use' error by removing port 22 binding conflict
      - Corrected tunnel architecture: wssshc → SSH server, not SSH server → wssshc
      - Updated handle_tunnel_request to establish SSH client connection to target
      - Removed accept_ssh_connection function (not needed for client mode)
      - Fixed bidirectional forwarding between WebSocket and SSH client connection
      - Resolved socket lifecycle issues by using correct connection direction
      - Eliminated port binding conflicts with system SSH server
      - Implemented proper SSH protocol flow for client-side tunneling
      0ecabb18
    • Stefy Lanza (nextime / spora )'s avatar
      Improve error handling for broken SSH connections · 3fbae822
      Stefy Lanza (nextime / spora ) authored
      - Added detailed error reporting when socket becomes invalid
      - Mark tunnel as inactive when SSH connection is broken
      - Enhanced debugging for socket closure detection
      - Added errno reporting for connection errors
      - Improved error messages to distinguish between different failure modes
      - Added proper tunnel state management when connections fail
      - Better handling of SSH client disconnections during handshake
      - Added mutex protection for tunnel state updates during errors
      3fbae822
    • Stefy Lanza (nextime / spora )'s avatar
      Add enhanced socket debugging and validation · 0ca61906
      Stefy Lanza (nextime / spora ) authored
      - Added fcntl() check to validate socket before sending data
      - Enhanced error reporting with socket descriptor and errno details
      - Added detailed send operation logging for troubleshooting
      - Improved socket state validation to prevent bad file descriptor errors
      - Added errno reporting for better error diagnosis
      - Enhanced debugging output for socket operations
      - Added socket validity checks using file descriptor flags
      - Improved error messages with more context information
      0ca61906
    • Stefy Lanza (nextime / spora )'s avatar
      Fix request ID generation to ensure uniqueness · 891795a3
      Stefy Lanza (nextime / spora ) authored
      - Added proper seeding of random number generator with time and PID
      - Prevents duplicate request IDs across program runs
      - Uses srand() with combination of current time and process ID
      - Ensures each tunnel session gets a truly unique request ID
      - Added thread-safe seeding with static flag to prevent reseeding
      - Fixed potential security issue with predictable request IDs
      - Improved randomness quality for tunnel identification
      891795a3
    • Stefy Lanza (nextime / spora )'s avatar
      Fix thread synchronization issues in wsssh.c · 8438ebe0
      Stefy Lanza (nextime / spora ) authored
      - Added proper mutex protection for active_tunnel access
      - Fixed race condition between main thread and forwarding thread
      - Protected SSL connection access with mutex locks
      - Fixed socket setting with proper mutex synchronization
      - Ensured thread-safe access to tunnel state variables
      - Prevented concurrent access to shared tunnel resources
      - Added proper SSL connection lifecycle management
      - Fixed potential data races in WebSocket message handling
      8438ebe0
    • Stefy Lanza (nextime / spora )'s avatar
      Fix socket availability issue in handle_tunnel_data · 35e6e78f
      Stefy Lanza (nextime / spora ) authored
      - Added check for valid target socket before attempting to send data
      - Prevents 'Bad file descriptor' errors when local socket isn't ready yet
      - Added debug message when target socket is not available
      - Ensures tunnel_data messages are ignored until SSH connection is established
      - Fixes race condition between WebSocket message arrival and SSH client connection
      35e6e78f
    • Stefy Lanza (nextime / spora )'s avatar
      Fix hex decoding and data handling issues in tunnel.c · 8ed44cda
      Stefy Lanza (nextime / spora ) authored
      - Improved handle_tunnel_data() with better hex validation and decoding
      - Added bounds checking for hex data length validation
      - Enhanced error handling for hex decoding failures
      - Added debug logging for hex decoding issues
      - Improved socket send error handling with detailed error messages
      - Added bounds checking for hex encoding in forwarding functions
      - Fixed potential buffer overflow issues with large hex data
      - Enhanced robustness for handling large SSH protocol packets
      8ed44cda
    • Stefy Lanza (nextime / spora )'s avatar
      Fix bidirectional tunnel for wssshc client · e86758cb
      Stefy Lanza (nextime / spora ) authored
      - Modified handle_tunnel_request() to connect to local SSH server (localhost:22)
      - Added forward_ws_to_local() function for WebSocket to local SSH forwarding
      - Updated handle_tunnel_data() to properly route data to correct socket
      - wssshc now establishes bidirectional forwarding between WebSocket and local SSH server
      - Fixed tunnel blocking issue by implementing proper data flow in both directions
      - Added thread for handling data from local SSH server back to WebSocket
      e86758cb
    • Stefy Lanza (nextime / spora )'s avatar
      Fix wssshc registration message to send password instead of request_id · 28431321
      Stefy Lanza (nextime / spora ) authored
      - Added send_registration_message() function to websocket library
      - Updated wssshc.c to use send_registration_message() instead of send_json_message()
      - Registration message now sends: {"type":"register","client_id":"<id>","password":"<password>"}
      - Instead of: {"type":"register","client_id":"<id>","request_id":"<password>"}
      - Server can now properly authenticate clients with passwords
      28431321
    • Stefy Lanza (nextime / spora )'s avatar
      Update .gitignore to exclude build artifacts · b853b506
      Stefy Lanza (nextime / spora ) authored
      - Added patterns for new shared library build artifacts (*.a, *.so)
      - Added patterns for compiled library executables (wssshlib, websocket, wssh_ssl, tunnel)
      - Enabled logos/ directory exclusion (generated assets)
      - Added comprehensive Debian packaging artifact patterns
      - Added build info file patterns (*_*.buildinfo)
      - Ensures clean git status by excluding all build-generated files
      b853b506
    • Stefy Lanza (nextime / spora )'s avatar
      Fix websockets server shutdown error · a56fed42
      Stefy Lanza (nextime / spora ) authored
      - Removed incorrect 'closed' attribute check on websockets Server object
      - Added proper exception handling for server shutdown
      - Fixed 'Server' object has no attribute 'closed' error during shutdown
      - Server now shuts down cleanly without throwing exceptions
      a56fed42
    • Stefy Lanza (nextime / spora )'s avatar
      Fix server-side registration to accept 'client_id' field · 286f91f0
      Stefy Lanza (nextime / spora ) authored
      - Modified wssshd.py to accept both 'id' and 'client_id' fields for registration
      - Added fallback logic: client_id = data.get('client_id') or data.get('id')
      - This allows the C client to send 'client_id' while maintaining backward compatibility
      - Fixes the KeyError: 'id' issue when C client tries to register
      286f91f0
    • Stefy Lanza (nextime / spora )'s avatar
      Remove artifacts files · ebed579e
      Stefy Lanza (nextime / spora ) authored
      ebed579e
    • Stefy Lanza (nextime / spora )'s avatar
      Major refactoring: Extract shared libraries and fix port option behavior · 17a93753
      Stefy Lanza (nextime / spora ) authored
      - Extracted ~1500+ lines of duplicate code into shared libraries:
        * wssshlib.h/.c - Shared utilities (config, flags, ports, IDs)
        * websocket.h/.c - WebSocket functions (handshake, framing, messaging)
        * wssh_ssl.h/.c - SSL/TLS setup functions
        * tunnel.h/.c - Tunnel management (setup, reconnection, data handling)
      
      - Fixed critical port option behavior:
        * -p/-P options now correctly specify wssshd server port
        * Removed misleading documentation about options being passed through
        * Updated help text and man pages to reflect correct behavior
      
      - Cleaned up help documentation:
        * Removed duplicate 'Options:' sections from wsssh and wsscp
        * Consolidated all options into single, clean sections
      
      - Updated build system:
        * Modified configure.sh and Makefile for new library structure
        * Proper linking of wsssh and wsscp against shared libraries
      
      - Updated documentation:
        * CHANGELOG.md - Added version 1.4.6 with comprehensive details
        * README.md - Updated architecture and project structure
        * DOCUMENTATION.md - Reflected new library structure
        * Man pages - Corrected port option examples
        * TODO.md - Updated completion status
      
      - Maintained backward compatibility while improving maintainability
      17a93753
    • Stefy Lanza (nextime / spora )'s avatar
      Remove Python implementations of wssshc, wsssh, wsscp · 34202ca9
      Stefy Lanza (nextime / spora ) authored
      - Delete wssshc.py, wsssh.py, wsscp.py files
      - Update build.sh to remove pyinstaller commands and output messages
      - Update Debian packaging to exclude Python script installations
      - Update documentation to reflect C-only implementations
      - Update CHANGELOG.md with version 1.4.5 entry
      - Focus on C implementations for better performance and minimal dependencies
      34202ca9
  2. 15 Sep, 2025 25 commits
    • nextime's avatar
      Clean up unused variables in flag rendering code · 250a9362
      nextime authored
      250a9362
    • nextime's avatar
      3a484773
    • nextime's avatar
    • nextime's avatar
      Add navigation improvements to web interface · 034ca420
      nextime authored
      - Fix navbar brand link to point to dashboard home page
      - Add back button to terminal page for easy navigation to dashboard
      - Improve user experience with better navigation between pages
      - Maintain consistent navigation throughout the web interface
      034ca420
    • nextime's avatar
      Update version to 1.4.4 and documentation · 7c86df54
      nextime authored
      - Updated CHANGELOG.md with new features and fixes for v1.4.4
      - Updated README.md with version 1.4.4 information and new features
      - Updated DOCUMENTATION.md with enhanced feature descriptions
      - Updated TODO.md to reflect completed tasks and new version
      - Updated Debian changelog files for both wsssh-server and wsssh-tools packages
      - Added comprehensive documentation for:
        * Dynamic terminal sizing and resize support
        * Force echo mode implementation
        * Enhanced logging with logrotate integration
        * Terminal dimension fixes and improvements
        * Backend API enhancements for terminal management
      7c86df54
    • nextime's avatar
      Fix terminal dimensions calculation at startup and resize · e857d27e
      nextime authored
      - Calculate terminal dimensions after initial fit to container
      - Store initial dimensions for use during connection
      - Use calculated dimensions for both startup and resize events
      - Ensure proper terminal sizing for applications like top
      - Handle browser window resize to update remote terminal dynamically
      e857d27e
    • nextime's avatar
      Force terminal echo by running stty echo before wsssh · dc3db4b2
      nextime authored
      - Modify wssshd.py to run 'stty echo' before launching wsssh
      - Use shell command wrapper to execute stty echo && wsssh
      - Ensure echo mode is forced before SSH connection is established
      - Remove JavaScript-based stty echo attempts
      - Fix terminal echo issue by setting echo mode at the right time
      dc3db4b2
    • nextime's avatar
      Simplify terminal echo: let SSH server control echo behavior · 675df299
      nextime authored
      - Remove JavaScript-based echo handling and password mode detection
      - Send all keystrokes directly to server without local echo manipulation
      - Let SSH server handle echo control through terminal protocol
      - Proper terminal behavior where server controls what gets displayed
      - No more manual echo logic, respects SSH server's echo settings
      675df299
    • nextime's avatar
      Fix password echo security issue in web terminal · c0b3a4bd
      nextime authored
      - Add passwordMode flag to detect password prompts from SSH server
      - Disable local echo when password prompts are detected (Password:, password:, etc.)
      - Re-enable echo after password is submitted (on Enter key or new prompt)
      - Reset passwordMode on disconnect for clean state
      - Maintain security by not displaying passwords in plain text
      - Preserve normal command echo for non-password input
      c0b3a4bd
    • nextime's avatar
      Fix terminal echo: restore local command echoing in web terminal · 09245516
      nextime authored
      - Add proper xterm.js configuration with disableStdin: false and other settings
      - Implement local echo handling for printable characters, backspace, and enter
      - Ensure terminal input is visible to user while maintaining server communication
      - Fix input handling to properly display typed commands in the web interface
      09245516
    • nextime's avatar
      Fix web terminal sizing: make xterm.js terminal use full available area · f3fe7c6d
      nextime authored
      - Update .terminal-container CSS to use calc(100vh - 200px) for responsive height
      - Remove fixed padding and height constraints
      - Add xterm-addon-fit for proper terminal resizing
      - Update terminal initialization to use fit addon for dynamic sizing
      - Ensure terminal fills entire container width and height
      - Add window resize event handler for responsive terminal sizing
      f3fe7c6d
    • nextime's avatar
      Update documentation for logging improvements · 47bb3803
      nextime authored
      - Add logging section to README.md with logrotate configuration details
      - Add comprehensive Logging Configuration section to DOCUMENTATION.md
      - Update CHANGELOG.md with version 1.4.4 entry for logging features
      - Update table of contents in DOCUMENTATION.md to include logging section
      
      Features documented:
      - Automatic log rotation with logrotate
      - Log file locations and management
      - Manual log management commands
      - Troubleshooting with logs
      - Log analysis techniques
      47bb3803
    • nextime's avatar
      Fix wssshd init script: use --output option to redirect stdout and stderr to log file · fc736a9c
      nextime authored
      Use start-stop-daemon --output option to properly redirect both stdout and stderr
      to /var/log/wssshd/wssshd.log while preserving correct PID storage in the PID file
      fc736a9c
    • nextime's avatar
      Configure wssshd and wssshc init scripts to redirect output to log files managed by logrotate · 1f6b7f9d
      nextime authored
      - Add wssshd.log and wssshc.log to respective logrotate configurations
      - Modify init scripts to redirect stdout and stderr to log files
      - Ensure proper log rotation with weekly rotation, compression, and HUP signals
      1f6b7f9d
    • nextime's avatar
      Fix PID file creation in watchdog start case · 51f99873
      nextime authored
      - Create PID file in start case with correct background process PID
      - Remove PID file creation from main() function to avoid empty files
      - Validate background process is running before reporting success
      - Clean up PID file if process fails to start
      - Fix both wssshd and wssshc watchdogs
      51f99873
    • nextime's avatar
      Fix watchdog PID file to store correct background process PID · 5ee95a9f
      nextime authored
      - Capture PID of background main() process with MAIN_PID=
      - Store correct PID in watchdog PID file instead of main() function PID
      - Prevent PID file from containing exited process PID
      - Fix both wssshd and wssshc watchdogs
      - Watchdog PID file now contains PID of actual running process
      5ee95a9f
    • nextime's avatar
      Fix bash condition evaluation in init scripts · 24611f90
      nextime authored
      - Separate PID file reading from process checking
      - Prevent command substitution failures in kill command
      - Add proper error handling for PID file operations
      - Fix false 'watchdog failed' reports due to bash syntax issues
      - Fixed both wssshd and wssshc init scripts
      24611f90
    • nextime's avatar
      Add debug logging to watchdog monitoring loops · a15aa00d
      nextime authored
      - Add detailed logging to main() monitoring loops
      - Track loop iterations and daemon status checks
      - Log sleep intervals and monitoring status
      - Help diagnose why watchdog exits prematurely
      - Fixed both wssshd and wssshc watchdogs
      a15aa00d
    • nextime's avatar
      Fix init scripts to handle existing watchdog processes · 299eed2b
      nextime authored
      - Stop existing watchdog before starting new one
      - Use pgrep to detect running watchdog processes
      - Prevent 'watchdog already running' conflicts
      - Ensure clean watchdog startup in init scripts
      - Fixed both wssshd and wssshc init scripts
      299eed2b
    • nextime's avatar
      Fix duplicate check_restart_limits() functions in watchdogs · 844a88ba
      nextime authored
      - Removed duplicate function definitions causing bash arithmetic errors
      - Kept the more complete check_restart_limits() function with awk timestamp parsing
      - Fixed both wssshd and wssshc watchdog scripts
      - Eliminates 'integer expression expected' errors
      844a88ba
    • nextime's avatar
      Refactor init scripts to start daemons directly before watchdog · 7c51589c
      nextime authored
      - Init scripts now start wssshd/wssshc daemons directly
      - Wait for daemons to be fully running before starting watchdog
      - Watchdog only monitors existing daemons, doesn't start them
      - Watchdog exits if daemon restart fails
      - Proper startup sequence: daemon → verify running → watchdog
      - Fixed both wssshd and wssshc init scripts and watchdogs
      7c51589c
    • nextime's avatar
      Add startup delay for daemon initialization · fa858590
      nextime authored
      - Watchdog now waits 3 seconds after starting daemon before checking status
      - Prevents false detection of daemon failure during startup
      - Gives daemon time to fully initialize and create PID file
      - Fixed both wssshd and wssshc watchdogs
      - Improves reliability of daemon startup detection
      fa858590
    • nextime's avatar
      Fix watchdog daemonization with setsid · 309d1940
      nextime authored
      - Use setsid to properly daemonize main() function
      - setsid bash -c 'main' & creates independent process group
      - Prevents main() from being killed when parent script exits
      - Fixed both wssshd and wssshc watchdogs
      - Watchdog processes should now persist correctly
      309d1940
    • nextime's avatar
      Fix watchdog daemonization issue · cab9eefd
      nextime authored
      - Watchdog now properly daemonizes by running main() in background
      - Removed complex PID file waiting logic that was causing issues
      - Simplified start case to just run main() and check for PID file
      - Fixed both wssshd and wssshc watchdogs
      - Watchdog processes should now persist after script exits
      cab9eefd
    • nextime's avatar
      Fix init scripts to kill processes even without PID file · 81f5c328
      nextime authored
      - Stop functions now kill daemon processes regardless of PID file existence
      - Added fallback pkill mechanism for processes without PID files
      - Uses graceful TERM signal followed by force KILL signal
      - Fixed both wssshd and wssshc init scripts
      - Ensures complete process cleanup in all scenarios
      81f5c328