Hi! What about to make feature for export all network connections to CSV format and import in this format. (even with passwords)
It's not secure, but very convenient for move configuration between machines.
Thank you!
Export network connections
Re: Export network connections
Hey,
It's possible to implement this functionality without changing NC itself.
A relatively straightforward Python script could traverse a JSON in "~/Library/Application Support/Nimble Commander/Config/NetworkConnections.json", gather the connections and their names, and then find the according passwords in Keychain Access.
It's unlikely I'll add this directly to NC anytime soon.
It's possible to implement this functionality without changing NC itself.
A relatively straightforward Python script could traverse a JSON in "~/Library/Application Support/Nimble Commander/Config/NetworkConnections.json", gather the connections and their names, and then find the according passwords in Keychain Access.
It's unlikely I'll add this directly to NC anytime soon.
Re: Export network connections
I would just copy NC's NetworkConnetions.json to the other Mac, and sync (or copy) the login.keychain.
A script would probably need to look something like this:
Reading the passwords from the keychain is possible, of course, but you'd have to type in your admin password twice for every entry, which is a pita if you have a lot of NC connections stored.
However, what Nimble Commander could do differently, is to use its own keychain file instead of the login.keychain. Then users could easily transfer connection passwords to a new Mac while at the same time being able to start with a fresh login.keychain.
A script would probably need to look something like this:
Code: Select all
#!/bin/zsh
csvloc="$HOME/ncconns.csv"
echo "#id,type,title,uuid,user,host,ftp path,sftp keypath,network share,local mountpoint,port,network share proto" > "$csvloc"
conncount=0
while read -r ctype ctitle cuuid cuser chost cpath ckeypath cshare cmountpoint cport cproto ; do
((conncount++))
echo "$conncount,${ctype},${ctitle},${cuuid},${cuser},${chost},${cpath},${ckeypath},${cshare},${cmountpoint},${cport},${cproto}" >> "$csvloc"
done < <(jq --raw-output '.connections[] | "\(.type) \(.title) \(.uuid) \(.user) \(.host) \(.path) \(.keypath) \(.share) \(.mountpoint) \(.port) \(.proto)"' < "$HOME/Library/Application Support/Nimble Commander/Config/NetworkConnections.json")
However, what Nimble Commander could do differently, is to use its own keychain file instead of the login.keychain. Then users could easily transfer connection passwords to a new Mac while at the same time being able to start with a fresh login.keychain.