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

Allow to prevent rule removal for a specified time range #1414

Open
imkaihao opened this issue Aug 12, 2024 · 5 comments
Open

Allow to prevent rule removal for a specified time range #1414

imkaihao opened this issue Aug 12, 2024 · 5 comments

Comments

@imkaihao
Copy link

imkaihao commented Aug 12, 2024

I use Santa in monitor mode to block distracting apps locally (without a sync server). However, it's easy to bypass the block by simply removing the rule.

Adding an option to lock rules for a specific duration would significantly improve self-control.

For example, at time t1, if we run:

sudo santactl rule --block --path /Applications/Example.app --duration Δt1

The rule cannot be removed until t2 (t2 = t1 + Δt1).

If, at time t3, we run again:

sudo santactl rule --block --path /Applications/Example.app --duration Δt2

If t4 (t4 = t3 + Δt2) is later than t2, the rule's expiration time updates to t4, preventing removal until then. Otherwise, the expiration time remains unchanged.

@imkaihao imkaihao changed the title Allow to prevent removing a rule for a time range Allow to prevent rule removal for a specified time range Aug 12, 2024
@russellhancox
Copy link
Contributor

I'm confused by this use-case. You're using Santa to prevent access to particular apps but then you remove the rules because you do want to use the app, so you want Santa to prevent rule removal? If you're willing to go to the trouble of removing the rules, what's to stop you from removing Santa?

@mlw
Copy link
Contributor

mlw commented Aug 13, 2024

An alternative might be to use built-in macOS screen time features: https://support.apple.com/guide/mac-help/manage-downtime-in-screen-time-mchl69510069/14.0/mac/14.0

But as alluded to by @russellhancox - if you have admin on your box you may be hard pressed to find a solution that cannot be bypassed manually.

@imkaihao
Copy link
Author

Thanks for your responses and feedback! I understand the concern about bypassing the system with admin privileges. However, the point of this feature request isn't to create an unbreakable system. It's about introducing friction and promoting mindful usage.

To address @russellhancox's point: Yes, I might eventually remove the rule, but the delay and extra steps involved force me to pause and reconsider my actions. It's similar to the concept behind website blockers or app timers – they don't completely prevent access, but they make you consciously choose to override the restriction. This brief moment of reflection can be enough to break the cycle of unproductive app usage and get back on track.

Think of it like setting a timer on your phone before indulging in social media. It's tempting to just dismiss the timer, but the act of doing so makes you aware of the time spent and encourages you to be more mindful.

While Screen Time offers similar functionality, it lacks the granular control of Santa, such as preventing the execution of binaries.

Santa's proposed time-lock feature would offer a more robust layer of resistance against impulsive rule removal. This added friction would be highly beneficial for users like me who want to leverage Santa for self-regulation.

Therefore, I'd still like to advocate for the implementation of this feature, as it would significantly enhance Santa's value as a self-regulation tool.

@jdnewman85
Copy link

jdnewman85 commented Sep 4, 2024

I'm not a santa dev, to be clear, but IMO a niche case like this is better suited to a santa server. There you could implement schedules, timers, etc for addition or removal of rules. This provides way better self-regulation by introducing friction, since the santa-server is now in control instead of the local user.

@russellhancox
Copy link
Contributor

This does seem like a good way to use a custom sync server. Such a server, written in a server friendly language like Go, would be trivial, compared to adding complexity to the already complex Santa client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants