Cloak icon indicating copy to clipboard operation
Cloak copied to clipboard

Configuration file error: failed to read

Open SavvyEngineer opened this issue 3 years ago • 7 comments

Hi thanks for this amazing project i cloned the repo and build but when i try to use the ck-server -c config file i get

Configuration file error: Failed to read configuration file: illegal base64 data at input byte 0

I even tried the exact example config file but still the same

and im using Centos

SavvyEngineer avatar Nov 23 '21 15:11 SavvyEngineer

@SavvyEngineer I'm facing the same issue on Ubuntu 20.04 Server. Have you found a solution for this?

anuradhapriyankara avatar Feb 17 '22 16:02 anuradhapriyankara

I have tested V2.0.0 and it worked as expected on Ubuntu 20.04. However none of the newer versions did. I'll be using V2.0.0 until devs fix the issue.

anuradhapriyankara avatar Feb 18 '22 17:02 anuradhapriyankara

The sample config is not meant to work (I suspected that people are using default UIDs and keys so I pulled it). If you look at its content you'll see placeholders asking you to provide your own UID and keys. https://github.com/cbeuw/Cloak/blob/847b7e24bf406b284dd7f008af26c205f81271d2/example_config/ckserver.json#L20-L25

You need to generate public key, private key and a UID following the steps in README https://github.com/cbeuw/Cloak#server-1:

You don't need to have the AdminUID field if you don't intend to add more than one users, just delete it from the JSON file, and put your UID in BypassUID (and in client config ofc)

cbeuw avatar Feb 18 '22 18:02 cbeuw

@cbeuw Actually I have generated my own private key, public key and Admin UID and replaced them in json configuration file yet the error still occurs. It seems to be occurring while unmarshalling the json configuration file into golang block. Here is a similar case on stackoverflow

Unfortunately I'm not a go lang developer so couldn't fix the issue myself. This might be something only happens on Linux. However, as I have already mentioned V2.0.0 doesn't have this issue and it works as expected on Ubuntu 20.04 server.

anuradhapriyankara avatar Feb 20 '22 15:02 anuradhapriyankara

@anuradhapriyankara The Stackoverflow question has the data in hex format (like 000daf177434acd55a3284787b793a3453c3d70eacdb9a84f5faed43adb2ff58), instead of Base64 format (like T4mu9oB7D9GOzXwUoFD/UNps3JfJW2dv7RlhpiqmImc=). Which format is yours in? Cloak currently only accepts UIDs and keys in Base64. This is also what ck-server -key and ck-server -uid displays

cbeuw avatar Feb 20 '22 15:02 cbeuw

@cbeuw Just checked again and realized I have left BypassUID as "-" instead of just "". My bad. Latest version works well. I have used an older configuration template with V2.0.0 so that's why it worked. Sorry for the confusion.

Great project and keep up the good work! This has been really useful for me to bypass speed limits imposed upon certain applications by my ISP.

anuradhapriyankara avatar Feb 20 '22 16:02 anuradhapriyankara

@anuradhapriyankara Thank you, glad to hear!

cbeuw avatar Feb 20 '22 17:02 cbeuw