🐛 Bug Report: Unable to kick off Setup #395

Closed
opened 2025-10-08 00:06:44 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @ryphez on GitHub.

Reproduction steps

Access pocket.domain.com/login/setup

Expected behavior

I should be able to setup Pocket Id

Actual Behavior

Leveraging Unraid, Docker build log

Even tried switching back to just port 3000 rather than 3002 which I had setup before. I've adjusted the port in SWAG as well

docker run
  -d
  --name='Pocket-ID'
  --net='andromedanet'
  --pids-limit 2048
  -e TZ="America/Los_Angeles"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Andromeda"
  -e HOST_CONTAINERNAME="Pocket-ID"
  -e 'PUBLIC_APP_URL'='https://pocket.domain.com'
  -e 'DB_PATH'='data/pocket-id.db'
  -e 'UPLOAD_PATH'='data/uploads'
  -e 'PORT'='3000'
  -e 'BACKEND_PORT'='8080'
  -e 'PUID'='099'
  -e 'PGID'='100'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:80]/'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png'
  -p '3000:80/tcp'
  -v '/mnt/user/appdata/pocket-id/data':'/app/backend/data':'rw' 'stonith404/pocket-id:latest'

50dfbae56cedcc682ffe0c7afc1d2924862e13535c3349895aa1e01466c34568

Pocket Id Log

