You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.8 KiB
Lua

-- Import the necessary LuCI modules
local uci = require("luci.model.uci").cursor()
local sys = require("luci.sys")
local util = require("luci.util")
-- Define the model
m = Map("tgsstp_cfg", "TorGuard SSTP VPN Setup")
-- Define the section for the SSTP settings
s = m:section(TypedSection, "sstpconfig", "SSTP VPN Settings")
s.anonymous = true
s.addremove = false
-- Define the input fields for the SSTP settings
user = s:option(Value, "username", translate("VPN Username"))
pass = s:option(Value, "password", translate("VPN Password"))
pass.password = true
svr = s:option(ListValue, "server", translate("VPN Server"))
-- Add all servers here
svr:value("ar.torguard.org", "Argentina")
svr:value("au.torguard.org", "Australia Sydney")
svr:value("br.torguard.org", "Brazil Sau Paulo")
svr:value("br2.torguard.org", "Brazil Sau Paulo 2")
svr:value("us-la.torguard.org", "USA LA")
svr:value("us-fl.torguard.org", "USA Miami")
svr:value("us-ny.torguard.org", "USA NY")
svr:value("us-lv.torguard.org", "USA Las Vegas")
svr:value("us-sa.torguard.org", "USA Seattle")
svr:value("us-slc.torguard.org", "USA Salt Lake City")
svr:value("dn.torguard.org", "Denmark Copenhagen")
svr:value("fn.torguard.org", "Finland Helsinki")
svr:value("dn.torguard.org", "Denmark Copenhagen")
svr:value("fr.torguard.org", "France Paris")
svr:value("ger.torguard.org", "Germany Frankfurt")
svr:value("ice.torguard.org", "Iceland Reykjavik")
svr:value("ire.torguard.org", "Ireland Dublin")
svr:value("it.torguard.org", "Italy Milan")
svr:value("nl.torguard.org", "Netherlands Amsterdam")
svr:value("ru.torguard.org", "Russia Moscow")
svr:value("swe.torguard.org", "Sweden Stockholm")
svr:value("tk.torguard.org", "Turkey Istanbul")
svr:value("uk.man.torguard.org", "United Kingdom Manchester")
svr:value("hk.torguard.org", "Hong Kong")
svr:value("id.torguard.org", "Indonesia Jakarta")
svr:value("sk.torguard.org", "South Korea Seoul")
svr:value("nz.torguard.org", "New Zealand Auckland")
svr:value("sg.torguard.org", "Singapore")
svr:value("tw.torguard.org", "Taiwan Taipei")
svr:value("th.torguard.org", "Thailand Bangkok")
svr:value("bh.torguard.org", "Bahrain Manama")
svr:value("in.torguard.org", "India Mumbai")
svr:value("isr-loc1.torguard.org", "Israel Tel Aviv")
svr:value("isr-loc2.torguard.org", "Israel Petah Tikva")
svr:value("sa.torguard.org", "South Africa Johannesburg")
-- VPN Control: Start/Stop SSTP VPN
ctrl = m:section(TypedSection, "sstpconfig", "VPN Control: Start/Stop SSTP")
ctrl.anonymous = true
ctrl.addremove = false
btnStop = ctrl:option(Button, "_btn_start", translate("Click to Stop SSTP"))
function btnStop.write()
io.popen("/etc/init.d/tgsstp stop")
end
btnStart = ctrl:option(Button, "_btn_stop", translate("Click to Start SSTP"))
function btnStart.write()
io.popen("/etc/init.d/tgsstp start")
end
-- Return the configuration page
return m