cbeuw / Cloak

A censorship circumvention tool to evade detection by authoritarian state adversaries
GNU General Public License v3.0
3.29k stars 293 forks source link

Configuration file error: failed to read #178

Open SavvyEngineer opened 2 years ago

SavvyEngineer commented 2 years ago

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

anuradhapriyankara commented 2 years ago

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

anuradhapriyankara commented 2 years ago

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.

cbeuw commented 2 years ago

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)

anuradhapriyankara commented 2 years ago

@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.

cbeuw commented 2 years ago

@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

anuradhapriyankara commented 2 years ago

@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.

cbeuw commented 2 years ago

@anuradhapriyankara Thank you, glad to hear!