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

Support for using Wireguard config files #3

Open
gaby opened this issue Sep 9, 2021 · 6 comments
Open

Support for using Wireguard config files #3

gaby opened this issue Sep 9, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@gaby
Copy link

gaby commented Sep 9, 2021

Are there plans to add support for Wireguard native config files instead of JSON?

@dadevel
Copy link
Owner

dadevel commented Sep 10, 2021

Do you know a library that can parse them? Previously I had a go with pythons built-in ini parser, but it doesn't handle repeated sections.

@dadevel dadevel added the enhancement New feature or request label Sep 10, 2021
@gaby
Copy link
Author

gaby commented Sep 13, 2021

@dadevel Probably this one: https://github.com/fictivekin/wireguard it has support for loading and writing WireGuard configs using Python.

@dadevel
Copy link
Owner

dadevel commented Sep 14, 2021

Maybe you can hack something together?

@gaby gaby closed this as completed Nov 25, 2021
@milahu
Copy link

milahu commented Aug 6, 2022

Previously I had a go with pythons built-in ini parser, but it doesn't handle repeated sections.

the configparser module supports repeated sections with strict=False

import configparser
config = configparser.ConfigParser(strict=False)

#config.read("config.ini")
config.read_string("""
[a]
a1=1

[a]
a2=2
""")

print(dict(config['a'])) # {'a1': '1', 'a2': '2'}

stackoverflow: Parsing configure file with same section name in python

edit: nope. multiple Interface or Peer sections should not be merged

@marek22k
Copy link
Contributor

Maybe reopen this issue as it is does not seems resolved?

@dadevel
Copy link
Owner

dadevel commented May 19, 2023

I wont work on this feature myself, because I don't have a use case for it, but I welcome every pull request.

@dadevel dadevel reopened this May 19, 2023
@dadevel dadevel added the help wanted Extra attention is needed label May 25, 2023
@dadevel dadevel self-assigned this May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants