YunoHost-Apps / hotspot_ynh

Wifi Hotspot app for YunoHost
GNU Affero General Public License v3.0
39 stars 19 forks source link

Fix DNS config + cleanup stuff when hotspot is disabled #109

Closed hidrarga closed 10 months ago

hidrarga commented 10 months ago

Problem

When advanced mode is disabled, the following variables are not declared:

These variables are needed to check if IPv4 and IPv6 DNS are valid and to set them. When the hotspot is enabled, they are also used to configure the service.

Solution

I moved the code that is splitting IPv4 and IPv6 DNS, in order to reuse them in the DNS validation step.

I make sure that when the advanced mode is disabled, I take variables from the "old" config. I guess these are the settings before any user changes, which in this case isn't a problem because the fields are hidden from the user.

I also added a check to ensure the hotspot isn't started when it is disabled. Instead, we cleanup some config files, and we restart dnsmasq to make sure changes are updated.

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

hidrarga commented 10 months ago

!testme

yunohost-bot commented 10 months ago

:carousel_horse: Test Badge