Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protonvpn wireguard config downloader #47

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

elfkuzco
Copy link
Collaborator

Changes

  • add script to automatically download wireguard configuration files for all available VPN servers

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.66%. Comparing base (0c088e1) to head (45b4e65).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #47   +/-   ##
=======================================
  Coverage   69.66%   69.66%           
=======================================
  Files          30       30           
  Lines         946      946           
  Branches       93       93           
=======================================
  Hits          659      659           
  Misses        267      267           
  Partials       20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@elfkuzco elfkuzco requested a review from rgaudin August 31, 2024 21:31
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you it's great and functional but I'd like a bit more details as comments.

That notion of port is unclear to me. What would one care about it? What are the consequences of picking one or not?

protonvpn-wireguard-config-downloader/README.md Outdated Show resolved Hide resolved
protonvpn-wireguard-config-downloader/pyproject.toml Outdated Show resolved Hide resolved
for server in session.server_list.logicals
if server.enabled and server.tier <= session.server_list.user_tier
)
return (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a comment here about how data is organized in their API so it's easier to maintain this in a year :)
I also recall that the UI mentions an expiration date. Are those ones expiring at some point? When?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, regarding this. I can't see a parameter for configuring the timeline. On the web browser, the credentials don't show either. I checked out their desktop code and there wasn't expiration set. It was simply saving the files to disk and updating them whenever the connection settings changed. In their case, there was only one configuration file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing I noticed was that the web client used a serial number for the configuration files but I didn't see similar code used in other clients. Also, the clients config when created on the web expires when their plan is inactive. I assume the same applies for the configs generated by this script.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make a different PR depending on what I find out about this.

@elfkuzco
Copy link
Collaborator Author

elfkuzco commented Sep 2, 2024

Thank you it's great and functional but I'd like a bit more details as comments.

That notion of port is unclear to me. What would one care about it? What are the consequences of picking one or not?

Our wireguard configuration from the worker-manager is configured to use a specific port for routing traffic, 51820 by default. When I fetch the client's config from ProtonVPN, there are other ports available for wireguard e.g 443, etc. So, when I try to write the configuration file using the template provided by ProtonVPN library, they end up picking up the first available port e.g 443 and if it's not the same port used on the worker-manager, then it won't work.

@rgaudin
Copy link
Member

rgaudin commented Sep 2, 2024

OK, please add it in the README

@elfkuzco elfkuzco merged commit d562d0f into main Sep 2, 2024
5 checks passed
@elfkuzco elfkuzco deleted the protonvpn-wireguard-config-downloader branch September 2, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants