Allow user to download tunnel elements for manual configuration
User story: I am a privacy enthusiast. I want to download my tunnel configuration details, so that I can run my tunnel on an unsupported device / platform / client.
Suggested solution:
Steps that allow the user to:
- Easily install ldh_client
- Enter LDH credentials
- Retrieve tunnel certificate / credentials
- Read their client documentation to learn how to apply these
This should have minimal dependencies (e.g. pure Python, no system dependencies) so that it works on any system that supports Python (e.g. Windows).
Workaround:
The default certificate can be retrieved here https://librem.one/public/certificate.ovpn
This script can be used to retrieve your tunnel credentials. It was supplied by a community member, no support will be provided. These endpoints are subject to change. Use at your own risk.
#!/bin/bash
read -p "Librem One username: " user
read -s -p "Librem One passphrase: " passphrase
echo ""
data=$(curl -X GET "https://librem.one/api/v1/user/tunnel_account" -H "Authorization: Basic "$(echo -n "$user:$passphrase" | base64 -w 0) 2> /dev/null)
echo "$data" | grep "Invalid username/password." >/dev/null 2>/dev/null && echo "Invalid username/passphrase." && exit 1
echo "$data" | cut -d '"' -f 4 > pass
echo "$data" | cut -d '"' -f 8 >> pass