Merge pull request #2149 from dibdot/openvpn-fix
authorDirk Brenken <dev@brenken.org>
Sun, 16 Sep 2018 06:42:21 +0000 (08:42 +0200)
committerGitHub <noreply@github.com>
Sun, 16 Sep 2018 06:42:21 +0000 (08:42 +0200)
luci-app-openvpn: fix template based config creation

applications/luci-app-unbound/luasrc/model/cbi/unbound/configure.lua
modules/luci-base/luasrc/sys.lua
modules/luci-base/po/tr/base.po
modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm

index df2164f8a647ab8fb3a597f87fd1f70a52fca935..60d0477d53910ff0ae7d8b1070d81d1473566625 100644 (file)
@@ -210,10 +210,11 @@ if (valman == "0") then
 
     pro = s1:taboption("resource", ListValue, "protocol",
         translate("Recursion Protocol"),
-        translate("Chose the protocol recursion queries leave on"))
+        translate("Chose the IP versions used upstream and downstream"))
     pro:value("default", translate("Default"))
     pro:value("ip4_only", translate("IP4 Only"))
-    pro:value("ip6_only", translate("IP6 Only"))
+    pro:value("ip6_local", translate("IP4 All and IP6 Local"))
+    pro:value("ip6_only", translate("IP6 Only*"))
     pro:value("ip6_prefer", translate("IP6 Preferred"))
     pro:value("mixed", translate("IP4 and IP6"))
     pro.rmempty = false
index 823e20770c2d90635436a7c54be3c5e2618c6068..1436a3a235f3b556d68d8b1baf4fb4580485974e 100644 (file)
@@ -70,6 +70,24 @@ function mounts()
        return data
 end
 
+function mtds()
+       local data = {}
+
+       if fs.access("/proc/mtd") then
+               for l in io.lines("/proc/mtd") do
+                       local d, s, e, n = l:match('^([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+"([^%s]+)"')
+                       if s and n then
+                               local d = {}
+                               d.size = tonumber(s, 16)
+                               d.name = n
+                               table.insert(data, d)
+                       end
+               end
+       end
+
+       return data
+end
+
 -- containing the whole environment is returned otherwise this function returns
 -- the corresponding string value for the given name or nil if no such variable
 -- exists.
index 5113bc9869f75e83cde9c7524c31250b00526d45..f8d89b4b17c77fa1d55344614ea8f824a48af0b9 100644 (file)
@@ -1,15 +1,16 @@
 msgid ""
 msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2013-11-25 14:47+0200\n"
-"Last-Translator: qbilay <qbilay@mynet.com>\n"
+"Project-Id-Version: \n"
+"PO-Revision-Date: 2018-09-13 22:59+0300\n"
+"Last-Translator: Yusuf Soyipek <yusuf@soyipek.com>\n"
 "Language-Team: none\n"
 "Language: tr\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Pootle 2.0.6\n"
+"X-Generator: Poedit 2.1.1\n"
+"POT-Creation-Date: \n"
 
 msgid "%.1f dB"
 msgstr ""
@@ -48,7 +49,7 @@ msgid "-- match by uuid --"
 msgstr "-- uuid'e göre eşleştir --"
 
 msgid "-- please select --"
-msgstr ""
+msgstr "-- lütfen seçin --"
 
 msgid "1 Minute Load:"
 msgstr "1 Dakikalık Yük:"
@@ -240,13 +241,13 @@ msgid "Add new interface..."
 msgstr "Yeni arabirim ekle..."
 
 msgid "Additional Hosts files"
-msgstr ""
+msgstr "Ek Hosts dosyaları"
 
 msgid "Additional servers file"
-msgstr ""
+msgstr "Ek sunucular dosyası"
 
 msgid "Address"
-msgstr "Adresler"
+msgstr "Adres"
 
 msgid "Address to access local relay bridge"
 msgstr ""
@@ -406,7 +407,7 @@ msgid "Apply unchecked"
 msgstr ""
 
 msgid "Architecture"
-msgstr ""
+msgstr "Mimari"
 
 msgid ""
 "Assign a part of given length of every public IPv6-prefix to this interface"
