-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Suggestion: config/flag that restricts dorothy from installing further packages/dependencies. #263
Comments
@molleweide what are your thoughts on this? |
It is something possible, but I want to push back a little bit beforehand. Ultimately, it does depend on your goal right? If your goal in this case is to For implementation, we could have |
At first glance i have to agree with Ben. If there is an easy way to signal to a command pipeline that it should not attempt to do something that could install packages going down the line. But I dont know how complex that would be to add. It is either easy or complicated to add this. If it is just a simple variable then sure, but if it turns out to add lots of conditional complexity to pretty much all larger composed commands, then it feels like a lot of complexity for very little gain from a maintenance perspective. But maybe it can be elegantly automated, however, I dont know if it is possible, and it is not urgent, but could however be a nice feature in the end.. |
An in-between alternative that's harmless could be listing dependencies inside the help text of commands, along with whether their installation is automated, and/or required/optional. Problem with this is it will have no visibility of nested deps, unless the help author manually goes hunting for such. Some tooling could probably be made to automate this to say 3 levels deep. |
that could prolly be automated by CI as well right? |
Read my mind. |
it could also be a simple this command has deps or not to make it easy. I mean if a user takes issues with some dep X then it is there
after these two then it beco{s just a whole ordeal in itself with different levels of granularity and then im like, just read the source instead.. |
@molleweide @balupton thanks for your input. As a user, if I didn't know Ben I would have uninstalled Dorothy at that point and probably forgotten about it after that. The reason for this is that I am not used to anything acting as 'sudo apt-get' as a side effect. I may be mistaken, but I imagine those in an education environment, corporate environment, or any other place where there's system administration would feel the same. After thinking on this more, as a user, I would also be fine if there was no per-package prompt and it was just an installation at Dorothy install time (ideally with a list of what will be installed). During updates, the screen could show the expected updates, removals, and installs. You guys definitely know best as to what the priority of something like this should be. Thanks again! |
There's def cross-over with #233 Is the issue the sudo usage? If ripgrep was installed to XDG bin home automatically without sudo, would that be an uninstall if Ben unknown? For solving #233 there will be a Dorothy install time config prompt for: How would you like to handle commands that need sudo?
While we could automate something to scan the deps of every command, to a certain nesting level, then show it in help text, and even say this dep is used by these commands; I'm thinking that then gets more complicated than a prompt configure; and would be too boring for me to code (PR/funding necessary). The immediate deps in immediate help tho would be easiest; then the config prompt at Dorothy install for whether all setup-util invocations require confirmation (there could also be a whitelist/blacklist of packages). Tomorrow I'll write some proposals. Please continue contemplation. |
It is definitley possible to think more about this. Dorothy is a dotfiels ecosystem as much as it is a shell/cli/bash dev lib. And as a dotfiles system and lib that tries to solve problems it will subsequently also install necessary dependencies if required. This might make some commands unusable if you cant/wont install any further deps. From that perspective it might make sense to have some kind of flag that strictly forbids dorothy to install further programs. This should be worked on over time.
|
From a legal/corp perspective the solution could be to just state that dorothy will try to do these things.. and then just take it from there... So instead of us first implementing some advanced analyzer, just add super explicit prompts that tell the user what to expect. So that we manage expectations and make things more complicated later if necessary. Cuz, if a newbie starts using dorothy, most things will be new to them and there is no way of handling all that. We can only tell them. |
This is not a disagreement but just some additional philosphy: one goal of dorothy for me is also to setup a foundation for solving all possible problems you might have and so it is kinda inherent to the philosophy that dorothy would install necessary packages if required. So dorothy is like the interface and then you can do whatever inside of it and this means naturally that dorothy has and will install dependencies. |
@balupton I can see the cross over to 233 (which I have read when it was discussed in the co-working session a while back). If the implementation of identifying dependencies requires some form of analysis of the source to identify what may be installed, I'm happy to give the development of that a try. I think there's a level of complexity in this 'package management' which may ultimately not fall within the scope of Dorothy, to @molleweide its ultimate goal is to accomplish what you need of it. However, I want to share some other things I found in case it is of value: There's an apt-file / auto-apt that may be of interested: Upon further research, I've discovered apt-cache search which looks promising: https://askubuntu.com/questions/160897/how-do-i-search-for-available-packages-from-the-command-line However, if this dependency identification cannot be cleanly implemented then I propose that a 'proxy' for it is not developed but that the Github / program simply has a list of dependencies that is documented. |
@octavian-one one other aspect here, is that Dorothy, or any open-source project, could Perhaps security isn't the concern here; I haven't seen that shine through in this report, or the sudo report, or any other issue. What is shining through in this report is "Dorothy did something I didn't expect" in which case we need to manage expectations. For the sudo issue, what shone through is "sudo prompts on a non-root system is extremely annoying" in which we need to just skip sudo. |
These would be doubling up on Dorothy's The automation @molleweide and I were discussing would be something that ensures these Such detection could be extended however, to allow for visibility with the confirm any
Then you may be interested in it. Such could be done by syncing source code analysis with the help text, but also say a {
"dependents": {
"config-edit": {
"ripgrep": {
"optional": false
}
},
"dorothy": {
"ripgrep": {
"optional": false
}
},
"get-filesystem": {
"ripgrep": {
"optional": false
}
}
},
"dependencies": {
"ripgrep": {
"config-edit": {
"optional": false
},
"dorothy": {
"optional": false
},
"get-filesystem": {
"optional": false
}
}
}
} Which can then be sourced by
However, this also illustrates the complexity of such. As |
So here are the proposals:
|
@balupton regarding a nefarious command such as delete everything... you raise a good point. Running un-trusted applications could be sandboxed (to a certain degree) with AppArmour. An organization should already be preventing rm -rf, apt-get, etc, and if they're not then it's up to their users and policies to prevent un-authorized code execution. A quick aside: I had previously missed the meaning of 'would that be an uninstall if Ben unknown?' which is pretty funny. It sounds like a Dorothy command! It also seems I didn't refresh GitHub before my comment this morning (leading me to miss out on @molleweide 's additional notes). I wasn't aware of the complexity of setup-util and its full capabilities, which I must agree are amazing. The proposal you made is robust and from the background of what drove me to create this issue, I want to note that the readme update itself would alleviate the trust concern I raised. You can imagine (as a somewhat naive user) what was going through my mind when I ran get-filesystem only to see some flashing lines of apt-get which then disappeared. It is this disappearing act which greatly contributed to my unease (leaving me thinking 'did I get my filesystem or did someone else?'). Thank you both for addressing and collaborating on the design of the proposed enhancement. |
One thing that I've done locally is add a I could update it so that What does this command do? The Breakdown
Example UsageDetermine Filesystem from Sourceget-filesystem --source=/dev/sda1 Determine Filesystem from Targetget-filesystem --target=/mnt/data Explanation of Helper Functions
|
@balupton the list with the potential to get the help text of commands is phenomenal. This is a great shell experience and is what I'm used to in other packages. The summary could be beneficial, but I think that may add more overhead at this time in reviewing the output and keeping it up to date. One example of it being a little vague was 'The script sources another script located at $DOROTHY/sources/ripgrep.bash, which likely contains helper functions or configurations.' In the future, such summaries could even be available in a documentation wiki (Github, etc), but I just think it would add a huge time commitment to our valuable contributors (ahem mostly you) which may best addressed down the road when adoption is greater (or the outcry for such docs rises). |
Should we maybe just start a wiki now and put some placeholder sections like "Getting started" and "FAQ", and then we can populate as time goes on. And link to them from readme and also link to the roadmap from the readme or wiki |
@molleweide nah no wiki, they are a pain to keep updated, as they can get out of sync way too easily with the codebase. Keep everything in the readme or the docs folder, then everything that is out of date easily shows up when I search VSCode for things. Originally Dorothy did have a wiki, and GitHub Discussions, but they were archived for this reason - everything got out of date because there was no visibility next to the code to keep them updated. |
ah ok make sense |
Add system-wide configuration for automatic package installation behavior
Issue Type
Enhancement Request
Current Behavior
When running certain Dorothy commands (like
get-filesystem
), the system automatically attempts to install required packages without explicit user confirmation. In the observed case, the ripgrep utility installation process began automatically as part of the command execution.Desired Behavior
Add a system-wide configuration option that allows users to control package installation behavior:
Use Case
Users may want to:
Suggested Implementation
Technical Notes
Additional Context
This was observed while running
get-filesystem
, which triggered the setup_util_ripgrep installation process without user confirmation. While the automatic installation is convenient, it may not be desired in all environments or situations.Let me know if you'd like me to clarify or expand on any part of this issue.
The text was updated successfully, but these errors were encountered: