|
Download README.md from swefse/wa: direct link, hf CLI and curl.
- Browser
- Download file 2.36 kB
-
https://huggingface.co/spaces/swefse/wa/resolve/main/README.md
- Command line
-
hf download hf://spaces/swefse/wa/README.md
-
curl -L -o README.md https://huggingface.co/spaces/swefse/wa/resolve/main/README.md
2.36 kB
metadata
title: SSH Tunnel Service
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
π SSH Tunnel Service - Hugging Face Space
24/7 SSH tunnel service using Pinggy with automatic WebSocket registration.
Features
- β Persistent SSH tunnel via Pinggy
- β Auto-reconnect on failure
- β WebSocket registration to control server
- β Real-time status monitoring
- β 7/24 uptime (Hugging Face keeps Space alive)
Setup
- Create a new Space on Hugging Face
- Select "Docker" as SDK
- IMPORTANT: Space must be PUBLIC (Private spaces sleep after 48h)
- Upload these files:
- Dockerfile
- app.py
- requirements.txt
- README.md (this file)
- Space will auto-deploy
π₯ KEEP SPACE ALIVE 24/7 (Choose one):
Option 1: Upgrade to Persistent Hardware (Recommended)
- Go to Space Settings β Hardware
- Select "CPU persistent" or higher ($0.60/day)
- Space NEVER sleeps, guaranteed 24/7 uptime
Option 2: Free Tier + External Ping (No cost)
- Space must be PUBLIC
- Add this cron job to ANY server:
# Ping every 10 minutes to prevent sleep
*/10 * * * * curl -s https://YOUR_USERNAME-SPACE_NAME.hf.space/ > /dev/null
- Or use UptimeRobot (free): https://uptimerobot.com
- Add HTTP monitor
- URL: https://YOUR_USERNAME-SPACE_NAME.hf.space/
- Interval: 5 minutes
Usage
Once deployed, the Space will:
- Start SSH tunnel via Pinggy
- Extract tunnel URL
- Register to WebSocket server
- Keep tunnel alive 24/7
Connection
SSH credentials will be displayed in the Space UI and sent to your WebSocket server.
Default credentials:
- User:
root - Pass:
HuggingFace2024! - Host: Dynamically assigned by Pinggy
Architecture
- Docker: Custom environment with SSH client
- Gradio: Simple UI for status monitoring
- Background Worker: Maintains tunnel and registration
- Auto-refresh: UI updates every 30 seconds
Notes
- Free tier: 16GB RAM, 8 CPU (sleeps after 48h inactivity)
- Persistent tier: $0.60/day (NEVER sleeps)
- Space MUST be PUBLIC for free tier
- Auto-restarts on crash
- Tunnel refreshes every 30 minutes
- Private repos don't affect Space (Space itself must be public)
Deployment
# Clone this repo to your Hugging Face Space
# Or manually upload files via web UI
Developed for 24/7 SSH tunnel access via Hugging Face Spaces.