Comments (9)
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
from docker-wireguard.
No idea what that .env
is meant to accomplish but the variable is explained here: https://github.com/linuxserver/docker-wireguard?tab=readme-ov-file#site-to-site-vpn
from docker-wireguard.
Sure, this is a feature request.
The .env file is supported by docker to add enviromental variables during docker deploy. Docker .env doc.
For now, to make a site-to-site, there must be individuals calls for each client:
SERVER_ALLOWEDIPS_PEER_laptop="192.168.1.0/24,192.168.2.0/24"
SERVER_ALLOWEDIPS_PEER_smartphone="192.168.1.0/24,192.168.3.0/24"
SERVER_ALLOWEDIPS_PEER_desktop="192.168.1.0/24,192.168.4.0/24"
For 3 clients, this is ok to admin. When this number grows a bit, it is kind of difficult to track.
My suggestion is to make like peer declaration, by comma separated.
PEERS_CLIENT="laptop,smartphone,desktop"
The problem is that subnets are comma separated.
Is is possible to reimplement this line to identify different clients with dot-comma?
In other words, map like peers:
from docker-wireguard.
so instead of setting
SERVER_ALLOWEDIPS_PEER_laptop="192.168.1.0/24,192.168.2.0/24"
SERVER_ALLOWEDIPS_PEER_smartphone="192.168.1.0/24,192.168.3.0/24"
SERVER_ALLOWEDIPS_PEER_desktop="192.168.1.0/24,192.168.4.0/24"
you want to set
SERVER_ALLOWEDIPS='laptop="192.168.1.0/24,192.168.2.0/24",smartphone="192.168.1.0/24,192.168.3.0/24",desktop="192.168.1.0/24,192.168.4.0/24"'
?
that barely saves any keystrokes, and the ones saved are all copy/pasteable. It would add a significant complication to the algorithm for virtually no gain.
from docker-wireguard.
IMHO this FR would only add complexity that we have to support. I am not in favor.
from docker-wireguard.
My suggestion is to keep the original var, but remap it as an array breaking by substring.
I will try to make some code for suggestions to clarify.
from docker-wireguard.
As an example:
I just want to merge all SERVER_ALLOWEDIPS_PEER_
in one variable as follows:
PEER_ALLOWEDIP="SERVER_ALLOWEDIPS_PEER_client1=10.254.1.0/24,SERVER_ALLOWEDIPS_PEER_client2=101.54.13.0/24,SERVER_ALLOWEDIPS_PEER_client3=110.254.11.0/24"
$ echo $PEER_ALLOWEDIP
SERVER_ALLOWEDIPS_PEER_client1=10.254.1.0/24,SERVER_ALLOWEDIPS_PEER_client2=101.54.13.0/24,SERVER_ALLOWEDIPS_PEER_client3=110.254.11.0/24
Now, I just need to extract the corresponding peer information:
PEER="client1"
substring=$(echo "$PEER_ALLOWEDIP" | grep -o "\bSERVER_ALLOWEDIPS_PEER_${PEER}=[^,]*")
echo "Substring for $PEER: $substring"
Substring for client1: SERVER_ALLOWEDIPS_PEER_client1=10.254.1.0/24
SERVER_ALLOWEDIPS
in
can be replaced by substring.
Of course my code is not good and is just to present a point.
If the variable is not defined, it looks for this new pattern, take the substring and change nothing else.
from docker-wireguard.
The way you describe it actually doesn't even save any keystrokes. I see no benefit to this, but a bunch of risk and development cost.
Plus, your suggestion would break if you try to add multiple comma separated ranges for a single peer.
Anyway, this is not something we will add due to high cost to benefit ratio.
from docker-wireguard.
Sure, thx anyway. I will try to find another way to fix my problem.
from docker-wireguard.
Related Issues (20)
- [BUG] The requested image's platform (linux/arm64) does not match the detected host platform (linux/arm/v8) HOT 2
- [BUG] SERVERPORT is being ignored HOT 2
- [BUG] Ping peers HOT 1
- [BUG] SERVER_ALLOWEDIPS_PEER_* include quotes inside AllowedIPs peer variable HOT 6
- [BUG] Improvement of the documentation of the ALLOWEDIPS parameter. HOT 2
- [FEAT] mDNS (Avahi) support through Wireguard HOT 2
- [FEAT] Always-OnKill Switch in Client-mode HOT 3
- [FEAT / BUG] <Modifiable 'ListenPort' used by host/wireguard incoming connections through docker configuration> HOT 8
- [BUG] Custom Server Port not taken into account in server.conf template HOT 3
- [BUG] starting with ~v1.0.20210914-ls116 cannot connect to wireguard HOT 3
- [BUG] Error generating QRCode - qrencode: command not found HOT 2
- [BUG] -ls23 and onwards has issue with adding iptables rules HOT 6
- [BUG] iptables v1.8.10 (legacy): can't initialize iptables table `filter' HOT 4
- [BUG] Conneted to the Wiregurad server, but no network connection on client side. HOT 3
- [BUG] Client IPs are all the container's host HOT 15
- [BUG] missing /32 in interface address HOT 14
- Old tags are wrong HOT 4
- [BUG] ListenPort = 51820 in default peer.conf disallows >1 peer through NAT loopback HOT 11
- [FEAT] [Peer] definition within generated wg0.conf should be templated HOT 10
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 docker-wireguard.