Skip to content
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

[BUG] issues with getting pihole stat widgets to work #1681

Closed
5 tasks done
back-lacking opened this issue Aug 29, 2024 · 9 comments
Closed
5 tasks done

[BUG] issues with getting pihole stat widgets to work #1681

back-lacking opened this issue Aug 29, 2024 · 9 comments
Assignees
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working

Comments

@back-lacking
Copy link

Environment

Self-Hosted (Docker)

System

Debian 12, Docker 27.1.1

Version

3.1.1

Describe the problem

So I'm currently trying to setup the widgets for Pihole in Dashy. I added the widgets in my conf file, provided my API key for all the Pihole widgets, and added the Traefik CORS headers from the Dashy documentation to my Pihole's compose file. Looking at Firefox's dev tools, I see that I'm getting a weird network error and errors about missing CORS headers, despite me adding it to my Pihole Compose file and seeing the cors headers middleware in my Traefik dashboard. Relevant configs and screenshots in next section.

Additional info

image the errors in firefox
image the network error expanded

      - traefik.http.middlewares.pihole-cors.headers.accesscontrolallowmethods=GET,OPTIONS,PUT
      - traefik.http.middlewares.pihole-cors.headers.accessControlAllowCredentials=true
      - traefik.http.middlewares.pihole-cors.headers.accesscontrolallowheaders=https://home.local.inever.cyou
      - traefik.http.middlewares.pihole-cors.headers.accesscontrolalloworiginlist=https://home.local.inever.cyou
      - traefik.http.middlewares.pihole-cors.headers.accesscontrolmaxage=100
      - traefik.http.middlewares.pihole-cors.headers.addvaryheader=true

the cors headers i added to my piholes compose file. home.local.inever.cyou is the url for the dashy instance.

    widgets:
      - type: pi-hole-stats
        options:
          hostname: https://pihole.local.inever.cyou
          apiKey: apikey
        id: 0_1168_piholestats
      - type: pi-hole-top-queries
        options:
          hostname: https://pihole.local.inever.cyou
          apiKey: apikey
        id: 1_1168_piholetopqueries
      - type: pi-hole-traffic
        options:
          hostname: https://pihole.local.inever.cyou
          apiKey: apikey
        id: 2_1168_piholetraffic

the part of my config file containing the pihole widgets

image the traefik dashboard

Please tick the boxes

@back-lacking back-lacking added the 🐛 Bug [ISSUE] Ticket describing something that isn't working label Aug 29, 2024
@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 29, 2024
@back-lacking

This comment has been minimized.

@back-lacking

This comment has been minimized.

@CrazyWolf13

This comment has been minimized.

@back-lacking

This comment has been minimized.

Repository owner deleted a comment Aug 29, 2024
@CrazyWolf13
Copy link
Collaborator

Why don't you use the proxy?

https://dashy.to/docs/widgets/#proxying-requests

That normally solves all CORS errors without any middleware or any other setup.

@back-lacking
Copy link
Author

@CrazyWolf13 i did try but i dont think it worked. I will try again with one of the widgets again in a bit.

@back-lacking
Copy link
Author

@CrazyWolf13 i think the reason why it didnt work previously was that useProxy was previously in the options of the widget instead of outside of the options. i looked at the documentation more carefully and now it works.

@back-lacking
Copy link
Author

image
yep, applied the useProxy option to all the widgets, and it works.

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 29, 2024
@CrazyWolf13
Copy link
Collaborator

Awesome! Glad you got it working!

@github-staff github-staff deleted a comment from back-lacking Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working
Projects
Status: Done
Development

No branches or pull requests

5 participants
@Lissy93 @back-lacking @liss-bot @CrazyWolf13 and others