2025/01/20 04:39:28 Updating GeoLite2 City database...
{"level":"info","ts":1737347968.5487928,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
{"level":"info","ts":1737347968.5499523,"msg":"adapted config to JSON","adapter":"caddyfile"}
{"level":"info","ts":1737347968.550774,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//[::1]:2019","//127.0.0.1:2019","//localhost:2019"]}
{"level":"warn","ts":1737347968.5509932,"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":1737347968.5510714,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00053d380"}
{"level":"info","ts":1737347968.551523,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"error","ts":1737347968.5515885,"msg":"unable to create folder for config autosave","dir":"/.config/caddy","error":"mkdir /.config: permission denied"}
{"level":"info","ts":1737347968.5516107,"msg":"serving initial configuration"}
{"level":"warn","ts":1737347968.551701,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"mkdir /.local: permission denied"}
{"level":"error","ts":1737347968.551817,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /.local/share/caddy/locks/storage_clean.lock: no such file or directory"}
{"level":"info","ts":1737347968.551834,"logger":"tls","msg":"finished cleaning storage units"}
Successfully started Caddy (pid=45) - Caddy is running in the background
2025/01/20 04:39:28 Failed to update GeoLite2 City database: failed to download database, received HTTP 401
Listening on 0.0.0.0:3000
[GIN] 2025/01/20 - 04:39:44 | 401 |     124.781µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:44 | 401 |     160.461µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:44 | 200 |    1.514366ms |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:44 | 200 |    1.645077ms |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:45 | 401 |     262.301µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:45 | 401 |    6.978779ms |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:45 | 200 |     546.694µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:45 | 200 |     573.322µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/application-configuration/background-image
    at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18)
    at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2025/01/20 - 04:39:45 | 401 |      38.972µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:45 | 401 |      63.394µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:45 | 200 |      394.62µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:45 | 200 |     424.184µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/application-configuration/logo
    at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18)
    at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2025/01/20 - 04:39:45 | 401 |      44.911µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:45 | 401 |       71.21µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
SvelteKitError: Not found: /api/application-configuration/favicon
    at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18)
    at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2025/01/20 - 04:39:45 | 200 |     731.475µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:45 | 200 |     904.842µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:49 | 401 |      48.855µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:49 | 401 |      82.445µs |       127.0.0.1 | GET      "/api/users/me"
Error #01: You are not signed in
[GIN] 2025/01/20 - 04:39:49 | 200 |     453.858µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2025/01/20 - 04:39:49 | 200 |      565.61µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/one-time-access-token/setup
    at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18)
    at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) {
  status: 404,
  text: 'Not Found'
}
Originally created by @ryphez on GitHub. ### Reproduction steps Access pocket.domain.com/login/setup ### Expected behavior I should be able to setup Pocket Id ### Actual Behavior Leveraging Unraid, Docker build log Even tried switching back to just port 3000 rather than 3002 which I had setup before. I've adjusted the port in SWAG as well ``` docker run -d --name='Pocket-ID' --net='andromedanet' --pids-limit 2048 -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Andromeda" -e HOST_CONTAINERNAME="Pocket-ID" -e 'PUBLIC_APP_URL'='https://pocket.domain.com' -e 'DB_PATH'='data/pocket-id.db' -e 'UPLOAD_PATH'='data/uploads' -e 'PORT'='3000' -e 'BACKEND_PORT'='8080' -e 'PUID'='099' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:80]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png' -p '3000:80/tcp' -v '/mnt/user/appdata/pocket-id/data':'/app/backend/data':'rw' 'stonith404/pocket-id:latest' 50dfbae56cedcc682ffe0c7afc1d2924862e13535c3349895aa1e01466c34568 ``` Pocket Id Log ``` 2025/01/20 04:39:28 Updating GeoLite2 City database... {"level":"info","ts":1737347968.5487928,"msg":"using config from file","file":"/etc/caddy/Caddyfile"} {"level":"info","ts":1737347968.5499523,"msg":"adapted config to JSON","adapter":"caddyfile"} {"level":"info","ts":1737347968.550774,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//[::1]:2019","//127.0.0.1:2019","//localhost:2019"]} {"level":"warn","ts":1737347968.5509932,"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":1737347968.5510714,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00053d380"} {"level":"info","ts":1737347968.551523,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} {"level":"error","ts":1737347968.5515885,"msg":"unable to create folder for config autosave","dir":"/.config/caddy","error":"mkdir /.config: permission denied"} {"level":"info","ts":1737347968.5516107,"msg":"serving initial configuration"} {"level":"warn","ts":1737347968.551701,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"mkdir /.local: permission denied"} {"level":"error","ts":1737347968.551817,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /.local/share/caddy/locks/storage_clean.lock: no such file or directory"} {"level":"info","ts":1737347968.551834,"logger":"tls","msg":"finished cleaning storage units"} Successfully started Caddy (pid=45) - Caddy is running in the background 2025/01/20 04:39:28 Failed to update GeoLite2 City database: failed to download database, received HTTP 401 Listening on 0.0.0.0:3000 [GIN] 2025/01/20 - 04:39:44 | 401 | 124.781µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:44 | 401 | 160.461µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:44 | 200 | 1.514366ms | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:44 | 200 | 1.645077ms | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:45 | 401 | 262.301µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:45 | 401 | 6.978779ms | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:45 | 200 | 546.694µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:45 | 200 | 573.322µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/application-configuration/background-image at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18) at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) { status: 404, text: 'Not Found' } [GIN] 2025/01/20 - 04:39:45 | 401 | 38.972µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:45 | 401 | 63.394µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:45 | 200 | 394.62µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:45 | 200 | 424.184µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/application-configuration/logo at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18) at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) { status: 404, text: 'Not Found' } [GIN] 2025/01/20 - 04:39:45 | 401 | 44.911µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:45 | 401 | 71.21µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in SvelteKitError: Not found: /api/application-configuration/favicon at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18) at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) { status: 404, text: 'Not Found' } [GIN] 2025/01/20 - 04:39:45 | 200 | 731.475µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:45 | 200 | 904.842µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:49 | 401 | 48.855µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:49 | 401 | 82.445µs | 127.0.0.1 | GET "/api/users/me" Error #01: You are not signed in [GIN] 2025/01/20 - 04:39:49 | 200 | 453.858µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2025/01/20 - 04:39:49 | 200 | 565.61µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/one-time-access-token/setup at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18) at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) { status: 404, text: 'Not Found' } ```
OVERLORD added the bug label 2025-10-08 00:06:44 +03:00
Author
Owner

@stonith404 commented on GitHub:

