A Node.js server that resolves ENS domains to IPFS content and provides Tor hidden service support for decentralized web hosting.
- Resolves ENS domains to IPFS/IPNS content
- Automatic SSL certificate management with Let's Encrypt
- Tor hidden service creation and management
- Content caching and pinning
- Rate limiting for DDoS protection
- Support for static web content
- Node.js
- Tor daemon
- IPFS node
- SSL certificates for root domain
- DNS configuration for domain
The server requires a config.js
file with the following parameters:
IFPS_NODE_ENDPOINT
: URL of IPFS nodeRPC_PROVIDER
: Ethereum RPC provider URLTOR_PATH
: Path to Tor executableTOR_BRIDGES
: Tor bridge configurationONION_PORT
: Port for Tor hidden servicesPATH_SSL_KEY
: Path to SSL private keyPATH_SSL_CERT
: Path to SSL certificateDNS_CHALLENGE_PARAMS
: DNS challenge parameters for Let's EncryptGLOCK_CONFIG
: Greenlock SSL configurationGLOCK_DEFAULTS
: Default Greenlock settings
-
ENS Resolution:
- Receives requests to
*.3th.ws
domains - Resolves ENS names to IPFS/IPNS content hashes
- Fetches content from IPFS network
- Receives requests to
-
Content Management:
- Caches IPFS content locally
- Pins content to configured IPFS node
- Serves static HTML content
- Cleans up unused cached content
-
Hidden Services:
- Creates Tor hidden services for IPFS content
- Manages onion addresses
- Handles reverse resolution of onion addresses
-
SSL Management:
- Automatic certificate generation and renewal
- Wildcard certificate support using greenlock.js
- Domain-specific certificate handling
- Start the server:
node server.js
- Access content via:
- Direct domain:
https://your-ens-name.[YOUR_TLD_NAME].[TLD]
- Onion service:
https://onion.your-ens-name.[YOUR_TLD_NAME].[TLD]
- Direct domain:
The server provides various error messages for common scenarios:
- Failed content fetching
- Unsupported content types
- Missing static content
- Resolution conflicts
- Hidden service errors
- Rate limiting to prevent abuse
- SSL/TLS encryption
- Tor network integration
- Content validation
- Error handling and logging
Feel free to submit issues and enhancement requests. Follow standard GitHub pull request process for contributions.
MIT jazz