This is a simple script that generates wireguard client config files for surfshark
You just need to curl
and jq
.
I'm using this to generate configs on openwrt.
To use this file:
- copy
config.json.sample
intoconfig.json
- replace
config.json
values with your account values. Normally user your "email" and "password" that you use on your official client on Android, iOS, or web, not specially OpenVpn username and password - run
gen_wg_config.sh
Usage: gen_wg_config.sh [-f]
-f force register ignore checking
-g ignore generating profile files
Please consider following caveates
As the date of writing this, each key pair expires in around 6 days so you need to rerun the script every now and then.
I suggest to run it in crontab every day, and with -g
parameter.
If you are not able to use the generated config files, there might be a chance that
there is an unhandleded corner case in wg_check_pubkey
function. I suggest you to
run the scring using -f
parameter to force the script to register the key pair
without chekcing if it exists.
- implement refresh token
- generate luci configuration