towalink / wgconfig Goto Github PK
View Code? Open in Web Editor NEWparsing and writing WireGuard configuration files (comment preserving)
License: GNU Affero General Public License v3.0
parsing and writing WireGuard configuration files (comment preserving)
License: GNU Affero General Public License v3.0
I try to use this in Django project but i encounter this error:
[Errno 13] Permission denied: '/etc/wireguard/wg0.conf'
how can i fix it?
thank you.
I'm unfamiliar with the license you chose.
If I used this project, I understand I would need to attribute you that I'm using it, and make the source available upon request.
What I don't understand is, would I need to use the same license for the larger project, which uses your program, or would I be able to use your program, and license my program which uses your program anyway I want, as long as I.
Attribute you/this project, as well as make the source available
The formatting on this question is all wrong, if you don't understand what I'm asking, please let me know.
At the moment it's unclear how the module deals with multiple Address lines in the Interface section in case there is a IPv4 and IPv6 address. It seems like keys should be unique in the [Interface] section which wouldn't match with what is allowed and exists in realworld scenarios.
I wanted to check before doing a PR for documentation, but I don't believe there's any docs about needing the wg-tools (which isn't necessarily required to run wireguard since it's integrated into Linux kernels) to be installed for using wgexec.py.
While I know, and most people will know, it might not hurt to have it explicitly called out.
Do you have any preference for the specific location to call that out if I was to do a PR for this project? (that is if you're accepting PRs).
If I run this code on a configfile - an unhandled exception occurs.
Traceback (most recent call last):
File "/home/erik/dwellir/wireguard-sub/wgconf.py", line 30, in
mana()
File "/home/erik/dwellir/wireguard-sub/wgconf.py", line 23, in mana
wc.del_attr(None,'ListenPort')
File "/home/erik/dwellir/wireguard-sub/venv/lib/python3.10/site-packages/wgconfig/init.py", line 248, in del_attr
if self.lines[i][0] == '#':
IndexError: string index out of range
It would be good to handle that exception and let a user know to have remove_leading_comments=False
import wgconfig
def removeAttr():
wc = wgconfig.WGConfig('./wg0.conf')
wc.read_file()
print(wc.interface)
# wc.del_attr(None,'PrivateKey')
wc.del_attr(None,'ListenPort', remove_leading_comments=False)
# wc.add_attr(None, 'PrivateKey', 'XXXXXXXXXXXXXXXXXXXXXXXXXXX=')
wc.write_file()
def removeAttrFail():
wc = wgconfig.WGConfig('./wg0.conf')
wc.read_file()
print(wc.interface)
# wc.del_attr(None,'PrivateKey')
wc.del_attr(None,'ListenPort')
# wc.add_attr(None, 'PrivateKey', 'XXXXXXXXXXXXXXXXXXXXXXXX=')
wc.write_file()
removeAttr()
removeAttrFail()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.