feat: Implement directory validation and shell command quoting

- Added is_valid_directory function to validate directory paths, ensuring they do not contain control characters and are within a specified length.
- Introduced quote_shell_arg to safely quote shell arguments, preventing command injection.
- Created build_cd_command to generate a command for changing directories in a shell.
- Enhanced the LoginHandler to utilize a login rate limiter, preventing brute-force attacks by tracking failed login attempts.
- Implemented an EncodingCache to optimize encoding detection for SSH connections.
- Updated the UI to include an input field for specifying an initial directory upon login, with appropriate validation and hints.
- Added a quickbar in the terminal interface for easy access to copy and paste functionality.
- Introduced a toast notification system to provide feedback on copy actions.
- Refactored connection storage to encrypt passwords at rest, improving security.
- Updated various templates and styles to accommodate new features and improve user experience.
This commit is contained in:
Jocay
2026-08-10 00:07:52 +08:00
parent af50427169
commit c013a389fe
21 changed files with 1396 additions and 62 deletions
+4 -1
View File
@@ -19,4 +19,7 @@ RUN useradd --system --create-home --shell /usr/sbin/nologin webssh && \
EXPOSE 8888/tcp
USER webssh
CMD ["python", "run.py", "--address=0.0.0.0", "--port=8888", "--data-dir=/data"]
# WEBSSH_OPTS passes extra wssh options through without rebuilding the image,
# e.g. WEBSSH_OPTS="--maxconn=50 --tdstream=172.18.0.1"
ENV WEBSSH_OPTS=""
CMD ["sh", "-c", "exec python run.py --address=0.0.0.0 --port=8888 --data-dir=/data $WEBSSH_OPTS"]