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] I can edit the whole config even i am a guest #590

Closed
4 tasks done
reke-buchenau opened this issue Apr 6, 2022 · 11 comments
Closed
4 tasks done

[BUG] I can edit the whole config even i am a guest #590

reke-buchenau opened this issue Apr 6, 2022 · 11 comments
Assignees
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 🔨 Fixed ‼️ High Priority [ISSUE] An issue or PR that needs to be dealt with urgently 🛩️ Released 2.0.9

Comments

@reke-buchenau
Copy link

Environment

Self-Hosted (Docker)

Version

2.0.6

Describe the problem

Hi,

my i can edit the whole config even i am in the guest mode. I removed all cookies and caches but nothing happened.

This is my Config:

{
"appConfig": {
"customCss": "",
"layout": "vertical",
"iconSize": "large",
"theme": "one-dark",
"language": "de",
"startingView": "default",
"defaultOpeningMethod": "newtab",
"statusCheck": true,
"statusCheckInterval": 5,
"faviconApi": "google",
"routingMode": "hash",
"enableMultiTasking": false,
"widgetsAlwaysUseProxy": false,
"webSearch": {
"disableWebSearch": false,
"searchEngine": "google",
"openingMethod": "newtab",
"searchBangs": {}
},
"enableFontAwesome": true,
"enableMaterialDesignIcons": false,
"hideComponents": {
"hideHeading": false,
"hideNav": false,
"hideSearch": false,
"hideSettings": false,
"hideFooter": true
},
"auth": {
"enableGuestAccess": true,
"users": [
{
"user": "admin",
"hash": "passwordhash",
"type": "admin"
}
],
"enableKeycloak": false
},
"showSplashScreen": true,
"preventWriteToDisk": false,
"preventLocalSave": true,
"disableConfiguration": false,
"allowConfigEdit": true,
"enableServiceWorker": false,
"disableContextMenu": false,
"disableUpdateChecks": false,
"disableSmartSort": false,
"enableErrorReporting": false,
"customColors": {
"one-dark": {
"primary": "#c5cad3",
"background": "#282c33",
"background-darker": "#1c1f23"
}
}
},
"pageInfo": {
"title": "IT Linksammlung",
"description": "Alle wichtigen Links",
"navLinks": [],
"footerText": ""
},
"sections": [
{
"name": "Server",
"icon": "fas fa-globe",
"displayData": {
"sortBy": "default",
"rows": 1,
"cols": 1,
"collapsed": false,
"hideForGuests": false
},
"items": [
{
}
]
}
]
}

Can you help me?

Additional info

No response

Please tick the boxes

@reke-buchenau reke-buchenau added the 🐛 Bug [ISSUE] Ticket describing something that isn't working label Apr 6, 2022
@am93
Copy link

am93 commented Apr 15, 2022

Same (or similar) issue is also in version 2.0.7, where authentication is not working. I configured conf.yml and created two users under appConfig.auth.users as instructed in the documentation. I also disabled guestAccess with appConfig.enableGuestAccess: false.

When I open application in the browser I don't get any authentication requests.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Apr 15, 2022
@am93
Copy link

am93 commented Apr 15, 2022

Ignore my previous comment - it is related to issue #601

@reke-buchenau are you using docker compose ?

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Apr 16, 2022
@dtypo
Copy link

dtypo commented May 5, 2022

Same problem here.
I can use the "interactive editor", the "edit page info", the "Edit app config" and the general "Edit config", allowing to write to disk, even if I'm guest. The guests are supposed to only visualize the dashboard, not to edit it 🤔
Obviously there is an admin user set.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 5, 2022
@LeoColman
Copy link
Contributor

@am93
I am using docker-compose and facing this issue

@Lissy93 Lissy93 added the ‼️ High Priority [ISSUE] An issue or PR that needs to be dealt with urgently label May 5, 2022
@dtypo
Copy link

dtypo commented May 5, 2022

I've just discovered that, as guest, I can even see all the users and relative hashes

image

@LeoColman
Copy link
Contributor

A quick "Hold the line" workaround is to make the conf file read only in docker.

volumes:
    - /my/path/to/confs:/app/public:ro

@LeoColman
Copy link
Contributor

I've tracked some of what could be to these files:

src/components/InteractiveEditor/EditModeSaveMenu.vue

<Button
        :click="writeToDisk"
        :disallow="!permissions.allowWriteToDisk"
        v-tooltip="tooltip($t('interactive-editor.menu.save-disk-tooltip'))"
      >
        {{ $t('interactive-editor.menu.save-disk-btn') }}
        <SaveToDiskIcon />
      </Button>

src/utils/Auth.js

export const isUserAdmin = () => {
  const users = getUsers();
  if (users.length === 0) return true; // Authentication not setup
  if (!isLoggedIn()) return false; // Auth setup, but not signed in as a valid user
  const currentUser = localStorage[localStorageKeys.USERNAME];
  let isAdmin = false;
  users.forEach((user) => {
    if (user.user === currentUser) {
      if (user.type === 'admin') isAdmin = true;
    }
  });
  return isAdmin;
};

I couldn't dig much deeper

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 6, 2022
@reke-buchenau
Copy link
Author

Ignore my previous comment - it is related to issue #601

@reke-buchenau are you using docker compose ?

Hi, sorry for my late reply. Yes, i use the docker compose.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 6, 2022
@WahidBawa
Copy link

I'm having this same issue, I'm also using docker-compose. I guess I'll leave guest access off until this is fixed.

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 9, 2022
@skornel02
Copy link

I'm facing the same issue. Contrary to others I'm running this self-compiled.
This is a very serious issue, is there any update on this?
Any way I try to configure it the only way to make guets unable to edit is - as mentiontioned above - to setting the file to read only.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 18, 2022
@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 20, 2022
@liss-bot
Copy link
Collaborator

The fix for this issue has now been released in 2.0.9 ✨

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

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

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 🔨 Fixed ‼️ High Priority [ISSUE] An issue or PR that needs to be dealt with urgently 🛩️ Released 2.0.9
Projects
None yet
Development

No branches or pull requests

8 participants