@@ -420,7 +421,7 @@ msgid ""
 msgstr ""
 
 msgid "Associated Stations"
-msgstr ""
+msgstr "İlişkili istasyonlar"
 
 msgid "Associations"
 msgstr ""
@@ -429,10 +430,10 @@ msgid "Auth Group"
 msgstr ""
 
 msgid "Authentication"
-msgstr "Kimlik doğrulama"
+msgstr "Kimlik Doğrulama"
 
 msgid "Authentication Type"
-msgstr ""
+msgstr "Kimlik doğrulama türü"
 
 msgid "Authoritative"
 msgstr "Yetkilendirme"
@@ -504,7 +505,7 @@ msgid "Backup"
 msgstr "Yedekleme"
 
 msgid "Backup / Flash Firmware"
-msgstr ""
+msgstr "Yedek/Firmware Yazma"
 
 msgid "Backup file list"
 msgstr ""
@@ -534,16 +535,16 @@ msgid "Bind the tunnel to this interface (optional)."
 msgstr ""
 
 msgid "Bitrate"
-msgstr ""
+msgstr "Bit hızı"
 
 msgid "Bogus NX Domain Override"
 msgstr ""
 
 msgid "Bridge"
-msgstr ""
+msgstr "Köprü"
 
 msgid "Bridge interfaces"
-msgstr ""
+msgstr "Köprü arabirimleri"
 
 msgid "Bridge unit number"
 msgstr ""
@@ -558,7 +559,7 @@ msgid "Broadcom BCM%04x 802.11 Wireless Controller"
 msgstr ""
 
 msgid "Buffered"
-msgstr ""
+msgstr "Tamponlu"
 
 msgid ""
 "Build/distribution specific feed definitions. This file will NOT be "
@@ -643,6 +644,8 @@ msgid ""
 "Click \"Generate archive\" to download a tar archive of the current "
 "configuration files."
 msgstr ""
+"Mevcut yapılandırma dosyalarının yeni bir arşivini indirmek için \"Arşiv "
+"Oluştur\"'u tıklayın."
 
 msgid "Client"
 msgstr ""
@@ -690,22 +693,22 @@ msgid "Configuration has been rolled back!"
 msgstr ""
 
 msgid "Confirmation"
-msgstr ""
+msgstr "Onayla"
 
 msgid "Connect"
-msgstr ""
+msgstr "Bağlan"
 
 msgid "Connected"
-msgstr ""
+msgstr "Bağlandı"
 
 msgid "Connection Limit"
-msgstr ""
+msgstr "Bağlantı limiti"
 
 msgid "Connection attempt failed"
 msgstr ""
 
 msgid "Connections"
-msgstr ""
+msgstr "Bağlantılar"
 
 msgid ""
 "Could not regain access to the device after applying the configuration "
@@ -714,10 +717,10 @@ msgid ""
 msgstr ""
 
 msgid "Country"
-msgstr ""
+msgstr "Ülke"
 
 msgid "Country Code"
-msgstr ""
+msgstr "Ülke Kodu"
 
 msgid "Cover the following interface"
 msgstr ""
@@ -729,19 +732,19 @@ msgid "Create / Assign firewall-zone"
 msgstr ""
 
 msgid "Create Interface"
-msgstr ""
+msgstr "Arabirim Oluştur"
 
 msgid "Create a bridge over multiple interfaces"
 msgstr ""
 
 msgid "Critical"
-msgstr ""
+msgstr "Kritik"
 
 msgid "Cron Log Level"
 msgstr ""
 
 msgid "Custom Interface"
-msgstr ""
+msgstr "Özel Arabirim"
 
 msgid "Custom delegated IPv6-prefix"
 msgstr ""
@@ -828,19 +831,19 @@ msgid "Debug"
 msgstr ""
 
 msgid "Default %d"
-msgstr ""
+msgstr "Varsayılan"
 
 msgid "Default gateway"
-msgstr ""
+msgstr "Default ağ geçidi"
 
 msgid "Default is stateless + stateful"
 msgstr ""
 
 msgid "Default state"
-msgstr ""
+msgstr "Varsayılan durum"
 
 msgid "Define a name for this network."
