Skip to content

Commit

Permalink
reformat using black
Browse files Browse the repository at this point in the history
  • Loading branch information
khodedawsh committed Nov 3, 2024
1 parent c1b0f1c commit efd7b2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion v2share/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@
from .wireguard import WireGuardConfig
from .xray import XrayConfig

__all__ = ["V2Data", "SingBoxConfig", "ClashConfig", "ClashMetaConfig", "XrayConfig"]
__all__ = [
"V2Data",
"SingBoxConfig",
"ClashConfig",
"ClashMetaConfig",
"XrayConfig",
"WireGuardConfig",
]
2 changes: 2 additions & 0 deletions v2share/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def to_link(self):

if self.protocol == "wireguard":
payload = {"publickey": self.path, "address": self.client_address}
if isinstance(self.mtu, int):
payload.update({"mtu": self.mtu})
return (
"wireguard://"
+ f"{self.ed25519}@{self.address}:{self.port}?"
Expand Down
2 changes: 1 addition & 1 deletion v2share/wireguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def render(self, sort: bool, shuffle: bool) -> str:
config += "PrivateKey = " + proxy.ed25519 + "\n"
if proxy.mtu is not None:
config += "MTU = " + str(proxy.mtu) + "\n"
if proxy.dns_servers is not None:
if proxy.dns_servers:
config += "DNS = " + ",".join(proxy.dns_servers) + "\n"
config += "\n"
config += "[Peer]\nPublicKey = " + proxy.path + "\n"
Expand Down

0 comments on commit efd7b2f

Please sign in to comment.