From 441560a910e7a17b2c9e035c632d956084b8a9e6 Mon Sep 17 00:00:00 2001 From: DanailDR Date: Mon, 14 Sep 2026 15:52:11 +0300 Subject: [PATCH] fix: update deployment scripts and resolve backend API communication issue --- README.md | 12 +++++------ deployment/Dockerfile | 11 +++------- deployment/docker-compose.yml | 14 ++++++------ deployment/docker-entrypoint.sh | 14 ++++++------ deployment/scripts/docker-build-and-push.sh | 2 +- docker-hub-overview.md | 2 +- src/backend_entrypoint.py | 4 ++-- src/help.html | 12 +++++------ src/index.html | 14 ++++++------ src/static/webssh.css | 2 +- src/static/webssh.js | 24 ++++++++++----------- src/webssh_backend/__init__.py | 4 ++-- src/webssh_backend/config.py | 10 ++++----- src/webssh_backend/main.py | 2 +- 14 files changed, 61 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 0ede1ea..0bcd282 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# StrixWebSSH - Browser-based SSH Client +# WebSSH - Browser-based SSH Client Multi-connection SSH client that runs in your browser with JWT authentication. @@ -40,7 +40,7 @@ Default credentials: Set users via environment variable in `deployment/docker-compose.yml`: ```yaml environment: - - STRIXWEBSSH_USERS=user1:pass1,user2:pass2 + - WEBSSH_USERS=user1:pass1,user2:pass2 ``` ### JWT Secret @@ -184,10 +184,10 @@ your-domain.com { :8080 { handle_path /ws* { - reverse_proxy strixwebssh:8081 + reverse_proxy webssh:8081 } handle_path /api/* { - reverse_proxy strixwebssh:8082 + reverse_proxy webssh:8082 } route { root * /srv @@ -202,8 +202,8 @@ your-domain.com { Pre-built multi-arch images available: ```bash -docker pull danaildr/strixwebssh:latest -docker pull danaildr/strixwebssh:0.3.1 +docker pull danaildr/webssh:latest +docker pull danaildr/webssh:0.4.0 ``` Supported architectures: `linux/amd64`, `linux/arm64` diff --git a/deployment/Dockerfile b/deployment/Dockerfile index 2bc1e16..db83d95 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -44,8 +44,7 @@ RUN set -eux; \ find /opt/venv -path '*/site-packages/pip*' -print0 | xargs -0 -r rm -rf || true; \ find /opt/venv -path '*/site-packages/setuptools*' -print0 | xargs -0 -r rm -rf || true; \ find /opt/venv -path '*/site-packages/wheel*' -print0 | xargs -0 -r rm -rf || true; \ - # Remove static metadata not required for runtime (careful: keep runtime metadata intact) - find /opt/venv -type d -name '*.dist-info' -prune -print0 | xargs -0 -r rm -rf || true || true + true # Download Caddy binary for the build target (multi-arch aware) ARG TARGETARCH @@ -108,12 +107,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY --from=builder /opt/venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -# Reinstall runtime dependencies explicitly in the final image to avoid missing package metadata -COPY requirements.txt /tmp/requirements.txt -RUN /opt/venv/bin/python -m ensurepip --upgrade && /opt/venv/bin/python -m pip install --no-cache-dir --prefer-binary -r /tmp/requirements.txt && rm -f /tmp/requirements.txt - # Security: Run as non-root user -RUN groupadd -r strixwebssh && useradd -r -g strixwebssh strixwebssh +RUN groupadd -r webssh && useradd -r -g webssh webssh WORKDIR /app/src @@ -122,7 +117,7 @@ COPY src/ /app/src/ COPY deployment/docker-entrypoint.sh /usr/local/bin/ # Create .ssh directory for host keys -RUN mkdir -p /app/src/.ssh && chown -R strixwebssh:strixwebssh /app/src +RUN mkdir -p /app/src/.ssh && chown -R webssh:webssh /app/src # Copy entrypoint RUN chmod +x /usr/local/bin/docker-entrypoint.sh diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index d50002b..7daa10d 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -1,11 +1,11 @@ services: - strixwebssh: + webssh: build: context: .. dockerfile: deployment/Dockerfile - container_name: strixwebssh-backend + container_name: webssh-backend restart: unless-stopped - # StrixWebSSH runs internal services; integrated Caddy will expose port 8080 to the host + # WebSSH runs internal services; integrated Caddy will expose port 8080 to the host ports: - "8080:8080" environment: @@ -13,7 +13,7 @@ services: - PYTHONUNBUFFERED=1 - LOG_LEVEL=INFO # Configure users: format is username:password,username2:password2 - - STRIXWEBSSH_USERS=admin:admin + - WEBSSH_USERS=admin:admin # Max upload size (supports format like "100M" for 100MB or "50M" for 50MB) - MAX_UPLOAD_SIZE=30M # Session Recording Configuration @@ -34,9 +34,9 @@ services: cpus: '0.25' memory: 128M volumes: - - strixwebssh_data:/data + - webssh_data:/data # Optionally expose code to other services (read-only) - # - ./:/srv/strixwebssh:ro + # - ./:/srv/webssh:ro healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/"] interval: 30s @@ -46,4 +46,4 @@ services: volumes: - strixwebssh_data: \ No newline at end of file + webssh_data: \ No newline at end of file diff --git a/deployment/docker-entrypoint.sh b/deployment/docker-entrypoint.sh index 2b1d85a..bdc292c 100644 --- a/deployment/docker-entrypoint.sh +++ b/deployment/docker-entrypoint.sh @@ -7,7 +7,7 @@ if [ "$(id -u)" != "0" ]; then exec python /app/src/run.py fi -# Create data directory with correct permissions for the StrixWebSSH user +# Create data directory with correct permissions for the WebSSH user if [ ! -d "/data" ]; then echo "Creating /data directory..." mkdir -p /data @@ -17,14 +17,14 @@ echo "Current /data permissions:" ls -la /data || true ls -la / | grep data || true -# Ensure /data is writable and owned by the StrixWebSSH user (UID 999) +# Ensure /data is writable and owned by the WebSSH user (UID 999) echo "Setting permissions on /data..." chmod 755 /data -chown strixwebssh:strixwebssh /data +chown webssh:webssh /data # Check if chown worked -if [ "$(stat -c %U /data)" != "strixwebssh" ]; then - echo "WARNING: Could not change ownership of /data to strixwebssh" +if [ "$(stat -c %U /data)" != "webssh" ]; then + echo "WARNING: Could not change ownership of /data to webssh" echo "Current owner: $(stat -c %U /data)" echo "This may happen with bind mounts. Ensure host directory is writable." fi @@ -43,5 +43,5 @@ else echo "Caddy binary not found; continuing without reverse proxy" fi -# Start the application (run as the StrixWebSSH user) -exec gosu strixwebssh python /app/src/run.py +# Start the application (run as the WebSSH user) +exec gosu webssh python /app/src/run.py diff --git a/deployment/scripts/docker-build-and-push.sh b/deployment/scripts/docker-build-and-push.sh index d9de324..14b4695 100755 --- a/deployment/scripts/docker-build-and-push.sh +++ b/deployment/scripts/docker-build-and-push.sh @@ -7,7 +7,7 @@ set -e # Configuration IMAGE_NAME="danaildr/webssh" -VERSION="0.3.1" +VERSION="0.4.0" PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7" # Colors diff --git a/docker-hub-overview.md b/docker-hub-overview.md index 613c7bd..8b86274 100644 --- a/docker-hub-overview.md +++ b/docker-hub-overview.md @@ -129,7 +129,7 @@ https://github.com/danaildr/web-ssh ## Tags - `latest` - Most recent stable build -- `0.3.1` - Version-specific tag (Grouped recordings + Bulk operations + Multi-arch support) +- `0.4.0` - Version-specific tag (Grouped recordings + Bulk operations + Multi-arch support) - `0.1.9` - Previous version Multi-arch: All tags support both `linux/amd64` and `linux/arm64`. diff --git a/src/backend_entrypoint.py b/src/backend_entrypoint.py index ee0b73f..0ae5904 100644 --- a/src/backend_entrypoint.py +++ b/src/backend_entrypoint.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 """ -StrixWebSSH Backend - Modular SSH and SFTP server. +WebSSH Backend - Modular SSH and SFTP server. -This file is a compatibility wrapper around the StrixWebSSH backend package. +This file is a compatibility wrapper around the WebSSH backend package. The actual implementation has been split into modular components in webssh_backend/: - config.py: Configuration and constants diff --git a/src/help.html b/src/help.html index 55834dd..2543043 100644 --- a/src/help.html +++ b/src/help.html @@ -3,7 +3,7 @@ - StrixWebSSH - Help + WebSSH - Help