8000 GitHub - code-abdulrehman/expose · GitHub
[go: up one dir, main page]

Skip to content
code-abdulrehmanPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

EXPOSE - Self-Hosted Cloudflare Tunnel Manager

Expose is a professional, brutalist-style system designed to help developers share their local environments with the world securely. Powered by Cloudflare Tunnels, it provides stable links with automatic SSL and no port-forwarding required.

Expose


Quick Setup (Magic AI Prompt)

If you are using an AI-powered IDE (Cursor, Windsurf, etc.), copy and paste this single prompt:

"Initialize the Expose project: 1. Install all dependencies across workspaces. 2. Configure .env files for backend and dashboard using imabdulrehman.site as ROOT_DOMAIN. 3. Ensure cloudflared is installed. 4. Guide me through 'cloudflared tunnel login' to generate the cert.pem."


Manual Installation Guide

1. Prerequisites

  • Node.js: v18+
  • cloudflared CLI
  • Domain: A domain connected to Cloudflare (e.g., yourdomain.com).

2. First-Time Authentication

Expose needs a certificate to manage tunnels on your behalf.

  1. Run: cloudflared tunnel login
  2. Select your domain in the browser window.
  3. This creates a cert.pem in ~/.cloudflared/.

3. DNS Configuration (Crucial for Custom Domains)

To use custom aliases like portal-expose.yourdomain.com, you must set a Wildcard CNAME in your Cloudflare Dashboard:

  1. Create your Tunnel: cloudflared tunnel create expose-tunnel
  2. Add DNS Record:
    • Type: CNAME
    • Name: * (Global Wildcard)
    • Target: [YOUR-TUNNEL-ID].cfargotunnel.com
    • Proxy Status: Proxied (Orange Cloud)

Note: We use the format alias-expose.yourdomain.com because Cloudflare Free SSL does not support nested subdomains (e.g., alias.expose.domain.com).

4. Project Config

# Install dependencies
npm install

# Setup Environment
# In /apps/backend/.env:
ROOT_DOMAIN=yourdomain.com
TUNNEL_NAME=expose-tunnel

# In /apps/dashboard/.env:
VITE_API_URL=http://localhost:3001
VITE_ROOT_DOMAIN=yourdomain.com

How to Use

  1. Start the Engine:
    ./start.sh
  2. Open Dashboard: http://localhost:5173
  3. Deploy a Tunnel:
    • PORT_NUM: The port where your local app is running (e.g. 3000). Expose will check if this port is active first.
    • NAME_ALIAS:
      • Leave Blank: Generates a random *.trycloudflare.com link.
      • Enter Name: Generates a [name]-expose.yourdomain.com link.
  4. Wait for Propagation: After clicking EXEC_START, wait 60 seconds for Cloudflare to register your machine.

Troubleshooting

Error Solution
ERR_CONNECTION_RESET Expose now automatically injects Host Headers. Ensure your local app is actually running on the specified port.
Error 1033 / NXDOMAIN Your computer is connecting but Cloudflare's DNS is still updating. Wait 1-2 minutes and refresh.
Port Vacant Expose cannot find anything running on that port. Start your development server (npm run dev) first.
ERR_QUIC_PROTOCOL Your network is blocking UDP. Expose is hard-coded to use HTTP/2 (TCP) to bypass this.

Built for the Developer Community.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0