Bad sync.conf file


Recommended Posts

I decided to use the conf file rather than the webui today for a little bit more security. But, when I enter my info into the file, btsync will not start. I get the following error:

Error while parsing config file: Unexpected end of config file (are you missing '}') ?

Here is my conf file:


{
"device_name": "Linux Server",
"listening_port" : 0,
"storage_path" : "/bin/.sync",
// "pid_file" : "/var/run/syncapp/syncapp.pid",
"check_for_updates" : true,
"use_upnp" : true,
"download_limit" : 0,
"upload_limit" : 0,

"shared_folders" :
[
{
// use /bin/btsync --generate-secret in command line to create new secret
"secret" : "SECRETKEY",
"dir" : "/home/folder1",
"use_relay_server" : true,
"use_tracker" : true,
"use_dht" : false,
"search_lan" : true,
"use_sync_trash" : false,
"known_hosts" :
[
"192.168.1.2:44444",
"myhost.com:6881"
]
}
{
"secret" : "SECRETKEY",
"dir" : "/home/folder2",
"use_relay_server" : true,
"use_tracker" : true,
"use_dht" : false,
"search_lan" : true,
"use_sync_trash" : false,
"known_hosts" :
[
"192.168.1.2:44444",
"myhost.com:6881"
]
}
{
"secret" : "SECRETKEY",
"dir" : "/home/folder3",
"use_relay_server" : true,
"use_tracker" : true,
"use_dht" : false,
"search_lan" : true,
"use_sync_trash" : false,
"known_hosts" :
[
"192.168.1.2:44444",
"myhost.com:6881"
]
}
]
}

Any ideas as to what is not right?

Eddie

Link to comment
Share on other sites

Any idea where I would put that?

This conf file works:


"device_name": "Linux Server",
"listening_port" : 0,
"storage_path" : "/bin/.sync",
// "pid_file" : "/var/run/syncapp/syncapp.pid",
"check_for_updates" : true,
"use_upnp" : true,
"download_limit" : 0,
"upload_limit" : 0,

"shared_folders" :
[
{
// use /bin/btsync --generate-secret in command line to create new secret
"secret" : "SECRETKEY",
"dir" : "/home/folder1",
"use_relay_server" : true,
"use_tracker" : true,
"use_dht" : false,
"search_lan" : true,
"use_sync_trash" : false,
"known_hosts" :
[
"192.168.1.2:44444",
"myhost.com:6881"
]
}
]
}

Link to comment
Share on other sites

Actually, I'd suggest some of the hacks below to make it work a bit more like a proper configuration file format (rather than whatever json is).

So there's commas at the start of every line so you can c&p or comment out any line you like without breaking the format.

The "shared_folders" sections are completely independent. so you just repeat the section if you have another share or comment out if you want to remove one.

The webui bit is on a single line so it's easy to comment out with the "/*" at the end of the line to work around the problem that the webui turns itself off when there's a share in the file.

There's not much I can do about the "line noise" like collection of special characters that are required though.

Wishlist request: Use simple format that's nowhere near as easy to get wrong!


{ "device_name": "My Test Host"

,"listening_port" : 12345
,"storage_path" : "/home/btsync/syncstate"
,"check_for_updates" : false
,"use_upnp" : false
,"download_limit" : 0
,"upload_limit" : 0

// , "webui" : { "listen" : "0.0.0.0:8888", "login" : "admin", "password" : "Pa55w0rD" } /*

,"shared_folders" :[{
"secret" : "R27WAH4LQCGDFOGS7NLQYLQPXW5TRCW5"
,"dir" : "/home/btsync/cats"
,"use_relay_server" : false
,"use_tracker" : true
,"use_dht" : true
,"search_lan" : true
,"use_sync_trash" : true
}]

,"shared_folders" :[{
"secret" : "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
,"dir" : "/home/btsync/zero"
,"use_relay_server" : false
,"use_tracker" : true
,"use_dht" : true
,"search_lan" : true
,"use_sync_trash" : false
}]

// End of WEBUI comment */

// ,"lan_use_tcp" : true

/*
,"shared_folders" :[{
"secret" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
,"dir" : "/home/btsync/zero"
,"use_relay_server" : false
,"use_tracker" : true
,"use_dht" : true
,"search_lan" : true
,"use_sync_trash" : false
}]
*/

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.