1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add OpenVPN support

This commit is contained in:
Ycarus 2018-06-12 19:22:55 +02:00
parent acea842fbd
commit 4e858a0ff9
3 changed files with 65 additions and 5 deletions

View file

@ -36,6 +36,7 @@
</div>
</div>
</div>
<% if nixio.fs.access("/usr/sbin/glorytun") or nixio.fs.access("/usr/sbin/glorytun-udp") then %>
<div class="cbi-value">
<label class="cbi-value-title"><%:Glorytun key%></label>
<div class="cbi-value-field">
@ -47,6 +48,8 @@
</div>
</div>
</div>
<% end %>
<% if nixio.fs.access("/usr/sbin/mlvpn") then %>
<div class="cbi-value">
<label class="cbi-value-title"><%:MLVPN password%></label>
<div class="cbi-value-field">
@ -58,13 +61,29 @@
</div>
</div>
</div>
<% end %>
<% if nixio.fs.access("/usr/sbin/openvpn") then %>
<div class="cbi-value">
<label class="cbi-value-title"><%:OpenVPN key%></label>
<div class="cbi-value-field">
<input type="file" name="openvpn_key" class="cbi-input-file">
<input type="text" class="cbi-input-text" data-update="change" value="<%=uci:get("openvpn","omr","secret")%>" />
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
<%:You need to upload OpenVPN key file generated by OpenMPTCProuter VPS script to use OpenVPN TCP%>
</div>
</div>
</div>
<% end %>
<div class="cbi-value">
<label class="cbi-value-title"><%:Default VPN%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" name="default_vpn" size="1">
<option value="glorytun_tcp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "tcp" then %>selected="selected"<% end %>>Glorytun TCP</option>
<option value="glorytun_udp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "udp" then %>selected="selected"<% end %>>Glorytun UDP</option>
<option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option>
<% if nixio.fs.access("/usr/sbin/glorytun") then %><option value="glorytun_tcp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "tcp" then %>selected="selected"<% end %>>Glorytun TCP</option><% end %>
<% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><option value="glorytun_udp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "udp" then %>selected="selected"<% end %>>Glorytun UDP</option><% end %>
<% if nixio.fs.access("/usr/sbin/mlvpn") then %><option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option><% end %>
<% if nixio.fs.access("/usr/sbin/openvpn") then %><option value="openvpn" <% if uci:get("openvpn","omr","enabled") == "1" then %>selected="selected"<% end %>>OpenVPN</option><% end %>
</select>
<br />
<div class="cbi-value-description">
@ -133,4 +152,5 @@
<button class="btn" type="submit">Submit</button>
</div>
</form>
<%+footer%>