mirror of
https://github.com/Dicklesworthstone/coding_agent_session_search.git
synced 2026-09-22 11:59:25 +08:00
55a617e880
Implements a reproducible SSH testing environment using Docker: - Dockerfile.sshd: Alpine-based SSH server with rsync and test data - ssh_test_helper.rs: RAII-style test helper for container management - ssh_sync_integration.rs: Integration tests for sync operations Features: - Ephemeral SSH key generation per test run - Dynamic port assignment for parallel test execution - Pre-populated test data for Claude, Codex, and Gemini agents - Tests marked with #[ignore = "requires Docker"] Run with: cargo test --test ssh_sync_integration -- --ignored 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
774 B
Bash
28 lines
774 B
Bash
#!/bin/bash
|
|
# Entrypoint script for SSH test container
|
|
# Allows injecting authorized keys via environment variable or volume mount
|
|
|
|
set -e
|
|
|
|
# If SSH_AUTHORIZED_KEY is provided, add it
|
|
if [ -n "$SSH_AUTHORIZED_KEY" ]; then
|
|
echo "$SSH_AUTHORIZED_KEY" > /root/.ssh/authorized_keys
|
|
chmod 600 /root/.ssh/authorized_keys
|
|
echo "Added authorized key from environment"
|
|
fi
|
|
|
|
# If authorized_keys file was mounted, ensure correct permissions
|
|
if [ -f /root/.ssh/authorized_keys ]; then
|
|
chmod 600 /root/.ssh/authorized_keys
|
|
chown root:root /root/.ssh/authorized_keys
|
|
fi
|
|
|
|
# Print SSH fingerprints for debugging
|
|
echo "SSH host key fingerprints:"
|
|
for key in /etc/ssh/ssh_host_*_key.pub; do
|
|
ssh-keygen -lf "$key" 2>/dev/null || true
|
|
done
|
|
|
|
# Start SSH daemon
|
|
exec "$@"
|