Files
Jocay c013a389fe 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.
2026-08-10 00:07:52 +08:00

26 lines
697 B
Docker

ARG PYTHON_IMAGE=python:3.12-slim
FROM ${PYTHON_IMAGE}
LABEL maintainer='<author>'
LABEL version='0.0.0-dev.0-build.0'
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt --no-cache-dir
COPY . /code
RUN useradd --system --create-home --shell /usr/sbin/nologin webssh && \
mkdir -p /data && \
chown -R webssh:webssh /code /data
EXPOSE 8888/tcp
USER webssh
# 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"]