-msgstr ""
+msgstr "Bu ağ için bir ad tanımlayın."
 
 msgid ""
 "Define additional DHCP options, for example "
@@ -849,69 +852,71 @@ msgid ""
 msgstr ""
 
 msgid "Delete"
-msgstr ""
+msgstr "Sil"
 
 msgid "Delete this network"
-msgstr ""
+msgstr "Bu ağı sil"
 
 msgid "Delivery Traffic Indication Message Interval"
 msgstr ""
 
 msgid "Description"
-msgstr ""
+msgstr "Açıklama"
 
 msgid "Design"
-msgstr ""
+msgstr "Tasarım"
 
 msgid "Destination"
-msgstr ""
+msgstr "Hedef"
 
 msgid "Device"
-msgstr ""
+msgstr "Cihaz"
 
 msgid "Device Configuration"
-msgstr ""
+msgstr "Cihaz Yapılandırması"
 
 msgid "Device is rebooting..."
-msgstr ""
+msgstr "Cihaz yeniden başlatılıyor..."
 
 msgid "Device unreachable!"
-msgstr ""
+msgstr "Cihaz ulaşılamaz!"
 
 msgid "Device unreachable! Still waiting for device..."
-msgstr ""
+msgstr "Cihaz ulaşılamaz! Hala cihazı bekliyorum..."
 
 msgid "Diagnostics"
-msgstr ""
+msgstr "Tanı"
 
 msgid "Dial number"
-msgstr ""
+msgstr "Arama numarası"
 
 msgid "Directory"
-msgstr ""
+msgstr "Dizin"
 
 msgid "Disable"
-msgstr ""
+msgstr "Pasif"
 
 msgid ""
 "Disable <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</abbr> for "
 "this interface."
 msgstr ""
+"Bu arabirim için <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</"
+"abbr>'yi devre dışı bırakın."
 
 msgid "Disable DNS setup"
-msgstr ""
+msgstr "DNS kurulumunu devre dışı"
 
 msgid "Disable Encryption"
-msgstr ""
+msgstr "Şifrelemeyi Devre Dışı"
 
 msgid "Disable this network"
-msgstr ""
+msgstr "Ağ devre dışı"
 
 msgid "Disabled"
-msgstr ""
+msgstr "Devre dışı"
 
 msgid "Disabled (default)"
-msgstr ""
+msgstr "Devre dışı (varsayılan)"
 
 msgid "Disassociate On Low Acknowledgement"
 msgstr ""
@@ -920,16 +925,16 @@ msgid "Discard upstream RFC1918 responses"
 msgstr ""
 
 msgid "Disconnection attempt failed"
-msgstr ""
+msgstr "Bağlantı kesme girişimi başarısız oldu"
 
 msgid "Dismiss"
-msgstr ""
+msgstr "Reddet"
 
 msgid "Displaying only packages containing"
-msgstr ""
+msgstr "Yalnızca içeren paketler görüntüleniyor"
 
 msgid "Distance Optimization"
-msgstr ""
+msgstr "Mesafe Optimizasyonu"
 
 msgid "Distance to farthest network member in meters."
 msgstr ""
@@ -1146,7 +1151,7 @@ msgid "Expand hosts"
 msgstr ""
 
 msgid "Expires"
-msgstr ""
+msgstr "Süre Bitişi"
 
 msgid ""
 "Expiry time of leased addresses, minimum is 2 minutes (<code>2m</code>)."
@@ -1236,19 +1241,19 @@ msgid "Firmware File"
 msgstr ""
 
 msgid "Firmware Version"
-msgstr ""
+msgstr "Firmware Versiyon"
 
 msgid "Fixed source port for outbound DNS queries"
 msgstr ""
 
 msgid "Flash Firmware"
-msgstr ""
+msgstr "Firmware Güncelle"
 
 msgid "Flash image..."
-msgstr ""
+msgstr "Dosyayı yaz..."
 
 msgid "Flash new firmware image"
-msgstr ""
+msgstr "Yeni firmware dosyasını yaz"
 
 msgid "Flash operations"
 msgstr ""
@@ -1308,10 +1313,10 @@ msgid "Frame Bursting"
 msgstr ""
 
 msgid "Free"
