sismics / docs

Lightweight document management system packed with all the features you can expect from big expensive solutions
https://teedy.io
GNU General Public License v2.0
1.94k stars 488 forks source link

env variable `DOCS_BASE_URL` doesn't seem to affect assets #628

Closed alexanderadam closed 2 years ago

alexanderadam commented 2 years ago

I'm using Teedy behind reverse proxy jwilder/nginx-proxy. Now what is special, is that I'm not using Teedy on a certain subdomain but a certain path (see VIRTUAL_PATH).

Therefore my Teedy compose configuration looks like this:

version: '3.8'

services:
  teedy-server:
    image: "sismics/docs:v1.10"
    environment:
      DOCS_BASE_URL: "http://foo.bar.com/teedy"
      DATABASE_URL: 'jdbc:postgresql://teedy-db:5432/teedy'
      DATABASE_USER: 'teedy_db_user'
      DATABASE_PASSWORD: 'teedy_db_password'
      VIRTUAL_HOST: "foo.bar.com"
      VIRTUAL_PATH: "/teedy"
      VIRTUAL_PORT: "8080"
      VIRTUAL_DEST: '/'

And according to the Teedy Readme generated url's will be using DOCS_BASE_URL as base, which makes sense but it doesn't seem to work.

When I visit http://foo.bar.com/teedy all further requests are going to http://foo.bar.com instead of http://foo.bar.com/teedy (i.e http://foo.bar.com/style/style.min.css, http://foo.bar.com/api/theme/stylesheet, http://foo.bar.com/docs.min.js, http://foo.bar.com/api/theme/image/logo) and therefore the page is rendered in a broken state:

Screenshot of Teedy without styles

PS: Will you reopen #621 and #622 at a certain point? 🤔

kserradell commented 2 years ago

Hello @alexanderadam

I am in a very similar situation as yours. I'm behind an Nginx reverse proxy and using a virtual path. I followed your docker-compose example but the page is still broken (exactly as in your screenshot).

How did you solve it? Any help would be appreciated.

Thanks!

alexanderadam commented 2 years ago

I "cheated" and I'm running another instance at the root path. But until this is properly solved at the Teedy side, you could fix this with a rewrite rule.

I'm not convinced that somebody will solve this properly on the Teedy side, though. Also other issues like https://github.com/sismics/docs/issues/621 and https://github.com/sismics/docs/issues/622 were just closed and ignored.

So good luck. Sorry that I don't better news.

kserradell commented 2 years ago

Thanks, @alexanderadam for your quick answer.

I think I would do the same and use the root path. I don't manage Nginx myself.

Gracias!

alexanderadam commented 2 years ago

De nada