NetAlertX icon indicating copy to clipboard operation
NetAlertX copied to clipboard

cleanDeviceName rewritten to remove all _ labels and remove search list and local domain

Open ulrichwisser opened this issue 10 months ago • 11 comments

This change introduces a new dependency to dnspython.

It removes all labels starting with an underscore.

It does not remove specific domain names like lan, home, ... Instead it removes the domain of the local network and even the search list of the local network.

I have not seen test cases for domain names. It would be really helpfull to collect names and how the users want them to change. For that even the local DNS config would be needed (domain and search list from /etc/resolv.conf)

This is potentially a big change. How can we test this?

ulrichwisser avatar Apr 23 '24 13:04 ulrichwisser

I tried to do these changes in my instance, but how can I access the newdev settings?

ulrichwisser avatar Apr 24 '24 11:04 ulrichwisser

And how do I enable debug logging?

ulrichwisser avatar Apr 24 '24 11:04 ulrichwisser

You can access the setting via get_setting_value("NEWDEV_CLEAN_NAME"). To enable debug logging see this doc: https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md

jokob-sk avatar Apr 24 '24 11:04 jokob-sk

Can I access the config through the web ui?

ulrichwisser avatar Apr 24 '24 12:04 ulrichwisser

yes, once you define it in teh aforementioned config.json, it will automatically show in the settings > newdev section

jokob-sk avatar Apr 24 '24 12:04 jokob-sk

My instance doesn't show me that configuration. I am running the docker container jokobsk/netalertx:latest

ulrichwisser avatar Apr 24 '24 12:04 ulrichwisser

hummm, can you show me how you defined the new setting in the config.json: https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/newdev_template/config.json

jokob-sk avatar Apr 24 '24 13:04 jokob-sk

I do not have a newdev section at all. In the setting menu I have only the following sections Enabled settings Core System Device scanners Other scanners Publishers

ulrichwisser avatar Apr 24 '24 13:04 ulrichwisser

Ah I see, it's here, under System: image

jokob-sk avatar Apr 24 '24 13:04 jokob-sk

OK, this did work for me. Thanks for all the hand holding!

ulrichwisser avatar Apr 24 '24 16:04 ulrichwisser

Thanks a lot for the submission and glad to hear it's almost done :) I left a couple of comments to keep the code somewhat consistent. Thanks for the help!

jokob-sk avatar Apr 24 '24 21:04 jokob-sk