-msgstr ""
+msgstr "Boş"
 
 msgid "Free space"
-msgstr ""
+msgstr "Boş alan"
 
 msgid ""
 "Further information about WireGuard interfaces and peers at <a href=\"http://"
@@ -1325,7 +1330,7 @@ msgid "GPRS only"
 msgstr ""
 
 msgid "Gateway"
-msgstr ""
+msgstr "Ağ Geçidi"
 
 msgid "Gateway address is invalid"
 msgstr ""
@@ -1349,7 +1354,7 @@ msgid "Generate PMK locally"
 msgstr ""
 
 msgid "Generate archive"
-msgstr ""
+msgstr "Arşiv oluştur"
 
 msgid "Generic 802.11%s Wireless Controller"
 msgstr ""
@@ -1488,7 +1493,7 @@ msgid "IPv4+IPv6"
 msgstr ""
 
 msgid "IPv4-Address"
-msgstr ""
+msgstr "IPv4-Adres"
 
 msgid "IPv4-in-IPv4 (RFC2003)"
 msgstr ""
@@ -1539,7 +1544,7 @@ msgid "IPv6 suffix"
 msgstr ""
 
 msgid "IPv6-Address"
-msgstr ""
+msgstr "IPv6-Adres"
 
 msgid "IPv6-PD"
 msgstr ""
@@ -1707,7 +1712,7 @@ msgid "Kernel Log"
 msgstr ""
 
 msgid "Kernel Version"
-msgstr ""
+msgstr "Çekirdek Versiyonu"
 
 msgid "Key"
 msgstr ""
@@ -1758,7 +1763,7 @@ msgid "Leasefile"
 msgstr ""
 
 msgid "Leasetime remaining"
-msgstr ""
+msgstr "Kalan kira süresi"
 
 msgid "Leave empty to autodetect"
 msgstr ""
@@ -1839,7 +1844,7 @@ msgid "Load"
 msgstr ""
 
 msgid "Load Average"
-msgstr ""
+msgstr "Ortalama Yük"
 
 msgid "Loading"
 msgstr ""
@@ -1863,7 +1868,7 @@ msgid "Local Startup"
 msgstr ""
 
 msgid "Local Time"
-msgstr ""
+msgstr "Yerel Zaman"
 
 msgid "Local domain"
 msgstr ""
@@ -1915,7 +1920,7 @@ msgid "MAC"
 msgstr ""
 
 msgid "MAC-Address"
-msgstr ""
+msgstr "MAC-Adres"
 
 msgid "MAC-Address Filter"
 msgstr ""
@@ -1979,7 +1984,7 @@ msgid "Mbit/s"
 msgstr ""
 
 msgid "Memory"
-msgstr ""
+msgstr "Bellek"
 
 msgid "Memory usage (%)"
 msgstr ""
@@ -2101,10 +2106,10 @@ msgid "Navigation"
 msgstr ""
 
 msgid "Netmask"
-msgstr ""
+msgstr "Ağ Maskesi"
 
 msgid "Network"
-msgstr ""
+msgstr ""
 
 msgid "Network Utilities"
 msgstr ""
@@ -2164,7 +2169,7 @@ msgid "No zone assigned"
 msgstr ""
 
 msgid "Noise"
-msgstr ""
+msgstr "Parazit"
 
 msgid "Noise Margin (SNR)"
 msgstr ""
@@ -2349,7 +2354,7 @@ msgid "Override the table used for internal routes"
 msgstr ""
 
 msgid "Overview"
-msgstr ""
+msgstr "Genel Bakış"
 
 msgid "Owner"
 msgstr ""
@@ -2543,7 +2548,7 @@ msgid "Prot."
 msgstr ""
 
 msgid "Protocol"
-msgstr ""
+msgstr "Protokol"
 
 msgid "Protocol family"
 msgstr ""
@@ -3370,7 +3375,7 @@ msgid "Tone"
 msgstr ""
 
 msgid "Total Available"
-msgstr ""
+msgstr "Toplam Mevcut"
 
 msgid "Traceroute"
 msgstr ""
@@ -3502,7 +3507,7 @@ msgid "Uploaded File"
 msgstr "Yüklenen Dosya"
 
 msgid "Uptime"
