auto-selfcontrol: auto-selfcontrol will break with upcoming SelfControl release

Hey @andreasgrill, I’m the author of the SelfControl app itself. I’m about to release an update with a giant refactor that will hopefully make SelfControl less buggy, more tamper-proof, and way easier to update in the future. BUT, it will break auto-selfcontrol unless your tool is adjusted to match. I know many users love the auto-selfcontrol tool, so I wanted to give you a heads-up and see if we can coordinate on a fix.

Two big things that are changing: 1. We’re moving from a BlockStartedDate and BlockDuration to just a BlockEndDate that determines when the block will be over. This is cleaner and makes it possible to cleanly extend a block without any hacks. 2. We’re no longer storing all settings in the user defaults. As an anti-tampering measure, some of the settings are “secured” with a hash and stored in a file with a pseudo-randomized name.

My proposed resolution is that I just make y’all a set of org.eyebeam.SelfControl command-line methods that do what you need, and you move auto-selfcontrol to use those instead of directly reading/writing from defaults. I think we could do that with these methods:

  1. org.eyebeam.SelfControl {userId} —version
    1. outputs the version string for the installed SelfControl command-line tool (note this may not be the same as the version of the installed SC app, since the command-line tool only gets copied over when a block is started)
    2. You’d use this method to decide whether to use the new behavior or fall back to the legacy behavior.
  2. org.eyebeam.SelfControl {userId} —is-running
    1. outputs YES if a SelfControl block is currently running, or NO otherwise
  3. org.eyebeam.SelfControl {userId} —install /path/to/saved/blocklist.selfcontrol
    1. blocklist.selfcontrol would have to be a saved blocklist in the SelfControl format (File —> Save Blacklist). That is very simple: Just a plist with two entries, HostBlacklist and BlockAsWhitelist. See this code to see exactly how we output those files: selfcontrol/AppController.m at b85462070b3f8e43a3d2831186f120b0ef079760 · SelfControlApp/selfcontrol · GitHub

The --version and --is-running methods are already implemented in the SC master branch; will work on the --install method taking blocklist files soon. Let me know if those work for you!. Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Ooops. 😆

Awesome! I’ll release Auto-SelfControl in the next few days.

Huge thanks for sorting this out! I’d noticed that the sbibauw fork had stopped working and thought I was going to have to roll my sleeves up myself until I saw this!

Y’all are the best.