Receipt-Wrangler / receipt-wrangler-api

Server for Receipt Wrangler
GNU Affero General Public License v3.0
82 stars 1 forks source link

Can't get past login screen #282

Closed betterthanever2 closed 3 months ago

betterthanever2 commented 3 months ago

I installed RW on Ubuntu. Here's my compose file:

services:
  api:
    image: noah231515/receipt-wrangler-api:latest
    container_name: receipt-wrangler-api
    restart: always
    command: ./api --env prod
    ports:
      - 50980:8081
    volumes:
      - ./data:/go/api/data
      - ./logs:/go/api/logs
    environment:
      - ENCRYPTION_KEY=encryptionKey
      - SECRET_KEY=secretKey
      - DB_USER=<user>
      - DB_PASSWORD=<pw>
      - DB_NAME=receipt_wrangler
      - DB_HOST=<db>
      - DB_PORT=<port>
      - DB_ENGINE=postgresql

  frontend:
    image: noah231515/receipt-wrangler-desktop:latest
    container_name: receipt-wrangler-frontend
    restart: always
    ports:
      - 50981:80

On top of this, I'm using Caddy for reverse proxy.

After the install, I can get to login screen using IP address, but attempts to log in raise 405. When I use the https host name, I'm only getting empty page.

What could be the issue?

zzahkaboom24 commented 3 months ago

For me, the solution was to login through the proxy, not through the frontend (I dont know if that's the actual solution, but I have been stuck on the same issue too for a while). I dont know if that would help you, but try using this compose file and going through the port defined in the proxy service instead (in your case, possibly 50982. I tried guessing what port you'd use):

services:
  api:
    image: noah231515/receipt-wrangler-api:latest
    container_name: receipt-wrangler-api
    restart: always
    command: ./api --env prod
    ports:
      - 50980:8081
    volumes:
      - ./data:/go/api/data
      - ./logs:/go/api/logs
    environment:
      - ENCRYPTION_KEY=encryptionKey
      - SECRET_KEY=secretKey
      - DB_USER=<user>
      - DB_PASSWORD=<pw>
      - DB_NAME=receipt_wrangler
      - DB_HOST=<db>
      - DB_PORT=<port>
      - DB_ENGINE=postgresql

  proxy:
    image: noah231515/receipt-wrangler-proxy:latest
    ports:
      - 50982:80
    depends_on:
      - api
      - frontend

  frontend:
    image: noah231515/receipt-wrangler-desktop:latest
    container_name: receipt-wrangler-frontend
    restart: always
    ports:
      - 50981:80
betterthanever2 commented 3 months ago

@zzahkaboom24 thank you for the response.

But I don't get it. Like, do I HAVE to use inbuild proxy? I have Caddy that takes care of my reverse proxying needs, and I would rather use that with RW, too. Is there a way to make it work?

Noah231515 commented 3 months ago

Hey @betterthanever2 thanks for checking out Receipt Wrangler!

I realize the documentation does not clarify why the proxy container exists and what it does, so I will update that shortly.

The purpose of the proxy container is to proxy traffic internally between the frontend container and the backend container. Technically the proxy container does not need to be used, but the traffic will have to be proxied by some other means to communicate with the backend container, an example is shown here of what needs to be proxied https://receiptwrangler.io/docs/getting-started/installation#step-2-add-proxy-in-npm-proxy-manager-optional.

The easiest way is to use the proxy container, or the monolithic container which has the proxy built into it.

betterthanever2 commented 3 months ago

oh, so it's a completely different kind of proxy. Interesting. Certainly needs clarification in the docs, because I definitely didn't catch that. Maybe name it something else?

That being said, I discovered some errors in my setup, that were partially responsible for the issue. Still, I'm glad I created this ticket, or else I may not have learned about the proxy nuance.

Noah231515 commented 3 months ago

I updated the docs to clarify the purpose of the proxy container, and to remove the step in installation mentioning the proxy. Before the proxy container existed, the internal traffic had to be proxied using npm or something else but it has not been necessary in a long time.

Thanks for bringing this up.