-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with reverse proxy #31
Comments
Can you post the logs from the container? |
There you go
|
Apologies for the late reply, this has definitely not dropped off of my radar, unfortunately I'm without internet so it's proving slow for me to test this. Off the top of my head, perhaps this is something to do with the websocket side of the swag reverse proxy? |
Hi, I use more than a dozen of services, some are using websocket, doing the exact same thing, and only plugsy is behaving. Maybe I'll take a look at the source code to see if you've got hard-coded urls, etc... |
I host mine through a caddy proxy, so I'm sure it's something in Swag! As I say, if I have some more time, I'll deffo give this a go |
I'll try to ask on the SWAG channel as well - will keep you posted. |
Failing with nginx proxy manager (500 error) with, or without, web socket support. I am also using self-signed certs from lets encrypt, so traffic comes in on https and then redirects to http.
|
@Inlustra I have the exact same issue with Caddy, note I use Caddy-Docker-Proxy https://github.com/lucaslorentz/caddy-docker-proxy which is the same as Caddy but uses Labels (like Plugsy) to built a caddyfile dynamically. All my other services that I proxy locally (not exposed through a webdomain) work fine, Plugsy is the only one giving me
There is definitely something funky with Plugsy here, I can access it via the port number 8888 in my case, (bypassing Caddy) but not via Log:
|
@Inlustra I understand you have no time for this project anymore, but can you please confirm this bug? Otherwise we are wasting time trying to solve it via Caddy (v2.4 or newer) or NGinx. You said you use Caddy, can you please confirm which version and/or share your caddyfile? As the above error happens with v2.4 and 2.5.1 was just released. |
I do intend to get back to the project but I've had a lot on recently. The caddyfile I use is super simple, there's really nothing to it:
As I say this may very well be an issue in Plugsy but it's not super clear as to why on a quick glance. I'm also not sure how you want me to confirm that this bug exists without digging into caddy-docker-proxy which I don't have time for right now. I wonder if it's something to do with the address being bound? |
Thanks so much! Just by confirming Caddy does work for you, it means I should be able to get it working as well with Caddy :) |
@Inlustra I can confirm the " 500 | internal server error" also happens with the regular caddy image (latest, which should be version 2.5.1). I also tested with
$DOCKERDIR/caddy2/Caddyfile:
Full log:
I really hope you find time to have a look, probably it is an easy fix because log shows Apollo is trying to find http://dashboard.myhome/graphql, I suppose that is wrong, as the domain is not proxied inside the container itself of course. |
@wallace11 @zilexa you need to teach the plugsy container how to get to its containers hostname. (I think it derives it by looking at the initial page load request headers to discover its domain name) Internally Plugsy is a NextJs app with server side api routes (this part is important), these routes fire off Apollo GQL queries to the Plugsy Agent Instance. The agent could be another container or the same plugsy container (the default). Because the request happens server side and not clientside, it means that your host machine is not the first port of call for resolving the hostname of your plugsy instance, instead its the hostname resolution mechanics inside the container, so probaby something like resolvconfd. Judging by your Homeserver repo, I presume you don't have your Adguard/unbind DNS server as the authoritive DNS server for your LAN? or have your Docker host daemon setup to use that DNS server? In my case, I have a similar setup to you except:
But with this setup, I still ran into this problem. (I had presumed that my dockerhost would be forced to resolve hostnames using the adguard instance it ran... 😢 ) The workaround (which is pretty robust) looks like this: version: "3.3"
services:
plugsy:
restart: unless-stopped
image: plugsy/core
volumes:
- ./config.json:/config.json
- /var/run/docker.sock:/var/run/docker.sock
labels:
traefik.http.routers.piehole-ui-router.service: plugsy-ui-service
traefik.http.routers.plugsy-ui-router.rule: Host(`the.home.lan`) 👀
traefik.http.services.plugsy-ui-service.loadbalancer.server.port: 3000
plugsy.name: "Plugsy"
plugsy.category: "Services"
plugsy.icon: "@styled-icons/material-twotone/Dashboard"
extra_hosts:
- the.home.lan:host-gateway 🎉
networks:
default:
external:
name: traefik_proxy whatever domain name you proxy plugsy under, you need to teach the container that domain name: extra_hosts:
- the.home.lan:host-gateway
Older instances of docker would get some other variant of this special hostname depending on how you run docker (via docker-desktop or directly on linux): Hope this helps. edit: And if you're like me and tried to just dump the Dracula theme file into the {
"$schema": "https://github.com/plugsy/core/releases/download/v7.0.0/core-config-schema.json",
"connectors": [
{
"type": "DOCKER",
"config": {}
}
]
}
@Inlustra There's nothing you can do to fix this in your code. It's solved by documentation. |
Thanks so much @airtonix ! I have added it to my Homeserver Guide docker-compose and it works now 👯 @Inlustra please update documentation and feel free to close this one :) https://github.com/plugsy/core#usage |
Ok nice investigation! Curious, have you tried using https at all?
…On 16 May 2022, 7:27 AM -0600, ZileXa ***@***.***>, wrote:
@Inlustra I can confirm the " 500 | internal server error" also happens with the regular caddy image (latest, which should be version 2.5.1). I also tested with caddy:2.2.1, same error. Not sure how you got it working, but it should be easy to reproduce when you have time.
caddy:
image: caddy:2.2.1
restart: unless-stopped
networks:
- caddy2
ports:
- 80:80
- 443:443
volumes:
- $DOCKERDIR/caddy2/Caddyfile:/etc/caddy/Caddyfile
- $DOCKERDIR/caddy2/caddy_data:/data
- $DOCKERDIR/caddy2/caddy_config:/config
networks:
caddy2:
driver: bridge
http://dashboard.myhome {
reverse_proxy plugsy:3000
}
Full log:
info: ┏ loadConnectors +0ms
info: ┗ [1] { component: 'watchConfig', count: 1 }
info: ┏ setInternalConnections +4ms
info: ┗ [1] { component: 'connectionPool', count: 1 }
info: ┏ No agent configured, will not publish connection results +1ms
info: ┗ [1] { component: 'agent' }
info: ▪ > Server listening at http://localhost:3000 as production +2ms
ApolloError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at new ApolloError ***@***.******@***.******@***.***/client/errors/errors.cjs.js:31:28)
at ***@***.******@***.******@***.***/client/core/core.cjs.js:1493:19
at both ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:963:53)
at ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:72
at new Promise (<anonymous>)
at Object.then ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:24)
at Object.error ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:964:49)
at notifySubscription (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:240:7) {
graphQLErrors: [],
networkError: FetchError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at ClientRequest.<anonymous> (/opt/prod/.yarn/cache/node-fetch-npm-2.6.1-46c670dbc1-cbb171635e.zip/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:400:28)
at Socket.socketErrorListener (_http_client.js:475:9)
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'system',
errno: 'ENOTFOUND',
code: 'ENOTFOUND'
},
extraInfo: undefined
}
ApolloError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at new ApolloError ***@***.******@***.******@***.***/client/errors/errors.cjs.js:31:28)
at ***@***.******@***.******@***.***/client/core/core.cjs.js:1493:19
at both ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:963:53)
at ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:72
at new Promise (<anonymous>)
at Object.then ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:24)
at Object.error ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:964:49)
at notifySubscription (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:240:7) {
graphQLErrors: [],
networkError: FetchError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at ClientRequest.<anonymous> (/opt/prod/.yarn/cache/node-fetch-npm-2.6.1-46c670dbc1-cbb171635e.zip/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:400:28)
at Socket.socketErrorListener (_http_client.js:475:9)
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'system',
errno: 'ENOTFOUND',
code: 'ENOTFOUND'
},
extraInfo: undefined
}
ApolloError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at new ApolloError ***@***.******@***.******@***.***/client/errors/errors.cjs.js:31:28)
at ***@***.******@***.******@***.***/client/core/core.cjs.js:1493:19
at both ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:963:53)
at ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:72
at new Promise (<anonymous>)
at Object.then ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:24)
at Object.error ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:964:49)
at notifySubscription (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:240:7) {
graphQLErrors: [],
networkError: FetchError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at ClientRequest.<anonymous> (/opt/prod/.yarn/cache/node-fetch-npm-2.6.1-46c670dbc1-cbb171635e.zip/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:400:28)
at Socket.socketErrorListener (_http_client.js:475:9)
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'system',
errno: 'ENOTFOUND',
code: 'ENOTFOUND'
},
extraInfo: undefined
}
ApolloError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at new ApolloError ***@***.******@***.******@***.***/client/errors/errors.cjs.js:31:28)
at ***@***.******@***.******@***.***/client/core/core.cjs.js:1493:19
at both ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:963:53)
at ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:72
at new Promise (<anonymous>)
at Object.then ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:956:24)
at Object.error ***@***.******@***.******@***.***/client/utilities/utilities.cjs.js:964:49)
at notifySubscription (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/opt/prod/.yarn/cache/zen-observable-npm-0.8.15-3bec99c19c-7d155f8a75.zip/node_modules/zen-observable/lib/Observable.js:240:7) {
graphQLErrors: [],
networkError: FetchError: request to http://dashboard.myhome/graphql failed, reason: getaddrinfo ENOTFOUND dashboard.myhome
at ClientRequest.<anonymous> (/opt/prod/.yarn/cache/node-fetch-npm-2.6.1-46c670dbc1-cbb171635e.zip/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:400:28)
at Socket.socketErrorListener (_http_client.js:475:9)
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'system',
errno: 'ENOTFOUND',
code: 'ENOTFOUND'
},
extraInfo: undefined
}
I really hope you find time to have a look, probably it is an easy fix because log shows the container is trying to find something using the domain name instead of just its localhost.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I do not expose Plugsy to the web. No need for it. All other stuff is not exposed. I also run Wireguard server and have configured my phones to automatically connect to my home VPN when I leave my home WiFi, but only for DNS and the LAN ip range. This way, I can still have access to all my local services through VPN. From security and confidentiality perspective, I believe this is best, to only expose what is necessary. So now I can always access plugsy by going to |
Hmm. I followed @airtonix suggestion and added the domain to My setup: My docker-compose gets rendered as a template by ansible so there are some jinja2 varirables in there. Replace version: '3'
services:
plugsy:
image: plugsy/core:latest
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "{{ docker_dir.path }}/config.json:/config.json"
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.{{ role_name }}.rule=Host(`{{ domain }}`)
- traefik.http.routers.{{ role_name }}.entrypoints=https
- traefik.http.routers.{{ role_name }}.tls=true
- traefik.http.routers.{{ role_name }}.tls.certresolver=letsencrypt
- traefik.http.services.{{ role_name }}.loadbalancer.server.port=3000
- traefik.http.routers.{{ role_name }}.middlewares=adminauth
networks:
- web
extra_hosts:
- "{{ domain }}:host-gateway"
networks:
web:
external:
name: traefik_web
And here the logs
maybe someone has an idea of what i'm doing wrong? |
The suggestion was for Caddy. Not Traefik. Also be aware this project is stale. This might be a much better alternative: https://github.com/Lissy93/dashy |
In Traefik the bug comes from the authentication middleware. I expect the middleware is some sort of basic auth. |
I expect it has something to do with the URL parsing in this file. https://github.com/plugsy/core/blob/main/packages/core/lib/apollo/links/index.ts Likely line 16 |
Looking into this a bit further, the issue might be that it is trying access it's own apis over the server side which is being blocked by the auth layer of the reverse proxy. In my case I would need to setup traefik to accept it's own requests unchallenged. Probably with a custom router. |
The solution suggested above when using Caddy as reverse proxy still works just fine.. |
I'm using SWAG with https://github.com/linuxserver/docker-mods/tree/swag-auto-proxy.
Literally every service that I throw at it works except for plugsy.
I'm getting a "500 Internal Server Error.".
Here's the relevant parts from my docker-compose for trying to replicate this:
The text was updated successfully, but these errors were encountered: