build 1437 - moving to new config system

Alpha/Beta versions for early access to new half-cooked features
User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

build 1437 - moving to new config system

Post by mike » Tue Dec 22, 2015 2:19 pm

Hi everyone,

Here're the first results on new config system for Files:
http://filesmanager.info/downloads/prev ... (1437).zip

Currently (as of 1.1.0) most of application's settings are stored in system "defaults" (also known as NSUserDefaults).
That worked fine so far but there're some drawbacks there:
- defaults are almost impossible to edit by own hands
- it's hard to share them (no cmd+c / cmd+v)
- no cloud-based sync
- hard to make backups/reverts

So, I wanted to achieve the following for next configuration system:
- fast, lightweight (as Files is)
- plain text with comments, readable and editable
- possibility to share settings (like posting here on the forum)
- friendly to external editing (including cloud-based sync systems like Dropbox etc)

And thus, what is available now:
- JSON-based config
- Default settings stored in Files.app/Contents/Resources/Config.json and overwritten values (values that differs from defaults) are stored in ~/Library/Application Support/FIles/Config/Config.json
- saving and loading on the fly, overwrites config file can be edited with any text editor and changes will be immediately reflected in running Files
- most of current settings are migrated automatically

What next:
- move rest of options to plaintext readable&editable JSON (network connections settings, shortcuts, history etc)
- option to set ../Config/ directory to arbitrary place, like for instance placing it in shared Dropbox folder - so any running instances of Files (i.e. home/work machines for examples) will share the same config

What do you think on these coming changes?

Mike.

don
Posts: 134
Joined: Sat Jul 18, 2015 11:03 am
Location: Sydney, AU

Re: build 1437 - moving to new config system

Post by don » Wed Dec 23, 2015 8:20 am

Few observations.

Could be a good idea to have a way how to migrate the old settings into the new format - an utility of sorts? Or, being new to Mac, I am missing something obvious here.

Next - connection settings. Do I understand correctly that passwords are stored in Keychain?

Just checking.

don
Posts: 134
Joined: Sat Jul 18, 2015 11:03 am
Location: Sydney, AU

Re: build 1437 - moving to new config system

Post by don » Wed Dec 23, 2015 8:26 am

Ok, the only setting that went off is the panels and fonts.
Recovered.

Other settings seem to have been migrated.

don
Posts: 134
Joined: Sat Jul 18, 2015 11:03 am
Location: Sydney, AU

Re: build 1437 - moving to new config system

Post by don » Wed Dec 23, 2015 8:31 am

Ok. I like the idea.
Checked the file and moved them into backup folder - migrating this stuff will be quite easy.

All good!

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: build 1437 - moving to new config system

Post by darek » Wed Dec 23, 2015 10:06 am

Oh yeah! This is the kind of stuff I like. Easy to backup and share with others. Also allows you to add extra, advanced options available for people who like to tinker with stuff. Cool!

BTW, it looks like everything migrated fine on my side. But I haven't had many customizations, to be honest, so it was easy :)

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1437 - moving to new config system

Post by mike » Thu Dec 24, 2015 7:33 am

Guys,

Thanks for comments!

Passwords for network connections are currently stored in OS X Keychain (and that is Apple's recommended way), but I think it might be useful to allow storing (and thus editing) them in config files so they can be synchronised between multiple instances of Files.
However, that's a trade-off between usability and security, not sure what is right here.

BTW, there's already a plenty of options which can be tuned only by editing a config file.

Mike.

don
Posts: 134
Joined: Sat Jul 18, 2015 11:03 am
Location: Sydney, AU

Re: build 1437 - moving to new config system

Post by don » Sun Dec 27, 2015 3:38 am

Re passwords - from my perspective the Keychain is the best place to keep them.

What options are available through the file config only?

We desperately need a wiki!

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1437 - moving to new config system

Post by mike » Sun Dec 27, 2015 5:44 am

Don,

Yep, Keychain is quite convenient, but in case of shared config you'll have to enter passwords on every machine - that's the point of having password stored directly in config.
As for options available only in config - mostly that's a fine tuning like extensions white lists, but I expect more of them to come.
(you can take a look at Config.json itself, there're comments there and I think key names are self-explaining)
Wiki manual will be written, I plan to work on that direction after renaming Files and moving to new domain/website.

Mike.

grapte
Posts: 3
Joined: Mon Dec 28, 2015 1:44 pm

Re: build 1437 - moving to new config system

Post by grapte » Mon Dec 28, 2015 1:58 pm

Hello, I hope the JSON based config will be one of the options to interface with saved preferences, while File.app still maintaining proper format with system's default. The reason is because of uniformity; I use the system command "defaults," to set and manage all my preferences when possible (quite useful when setting up new users and moving to new macs), and it would be great for people like me who still follow the system developer's way of applying settings.

Cheers.

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1437 - moving to new config system

Post by mike » Tue Dec 29, 2015 5:12 pm

Hi grapte and welcome to forum!

Frankly I'm quite surprised with using defaults system for deploying/migration purposes.
IMHO defaults are not intended for this usage, are you running own scripts or some app to modify app's settings via defaults?

I think that copying a bunch of config files is much simpler approach for settings migration.

Speaking about Files - there were already some settings stored in ~/Library/Application Support/ directory, like hotkey overrides, external editors settings, viewer history and so on...

Mike.

Post Reply