Comments (4)
The VPN server features are stored as bitflags, but the CLI does not support decoding them, simply mapping every feature to a value instead. This causes the issue described above when a server supports multiple features.
After some digging, I found that the feature flags are defined in proton-vpn-session/servers/types.py
class ServerFeatureEnum(IntFlag):
"""
A Class representing the Server features as encoded in the feature flags field of the API:
"""
SECURE_CORE = 1 << 0 # 1
TOR = 1 << 1 # 2
P2P = 1 << 2 # 4
STREAMING = 1 << 3 # 8
IPV6 = 1 << 4 # 16
For example the 12 seen in KeyError: 12
would correspond to the server features P2P (4) + STREAMING (8).
I'm going to implement handling for this and submit a PR.
from linux-cli-community.
Im experiencing the same thing. Also using the latest version from the AUR.
from linux-cli-community.
A detail I didn't mention is that if it's disconnected the command runs as expected. Only happens under a vpn connection.
from linux-cli-community.
It seems that the feature key does not match the hardcoded all_features
map anymore.
connection.py:
# Collect Information
all_features = {0: "Normal", 1: "Secure-Core", 2: "Tor", 4: "P2P"}
logger.debug("Collecting status information")
country_code = get_server_value(connected_server, "ExitCountry", servers)
country = get_country_name(country_code)
city = get_server_value(connected_server, "City", servers)
load = get_server_value(connected_server, "Load", servers)
feature = get_server_value(connected_server, "Features", servers)
last_connection = get_config_value("metadata", "connected_time")
connection_time = time.time() - int(last_connection)
if os.path.isfile(os.path.join(CONFIG_DIR, "iptables.backup")):
killswitch_on = True
else:
killswitch_on = False
killswitch_status = "Enabled" if killswitch_on else "Disabled"
# Turn time into human readable format and trim microseconds
connection_time = str(datetime.timedelta(
seconds=connection_time)).split(".")[0]
tx_amount, rx_amount = get_transferred_data()
# Print Status Output
logger.debug("Printing status")
print(
"Status: Connected\n"
+ "Time: {0}\n".format(connection_time)
+ "IP: {0}\n".format(ip)
+ "Server: {0}\n".format(connected_server)
+ "Features: {0}\n".format(all_features[feature])
+ "Protocol: {0}\n".format(connected_protocol.upper())
+ "Kill Switch: {0}\n".format(killswitch_status)
+ "Country: {0}\n".format(country)
+ "City: {0}\n".format(city)
+ "Load: {0}%\n".format(load)
+ "Received: {0}\n".format(rx_amount)
+ "Sent: {0}".format(tx_amount)
)
I'll look further into this, I might be able to submit a fix
from linux-cli-community.
Related Issues (20)
- [Enhancement] Support other inits HOT 1
- Vintage is gold - install and usage combined with official release
- [Enhancement] WSL host support?
- Can't use CLI application HOT 9
- Error Getting VPN State [BUG] HOT 2
- [BUG] Many UDP free servers no longer connecting
- [BUG] - Install on Debian 12 (Bookworm) HOT 2
- [BUG] Protonvpn goes out to lunch randomly. HOT 1
- Any updated fork? HOT 2
- Is it possible to specify a static IP address? HOT 1
- [BUG] Crush on GitHub Codespaces
- Cannot connect to US free servers
- [Query] each install needs to be unique?
- [BUG] There was an error connecting to the ProtonVPN API. HOT 16
- `Please install ip.` WTF?[BUG] HOT 3
- Log Spam & lack of function on Slackware-Current HOT 3
- [Enhancement] Use a Python script to connect and disconnect
- READ.ME: Does NOT support MX Linux 19+ or Archlinux / Manjaro
- Reconnection issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linux-cli-community.