davesteele / comitup

Bootstrap Wifi support over Wifi
https://davesteele.github.io/comitup/
GNU General Public License v2.0
320 stars 54 forks source link

Add custom Zeroconf service name, load config from /boot #136

Closed d8ahazard closed 3 years ago

d8ahazard commented 3 years ago

(Re-submitted after rebase/cleanup of original PR)

Pretty straightforward...

Add an option to put "service_name" in comitup.conf, which will then be read and injected into the MDNS service advertiser for zeroconf. Tested and works perfect for my service "_glimmr._tcp". Made sure to keep the default as "workstation" to not break existing instances.

Also, add a check before loading the config that looks for /boot/comitup.conf, and if detected, copies it over the existing config in /etc/comitup.conf and then deletes the config from /boot. This is similar to how Rpi does wifi autoconfig now, and I think would be the perfect finishing touch for the full flashable image. ;)

d8ahazard commented 3 years ago

I'd be happy to, I just didn't want to go changing the original code base too much. I'll move it briefly and submit another commit.

On Sun, Feb 7, 2021, 1:45 PM David Steele notifications@github.com wrote:

@davesteele requested changes on this pull request.

I'd be happy to merge this, given a fix for the duplicated load_data().

Side note - there is not a strong justification for the original choice of "workstation".

In comitup/mdns.py https://github.com/davesteele/comitup/pull/136#discussion_r571676261:

@@ -129,6 +138,34 @@ def get_interface_mapping(): pass

 return mapping

+ + +def load_data():

I'm not OK with the duplication of this function. Can you either extend the init_(mgr)() tree starting in comitup.py, or move load_data to config.py, or a new file?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davesteele/comitup/pull/136#pullrequestreview-585060768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NHADPTTWIECWIUVKHLS53UVXANCNFSM4XHW355A .

davesteele commented 3 years ago

Thanks

d8ahazard commented 3 years ago

My pleasure!

How do I get a raspberry pi image with these features added to it? Are those auto-generated?

On Sun, Feb 7, 2021, 3:54 PM David Steele notifications@github.com wrote:

Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davesteele/comitup/pull/136#issuecomment-774774861, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NFMSDSSHHFEI4POOH3S54D23ANCNFSM4XHW355A .

davesteele commented 3 years ago

I use https://github.com/davesteele/pi-gen.

An update for comitup is due. I'm waiting for https://github.com/RPi-Distro/pi-gen/issues/491.

d8ahazard commented 3 years ago

Gotcha. That might be useful for me to fork, as I'm making an image based on your image plus my app, so I'm looking at it.

One question...it seems as if this is installing the .deb package. Am I correct in assuming that the changes need to be pushed out to that? Is that auto-generated, or do I need to do some magic?

On Sun, Feb 7, 2021 at 4:42 PM David Steele notifications@github.com wrote:

I use https://github.com/davesteele/pi-gen.

An update for comitup is due. I'm waiting for RPi-Distro/pi-gen#491 https://github.com/RPi-Distro/pi-gen/issues/491.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davesteele/comitup/pull/136#issuecomment-774781515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NCLLOLBYVXP4ZZPX23S54JL5ANCNFSM4XHW355A .

davesteele commented 3 years ago

It's not automatic.

d8ahazard commented 3 years ago

Any idea when it'll be updated there?

On Sun, Feb 7, 2021 at 6:06 PM David Steele notifications@github.com wrote:

It's not automatic.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davesteele/comitup/pull/136#issuecomment-774793582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NHYQRXYRUU7BCTDDCLS54THBANCNFSM4XHW355A .

davesteele commented 3 years ago

Not a clue.

d8ahazard commented 3 years ago

So, what am I missing? Just trying to understand how the code flow works. It gets merged to git...then...it needs to be packaged for python and the .egg uploaded?

How does the .deb package work to pull down the python code?

Is there something I can help with here?

On Sun, Feb 7, 2021 at 7:08 PM David Steele notifications@github.com wrote:

Not a clue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davesteele/comitup/pull/136#issuecomment-774806813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NB7QY7FLPAG3EB2V6DS542QNANCNFSM4XHW355A .

davesteele commented 3 years ago

The steps are: × merge master with debian × update debian/changelog × build with debuild × upload to my debian repo

The Deb package contains all of the python code.

davesteele commented 3 years ago

The image is up.

d8ahazard commented 3 years ago

Awesome, thanks!

On Thu, Feb 11, 2021, 5:42 PM David Steele notifications@github.com wrote:

The image is up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davesteele/comitup/pull/136#issuecomment-777869324, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NCN3LOPE3JSXIULWI3S6RTOHANCNFSM4XHW355A .