amalshaji / portr

Open source ngrok alternative designed for teams. Tunnel http, tcp or websocket connections.
https://portr.dev
GNU Affero General Public License v3.0
2.24k stars 63 forks source link

Always get operation timed out #74

Open julien-blanchon opened 1 month ago

julien-blanchon commented 1 month ago

I always get a dial tcp [2a06:98c1:3120::2]:2222: connect: operation timed out

For example with

❯ portr http 5173 
🌍 Starting tunnel connection for :5173
🚨 Portr inspector running on http://localhost:7777

dial tcp [2a06:98c1:3120::2]:2222: connect: operation timed out

The localhost:7777 show an empty table. On the admin side sometime I see a connection with a domain name but it doesnt end up working.

I'm using the following docker compose config:

services:
  # Caddy reverse proxy: Reverse proxy and SSL manager
  caddy:
    image: lucaslorentz/caddy-docker-proxy:latest
    container_name: caddy
    environment:
      PUID: 1000
      PGID: 1000
      TZ: Europe/Paris
      CADDY_INGRESS_NETWORKS: caddy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ../config/caddy:/data:rw
    restart: unless-stopped
    networks:
      - caddy
    ports:
      - 80:80 # Public HTTP Port
      - 443:443 # Public HTTPS Port
    labels:
      com.centurylinklabs.watchtower.enable: true
      caddy.email: ${EMAIL}

portr_admin:
    image: amalshaji/portr-admin:0.0.15-beta
    container_name: portr_admin
    restart: unless-stopped
    env_file: .env
    depends_on:
      portr_postgres:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/healthcheck"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - caddy
    labels:
      com.centurylinklabs.watchtower.enable: true
      caddy_0: ${HOSTNAME:?error}
      caddy_0.reverse_proxy: "{{upstreams 8000}}"
      caddy_0.encode: gzip

  portr_tunnel:
    image: amalshaji/portr-tunnel:0.0.15-beta
    container_name: portr_tunnel
    command: ["start"]
    env_file: .env
    restart: unless-stopped
    depends_on:
      portr_admin:
        condition: service_healthy
      portr_postgres:
        condition: service_healthy
    networks:
      - caddy
    ports:
      - 2222:2222
    expose:
      - 2222
    labels:
      com.centurylinklabs.watchtower.enable: true
      caddy_1: "*.${HOSTNAME:?error}"
      caddy_1.reverse_proxy: "{{upstreams 8001}}"
      caddy_1.tls.dns: "cloudflare $CLOUDFLARE_API_TOKEN"
      caddy_1.encode: gzip

  portr_postgres:
    image: postgres:16.2
    container_name: portr_postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: postgres
    volumes:
      - portr_postgres_data:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - caddy

networks:
  # Caddy network: Network for exposing services using Caddy
  caddy:
    external: true
    name: caddy

With caddy network

64552f4c211e   caddy               bridge    local

Do you have any idea ?

julien-blanchon commented 1 month ago

Okay I had to change my ssh_url to my server IP to something like that

static/tools/packshotRelight on ξ‚  main took 11s 
❯ portr http 5173 
🌍 Starting tunnel connection for :5173
🚨 Portr inspector running on http://localhost:7777
πŸŽ‰ Tunnel connected: https://gbcsgc.my_domain.com -> 🌐 -> localhost:5173

But I still don't have anything in the localhost:7777 table and at gbcsgc.my_domain.com I got a SSL handshake failed Error code 525

amalshaji commented 1 month ago

You must make at least one request through the tunnel to see it in the inspector. Once you set up DNS for my_domain.com and *.my_domain.com it should work. Are you on cloudflare?