Git Product home page Git Product logo

coredns_omada's People

Contributors

dougbw avatar eckhbeck avatar jsoref avatar pduchnovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coredns_omada's Issues

Site not found

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!

Omada OpenAPI

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.

Issues with Omada v5.12

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!

disable https verification

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

Reload plugin does not work with Docker and custom Corefile

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

Multiple Sites on one Omada Controller

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.

Not working with ER7212PC

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..... :-(

Is it possible to add A and CNAME records

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.

linux/arm/v7 Docker image support for Raspberry Pi

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 .).

Feature Request: CNAME records

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

updateZones() panic: runtime error: invalid memory address or nil pointer dereference

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`

no route to host

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.

Disable HTTPS validation in CoreFile

Hi,

Is it possible to set the "Disable HTTPS validation" in the CoreDNS CoreFile, I tried both

disable-https-verification and disable_https_verification

"found '0' sites: []" if controller URL has a trailing slash

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.

Reverse lookup for devices; position of coredns-omada in the plugin chain

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

If controller is unavailable coredns crashes

@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.)

Error during make

/coredns$ sudo make
go generate coredns.go

command-line-arguments

./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

Initial Setup results in " invalid memory address or nil pointer dereference"

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...`

FR: use client hostname instead of name

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!

[Feature Request] Allow . in DNS names

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 .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.