-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
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
6ed38ed
to
1b9361a
Compare
@@ -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 |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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"
firmware-packages/utils/luci-app-ffwizard-berlin/luasrc/view/freifunk/assistent/decide.htm
Line 37 in 8e2b55e
<a class="cbi-button cbi-button-save" href="<%=luci.dispatcher.build_url("/admin/freifunk/assistent/sharedInternet")%>"> |
If the user clicks "Am Freifunk-Netz teilnehmen"
firmware-packages/utils/luci-app-ffwizard-berlin/luasrc/view/freifunk/assistent/decide.htm
Line 19 in 8e2b55e
<a class="cbi-button cbi-button-save" href="<%=luci.dispatcher.build_url("admin/freifunk/assistent/optionalConfigs")%>?sharenet=0"> |
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
Lines 10 to 13 in 8e2b55e
if html.formvalue("sharenet", true) == "0" then | |
uci:set("ffwizard","settings","sharenet", 2) | |
uci:save("ffwizard") | |
end |
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)
This implementation has been tested and passes the tests described in #185 (comment)