With "CADDY_PORT". See the README for the configuration options.

@stonith404 commented on GitHub: With "CADDY_PORT". See the README for the configuration options.
Author
Owner

@ryphez commented on GitHub:

So my mapping in my SWAG config should point to the Caddy Port not the frontend port, correct?

@ryphez commented on GitHub: So my mapping in my SWAG config should point to the Caddy Port not the frontend port, correct?
Author
Owner

@wargio commented on GitHub:

You are accessing directly the frontend instead of caddy which does the reverse proxy for the frontend (3000) & backend (8080).

@wargio commented on GitHub: You are accessing directly the frontend instead of caddy which does the reverse proxy for the frontend (3000) & backend (8080).
Author
Owner

@stonith404 commented on GitHub:

You're probably accessing Pocket ID on port 3000 but you should use the CADDY_PORT which defaults to 80.

@stonith404 commented on GitHub: You're probably accessing Pocket ID on port `3000` but you should use the `CADDY_PORT` which defaults to `80`.
Author
Owner

@ryphez commented on GitHub:

Hmm, the issue I have is SWAG (nginx) already runs on port 80. Nothing in the Unraid template exposes port 80, only port 3000.

Is there a way to adjust the Caddy port?

@ryphez commented on GitHub: Hmm, the issue I have is SWAG (nginx) already runs on port 80. Nothing in the Unraid template exposes port 80, only port 3000. Is there a way to adjust the Caddy port?
Author
Owner

@cdanis commented on GitHub:

Expose just the Caddy port. Ignore the 'frontend port' -- only Caddy should talk to that directly. And never export two different pod ports onto one host port as you've done :)

SWAG should talk only to Caddy, which wraps both the frontend and backend.

@cdanis commented on GitHub: Expose _just_ the Caddy port. Ignore the 'frontend port' -- only Caddy should talk to that directly. And never export two different pod ports onto one host port as you've done :) SWAG should talk only to Caddy, which wraps both the frontend and backend.
Author
Owner

@ryphez commented on GitHub:

I've adjusted to the ports to map how it seems like they should yet still get the error. I'm not sure what could be causing it. The page loads with SWAG pointed at 8183.

CADDY_PORT = 8183
Front End = 3000
Back End = 8080

Expose 3000 -> 8183
Expose 8183 -> 8183

Docker Build Command

docker run
  -d
  --name='Pocket-ID'
  --net='andromedanet'
  --pids-limit 2048
  -e TZ="America/Los_Angeles"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Andromeda"
  -e HOST_CONTAINERNAME="Pocket-ID"
  -e 'PUBLIC_APP_URL'='https://pocket.domain.com'
  -e 'CADDY_PORT'='8183'
  -e 'DB_PATH'='data/pocket-id.db'
  -e 'UPLOAD_PATH'='data/uploads'
  -e 'PORT'='3000'
  -e 'BACKEND_PORT'='8080'
  -e 'PUID'='099'
  -e 'PGID'='100'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:80]/'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png'
  -p '3000:8183/tcp'
  -p '8183:8183/tcp'
  -v '/mnt/user/appdata/pocket-id/data':'/app/backend/data':'rw' 'stonith404/pocket-id:latest'

b94ae99cd8da7075485d3602578221810922d8eb120e1d456a6a2a37deb84d29

The command finished successfully!

Error

SvelteKitError: Not found: /api/one-time-access-token/setup
    at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18)
    at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) {
  status: 404,
  text: 'Not Found'
}

SWAG Config

