dougbw / coredns_omada Goto Github PK
View Code? Open in Web Editor NEWCoreDNS plugin for TP-Link Omada SDN
License: Apache License 2.0
CoreDNS plugin for TP-Link Omada SDN
License: Apache License 2.0
Hi,
Apologies - this may be me, but ... after the build, and configure, I end up with this error when trying to run coredns,
plugin/omada: site not found:
Any thoughts?
Thanks!
Hey, thanks for this :), really appreciate it, I no longer have to use local script :)
I have a question, any plans on implementing API V2 ?
So we could switch from using account to using client/secret pair ?
Also, I would appreciate if there was a way/option for this to only serve for PTR entries, without any upstream, would that be possible.
Hi,
I just updated to Omada v5.12 (officially released), and now coredns_omada seems to have issues? Or at least, I don't see to have local name resolution.
Is there a way to check for this, help debug?
Thanks!
I can't seem to figure out how to set this outside of docker
and I can't get the docker image to run but I was able to build
and run coredns and the plugin
This really isn't an issue with coredns_omada per se, but I'm putting this out there in case someone else struggles to get the reload plugin to work. Maybe the documentation can be updated?
The issue, related to Docker, is described in detail here https://dev.to/robbmanes/running-coredns-as-a-dns-server-in-a-container-1d0
Basically, placing Corefile in a directory and mounting the directory as a volume and passing the config on the command line solves it.
ie. copy Corefile to /home/mikepell/root then mount that folder to /root in the container
docker run --name coredns --restart=always --volume=/home/mikepell/root/:/root --env OMADA_DISABLE_HTTPS_VERIFICATION="true" -p 53:53/udp ghcr.io/dougbw/coredns_omada -conf /root/Corefile
I have 2 sites configured on an OC200. There is a site-to-site always on VPN between the two sites. As a result, clients on one site subnet can communicate directly with clients on the other. Is there a way in the config/env variables to specify that coredns-omada should read the client entries for both sites off the controller? e.g. using a list [“site_one”, “site_two”]
Alternatively, can I run a second instance of coredns-omada (listening on a port other than 53) which serves as the nameserver for the second site and then chain the upstream nameservers from first coredns to second to 8.8.8.8? (or, instead of chaining, just add the second coredns instance to a list of upstream resolvers for the first instance) . Thanks.
I tried to get it working with the ER7212PC which is the omada router with integrated controller. But it does not seem to work. I could not find any info if this device even has an API..... :-(
Firstly, thank you for doing what TP-Link could not... great work.
QUESTION. How do I add a A or CNAME record.
I have a couple of services I need to define and I've not managed to work out how to do it.
Freely admit I have no idea what I'm doing... but I do appreciate your work.
The plugin has worked a treat for my local DNS woes! I'm currently running it in Docker (Portainer) on a Raspberry Pi 4.
Unfortunately, my Pi OS is 32 bit and thus only runs armv7 based images, so I couldn't just pull the images on DockerHub.
Would it be possible to add linux/arm/v7
images, or add the arch to the multi-platform images?
No changes are required on the docker buildx
side other than adding --platform linux/arm/v7
, which worked perfectly for me (i.e. docker buildx build --platform linux/arm/v7 -t coredns-omada .
).
I love this plugin, but would it be possible to add a feature where the plugin loads a list of CNAME records for my local network zone?
for example, I have a local server with multiple services running in docker including an NGINX reverse proxy on port 80/443 that forwards traffic to the correct port depending on hostname of HTTP/S request. For this to solution to work multiple hostnames must resolve to the same IP.
In this example the A record would be populated from the omada clients list:
server.omada.home A 10.0.0.5
to get the reverse proxy to route to the correct container, I would need a CNAME (or A) record to be added to the local zone too:
smokeping.omada.home CNAME server.omada.home
Getting panic error while updating zones.
Maybe a null ip on a client on omada... We have a few of those
`[INFO] plugin/omada: logging in...
[INFO] plugin/omada: found '1' sites: [MySite]
[INFO] plugin/omada: update: updating zones...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x563220]
goroutine 1 [running]:
net.networkNumberAndMask(0xc000bf64f0?)
/usr/local/go/src/net/ip.go:498
net.(*IPNet).Contains(0xc000bf64f0?, {0xc0008e6930, 0x10, 0x19?})
/usr/local/go/src/net/ip.go:522 +0x27
github.com/dougbw/coredns_omada.(*Omada).updateZones(0xc0002fe480, {0x1?, 0x21d806a?})
/coredns_omada/update.go:141 +0x12c6
github.com/dougbw/coredns_omada.setup(0xc000052990)
/coredns_omada/setup.go:52 +0x6cb
github.com/coredns/caddy.executeDirectives(0xc00032c400, {0x7fff5f1eaecc, 0x15}, {0x3749d40, 0x35, 0x203000?}, {0xc00031bd00, 0x1, 0x8?}, 0x0)
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:661 +0x5dd
github.com/coredns/caddy.ValidateAndExecuteDirectives({0x26becb8?, 0xc00070cb80}, 0x8?, 0x0)
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:612 +0x3ec
github.com/coredns/caddy.startWithListenerFds({0x26becb8, 0xc00070cb80}, 0xc00032c400, 0x0)
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:515 +0x272
github.com/coredns/caddy.Start({0x26becb8, 0xc00070cb80})
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:472 +0xe5
github.com/coredns/coredns/coremain.Run()
/coredns/coremain/run.go:66 +0x1cd
main.main()
/coredns/coredns.go:12 +0x17`
Trying to get this up and running for the first time. I set up all the environment variables correctly, as it does display the https://IP_address environment variable for the Omada controller successfully.
Yet all I get is connect: no route to host
spamming every second. What do I need to start debugging? Wondering if the virtual switch is routing traffic out to the LAN correctly.
Super appreciative of this project and the support you are providing us, @dougbw. This is a fantastic weekend project for those of us that want to map to device names around the house without having to resort to the dreaded hosts file hack.
Hi,
Is it possible to set the "Disable HTTPS validation" in the CoreDNS CoreFile, I tried both
disable-https-verification and disable_https_verification
This is probably not a real issue but imho it should be some how documented.
I had a trailing slash in my controller URL. This lead to coredna-omada not finding any sites and printed the following log:
[INFO] plugin/omada: logging in... [INFO] plugin/omada: found '0' sites: [] [INFO] plugin/omada: update: updating zones...
Login succeeded and no more (error) logs were printed. It didn't matter if I had the actual site name configured or ".*".
Removing the trailing slash fixed the problem and the site was found.
Hi,
I was wondering if there is a reason why devices are not added to reverse zone. So I gave it a try and added it in update.go to see if it would work and it actually did ;-)
If you think this makes sense I could fork the repo and file a PR if you prefer it, but as it's a simple copy/paste of code and some small adjustments, I wouldn't mind if you just add it yourself.
The other thing is that I would like to start a discussion as I want to see coredns-omada at an "earlier place" in the "plugin chain". Btw, I saw the other issue regarding not putting it right at the beginning and the suggestion to have it before forward, so I know why it is currently right before forward.
I would like to see it before file/auto or even hosts as I would like to have coredns-omada handle most of the request and fall back to file/auto or even hosts for requests which are not "in omada clients/devices". The way it works in file/auto is, that the plugins are authoritive for whatever (sub-)domain the zone is configured for and wouldn't pass along the "plugin chain" if they can't handle the query. So they will not pass any query to coredns-omada. That would completely 'disable' coredns-omada for the sub-domain(s) in question. So I would like coredns-omada to handle most queries it can from 'clients/devices' and pass 'the rest' to file/auto which handle some fixed entries I added to zone files (or maybe to hosts bit preferably to file/auto). And for that coredns-omada would need to be before the other plugins in the chain.
Hope this makes sense.
Regards
@dougbw ,
Maybe this is just me but if my controller is unavailable for some reason, the plugin refresh process seems to cause coredns
to crash.
I am not familiar with coredns plugins, but is there a way to gracefully handle an offline controller? Perhaps just log the failure instead? That way clients can continue to get external resolution while the controller comes back online.
(I also really appreciate your efforts here. The plugin is super useful for me.)
/coredns$ sudo make
go generate coredns.go
./directives_generate.go:103:11: undefined: os.WriteFile
note: module requires Go 1.20
coredns.go:3: running "go": exit status 2
make: *** [Makefile:22: core/plugin/zplugin.go] Error 1
running software SDN Controller on proxmox lxc (latest version)
starting docker container results in an error
plugin/omada: plugin/omada: Get "https://192.168.10.100/api/info": dial tcp 192.168.10.100:443: connect: connection refused
running docker in seperate lxc using portainer
need to specify port cause HW Controller uses 443 , software controller 8043
see also
Hi,
As outlined at coredns/coredns#6262, it seems that this plugin should not be at the start of the config file, but rather right before forward
... agreed?
Thanks!
Hi there,
it sounds like a great solution you build. but i am currently not able to use it.
using the latest docker container with an omada software controller 5.13.23
added the corresponding variables to the docker run command, created the user in omada and i can confirm that the docker is connecting and logging into the omada controller.
after that i crashes immediately with this result in the logs.
searching the existing issues, this seems to relate to ipv6, but we only use ipv4, i was not able to find any ipv6 configuration in the omada controller.
Do you have any idea what is going wrong?
Thank you a lot
Regards
`panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5707e0]
goroutine 1 [running]:
net.networkNumberAndMask(0x0?)
/usr/local/go/src/net/ip.go:425
net.(*IPNet).Contains(0x0?, {0xc00091eb60, 0x10, 0x14?})
/usr/local/go/src/net/ip.go:449 +0x25
github.com/dougbw/coredns_omada.(*Omada).updateZones(0xc00099f560, {0x1?, 0x22ef893?})
/coredns_omada/update.go:144 +0x18bc
github.com/dougbw/coredns_omada.setup(0xc0009b0240)
/coredns_omada/setup.go:50 +0x7d9
github.com/coredns/caddy.executeDirectives(0xc000616100, {0x22d7859, 0x8}, {0x3a685c0, 0x35, 0x0?}, {0xc000560460, 0x1, 0x14ae9ce2f338?}, 0x0)
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:661 +0x61d
github.com/coredns/caddy.ValidateAndExecuteDirectives({0x287a680?, 0xc0009ba3c0}, 0x416b3c?, 0x0)
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:612 +0x3c5
github.com/coredns/caddy.startWithListenerFds({0x287a680, 0xc0009ba3c0}, 0xc000616100, 0x0)
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:515 +0x265
github.com/coredns/caddy.Start({0x287a680, 0xc0009ba3c0})
/go/pkg/mod/github.com/coredns/[email protected]/caddy.go:472 +0xd4
github.com/coredns/coredns/coremain.Run()
/coredns/coremain/run.go:66 +0x1c6
main.main()
/coredns/coredns.go:12 +0xf
[INFO] plugin/omada: logging in...`
Thanks for creating this awesome plugin!
Just set it up and noticed that it used the "name" of the client instead of the "hostname" as the DNS name. Any reason for this? It was a bit counterintuitive as I would have expected to be able to resolve by client hostname.
Thanks again!
Tried to get this up and running. I am running my Omada controller on a Pi - and seemingly cant set port 443 for the controller HTPPS port.
Is there a way to customise this to use my controller URL & port?
Thanks
I have a few security cameras I'd like to group together in a subdomain (as in [location].cam.[domain]
), currently the period gets stripped here, would be great to have the option to not strip a .
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.