stonith404 / pocket-id

A simple OIDC provider that allows users to authenticate with their passkeys to your services.
BSD 2-Clause "Simplified" License
311 stars 4 forks source link

🐛 Bug Report: Failed to get application configuration: connect ECONNREFUSED <server-IP>:80 #10

Closed Bartrpc closed 2 months ago

Bartrpc commented 2 months ago

Reproduction steps

I'm trying to deploy pocket-id on my orangepi 3b board using docker compose.

Here is my docker-compose.yml file:

services: pocket-id: image: stonith404/pocket-id:latest restart: unless-stopped env_file: .env ports:

I've added also .env like You mention in README

PUBLIC_APP_URL=http://my-server-IP:3000 DB_PATH=data/pocket-id.db UPLOAD_PATH=data/uploads PORT=3000 BACKEND_PORT=8080 I'm using dockge as a deployment tool

Expected behavior

I'm guessing that I should be able to open http://my-server-IP:3000/login site.

Actual Behavior

Instead, I'am unable to access to /login page and got some error, screenshot below:

image

Container logs below:

✘ ⚡ root@raspberrypi  /  docker logs -f a4cd73b9f566 Starting frontend... Starting backend... Starting Caddy... {"level":"info","ts":1723722133.754786,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""} {"level":"warn","ts":1723722133.7626083,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2} {"level":"info","ts":1723722133.769219,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]} {"level":"warn","ts":1723722133.7711747,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80} {"level":"info","ts":1723722133.7730367,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x4000466000"} {"level":"info","ts":1723722133.7741003,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} {"level":"warn","ts":1723722133.7755256,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"open /root/.local/share/caddy/instance.uuid: no such file or directory"} {"level":"info","ts":1723722133.7764575,"msg":"autosaved config (load with --resume flag)","file":"/root/.config/caddy/autosave.json"} {"level":"info","ts":1723722133.7776976,"msg":"serving initial configuration"} Successfully started Caddy (pid=30) - Caddy is running in the background {"level":"info","ts":1723722133.7874272,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/root/.local/share/caddy"} {"level":"info","ts":1723722133.7902582,"logger":"tls","msg":"finished cleaning storage units"} Listening on 0.0.0.0:3000 Failed to get application configuration: connect ECONNREFUSED <my-server-ip>:80 Failed to get application configuration: connect ECONNREFUSED <my-server-ip>:80 Failed to get application configuration: connect ECONNREFUSED <my-server-ip>:80

Am I doing something wrong ? Browser: Opera, Google Chrome

Thank You for your good and hard work btw <3 love Your projects ! <3

stonith404 commented 2 months ago

Are you sure that the PUBLIC_APP_URL is set to http://<my-server-ip>:3000 instead of http://<my-server-ip>:80? Btw. you will need https to use Pocket ID, else you can't sign in and add a passkey, I'll add this to the docs.

Bartrpc commented 2 months ago

Yes PUBLIC_APP_URL is set to http://:3000 also I've used cloudflared which is inside docker to expose it.

Container logs: {"level":"error","ts":1723729791.9804342,"logger":"http.log.error.log0","msg":"dial tcp [::1]:8080: connect: connection refused","request":{"remote_ip":"<remote-ip>","remote_port":"57290","client_ip":"<client-ip>","proto":"HTTP/1.1","method":"GET","host":"<my-server-ip>:3000","uri":"/api/application-configuration/favicon","headers":{"Connection":["keep-alive"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0"],"Accept":["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"],"Referer":["http://<my-server-ip>:3000/login"],"Accept-Encoding":["gzip, deflate"],"Accept-Language":["pl,en;q=0.9,en-GB;q=0.8,en-US;q=0.7"]}},"duration":0.003347433,"status":502,"err_id":"uerevd8m7","err_trace":"reverseproxy.statusError (reverseproxy.go:1267)"}

Bartrpc commented 2 months ago

Ok, problem solved. PUBLIC_APP_URL is set to pocket.domain.tld and public hostname need to be set to http://server-ip:PORT Thank You for fast reply :)