## Version 2024/07/16
# make sure that your Pocket-ID container is named Pocket-ID
# make sure that your dns has a cname set for pocket

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name pocket.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app Pocket-ID;
        set $upstream_port 8183;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
        proxy_set_header X-Scheme https;

    }
}
@ryphez commented on GitHub: I've adjusted to the ports to map how it seems like they should yet still get the error. I'm not sure what could be causing it. The page loads with SWAG pointed at 8183. CADDY_PORT = 8183 Front End = 3000 Back End = 8080 Expose 3000 -> 8183 Expose 8183 -> 8183 Docker Build Command ``` docker run -d --name='Pocket-ID' --net='andromedanet' --pids-limit 2048 -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Andromeda" -e HOST_CONTAINERNAME="Pocket-ID" -e 'PUBLIC_APP_URL'='https://pocket.domain.com' -e 'CADDY_PORT'='8183' -e 'DB_PATH'='data/pocket-id.db' -e 'UPLOAD_PATH'='data/uploads' -e 'PORT'='3000' -e 'BACKEND_PORT'='8080' -e 'PUID'='099' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:80]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png' -p '3000:8183/tcp' -p '8183:8183/tcp' -v '/mnt/user/appdata/pocket-id/data':'/app/backend/data':'rw' 'stonith404/pocket-id:latest' b94ae99cd8da7075485d3602578221810922d8eb120e1d456a6a2a37deb84d29 The command finished successfully! ``` Error ``` SvelteKitError: Not found: /api/one-time-access-token/setup at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18) at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) { status: 404, text: 'Not Found' } ``` SWAG Config ``` ## Version 2024/07/16 # make sure that your Pocket-ID container is named Pocket-ID # make sure that your dns has a cname set for pocket server { listen 443 ssl; listen [::]:443 ssl; server_name pocket.*; include /config/nginx/ssl.conf; client_max_body_size 0; # enable for ldap auth (requires ldap-location.conf in the location block) #include /config/nginx/ldap-server.conf; # enable for Authelia (requires authelia-location.conf in the location block) #include /config/nginx/authelia-server.conf; # enable for Authentik (requires authentik-location.conf in the location block) #include /config/nginx/authentik-server.conf; location / { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; # enable for ldap auth (requires ldap-server.conf in the server block) #include /config/nginx/ldap-location.conf; # enable for Authelia (requires authelia-server.conf in the server block) #include /config/nginx/authelia-location.conf; # enable for Authentik (requires authentik-server.conf in the server block) #include /config/nginx/authentik-location.conf; include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; set $upstream_app Pocket-ID; set $upstream_port 8183; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header X-Scheme https; } } ```
Author
Owner

@cdanis commented on GitHub:

Correct. The Caddy port is the entry point for the app

On Mon, Jan 20, 2025 at 5:59 PM ryphez @.***> wrote:

So my mapping in my SWAG config should point to the Caddy Port not the
frontend port, correct?


Reply to this email directly, view it on GitHub
https://github.com/stonith404/pocket-id/issues/140#issuecomment-2603333480,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAI3NZ3D6Q6OEZPIF4NEE2D2LV5ULAVCNFSM6AAAAABVPPVUNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBTGMZTGNBYGA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

@cdanis commented on GitHub: Correct. The Caddy port is the entry point for the app On Mon, Jan 20, 2025 at 5:59 PM ryphez ***@***.***> wrote: > So my mapping in my SWAG config should point to the Caddy Port not the > frontend port, correct? > > — > Reply to this email directly, view it on GitHub > <https://github.com/stonith404/pocket-id/issues/140#issuecomment-2603333480>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAI3NZ3D6Q6OEZPIF4NEE2D2LV5ULAVCNFSM6AAAAABVPPVUNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBTGMZTGNBYGA> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@ryphez commented on GitHub:

Okay, I've adjsuted to remove the other exposing and only kept
8183 -> 80

I reverted the caddy port change given its an internal port and wouldn't conflict.

I still get the same setup error though accessing "https://pocket.domain.com/login/setup"

error

[GIN] 2025/01/21 - 00:21:30 | 200 |     253.711µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/one-time-access-token/setup
    at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18)
    at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) {
  status: 404,
  text: 'Not Found'
}

Here is my latest docker deploy

