dashy
dashy copied to clipboard
[BUG] auth doesnt work, especially keycloak
Environment
Self-Hosted (Docker)
System
debian
Version
2.1.1
Describe the problem
Deploy dashy in kubernetes with ingress tried to make auth by dashy documentation, but it didnt work, even basic auth with user hash and title also auth parameters as enableGuestAccess doesnt work i think its something in last update, that interfere auth work last git update was a week ago, maybe u didnt update documentation
Additional info
No response
Please tick the boxes
- [X] You have explained the issue clearly, and included all relevant info
- [X] You are using a supported version of Dashy
- [X] You've checked that this issue hasn't already been raised
- [X] You've checked the docs and troubleshooting guide
- [X] You agree to the code of conduct
If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated
Same here. Basic auth is not working.
Was about to give up, because I couldn't find what I was doing wrong. Tried a couple of different options, but below is latest. After applying below to the config, I also get the message that I'm not logged in as admin. When trying to force via URL to login I just get redirected to Dashy homepage.
https://url/login redirects to https://url/
I deleted cache, restarts, incognito, other browsers etc.
appConfig:
theme: nord-frost
layout: auto
iconSize: medium
language: en
auth:
users:
- user: randyjc
hash: <REDACTED>
type: admin
pageInfo:
title: Dashy
description: Welcome to your new dashboard!
navLinks:
- title: GitHub
path: https://github.com/Lissy93/dashy
- title: Documentation
path: https://dashy.to/docs
sections:
- name: Getting Started
icon: fas fa-rocket
items:
- title: Dashy Live
description: Development a project management links for Dashy
icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
url: https://live.dashy.to/
target: newtab
id: 0_1481_dashylive
- title: GitHub
description: Source Code, Issues and Pull Requests
url: https://github.com/lissy93/dashy
icon: favicon
id: 1_1481_github
V2.1.1 via PikaPods
EDIT: Probably related: https://github.com/Lissy93/dashy/issues/1126
same here, auth (basic) doesnt work =(
I am new to Dashy (Just set it up about a week ago.) Today I was following the basic auth docs and I am also seeing the same issue. Opening Dashy, I just get to my dashboard. If I go to config, update config, edit config, I see a message across the bottom "You cannot write changes to disk because you are not logged in as an administrator". So it would seem it knows about my new user account that is an admin, however it is not redirecting to login. I've tried multiple browsers (Edge, chromium, Chrome), and multiple PCs, but there is no change. If it matters, I added the auth config by hand from ssh use VI.
Thanks
Andy
I seem to be having a similar issue.
+1 Basic auth is NOT working, new user running Docker, auth is configured, dashboard is completely exposed and unsecured.
Have attempted these additional configuration options mentioned in other Issues.
enableGuestAccess: false
disableConfigurationForNonAdmin: true
Here is my entire appConfig:
appConfig:
theme: nord-frost
layout: auto
iconSize: medium
language: en
auth:
enableGuestAccess: false
disableConfigurationForNonAdmin: true
users:
- user: *****
hash: *****
type: admin
Auth tickets should be a priority.
Related to these other Issues that are getting closed from the timeout bot. It does not appear the repo owner @Lissy93 is responding these.
- https://github.com/Lissy93/dashy/issues/1082
- https://github.com/Lissy93/dashy/issues/1063
- https://github.com/Lissy93/dashy/issues/990
- https://github.com/Lissy93/dashy/issues/1019
Is this still going on? I think I have the same problem but cant seem to find a fix if there is maybe someone can direct me into the right direction?
I've not found a solution yet. So for now I've just disabled Dashy.
I am experiencing the same issue too... Neither keycloak nor basic auth working...
Lets hope @Lissy93 can fix it soon somehow.
+1 No login page showing after enabling auth. With the aforementioned work-around of "enableguestaccess" I've the login button but even if I authenticate with an Admin user, I'm no able to make any conf changes.
EDIT: Reverting to 2.1.0 seems to fix the issue
+1 on docker swarm 2.1.0 docker image works fine tho. Keeping previous version until fix is available :)
Btw. Thanks for superb app, and no pressure ;)
+1, I have exactly the same problem that is described here and in the other issues (logout button without even logging-in and keycloak weird errors). Reverting to 2.1.0
+1 , This is not working on Dashy 2.1.1 too. Does not work even after adding enableGuestAccess: true and disableConfigurationForNonAdmin: true parameters. I have tried it in the incognito mode browser too, to ensure its not a caching issue. Any advice is appreciated.
appConfig:
auth:
enableGuestAccess: true
users:
- user: user1
hash: ############
type: admin
- user: user2
hash: ##############
type: normal
disableConfigurationForNonAdmin: true
Keycloak works perfectly fine for me.
The needing element is an attribute mapper providing roles and groups to simple attributes "roles" and "groups" in the access token.
Does not work in conjunction with basic auth though
Any progress on this? For me, it also does not work with 2.1.1. With 2.1.0 everything works perfectly though...
Any progress on this? For me, it also does not work with 2.1.1. With 2.1.0 everything works perfectly though...
Have you made sure you get the groups with your requests? It works when you add them to the access token
Edit: It looks like the effects of this (and https://github.com/Lissy93/dashy/issues/1051#issue-1525872151) are far-reaching, I believe a lot of the open bug reports right now could be fixed by this. I've linked a few to my explanation, but I have to leave it there for today - I'll pick this back up if mentioned and/or a maintainer responds.
I believe there are several reasons why this could be happening - in my case it was a combination of two issues.
- Problem 1: User Error
- Contrary to what the documentation says, I decided to bind mount
./config:/app/public. This was a mistake, since/app/publicis pre-populated with a sample configuration and some other files - including the website icon etc. Only bind mount individual files into/app/public!! - _Note: In the release notes for 2.1.1, there was mention about a configuration overhaul - I would wait on this to be released before making any requests/suggestions.
- Contrary to what the documentation says, I decided to bind mount
- Problem 2: First build
- I haven't had a chance to look fully into this yet, but I believe it's due to how the dashy docker image is built. It runs a node.js server (which is required to support functions like config editing and more), and a "static" site generated from the config. The static site is built at runtime with
yarn, and can be manually started withyarn build(or through the UI viaUpdate Configuration > Rebuild Application). The generated site is placed at/app/dist/, which is non-persistent - if you recreate the container (which happens when runningdocker compose down, ordocker compose up -dwith an already running container), the contents of/app/distwill be lost. I believe that upon first startup, the site is run directly from source while the first build is created - which leads to inconsistencies in login mentioned in this issue. If (like me) there are issues with auto rebuild, the static site won't be generated automatically - you need to trigger it manually via any of the above methods. Once built, login functions as expected. - @Lissy93 do you mind giving this a quick read and response? A yes/no would suffice, I know you are busy with v2.1.2/v3 among other things.
- I haven't had a chance to look fully into this yet, but I believe it's due to how the dashy docker image is built. It runs a node.js server (which is required to support functions like config editing and more), and a "static" site generated from the config. The static site is built at runtime with
As for solutions to the problem, make sure the static component is built upon container recreation. Since the release notes mentioned a big overhaul, I won't do anything right now, but I have an idea as for how to fix the issue at it's root, should it still exist - make /app/dist persist to an extent (or require yarn build to complete before the container becomes accessible). If a maintainer can give me the go ahead (i.e. this won't be solved by anything that's currently in the works), I'll draft up a PR with the fix (basically add documentation for an additional bind mount, ./cache:/app/dist or the like, and make a few changes to make it work (there's an RM command somewhere that needs a change)).
These mentions are just for letting people involved in the other bugs know, sorry for the spam
Thanks for looking int this @TheRealGramdalf. I tried at my end again, unfortunately I couldn't get things to work.
- Added the Keycloack mapper as per the screenshot of @jakob1379, no change unfortunately
- Ran
sudo docker exec -it dashboard yarnas per your note above and still won't get a prompt to logon
Back to v2.1.0 and things are working again…
* Ran` sudo docker exec -it dashboard yarn` as per your note above and still won't get a prompt to logon
Did you do sudo docker exec -it dashboard yarn or sudo docker exec -it dashboard yarn build? The latter is what you need for it to build, on my server it takes about ~100s. Make sure to clear all cache (especially if you have the service worker enabled) for it to take effect - there may be residual login cookies etc that mess with things.
I just tried your fix and it worked like a charm. Thanks!
Did you do
sudo docker exec -it dashboard yarnorsudo docker exec -it dashboard yarn build?
The first one :-) Just tried again with yarn build…and bingo! Got my logon dialog! I think that's a workable solution for me until this get fixed for good.
Thanks a lot for helping along, really appreciated!
Even with version 2.1.0, I don't achieve keycloak auth to work :( It gives a never ending refresh on the dashy loading screen. Did someone have a working configuration with keycloak to provide ?
Hello,
I'm encountering a couple of issues with Dashy after deploying it using Docker Compose. Here's a summary of my steps and the problems I'm facing:
Initial Deployment: I deployed Dashy using the command docker compose up -d. After deployment, the login screen did not appear as expected.
Rebuilding Dashy: To troubleshoot, I rebuilt Dashy using two methods:
Through the Dashy UI by selecting "Rebuild Application."
Via command line with sudo docker exec -it
Configuration Update Problem: However, a new problem arose where updates made to the Dashy configuration through the UI are not being saved. Interestingly, the changes appear in the configuration file when viewed with cat or vim, but these updates don't reflect within the application itself when I reload the browser, tried also in incognito mode clear cookis. Specifically, I'm looking for help with the following:
Why are the configuration changes not persisting in the UI, even though they're visible in the configuration file? Is there a step I'm missing or a known issue that prevents configuration updates from being saved properly when using Docker? Any insights, suggestions, or guidance on how to resolve this issue would be greatly appreciated. Thank you!
Configuration changes require a rebuild before they take effect. Just trigger that after making changes to the config and you should be good.
Configuration changes require a rebuild before they take effect. Just trigger that after making changes to the config and you should be good.
Thanks for the fast response. However, the problem I face after rebuild is that I can not change the configuration in UI, so to say interactively. I do the changes, like add section, as can be seen on the screenshots. I added the "test section" clicked on save disk, after refreshing the page "test section" is gone, but is, in fact, in the config.yml file. It is very inconvenient to rebuild the app after every change. So long story short, I have only problem that after I run it with docker compose up -d, anyone can see the dashboard after just deleting the /login in the URL IP:Port/login is there a workaround I can do to avoid that?? Seems like enableGuestAccess: false do not take effect until the rebuild.
appConfig:
disableConfigurationForNonAdmin: true
enableGuestAccess: false
auth:
#enableGuestAccess: false
users:
- user: user1
Essentially the issue is that you must rebuild after making any changes, period. This used to happen automatically, but it was recently broken (as of 2.11 iirc?). I haven't looked into the specifics exactly, but that's the TL;DR
Essentially the issue is that you must rebuild after making any changes, period. This used to happen automatically, but it was recently broken (as of 2.11 iirc?). I haven't looked into the specifics exactly, but that's the TL;DR
Thx for the answer. I revert it to 2.1.0 and it is working fine. I will wait till the bug is fix in the next releases.
> Even with version 2.1.0, I can't get keycloak authentication to work :( It provides a never-ending refresh on the dash loading screen. Does anyone have a working configuration for keycloak?
I also can't use keycloak for authentication.