Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable ffuplink-interface during initial setup - revisited #190

Closed
wants to merge 3 commits into from

Conversation

pmelange
Copy link
Contributor

@pmelange pmelange commented Jun 14, 2019

This is an alternative to PR #185

In this version, the option network.ffuplink.disabled is set to 0 in the wizard if sharenet is selected. Additionally, if sharenet is disabled (for example re-running the wizard), the same option is set to 1.

Quoted from #185 (comment)

On a fresh installed system, there is no valid setup of ffuplink. So we disable this interface, till it's configured by some uplink-preset.
The advantage of this change s, that an unconfigured ffuplink (as so uplink-preset was installed for manual configuration) will not cause any unintended sideeffects.

This implementation has been tested and passes the tests described in #185 (comment)

On a fresh installed system, there is no valid setup of ffuplink. So
we disable this interface, till it's configured by some uplink-preset.

This was cherry-picked from 29cda0a
The ffuplink interface is disabled by default on a fresh install.
During the course of running the wizard, the user must select if
they want to share their internet connection or not.  If the user
decides to share their internet, then the ffuplink interface shall
be enabled (setting disabled=0).

This addresses freifunk-berlin/firmware#603
@@ -88,6 +88,11 @@ function main.write(self, section, value)
--share internet was not enabled before, set to false now
uci:set("ffwizard", "settings", "sharenet", "0")
uci:save("ffwizard")
--in case the wizard has been re-ran, ensure ffuplink is disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these changes made in the wireless.lua file? As it acts on the "share internet"-settings it should be better placed in "shareInternet.lua".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shareInternet.lua is only called when the user clicks on " Am Freifunk-Netz teilnehmen und Internet teilen"

<a class="cbi-button cbi-button-save" href="<%=luci.dispatcher.build_url("/admin/freifunk/assistent/sharedInternet")%>">

If the user clicks "Am Freifunk-Netz teilnehmen"

<a class="cbi-button cbi-button-save" href="<%=luci.dispatcher.build_url("admin/freifunk/assistent/optionalConfigs")%>?sharenet=0">
then shareInternet.lua is jumped-over and the wizard goes straight to "optionalConfigs".

When the wizard is run for a second time, and if this code were in "shareInternet", and the user changes from sharing to not sharing, then the code would never run and ffuplink would not be disabled.

Sure the code could be moved to

if html.formvalue("sharenet", true) == "0" then
uci:set("ffwizard","settings","sharenet", 2)
uci:save("ffwizard")
end
with an else clause, but that still is not in "shareInternet". Therefore "shareInternet.lua" is not a better place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants