Clem-Fern / rtabby-web-api

Tabby Web API for Config Sync
GNU Affero General Public License v3.0
60 stars 4 forks source link

HTTP 404 when using different port #26

Closed patschwork closed 1 month ago

patschwork commented 3 months ago

Hi,

I tried several settings, but I can't figure out a solution for this.

My docker-compose.yml is as follows (SQLite template):

services:
  rtabby:
    container_name: rtabby-web-api

    image: ghcr.io/clem-fern/rtabby-web-api:sqlite
    # Minimal image without third party login
    #image: ghcr.io/clem-fern/rtabby-web-api:sqlite-minimal

    # Build image from local rtabby repository
    #build:
    #  context: .
    #  args:
    #    - FEATURE_FLAGS=-F|sqlite-bundle|-F|all-login
    #    - GIT_COMMIT=${GIT_COMMIT}
    # Optional: Minimal image without third party login
    #    - FEATURE_FLAGS=-F|sqlite-bundle

    # If running as root, setup your user/volume owner UID and GID
    #user: "1000:1000"

    cap_add:
      - "CAP_DAC_OVERRIDE"
    cap_drop: ['ALL']
    read_only: true

    ports:
      - "8090:8090"  # <--------------------------------------------------------- CHANGED
    environment:
      - DATABASE_URL=sqlite:///config/db.sqlite
      #- GITHUB_APP_CLIENT_ID=
      #- GITHUB_APP_CLIENT_SECRET=
      #- GITLAB_APP_CLIENT_ID=
      #- GITLAB_APP_CLIENT_SECRET=
      #- GOOGLE_APP_CLIENT_ID=
      #- GOOGLE_APP_CLIENT_SECRET=
      #- MICROSOFT_APP_CLIENT_ID=
      #- MICROSOFT_APP_CLIENT_SECRET=
      - BIND_PORT=8090  # <--------------------------------------------------------- ALSO TRIED WITH THIS SETTING
    volumes:
      - ./config:/config
    networks:
      - frontend
networks:
  frontend:
    name: rtabby_net_frontend

For http://:8090 and http://:8090/login I get blank pages (and the sync in Tabby does not work either :-D)

The docker compose logs only states, that an error for HTTP 404:

rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Running v0.4.2
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] users.yml loaded => 1 users found
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Third party login enabled: 0 providers found.
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Binding HTTP Listener on 0.0.0.0:8090
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Starting HTTP Listener on 0.0.0.0:8090
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  actix_server::builder] starting 2 workers
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  actix_server::server] Actix runtime found; starting in Actix runtime
worker@srv /media/ANTARES/docker/rtabby-web-api $ docker compose logs
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Running v0.4.2
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] users.yml loaded => 1 users found
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Third party login enabled: 0 providers found.
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Binding HTTP Listener on 0.0.0.0:8090
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  rtabby_web_api] Starting HTTP Listener on 0.0.0.0:8090
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  actix_server::builder] starting 2 workers
rtabby-web-api  | [2024-06-26T19:36:51Z INFO  actix_server::server] Actix runtime found; starting in Actix runtime
rtabby-web-api  | [2024-06-26T19:36:57Z INFO  rtabby-web-api] 192.168.178.78 "GET /login HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 0.000130
rtabby-web-api  | [2024-06-26T19:37:03Z INFO  rtabby-web-api] 192.168.178.78 "GET / HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" 0.000104
rtabby-web-api  | [2024-06-26T19:37:10Z INFO  rtabby-web-api] 192.168.178.78 "GET /login HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" 0.000074

Any ideas, what I'm doing wrong?

StinkyTACO commented 3 months ago

try this instead you should only change the left side of the port the right side is the container itself.

ports:

patschwork commented 3 months ago

try this instead you should only change the left side of the port the right side is the container itself.

ports: - "8090:8080"

I tried this (was my first attempt). Didn't work: Same Error messages

Clem-Fern commented 2 months ago

Hi @patschwork

Really sorry for the delay... Just tried it and I don't see anything strange. Have you figured it out ?

You should know that root and login endpoints aren't published if none of the third party login providers are configured. It is quite normal that you can't access login page with the docker compose you have sent.

There is no trace of authentication from your tabby client in the log above. Could you please send log again after trying to sync your config from tabby ?

patschwork commented 2 months ago

Hi @Clem-Fern,

thanks for answering: no worries :-)

Really sorry for the delay... Just tried it and I don't see anything strange. Have you figured it out ?

No. But I have also given up since


You should know that root and login endpoints aren't published if none of the third party login providers are configured.

Ahhhh, ok. That's a good information. I didn't configured them, because I didn't wanted a third party login mechanism.

Should I go for this image: ghcr.io/clem-fern/rtabby-web-api:sqlite-minimal when I only want something "local-only"?

Clem-Fern commented 2 months ago

Should I go for this image: ghcr.io/clem-fern/rtabby-web-api:sqlite-minimal when I only want something "local-only"?

Yeah, you could definitely use minimal image. There is a really small image size difference between the two though.

patschwork commented 1 month ago
    image: ghcr.io/clem-fern/rtabby-web-api:sqlite
    # Minimal image without third party login
    #image: ghcr.io/clem-fern/rtabby-web-api:sqlite-minimal

I changed it to

    ###### image: ghcr.io/clem-fern/rtabby-web-api:sqlite
    # Minimal image without third party login
    image: ghcr.io/clem-fern/rtabby-web-api:sqlite-minimal 

This works great. Thank you @Clem-Fern :-)