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

Can access CVAT over LAN but not Internet #1095

Closed
LukeAI opened this issue Jan 27, 2020 · 12 comments
Closed

Can access CVAT over LAN but not Internet #1095

LukeAI opened this issue Jan 27, 2020 · 12 comments

Comments

@LukeAI
Copy link
Contributor

LukeAI commented Jan 27, 2020

Having followed the instructions here #1011

(using local IP and default port 8080) I am able to access CVAT across the LAN. I would like to be able to access CVAT from anywhere using the public IP address and port. What config changes should I make? and how should the NAT port forward be configured?

I did try the above but with our public IP address and an 8080 port forward on the firewall but it didn't work :/

(I have successfully set this up with a previous version of CVAT but I'm a bit confused as to how it works now re. different ports, HOSTS etc.)

My working LAN config.

base.py.txt
docker-compose.override.yml.txt
react_nginx.conf.txt

@yxftju
Copy link

yxftju commented Jan 27, 2020

I could not login over LAN ,can you post your configuration ? I want to have a look .

@LukeAI
Copy link
Contributor Author

LukeAI commented Jan 27, 2020

I could not login over LAN ,can you post your configuration ? I want to have a look .

I've done so, but I just followed the instructions in #1011 and then rebuilt everything. I deleted the volume before rebuilding just to be sure I was purging everything and I don't understand what's going on but probably not necessary.

@bsekachev
Copy link
Member

@LukeAI
I agree it might confuse a little
For example we have these ports:

Port over the Internet LAN port Port inside Docker
REST API 8060 8070 8080
UI SERVER 7060 7070 80

Than config file should be:

services:
  cvat:
    ports:
      - "8070:8080"
    environment:
      ALLOWED_HOSTS: '*'
      UI_SCHEME: http
      UI_HOST: <your external ip address>
      UI_PORT: 7060
  cvat_ui:
    build:
      args:
        REACT_APP_API_HOST: <your external ip address>
        REACT_APP_API_PORT: 8060
      dockerfile: Dockerfile.ui
    ports:
      - "7070:80"

Also you need to trigger port on a router:

Internet 8060 => Local 8070
Internet 7060 => Local 7070

And setup your firewall for these ports.

@LukeAI
Copy link
Contributor Author

LukeAI commented Jan 27, 2020

@bsekachev

Ok that works, thankyou very much for you help. This is surely far too complicated a setup for what must be the most common single use-case? Especially given that it is undocumented? I would never have worked this out without #1011 (comment) and your help.

Would it be welcomed if I added a step by step summary to the README or Wiki?

@bsekachev
Copy link
Member

@LukeAI

Sure. It would be great.
I would recommend to create a section (something like: Setup for LAN/Internet) here in advanced installation topics and provide some steps, config examples, short explanations.
I believe it's a valuable contribution.

@LukeAI
Copy link
Contributor Author

LukeAI commented Jan 27, 2020

cool, will do so later. but maybe the edit to base.py should just be mainlined? It's an edit that is around 3 directories deep and it doesn't (??) break anything or make anything less secure?

@bsekachev
Copy link
Member

@LukeAI

I am not sure why we should edit this file

@LukeAI
Copy link
Contributor Author

LukeAI commented Jan 27, 2020

I don't know either, I just followed #1011 (comment)

@bsekachev
Copy link
Member

@LukeAI

Ok, just send us a PR, we will look and test it.

@azhavoro
Copy link
Contributor

@LukeAI Can I close the issue?

@LukeAI LukeAI closed this as completed Jan 29, 2020
@LukeAI
Copy link
Contributor Author

LukeAI commented Feb 3, 2020

@LukeAI

Sure. It would be great.
I would recommend to create a section (something like: Setup for LAN/Internet) here in advanced installation topics and provide some steps, config examples, short explanations.
I believe it's a valuable contribution.

I'm not sure if I'm qualified to make this addition :/

My setup was working on Friday and has been up over the weekend continuously but today, Monday I am getting the same old "authorization failure" login error on both LAN and WAN.

Tried pulling the latest from the repo and rebuilding everything and I still get the error messages but am now able to login again.

@LukeAI
Copy link
Contributor Author

LukeAI commented Feb 3, 2020

Using this config

@LukeAI
I agree it might confuse a little
For example we have these ports:
Port over the Internet LAN port Port inside Docker
REST API 8060 8070 8080
UI SERVER 7060 7070 80

Than config file should be:

services:
  cvat:
    ports:
      - "8070:8080"
    environment:
      ALLOWED_HOSTS: '*'
      UI_SCHEME: http
      UI_HOST: <your external ip address>
      UI_PORT: 7060
  cvat_ui:
    build:
      args:
        REACT_APP_API_HOST: <your external ip address>
        REACT_APP_API_PORT: 8060
      dockerfile: Dockerfile.ui
    ports:
      - "7070:80"

Also you need to trigger port on a router:

Internet 8060 => Local 8070
Internet 7060 => Local 7070

And setup your firewall for these ports.

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