docker run
  -d
  --name='Pocket-ID'
  --net='andromedanet'
  --pids-limit 2048
  -e TZ="America/Los_Angeles"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Andromeda"
  -e HOST_CONTAINERNAME="Pocket-ID"
  -e 'PUBLIC_APP_URL'='https://pocket.domain.com'
  -e 'DB_PATH'='data/pocket-id.db'
  -e 'UPLOAD_PATH'='data/uploads'
  -e 'PORT'='3000'
  -e 'BACKEND_PORT'='8080'
  -e 'PUID'='099'
  -e 'PGID'='100'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:80]/'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png'
  -p '8183:80/tcp'
  -v '/mnt/user/appdata/pocket-id/data':'/app/backend/data':'rw' 'stonith404/pocket-id:latest'

401eca4d4c48781c9c447eccda7906d0833815164090997c0cab756d3c632584

The command finished successfully!
@ryphez commented on GitHub: Okay, I've adjsuted to remove the other exposing and only kept 8183 -> 80 I reverted the caddy port change given its an internal port and wouldn't conflict. I still get the same setup error though accessing "https://pocket.domain.com/login/setup" error ``` [GIN] 2025/01/21 - 00:21:30 | 200 | 253.711µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/one-time-access-token/setup at resolve2 (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5351:18) at resolve (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5184:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DynDwJ34.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-BFeipd-o.js:5182:43) { status: 404, text: 'Not Found' } ``` Here is my latest docker deploy ``` docker run -d --name='Pocket-ID' --net='andromedanet' --pids-limit 2048 -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Andromeda" -e HOST_CONTAINERNAME="Pocket-ID" -e 'PUBLIC_APP_URL'='https://pocket.domain.com' -e 'DB_PATH'='data/pocket-id.db' -e 'UPLOAD_PATH'='data/uploads' -e 'PORT'='3000' -e 'BACKEND_PORT'='8080' -e 'PUID'='099' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:80]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png' -p '8183:80/tcp' -v '/mnt/user/appdata/pocket-id/data':'/app/backend/data':'rw' 'stonith404/pocket-id:latest' 401eca4d4c48781c9c447eccda7906d0833815164090997c0cab756d3c632584 The command finished successfully! ```
Author
Owner

@wargio commented on GitHub:

you are still accessing the frontend. if you really want to not use caddy (like i do) and just Nginx, you can do this:

on docker you need to define HOST=0.0.0.0 env variable (because by default the backend binds to 127.0.0.1) and expose the two ports internally (you can avoid changing all the other env vars besides the PUBLIC_APP_URL which is required):

  • 127.0.0.1:12673:3000 pocket-id frontend
  • 127.0.0.1:12674:8080 pocket-id backend

Then on nginx just set this

server {
 .....
    # proxy_buffer stuff required by pocket-id
    proxy_buffers           4 512k;
    proxy_buffer_size         256k;
    proxy_busy_buffers_size   512k;

    # proxy headers for forwarding.
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Protocol $scheme;
    proxy_set_header X-Forwarded-Host $http_host;

    # frontend
    location / {
        proxy_pass http://127.0.0.1:12673;
    }
    # backend
    location /api/ {
        proxy_pass http://127.0.0.1:12674;
    }
    location /.well-known/ {
        proxy_pass http://127.0.0.1:12674;
    }
}
@wargio commented on GitHub: you are still accessing the frontend. if you really want to not use caddy (like i do) and just Nginx, you can do this: on docker you need to define `HOST=0.0.0.0` env variable (because by default the backend binds to `127.0.0.1`) and expose the two ports internally (you can avoid changing all the other env vars besides the `PUBLIC_APP_URL` which is required): - `127.0.0.1:12673:3000` pocket-id frontend - `127.0.0.1:12674:8080` pocket-id backend Then on nginx just set this ``` server { ..... # proxy_buffer stuff required by pocket-id proxy_buffers 4 512k; proxy_buffer_size 256k; proxy_busy_buffers_size 512k; # proxy headers for forwarding. proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Protocol $scheme; proxy_set_header X-Forwarded-Host $http_host; # frontend location / { proxy_pass http://127.0.0.1:12673; } # backend location /api/ { proxy_pass http://127.0.0.1:12674; } location /.well-known/ { proxy_pass http://127.0.0.1:12674; } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#395