-msgstr "Açılma süresi"
+msgstr "Çalışma Zamanı"
 
 msgid "Use <code>/etc/ethers</code>"
 msgstr ""
index 2fa7847fc6d2d2bf77bf8d07494f1620b7dcc50c..46d2e36c32b1b1a523aa696305c6fbb6ba44c529 100644 (file)
@@ -35,6 +35,7 @@ function index()
        entry({"admin", "system", "flashops"}, call("action_flashops"), _("Backup / Flash Firmware"), 70)
        entry({"admin", "system", "flashops", "reset"}, post("action_reset"))
        entry({"admin", "system", "flashops", "backup"}, post("action_backup"))
+       entry({"admin", "system", "flashops", "backupmtdblock"}, post("action_backupmtdblock"))
        entry({"admin", "system", "flashops", "backupfiles"}, form("admin_system/backupfiles"))
 
        -- call() instead of post() due to upload handling!
@@ -318,6 +319,23 @@ function action_backup()
        luci.ltn12.pump.all(reader, luci.http.write)
 end
 
+function action_backupmtdblock()
+       local http = require "luci.http"
+       local mv = http.formvalue("mtdblockname")
+       local m, s, n = mv:match('^([^%s]+)/([^%s]+)/([^%s]+)')
+
+       local reader = ltn12_popen("dd if=/dev/mtd%s conv=fsync,notrunc 2>/dev/null" % n)
+
+       luci.http.header(
+               'Content-Disposition', 'attachment; filename="backup-%s-%s-%s.bin"' %{
+                       luci.sys.hostname(), m,
+                       os.date("%Y-%m-%d")
+               })
+
+       luci.http.prepare_content("application/octet-stream")
+       luci.ltn12.pump.all(reader, luci.http.write)
+end
+
 function action_restore()
        local fs = require "nixio.fs"
        local http = require "luci.http"
index f3d2e8d7b09defe0dd51d5fa79089effddbc8971..8204d38e3435e25e81ed23fe5809f2b9219dd563 100644 (file)
                        <div class="cbi-section-error"><%:The backup archive does not appear to be a valid gzip file.%></div>
                <% end %>
        </div>
+
+       <% local mtds = require("luci.sys").mtds(); if #mtds > 0 then -%>
+       <h3><%:Save mtdblock contents%></h3>
+       <div class="cbi-section-descr"><%:Click "Save mtdblock" to download specified mtdblock file. (NOTE: THIS FEATURE IS FOR PROFESSIONALS! )%></div>
+       <div class="cbi-section-node">
+               <form class="inline" method="post" action="<%=url('admin/system/flashops/backupmtdblock')%>">
+                       <input type="hidden" name="token" value="<%=token%>" />
+                       <div class="cbi-value">
+                               <label class="cbi-value-title" for="mtdblockname"><%:Choose mtdblock%></label>
+                               <div class="cbi-value-field">
+                                       <select class="cbi-input-select" data-update="change" name="mtdblockname" id="mtdblockname">
+                                               <% for i, key in ipairs(mtds) do
+                                                       if key and key.name ~= "rootfs_data" then -%>
+                                                               <option<%=
+                                                                       attr("id", "mtdblockname-" .. key.name) ..
+                                                                       attr("value", key.name .. '/'.. key.size .. '/' .. i - 1) ..
+                                                                       attr("data-index", i) ..
+                                                                       ifattr(key.name == "linux" or key.name == "firmware", "selected", "selected")
+                                                               %>><%=pcdata(key.name)%></option>
+                                               <%      end
+                                                end -%>
+                                       </select>
+                               </div>
+                       </div>
+                       <div class="cbi-value cbi-value-last<% if reset_avail then %> cbi-value-error<% end %>">
+                               <label class="cbi-value-title" for="image"><%:Download mtdblock%></label>
+                               <div class="cbi-value-field">
+                                       <input type="submit" class="cbi-button cbi-button-action important" value="<%:Save mtdblock%>" />
+                               </div>
+                       </div>
+               </form>
+       </div>
+       <% end %>
+
 </div>
 
 <div class="cbi-section">