Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self Hosting bore server #77

Closed
ashseqera opened this issue Apr 20, 2023 · 6 comments
Closed

Self Hosting bore server #77

ashseqera opened this issue Apr 20, 2023 · 6 comments

Comments

@ashseqera
Copy link

ashseqera commented Apr 20, 2023

I am trying to host bore-server on our network on a EC2 machine. I have allowed all the TCP ports on both the inbound and outbound rule. I see the below when i try to hit my bore server . The connection seems to be successful but when i hit this up on my browser i get "site can't be reaached" error

bore local 8888 --to dev.net
2023-04-20T19:30:55.583115Z  INFO bore_cli::client: connected to server remote_port=41867
2023-04-20T19:30:55.583228Z  INFO bore_cli::client: listening at dev.net:41867

Docker Logs from the bore server which is different from what i see when i hit bore.pub. Does it require us to self host a nginx server with certificate to handle the redirect ?

2023-04-20T11:29:43.529295Z  INFO bore_cli::server: server listening addr=0.0.0.0:7835
2023-04-20T11:30:47.471783Z  INFO control{addr=172.x.x.x:37596}: bore_cli::server: incoming connection
2023-04-20T11:30:50.472804Z  WARN control{addr=172.x.x.x:37596}: bore_cli::server: connection exited with error err=timed out waiting for initial message
2023-04-20T11:42:34.102660Z  INFO control{addr=86.x.x.x:51214}: bore_cli::server: incoming connection
2023-04-20T11:42:34.106705Z  INFO control{addr=86.x.x.x:51214}: bore_cli::server: new client port=0
2023-04-20T11:47:15.286624Z  INFO control{addr=86.x.x.x:51214}: bore_cli::server: connection exited
2023-04-20T11:47:19.809784Z  INFO control{addr=86.x.x.x:51537}: bore_cli::server: incoming connection
2023-04-20T11:47:19.814490Z  INFO control{addr=86.x.x.x:51537}: bore_cli::server: new client port=0
2023-04-20T14:20:01.398879Z  INFO control{addr=86.x.x.x:51537}: bore_cli::server: connection exited
2023-04-20T19:30:55.608035Z  INFO control{addr=86.x.x.x:57207}: bore_cli::server: incoming connection
2023-04-20T19:30:55.612537Z  INFO control{addr=86.x.x.x:57207}: bore_cli::server: new client port=0

Also as mentioned in one of the previous issue new client port is always 0 . Has anyone been able to successfully host a bore server on their environment? Any pointers/help is greatly appreciated

@ekzhang
Copy link
Owner

ekzhang commented Apr 21, 2023

Hi, is your web server listening on port 80 on the machine that is running bore server? You can test by running

curl localhost

@ashseqera
Copy link
Author

@ekzhang I have my web application running on port 8888 on my local machine , and the bore server is running on a EC2 server.

However, I attempted what you suggested and installed bore-cli and my web application on my EC2 server . The web application is reachable from both the dns name and via curl localhost:8888. But when i try with bore-server's remote port , it fails to load.

Bore-cli

 bore local 8888 --to dev.net
2023-04-21T10:13:26.947396Z  INFO bore_cli::client: connected to server remote_port=36807
2023-04-21T10:13:26.947425Z  INFO bore_cli::client: listening at dev.net:36807

Bore-server logs

docker logs -f 1ba00988973f
2023-04-20T11:29:43.529295Z  INFO bore_cli::server: server listening addr=0.0.0.0:7835
2023-04-20T11:30:47.471783Z  INFO control{addr=172.x.x.x:37596}: bore_cli::server: incoming connection
2023-04-20T11:30:50.472804Z  WARN control{addr=172.x.x.x:37596}: bore_cli::server: connection exited with error err=timed out waiting for initial message
2023-04-21T10:13:26.947203Z  INFO control{addr=172.x.x.x:34552}: bore_cli::server: incoming connection
2023-04-21T10:13:26.947284Z  INFO control{addr=172.x.x.x:34552}: bore_cli::server: new client port=0

The issue i noticed is the remote port 36807 and the one printed on the bore server logs addr=172.x.x.x:34552 are different from each other . But both are not reachable even with localhost.

@mjcc30
Copy link

mjcc30 commented Aug 3, 2023

Hello i want to deploy bore server on cloud run
th default port is 8080 then i change it to 7835 and i change dockerfile to expose the new port like this

EXPOSE 7835
ENTRYPOINT ["./bore", "server"]

i also create a cloudbuild file to push and deploy the bore server

steps:
# Build the container image # https://cloud.google.com/build/docs/optimize-builds/speeding-up-builds#yaml
- name: 'gcr.io/cloud-builders/docker'
  entrypoint: 'bash'
  args: ['-c', 'docker pull gcr.io/$PROJECT_ID/bore:latest || exit 0']
- name: 'gcr.io/cloud-builders/docker'
  args: [
            'build',
            '-t', "gcr.io/$PROJECT_ID/bore:latest",
            '--cache-from', 'gcr.io/$PROJECT_ID/bore:latest',
            '.'
        ]
# Push the container image to Container Registry
- name: "gcr.io/cloud-builders/docker"
  args: [
            "push",
            "gcr.io/$PROJECT_ID/bore:latest"
        ]
# Deploy container image to Cloud Run
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
  entrypoint: gcloud
  args:
  - "run"
  - "deploy"
  - "bore"
  - "--image"
  - "gcr.io/$PROJECT_ID/bore:latest"
  - "--platform"
  - "managed"
  - "--region"
  - "europe-west1"
  - "--allow-unauthenticated"
  - "--memory"
  - "500Mi"
  - "--cpu"
  - "1"
  - "--labels=cloudrun=bore"
  - "--port"
  - "7835"

@ekzhang
Copy link
Owner

ekzhang commented Aug 3, 2023

I don't think bore will work on Cloud Run since that environment virtualizes the network and does not allow you to map the entire linux host port range.

@bropines
Copy link

bropines commented Oct 19, 2023

I put bore on my server, configured nginx to redirect the subdomain bore.bro####.xxx

server {
    listen 80;
    server_name bore.bro####.xxx;

    location / {
        proxy_pass http://localhost:7835;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

But, bore, when trying to connect, it makes a request to

bore local 7860 --to bore.bro#####.xxx
Error: could not connect to bore.bro#####.xxx:7835                                                                                                                                                                                           Caused by:
    timed out

Either I'm dumb and don't understand anything about the web, or it's a mistake. Just querying bro#####.xxx won't work, my domain is under cloudflare.

At the moment I have to disable subdomain proxying via cloudlfare for the tunnels to work

@ekzhang
Copy link
Owner

ekzhang commented Oct 19, 2023

@bropines Nginx is an HTTP proxy, and Bore uses TCP, which is a level below that. You wouldn't be able to expose the control port via an HTTP reverse proxy because it doesn't speak HTTP.

By the way, I'm closing this issue since it's gotten a bit off-topic. Please create a new issue if you have any other questions!

@ekzhang ekzhang closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants