fix: update deployment scripts and resolve backend API communication issue

This commit is contained in:
dido committed 2026-09-14 15:52:11 +03:00
1 parent ae023525ec
commit 441560a910
14 files changed
+61 -66

No files matched your search

+3 -8
View File
@@ -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
+7 -7
View File
@@ -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:
webssh_data:
+7 -7
View File
@@ -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
+1 -1
View File
@@ -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