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

[QUESTION] What am I missing/doing wrong in the Pi Hole Stats widget? #391

Closed
4 tasks done
KierenConnell opened this issue Dec 30, 2021 · 8 comments · Fixed by #392
Closed
4 tasks done

[QUESTION] What am I missing/doing wrong in the Pi Hole Stats widget? #391

KierenConnell opened this issue Dec 30, 2021 · 8 comments · Fixed by #392
Labels

Comments

@KierenConnell
Copy link
Contributor

Question

Configured the Pi Hole stats widget as per the example, but it returns Unable to fetch data

name: Pi-Hole Stats
icon: hl-pihole
displayData:
  sortBy: default
  rows: 1
  cols: 1
  collapsed: false
  hideForGuests: false
widgets:
  - type: pi-hole-stats
    options:
      hostname: 'https://pihole-1.kierenconnell.com/admin/api.php'

Have tried setting hostname as direct IP to Pi Hole as per example, and also api.php

Category

Widgets

Please tick the boxes

@KierenConnell KierenConnell added the 🤷‍♂️ Question [ISSUE] Further information is requested label Dec 30, 2021
@liss-bot
Copy link
Collaborator

Welcome to Dashy 👋
It's great to have you here, but unfortunately your ticket has been closed to prevent spam. Before reopening this issue, please ensure the following criteria are met.

Issues are sometimes closed when users:

  • Have only recently joined GitHub
  • Have not yet stared this repository
  • Have not previously interacted with the repo

Before you reopen this issue, please also ensure that:

  • You have checked that a similar issue does not already exist
  • You have checked the documentation for an existing solution
  • You have completed the relevant sections in the Issue template

Once you have verified the above standards are met, you may reopen this issue. Sorry for any inconvenience caused, I'm just a bot, and sometimes make mistakes 🤖

@Lissy93 Lissy93 reopened this Dec 30, 2021
@Lissy93
Copy link
Owner

Lissy93 commented Dec 30, 2021

@EVOTk also raised this too. It seems to be a CORS error, I'll implement an option to proxy the request with the correct headers.

In the meantime, verify that you've got API access enabled on your Pi-Hole, can you access https://location-of-pi-hole.local/admin/api.php. If you were to set the CORS headers to allow requests from Dashy, this would also fix your issue.

@Lissy93
Copy link
Owner

Lissy93 commented Dec 30, 2021

Actually, just noticed in your config sipped that you've got a mistake, the hostname should just be: https://pihole-1.kierenconnell.com. Could you also share the output of the console, so that I can debug the issue, is there an error in Red?

@KierenConnell
Copy link
Contributor Author

Same error Unable to fetch data if I have hostname as https://pihole-1.kierenconnell.com
image

@Lissy93
Copy link
Owner

Lissy93 commented Dec 30, 2021

Yup, that's a missing CORS header. Depending on how you're hosting Pi-Hole you should just be able to add:

Access-Control-Allow-Origin: https://location-of-dashy/

But I will also add a proxy server which you can then use as an option

@Lissy93 Lissy93 linked a pull request Jan 1, 2022 that will close this issue
6 tasks
@Lissy93
Copy link
Owner

Lissy93 commented Jan 1, 2022

Heya @KierenConnell
I've pushed a fix out for this, you can now proxy requests to Pi-Hole, without the need to apply any headers on Pi-Hole's side :)
Hope that helps, and happy new year 🎇

@Lissy93 Lissy93 closed this as completed Jan 1, 2022
@KierenConnell
Copy link
Contributor Author

Awesome! Working perfectly now
Thanks!

@liss-bot
Copy link
Collaborator

The fix for this issue has now been released in Dashy 2.0.0 ✨

If you haven't done so already, please update your instance to 2.0.0 or later. See Dashy 2.0.0 for full info.

Feel free to reach out if you need any more support. If you are enjoying Dashy, consider supporting the project.

asterling8516 pushed a commit to asterling8516/dashy that referenced this issue Nov 23, 2023
Co-authored-by: Dashboard Icons Bot <noreply@walkx.fyi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants