qcbqoucq Posted May 3, 2013 Report Share Posted May 3, 2013 i would like to secure webUI with password on linux. i followed the manual but it seems that i am doing something wrong, because i can still connect to webUI without the usn/pwd prompt.what i did (following the manual):1. i made a config file in the folder where the btsync binary is:./btsync --dump-sample-config > sync.conf2. i edited that config file:changed/* remove "listen" field to disable WebUIremove "login" and "password" fields to disable credentials check*/"webui" :{"listen" : "0.0.0.0:8888","login" : "admin","password" : "password"}to// remove "listen" field to disable WebUIremove "login" and "password" fields to disable credentials check//"webui" :{"listen" : "0.0.0.0:8888","login" : "admin","password" : "blahblahblah"}3. i also added the LAN encryption line to the end of the file:// LAN encryption"lan_encrypt_data": true4. restarted the deamon, connected to webui - without the password propmt!5. i also renamed the sync.conf file to sync.json. same result.please tell me what i am doing wrong...thanks! Quote Link to comment Share on other sites More sharing options...
stallemanden Posted May 3, 2013 Report Share Posted May 3, 2013 Are you remembering to do:./btsync --config sync.confIt's not enough just to restart the deamon or run it as ./btsync Quote Link to comment Share on other sites More sharing options...
affinity Posted May 3, 2013 Report Share Posted May 3, 2013 Did you start btsync with the config file command line option?./btsync --config ./btsync.confI created a config file in a similar manner and it does ask for login details.I also made the permissions on the conf file 600 and run as an ordinary user. Quote Link to comment Share on other sites More sharing options...
qcbqoucq Posted May 3, 2013 Author Report Share Posted May 3, 2013 thanks! now it works. (followed the first suggestion)now i have another problem. adding the line that enables encryption over LAN does something bad to the config file.i added this to the very end of the .config file (as suggested in the manual):// LAN encryption"lan_encrypt_data": trueand got an error when starting the deamon:Error while parsing config file: parse error: after key and value, inside map, I expect ',' or '}' Guide. // LAN encryption "lan_encrypt_data": true } (right here) ------^any suggestion? Quote Link to comment Share on other sites More sharing options...
qcbqoucq Posted May 3, 2013 Author Report Share Posted May 3, 2013 also, i can't set btsync to automatically start at start up with .conf file.i put this line to startup manager on my ubuntu computer, but this doesn't start the deamon:/home/user/btsyncfolder/btsync --config sync.conf Quote Link to comment Share on other sites More sharing options...
stallemanden Posted May 3, 2013 Report Share Posted May 3, 2013 thanks! now it works. (followed the first suggestion)now i have another problem. adding the line that enables encryption over LAN does something bad to the config file.i added this to the very end of the .config file (as suggested in the manual):// LAN encryption"lan_encrypt_data": trueand got an error when starting the deamon:Error while parsing config file: parse error: after key and value, inside map, I expect ',' or '}' Guide. // LAN encryption "lan_encrypt_data": true } (right here) ------^any suggestion?My best guess is, that you put it outside the last } ? Quote Link to comment Share on other sites More sharing options...
qcbqoucq Posted May 3, 2013 Author Report Share Posted May 3, 2013 nope, } is the last on the list. Quote Link to comment Share on other sites More sharing options...
affinity Posted May 3, 2013 Report Share Posted May 3, 2013 Did you try putting a comma at the end of the line? Quote Link to comment Share on other sites More sharing options...
Automatic Coding Posted May 3, 2013 Report Share Posted May 3, 2013 Post your full configuration, minus the port/user/pass.make sure it's in the following json format:-http://www.json.org/ Quote Link to comment Share on other sites More sharing options...
eseelke Posted May 3, 2013 Report Share Posted May 3, 2013 also, i can't set btsync to automatically start at start up with .conf file.i put this line to startup manager on my ubuntu computer, but this doesn't start the deamon:/home/user/btsyncfolder/btsync --config sync.confWhere is your sync.conf? You need the full path/home/user/btsyncfolder/btsync --config /home/user/btsyncfolder/sync.conf Quote Link to comment Share on other sites More sharing options...
qcbqoucq Posted May 3, 2013 Author Report Share Posted May 3, 2013 Did you try putting a comma at the end of the line?if i do that i get this:Error while parsing config file: Unexpected end of config file (are you missing '}') ? Quote Link to comment Share on other sites More sharing options...
Automatic Coding Posted May 3, 2013 Report Share Posted May 3, 2013 if i do that i get this:Error while parsing config file: Unexpected end of config file (are you missing '}') ?Please post the full configuration, replace any personal information with ***. Quote Link to comment Share on other sites More sharing options...
qcbqoucq Posted May 3, 2013 Author Report Share Posted May 3, 2013 Post your full configuration, minus the port/user/pass.make sure it's in the following json format:-http://www.json.org/here it is:{"device_name": "nameofmymachine","listening_port" : 0, // 0 - randomize port/* storage_path dir contains auxilliary app filesif no storage_path field: .sync dir created in the directorywhere binary is located.otherwise user-defined directory will be used*/"storage_path" : "/home/myusername/mybtsyncfolder/.sync",// uncomment next line if you want to set location of pid file// "pid_file" : "/var/run/syncapp/syncapp.pid","check_for_updates" : true,"use_upnp" : true, // use UPnP for port mapping/* limits in kB/s0 - no limit*/"download_limit" : 0, "upload_limit" : 0,// remove "listen" field to disable WebUI// remove "login" and "password" fields to disable credentials check//"webui" :{"listen" : "0.0.0.0:8888","login" : "myusn","password" : "mypwd" }/* !!! if you set shared folders in config file WebUI will be DISABLED !!!shared directories specified in config fileoverride the folders previously added from WebUI.*//*,"shared_folders" :[{// use --generate-secret in command line to create new secret "secret" : "MY_SECRET_1", // * required field "dir" : "/home/user/bittorrent/sync_test", // * required field// use relay server when direct connection fails "use_relay_server" : true, "use_tracker" : true, "use_dht" : false, "search_lan" : true,// enable sync trash to store files deleted on remote devices "use_sync_trash" : true,// specify hosts to attempt connection without additional search "known_hosts" : [ "192.168.1.2:44444", "myhost.com:6881" ]}]*/// Advanced preferences can be added to config file.// Info is available in BitTorrent Sync User Guide.// LAN encryption"lan_encrypt_data": true} Quote Link to comment Share on other sites More sharing options...
Automatic Coding Posted May 3, 2013 Report Share Posted May 3, 2013 here it is:-snip-Try adding a comma after:-"mypwd"}So that it's:-"mypwd"},EDIT:- Here's a comment free updated version with real tabs:-http://pastebin.com/raw.php?i=mC9fcPbX Quote Link to comment Share on other sites More sharing options...
qcbqoucq Posted May 3, 2013 Author Report Share Posted May 3, 2013 thank you, @Automatic Coding, that worked! thank you also, eseelke, you were right too! Quote Link to comment Share on other sites More sharing options...
cyanarnofsky Posted June 21, 2013 Report Share Posted June 21, 2013 Having same issue with no login prompt before webUI. Followed this from top to bottom.{ "device_name": "***", "listening_port" : 0, // 0 - randomize port/* storage_path dir contains auxilliary app files if no storage_path field: .sync dir created in the directory where binary is located. otherwise user-defined directory will be used*/ "storage_path" : "/home/cyanarnofsky",// uncomment next line if you want to set location of pid file// "pid_file" : "/var/run/btsync/btsync.pid", "check_for_updates" : true, "use_upnp" : true, // use UPnP for port mapping/* limits in kB/s 0 - no limit*/ "download_limit" : 0, "upload_limit" : 0,/* remove "listen" field to disable WebUI remove "login" and "password" fields to disable credentials check*/ "webui" : { "listen" : "0.0.0.0:8888", "login" : "***", "password" : "***" }/* !!! if you set shared folders in config file WebUI will be DISABLED !!! shared directories specified in config file override the folders previously added from WebUI.*//* , "shared_folders" : [ {// use --generate-secret in command line to create new secret "secret" : "MY_SECRET_1", // * required field "dir" : "/home/user/bittorrent/sync_test", // * required field// use relay server when direct connection fails "use_relay_server" : true, "use_tracker" : true, "use_dht" : false, "search_lan" : true,// enable sync trash to store files deleted on remote devices "use_sync_trash" : true,// specify hosts to attempt connection without additional search "known_hosts" : [ "192.168.1.2:44444" ] } ]*/// Advanced preferences can be added to config file.// Info is available in BitTorrent Sync User Guide.}Start using:./btsync --config ./btsync.conf( I know it is using the config due to name)but I still go directly into the UI no prompt. I tried adding the comma after the pwd but I get that same errorError while parsing config file: Unexpected end of config file (are you missing '}') ?Thanks for any help Quote Link to comment Share on other sites More sharing options...
cyanarnofsky Posted June 22, 2013 Report Share Posted June 22, 2013 Just to clear,1: ./btsync --dump-sample-config > sync.confThen used Nano to edit, tried "mypwd"}, that just gave me that same error:Error while parsing config file: Unexpected end of config file (are you missing '}') ?any ideas? I noticed someone sent previous person a non tabbed version that worked, possible get re up to pastebin?I used nano through terminal so that shouldn't be the problem....:/ran it as a .conf and .json neither work with or without the comma.get this errorParse error on line 3:...ening_port": 0, //0-randomizeport/*s----------------------^Expecting 'STRING' Quote Link to comment Share on other sites More sharing options...
sirphilip Posted July 18, 2013 Report Share Posted July 18, 2013 Just to clear,1: ./btsync --dump-sample-config > sync.confThen used Nano to edit, tried "mypwd"}, that just gave me that same error:Error while parsing config file: Unexpected end of config file (are you missing '}') ?any ideas? I noticed someone sent previous person a non tabbed version that worked, possible get re up to pastebin?I used nano through terminal so that shouldn't be the problem....:/ran it as a .conf and .json neither work with or without the comma.get this errorParse error on line 3:...ening_port": 0, //0-randomizeport/*s----------------------^Expecting 'STRING'I am also experiencing this, did you ever find a solution? Quote Link to comment Share on other sites More sharing options...
Mang Posted July 29, 2013 Report Share Posted July 29, 2013 Add one more with the same problems. I've followed all the steps above, and get the same error messages.I've had a look through, and can't see any stray commas or brackets. I don't know JSON though Quote Link to comment Share on other sites More sharing options...
dswd Posted July 29, 2013 Report Share Posted July 29, 2013 To all of you that get parsing errors on lines with comments. Please try to put the comment on the next line or remove it completely. JSON normally does not allow comments at all and I suspect there are bugs in the code that parses the comments out of the config file. (If it was OpenSource I would invest a few minutes to write a proper parser...) Quote Link to comment Share on other sites More sharing options...
djf Posted July 31, 2013 Report Share Posted July 31, 2013 Guys, please post an example of a working conf file.The pastebin mentioned earlier has been removed.I came up with this config, but it doesn't work, because the parser expects a "}" and I cant get how is it possible. { "device_name": "My Sync Device", "listening_port" : 0, "storage_path" : "/home/user/.sync", "check_for_updates" : true, "use_upnp" : true, "download_limit" : 0, "upload_limit" : 0, "listen" : "0.0.0.0:8888", "login" : "admin", "password" : "password", "use_relay_server" : true, "use_tracker" : true, "use_dht" : false, "search_lan" : true, "use_sync_trash" : true,} Quote Link to comment Share on other sites More sharing options...
nuclearcanary Posted July 31, 2013 Report Share Posted July 31, 2013 Remove the trailing comma."use_sync_trash" : true,should be"use_sync_trash" : trueThe built in parser expects another key:value pair when it sees a comma. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.