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

Selfcontrol-cli can't read blocklist from default directory #853

Open
coolandsmartrr opened this issue Oct 25, 2023 · 3 comments
Open

Selfcontrol-cli can't read blocklist from default directory #853

coolandsmartrr opened this issue Oct 25, 2023 · 3 comments
Labels

Comments

@coolandsmartrr
Copy link

Summary

Selfcontrol-cli does not seem to be able to read the blocklist in the default directory. This command results in an error:

➜  ~ /Applications/SelfControl.app/Contents/MacOS/selfcontrol-cli start --blocklist  ~/Library/Preferences/org.eyebeam.SelfControl.plist --enddate 2023-10-26T07:00:00+09:00

2023-10-25 18:45:32.469 selfcontrol-cli[62929:14233026] ERROR: Could not read a valid block from file file:///Users/ricky/Library/Preferences/org.eyebeam.SelfControl.plist
2023-10-25 18:45:32.469 selfcontrol-cli[62929:14233026] ERROR: Block could not be read from file /Users/ricky/Library/Preferences/org.eyebeam.SelfControl.plist

Background Info

SelfControl version? 4.0.2
macOS version? 13.5
Do you use a VPN/proxy, and if so which one? No
Has this ever worked for you on a prior version of SelfControl? If so, when?
Any other special system setup we should know about?

How Do We Reproduce This Issue?

Describe detailed steps that reliably make this issue show up. For example, "start a block containing 5 websites, click button X, then button Y"

Run the command as listed above.

What Should Have Happened?

I expected the selfcontrol block to start.

What Actually Happened Instead?

Selfcontrol-cli could not read the blocklist from the default directory.

@reynoldsnlp
Copy link

If you save the blocklist in the app is the resulting file identical to the plist file?

@Spelkington
Copy link

A bit of research on this: it appears that the file stored at ~/Library/Preferences/org.eyebeam.SelfControl.plist and the .selfcontrol file exported by the program are not the same, which would explain why SelfControl's CLI doesn't read the former as a valid blocklist:

Copy of the blocklist from ~/Library/Preferences/org.eyebeam.SelfControl.plist:

bplist00���������	
�
�������MNOPQ�_�0NSWindow Frame NSSpellCheckerSubstitutionsPanel2_�'MASPreferences Selected Identifier View_��SUHasLaunchedBefore_��SULastCheckTime_��WhitelistAlertSuppress_��GetStartedShownYBlocklist_�%NSWindow Frame NSNavPanelAutosaveName_��BlockAsWhitelist_��NSNavLastRootDirectory_��SULastProfileSubmissionDate_�!NSNavPanelExpandedSizeForOpenMode_��FirstBlockStarted_��692 407 425 137 0 0 1728 1079 _��GeneralPreferences	3A���V���		��8����������� !"#$%&'()*+,-./0123456789:;<=>[email protected][nytimes.com[bluesky.app[twitter.com\linkedin.com_��forever.utah.eduXbsky.app]inoreader.com^abcnews.go.com[ground.newsWcnn.com_��huffingtonpost.com[foxnews.comWbbc.comYbbc.co.uk_��telegraph.co.uk_��news.google.com\buzzfeed.comXvice.comZgawker.comZtumblr.comZforbes.com]gothamist.com[jezebel.com\usatoday.com\theonion.com^news.yahoo.com_��washingtonpost.comWwsj.com_��theguardian.com[latimes.com_��nydailynews.comYsalon.comYmsnbc.comVrt.com]bloomberg.comWaol.com_��drudgereport.com_��nationalgeographic.comZnypost.com_��chicagotribune.comWmsn.comZusnews.com\facebook.comX9gag.com[netflix.comXhulu.com_��dailymotion.com_��collegehumor.com^funnyordie.comWvine.co]pinterest.com_��stumbleupon.com]instagram.com_��mail.google.com_��blog.chaoticgood.computer_��464 473 800 448 0 0 1728 1079 �Q~3A�Ȃ�'�Z{800, 448}	���#�V�����������������1�O�s���������������������&�2�?�R�[�i�x���������������������������(�4�A�N�]�r�z�����������������������'�/�:�G�P�\�e�w���������������������!�*�5���������������S���������������6

Exported file containing the same blocklist:

bplist00�����_��BlockAsWhitelist]HostBlacklist���8����	
�
������������������ !"#$%&'()*+,-./0123456789:;<Ygmail.com[nytimes.com[bluesky.app[twitter.com\linkedin.com_��forever.utah.eduXbsky.app]inoreader.com^abcnews.go.com[ground.newsWcnn.com_��huffingtonpost.com[foxnews.comWbbc.comYbbc.co.uk_��telegraph.co.uk_��news.google.com\buzzfeed.comXvice.comZgawker.comZtumblr.comZforbes.com]gothamist.com[jezebel.com\usatoday.com\theonion.com^news.yahoo.com_��washingtonpost.comWwsj.com_��theguardian.com[latimes.com_��nydailynews.comYsalon.comYmsnbc.comVrt.com]bloomberg.comWaol.com_��drudgereport.com_��nationalgeographic.comZnypost.com_��chicagotribune.comWmsn.comZusnews.com\facebook.comX9gag.com[netflix.comXhulu.com_��dailymotion.com_��collegehumor.com^funnyordie.comWvine.co]pinterest.com_��stumbleupon.com]instagram.com_��mail.google.com_��blog.chaoticgood.computer���
� �.�/�j�t���������������������������%�7�I�V�_�j�u�������������������������$�+�9�A�T�m�x�������������������������'�5�G���������������=���������������c

It appears they contain very similar information, but are definitely not the same.

@Spelkington
Copy link

Spelkington commented Mar 4, 2024

After doing a search for files with the same MD5 hash as the exported blocklist, it appears none exist in either ~/Applications or ~/Library/Preferences, which leads me to believe that the blocklist recognized by the SelfControl frontend application and the CLI are using two different formats for blocklists. Pure speculation, but I'd imagine the copy in ~/Library/Preferences is the format recognized by the GUI, and the exported copy is the format recognized by the CLI.

Being able to access the blocklist defined by the user in the GUI would be enormously helpful - I am currently building out a SelfControl Raycast extension for my own (and others) use, and being able to use the GUI-defined blocklist rather than having to re-export changes to a specific file location in the user's home directory would be awesome.

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

No branches or pull requests

3 participants