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

Cant use 0.0.0.0 to open the api for desktop apps #8551

Open
MiguelFiguera725 opened this issue Nov 25, 2024 · 2 comments
Open

Cant use 0.0.0.0 to open the api for desktop apps #8551

MiguelFiguera725 opened this issue Nov 25, 2024 · 2 comments
Assignees
Labels
type: question ❓ Further information is requested

Comments

@MiguelFiguera725
Copy link

I run the self hosted version inside a digital ocean droplet.

I used the docker compose up command after changing the API_BASE_URL to 'http://mydropletip:3000'. For this to work I had to add a lot of permissions to iptables and ufw:

sudo ufw allow from 0.0.0.0/0 to any
sudo ufw allow 4200/tcp
sudo ufw allow 3000/tcp

also this to ip tables:
sudo iptables -A INPUT -p tcp --dport 4200 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 4200 -j ACCEPT
sudo iptables-save
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 3000 -j ACCEPT
sudo iptables -A INPUT -s 0.0.0.0/0 -j ACCEPT

sudo iptables-save

When I change the API_HOST to 0.0.0.0 it never starts the webapp and checking the logs I find this:

+ ./wait
[INFO  wait] --------------------------------------------------------
[INFO  wait]  docker-compose-wait 2.9.0
[INFO  wait] ---------------------------
[DEBUG wait] Starting with configuration:
[DEBUG wait]  - Hosts to be waiting for: [0.0.0.0:3000]
[DEBUG wait]  - Paths to be waiting for: []
[DEBUG wait]  - Timeout before failure: 30 seconds 
[DEBUG wait]  - TCP connection timeout before retry: 5 seconds 
[DEBUG wait]  - Sleeping time before checking for hosts/paths availability: 0 seconds
[DEBUG wait]  - Sleeping time once all hosts/paths are available: 0 seconds
[DEBUG wait]  - Sleeping time between retries: 1 seconds
[DEBUG wait] --------------------------------------------------------
[INFO  wait] Checking availability of host [0.0.0.0:3000]
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[INFO  wait] Host [0.0.0.0:3000] not yet available...
[ERROR wait] Timeout! After 30 seconds some hosts are still not reachable
+ export 'WAIT_HOSTS=0.0.0.0:3000'
+ envsubst

When I try to connect using the desktop app for linux I receive @mantainance screen.

Also how do I disable the demo credentials? and the screenshots?

@evereq evereq self-assigned this Nov 25, 2024
@evereq evereq added the type: question ❓ Further information is requested label Nov 25, 2024
@evereq
Copy link
Member

evereq commented Nov 25, 2024

@MiguelFiguera725 I doubt 0.0.0.0 will work well inside Docker, not sure honestly... Think you should only update API_BASE_URL for frontend to know where to connect (your machine external public IP or domain name), you can keep API_HOST to a default value so it starts API host inside the docker correctly and next it should be accessible. I would suggest to check more about such configuration for running docker compose inside VMs, it's not something specific to our project. When you run some service inside docker (compose), there should be a lot of docs / blogs about how to expose it to external traffic (or you can setup some proxy like nginx to redirect incoming traffic to container running inside Docker).

Btw, did you saw https://github.com/ever-co/ever-gauzy/blob/develop/.github/workflows/deploy-do-app-platform-prod.yml and https://github.com/ever-co/ever-gauzy/blob/develop/.github/workflows/deploy-do-droplet-prod.yml and also check our Wiki, we explaining how to deploy to DigitalOcean in details there... https://github.com/ever-co/ever-gauzy/wiki/Gauzy-Self%E2%80%90Hosted-Setup-in-DigitalOcean#digitalocean-droplets

@MiguelFiguera725
Copy link
Author

I left the api_host on default mode and started to work. Using nginx is not necessary. To be honest, your documentation is not that straight forward. Quite hard to handle, but either way, gauzy is working after resetting API_HOST=api and that's all.

Thanks bro.

I use the .deb package of the desktop app and it worked fine the first day, after reboot it does not work anymore. Nor the appImage of the same version. And the windows desktop version returns an PHP error impossible to read or to copy.

Happens with both, desktop app and desktop timer. Could you provide an user manual? or maybe should I use a older release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question ❓ Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants