acouvreur / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://acouvreur.github.io/sablier/
GNU Affero General Public License v3.0
1.18k stars 44 forks source link

Feature Request WOL (Wake On Lan) #159

Open KillrOfLife opened 1 year ago

KillrOfLife commented 1 year ago

Send a Wake On Lan packet to a predefined device. maybe add the possibility of setting a minimum wait time.

ravngr commented 1 year ago

While I agree this would be a nice feature (that I would also find useful), I think this is non-trivial to implement. WOL packets are sent via the network broadcast address and are implicitly link-local. Default docker networks are created in bridge mode, creating their own LAN and any WOL packet from sablier wouldn't be forwarded to other hosts on separate networks (i.e. your LAN). I think there are some workarounds, but am not sure on their reliability. The alternative is running sablier or traefik in host mode, which is probably a bad idea if exposed to the internet.

A better solution might be to have the capability to send an arbitrary GET request to another host running a microservice that can fire off the WOL packet. You could then trigger other automations too via webhooks in home-assistant, node-red, whatever...

webysther commented 1 year ago

WOL is layer 3 and this solution is more layer 7, maybe using with another services that support WOL like, UpSnap, added a rule on midleware to call the api. But this sounds out of scope.

D-Konopka commented 3 months ago

I would be also interested in that feature, but if its out of scope then adding ability to execute shell command on wake would fix the problem. It should be pretty easy to implement

acouvreur commented 3 months ago

While the API is layer 7, the calls it can make are not bound to any layer. Please feel free to create a WakeOnLAN provider. Open a draft PR and we can discuss about it :)

I think it's a very neat feature actually !