AppFlowy-Cloud icon indicating copy to clipboard operation
AppFlowy-Cloud copied to clipboard

[Bug] Extras service URLs do not load (Portainer, PgAdmin, Minio admin)

Open philiprenich opened this issue 11 months ago • 3 comments

Describe the bug When trying to access the services listed at /web/admin/home like Portainer, PgAdmin, or Minio, an incorrect 301 redirect is sent and they fail to load.

the url is FQDN/portainer (for example).

To Reproduce Steps to reproduce the behavior:

  1. Go to /web/admin/home
  2. Click on Admin
  3. Attempt to navigate to Minio (or Portainer, or PgAdmin if those are running)

Expected behavior The admin software should load

Additional context I'm running cloud 0.9.12.

The URL for the links is FQDN/minio (or /portainer). A 301 redirect is sent when the links are clicked which is the local network IP for the server that is running AppFlowy, eg, 192.168.0.5/minio This fails as I am not running AppFlowy on port 80. If I manually add my port to the IP (192.168.0.5:8888/minio) the page will load correctly.

I'm assuming AppFlowy is somehow accessing my host through Docker to get the IP address? The non-standard port is because I am running this behind an Nginx reverse proxy which forwards requests to AppFlowy's Nginx server.

Now, I am completely fine with not exposing any of these services to the wider web as that's a lot of extra stuff to keep secure, but at the least, the system should add the port number being used to those URLs.

philiprenich avatar Jan 19 '25 06:01 philiprenich

This is where the URL for Minio and portainers are defined: https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/337e28de3833d8516254057920ba7d44b3d9ed46/admin_frontend/templates/components/admin_navigate.html#L14

Just to confirm, when setting the FQDN env, is the port 8888 included?

khorshuheng avatar Jan 19 '25 14:01 khorshuheng

Just to confirm, when setting the FQDN env, is the port 8888 included?

No, I'm setting the port with NGINX_PORT and NGINX_TLS_PORT The FQDN env is just the domain. My reverse proxy is handling getting from 80/443 to 8888.

philiprenich avatar Jan 19 '25 19:01 philiprenich

I did a bit of digging and this isn't a unique issue: https://github.com/minio/docs/issues/957 https://github.com/minio/console/issues/3009

I noticed that the redirect I've been experienced is adding the slash. However, it's using the local IP address instead of domain name. The internal AppFlowy Nginx isn't going to be aware of what that is without hard-coding it.

I tried altering the nginx.conf to redirect /minio to /minio/ but either couldn't get anything to happen, or it would redirect to the local IP again. I'm surprised a simple rewrite ^/minio$ /minio/ wouldn't work :(

The simplest work around seems to be to add a slash to the line mentioned in the comment above.

https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/337e28de3833d8516254057920ba7d44b3d9ed46/admin_frontend/templates/components/admin_navigate.html#L14

philiprenich avatar Jan 21 '25 11:01 philiprenich