Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • autinerd/experimental-openwrt-24.10
  • experimental
  • feature/addMikrotikwAP
  • master
  • nrb/airmax-test
  • nrb/ar9344-reset-sequence
  • nrb/ex400-remove-wps
  • nrb/gluon-master-cpe510
  • nrb/test-radv-filter
  • nrbffs/fastd-remove-delay
  • nrbffs/netgear-ex6120
  • v2018.2.2-ffs
  • v2018.2.3-ffs
  • v2019.1-ffs
  • v2019.1.1-ffs
  • v2019.1.2-ffs
  • v2020.1-ffs
  • v2020.1.1-ffs
  • v2020.1.3-ffs
  • v2020.2-ffs
  • v2020.2.1-ffs
  • v2020.2.2-ffs
  • v2020.2.3-ffs
  • v2021.1-ffs
  • v2021.1.1-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • v2022.1.3-ffs
  • v2022.1.4-ffs
  • v2023.1-ffs
  • v2023.2-ffs
  • v2023.2.2-ffs
  • v2023.2.3-ffs
  • v2023.2.4-ffs
  • v2023.2.5-ffs
  • experimental-2022-09-24
  • experimental-2022-09-24-base
  • experimental-2023-03-11
  • experimental-2023-03-11-base
  • experimental-2023-03-12
  • experimental-2023-03-12-base
  • experimental-2023-03-16
  • experimental-2023-03-16-base
  • experimental-2023-03-20
  • experimental-2023-03-20-base
  • experimental-2023-03-23
  • experimental-2023-03-23-base
  • experimental-2023-03-25
  • experimental-2023-03-25-base
  • experimental-2023-03-26
  • experimental-2023-03-26-base
  • experimental-2023-03-30
  • experimental-2023-03-30-base
  • experimental-2023-03-31
  • experimental-2023-03-31-base
  • experimental-2023-04-01
  • experimental-2023-04-01-base
  • experimental-2023-04-08
  • experimental-2023-04-08-base
  • experimental-2023-04-10
  • experimental-2023-04-10-base
  • experimental-2023-04-13
  • experimental-2023-04-13-base
  • experimental-2023-04-15
  • experimental-2023-04-15-base
  • experimental-2023-04-16
  • experimental-2023-04-16-base
  • experimental-2023-04-18
  • experimental-2023-04-18-base
  • experimental-2023-04-20
  • experimental-2023-04-20-base
  • experimental-2023-04-26
  • experimental-2023-04-26-base
  • experimental-2023-04-28
  • experimental-2023-04-28-base
  • experimental-2023-04-30
  • experimental-2023-04-30-base
  • experimental-2023-05-02
  • experimental-2023-05-02-base
  • experimental-2023-05-03
  • experimental-2023-05-03-base
  • experimental-2023-05-12
  • experimental-2023-05-12-base
  • experimental-2023-05-21
  • experimental-2023-05-21-base
  • experimental-2023-05-25
  • experimental-2023-05-25-base
  • experimental-2023-07-02
  • experimental-2023-07-02-base
  • experimental-2023-07-04
  • experimental-2023-07-04-base
  • experimental-2023-07-12
  • experimental-2023-07-12-base
  • experimental-2023-07-16
  • experimental-2023-07-16-base
  • experimental-2023-08-04
  • experimental-2023-08-04-base
  • experimental-2023-08-10
  • experimental-2023-08-10-base
  • experimental-2023-09-08
  • experimental-2023-09-08-base
  • experimental-2023-09-09
  • experimental-2023-09-09-base
  • experimental-2023-09-10
  • experimental-2023-09-10-base
  • experimental-2023-09-11
  • experimental-2023-09-11-base
  • experimental-2023-09-12
  • experimental-2023-09-12-base
  • experimental-2023-09-13
  • experimental-2023-09-13-base
  • experimental-2023-09-15
  • experimental-2023-09-15-base
  • experimental-2023-09-16
  • experimental-2023-09-16-base
  • experimental-2023-09-18
  • experimental-2023-09-18-base
  • experimental-2023-09-20
  • experimental-2023-09-20-base
  • experimental-2023-09-27
  • experimental-2023-09-27-base
  • experimental-2023-09-28
  • experimental-2023-09-28-base
  • experimental-2023-09-29
  • experimental-2023-09-29-base
  • experimental-2023-10-02
  • experimental-2023-10-02-base
  • experimental-2023-10-13
  • experimental-2023-10-13-base
  • experimental-2023-10-14
  • experimental-2023-10-14-base
  • experimental-2023-10-16
  • experimental-2023-10-16-base
  • experimental-2023-10-23
  • experimental-2023-10-23-base
137 results

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • 2014.3.x
  • 2014.4.x
  • babel
  • experimental
  • hoodselector
  • master
  • nrb/gluon-master-cpe510
  • nrb/test-radv-filter
  • nrbffs/fastd-remove-delay
  • nrbffs/netgear-ex6120
  • radv-filterd
  • v2015.1.x
  • v2016.1.x
  • v2016.2.4-batmanbug
  • v2016.2.x
  • v2018.2.2-ffs
  • v2018.2.3-ffs
  • v2018.2.x
  • v2019.1-ffs
  • v2019.1.1-ffs
  • v2019.1.2-ffs
  • v2020.1-ffs
  • v2020.1.1-ffs
  • v2020.1.3-ffs
  • v2020.2-ffs
  • v2020.2.1-ffs
  • v2020.2.2-ffs
  • v2020.2.3-ffs
  • v2020.2.x
  • v2021.1-ffs
  • v2021.1.1-ffs
  • v2021.1.2-ffs
  • v2014.1
  • v2014.2
  • v2014.3
  • v2014.3.1
  • v2014.4
  • v2015.1
  • v2015.1.1
  • v2015.1.2
  • v2016.1
  • v2016.1.1
  • v2016.1.2
  • v2016.1.3
  • v2016.1.4
  • v2016.1.5
  • v2016.1.6
  • v2016.2
  • v2016.2.1
  • v2016.2.2
  • v2016.2.3
  • v2016.2.4
  • v2016.2.5
  • v2016.2.6
  • v2016.2.7
  • v2017.1
  • v2017.1.1
  • v2017.1.2
  • v2017.1.3
  • v2017.1.4
  • v2017.1.5
  • v2017.1.6
  • v2017.1.7
  • v2017.1.8
  • v2018.1
  • v2018.1.1
  • v2018.1.2
  • v2018.1.3
  • v2018.1.4
  • v2018.2
  • v2018.2-ffs0.1
  • v2018.2.1
  • v2018.2.1-ffs0.1
  • v2018.2.2-ffs0.1
  • v2018.2.3-ffs0.1
  • v2019.1-ffs0.1
  • v2019.1.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2020.1-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.2
  • v2020.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.3-ffs0.1
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.3
  • v2020.2.x-ffs0.1
  • v2021.1-ffs0.1
  • v2021.1.1-ffs0.1
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.4
  • v2021.1.2-ffs0.1
  • v2021.1.2-ffs0.2
98 results
Show changes
Showing
with 822 additions and 50 deletions
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2009 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
-%>
<h2><%:Upgrade firmware%></h2>
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>">
<p>
<%:You can manually upgrade your firmware here.%>
</p>
<% if bad_image then %>
<p class="error"><%:The provided firmware image is not valid for this device.%></p>
<% end %>
<div class="gluon-section-node">
<div class="gluon-value">
<label class="gluon-value-title">
<%:Firmware image%>
</label>
<div class="gluon-value-field">
<input type="file" name="image">
</div>
</div>
<div class="gluon-value gluon-value-last">
<label class="gluon-value-title">
<%:Keep settings%>
</label>
<div class="gluon-value-field">
<input id="keepcfg" type="checkbox" name="keepcfg" value="1" checked="checked">
<label for="keepcfg"></label>
</div>
</div>
</div>
<div class="gluon-page-actions">
<input type="hidden" name="step" value="2">
<input class="gluon-button gluon-button-submit" type="submit" value="<%:Upload image%>">
</div>
</form>
<%#
SPDX-FileCopyrightText: 2008 Steven Barth <steven@midlink.org>
SPDX-FileCopyrightText: 2008-2009 Jo-Philipp Wich <xm@subsignal.org>
SPDX-License-Identifier: Apache-2.0
-%>
<h2><%:Upgrade firmware%></h2>
<p>
<%:The firmware image has been transmitted. Please ensure the SHA-256 checksum and image size are correct and click "continue".%>
</p>
<% if flashsize > 0 and filesize > flashsize then %>
<p class="error"><%:The firmware is too big for your device's storage.%></p>
<% end %>
<p>
<ul>
<li>sha256sum: <code><%=checksum%></code></li>
<li><%:Size%>: <%
function byte_format(byte)
local suff = {"B", "KB", "MB", "GB", "TB"}
for i=1, 5 do
if byte > 1024 and i < 5 then
byte = byte / 1024
else
return string.format("%.2f %s", byte, suff[i])
end
end
end
write(byte_format(filesize))
if flashsize > 0 then
write(translatef(
" (%s available)",
byte_format(flashsize)
))
end
%></li>
</ul>
</p>
<div class="gluon-page-actions">
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>" style="display:inline">
<input type="hidden" name="step" value="3">
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>">
<input class="gluon-button gluon-button-submit" type="submit" value="<%:Continue%>">
</form>
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>" style="display:inline">
<input type="hidden" name="step" value="1">
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>">
<input class="gluon-button gluon-button-reset" type="submit" value="<%:Cancel%>">
</form>
</div>
<p>
<%:The firmware is currently being upgraded.%>
<strong><%:Don't switch off the device in any circumstance!%></strong>
<%:The upgrade will take a few minutes. When it is finished, your node will reboot automatically.%>
</p>
......@@ -10,42 +10,48 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "%u characters min."
msgstr "Mindestens %u Zeichen"
msgid "(%s available)"
msgstr "(%s verfügbar)"
msgid "Advanced settings"
msgstr "Erweiterte Einstellungen"
msgid ""
"Alternatively, you can set a password to access you node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty "
"Alternatively, you can set a password to access your node. Please choose a "
"secure password you don't use anywhere else.<br><br>If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
"Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres "
"Passwort, das du nirgendwo anders verwendest.<br /><br />Beim Setzen eines "
"Passwort, das du nirgendwo anders verwendest.<br><br>Beim Setzen eines "
"leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-"
"Einstellung)."
msgid "Cancel"
msgstr "Abbrechen"
msgid "Confirmation"
msgstr "Bestätigung"
msgid "Continue"
msgstr "Fortfahren"
msgid "Don't switch off the device in any circumstance!"
msgstr "Unterbrich auf keinen Fall die Stromversorgung!"
msgid "Expert Mode"
msgstr "Export Mode"
msgid "Firmware image"
msgstr "Firmware-Datei"
msgid "Firmware release"
msgstr "Firmware-Release"
msgid "Gluon version"
msgstr "Gluon-Version"
msgid "Hardware model"
msgstr "Hardware-Modell"
msgid "Information"
msgstr "Info"
msgid "MAC address"
msgstr "MAC-Adresse"
msgid "Keep settings"
msgstr "Konfiguration behalten"
msgid "Password"
msgstr "Passwort"
msgid "Password changed."
msgstr "Passwort geändert."
......@@ -53,23 +59,20 @@ msgstr "Passwort geändert."
msgid "Password removed."
msgstr "Passwort gelöscht."
msgid "Public VPN key"
msgstr "Öffentlicher VPN-Schlüssel"
msgid "Remote access"
msgstr "Remotezugriff"
msgid "SSH keys"
msgstr "SSH-Schlüssel"
msgid "Site"
msgstr "Site"
msgid "Size"
msgstr "Größe"
msgid ""
"The firmware image has been transmitted. Please ensure the MD5 checksum and "
"image size are correct and click \"continue\"."
"The firmware image has been transmitted. Please ensure the SHA-256 checksum "
"and image size are correct and click \"continue\"."
msgstr ""
"Die Firmwaredatei wurde übermittelt. Bitte vergleiche MD5-Checksumme und "
"Die Firmwaredatei wurde übermittelt. Bitte vergleiche SHA-256-Checksumme und "
"Dateigröße und klicke anschließend auf \"fortfahren\"."
msgid "The firmware is currently being upgraded."
......@@ -97,9 +100,6 @@ msgstr "Das Passwort konnte nicht geändert werden."
msgid "Upgrade firmware"
msgstr "Firmware aktualisieren"
msgid "Upgrading firmware"
msgstr "Firmware wird aktualisiert"
msgid "Upload image"
msgstr "Datei hochladen"
......
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-19 20:20+0100\n"
"Last-Translator: Bernot Tobias <tqbs@airmail.cc>\n"
"Language-Team: French\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "%u characters min."
msgstr "Au moins %u caractères"
msgid "(%s available)"
msgstr ""
msgid "Advanced settings"
msgstr "Paramètres avancés"
msgid ""
"Alternatively, you can set a password to access your node. Please choose a "
"secure password you don't use anywhere else.<br><br>If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
"Alternativement, vous pouvez mettre un mot de passe pour accéder à votre "
"nœud, Penseiz à choisir un mot de passe sûr, que vous n'utilisez nulle part "
"ailleurs. <br><br> Si vous n'entrez pas de mot de passe, la connexion par "
"mot de passe sera désactivée. La connexion par mot de passe est désactivée "
"par défaut."
msgid "Cancel"
msgstr "Annuler"
msgid "Confirmation"
msgstr "Confirmation"
msgid "Continue"
msgstr "Continuer"
msgid "Don't switch off the device in any circumstance!"
msgstr "N'interrompez en aucun cas l'alimentation!"
msgid "Firmware image"
msgstr "Fichier image"
msgid "Information"
msgstr "Informations"
msgid "Keep settings"
msgstr "Garder le paramètrage"
msgid "Password"
msgstr "Mot de passe"
msgid "Password changed."
msgstr "Mot de passe changé."
msgid "Password removed."
msgstr "Mot de passe effacé."
msgid "Remote access"
msgstr "Accès à distance"
msgid "SSH keys"
msgstr "Clé SSH"
msgid "Size"
msgstr "Taille"
msgid ""
"The firmware image has been transmitted. Please ensure the SHA-256 checksum "
"and image size are correct and click \"continue\"."
msgstr ""
"L'image de firmware a été transmise. Vérifiez que la somme SHA-256 et la "
"taille de l'image correspondent, et appuiez ensuite sur \"continuer\"."
msgid "The firmware is currently being upgraded."
msgstr "La firmware est en cours de mise à jour."
msgid "The firmware is too big for your device's storage."
msgstr "La firmware est trop grande pour la mémoire de l'appareil."
msgid "The password and the confirmation differ."
msgstr "Les deux mots de passe ne correspondent pas."
msgid "The provided firmware image is not valid for this device."
msgstr "La firmware fournie n'est pas une image valide pour cet appareil."
msgid ""
"The upgrade will take a few minutes. When it is finished, your node will "
"reboot automatically."
msgstr ""
"La mise à jour va prendre quelques minutes. Quand elle sera finie, votre "
"nœud va redémarrer automatiquement."
msgid "Unable to change the password."
msgstr "Le mot de passe n'a pas pu être changé."
msgid "Upgrade firmware"
msgstr "Mettre à jour la firmware"
msgid "Upload image"
msgstr "Transférer l'image"
msgid "You can manually upgrade your firmware here."
msgstr "Ici vous pouvez changer manuellement votre firmware."
msgid "You can provide your SSH keys here (one per line):"
msgstr "Ici vous pouvez entrer vos clés SSH (une par ligne):"
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"Alternatively, you can set a password to access you node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty "
"password, login via password will be disabled. This is the default."
msgid "%u characters min."
msgstr ""
msgid "Continue"
msgid "(%s available)"
msgstr ""
msgid "Don't switch off the device in any circumstance!"
msgid "Advanced settings"
msgstr ""
msgid "Expert Mode"
msgid ""
"Alternatively, you can set a password to access your node. Please choose a "
"secure password you don't use anywhere else.<br><br>If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
msgid "Firmware image"
msgid "Cancel"
msgstr ""
msgid "Confirmation"
msgstr ""
msgid "Firmware release"
msgid "Continue"
msgstr ""
msgid "Gluon version"
msgid "Don't switch off the device in any circumstance!"
msgstr ""
msgid "Hardware model"
msgid "Firmware image"
msgstr ""
msgid "Information"
msgstr ""
msgid "MAC address"
msgid "Keep settings"
msgstr ""
msgid "Password changed."
msgid "Password"
msgstr ""
msgid "Password removed."
msgid "Password changed."
msgstr ""
msgid "Public VPN key"
msgid "Password removed."
msgstr ""
msgid "Remote access"
......@@ -49,12 +52,12 @@ msgstr ""
msgid "SSH keys"
msgstr ""
msgid "Site"
msgid "Size"
msgstr ""
msgid ""
"The firmware image has been transmitted. Please ensure the MD5 checksum and "
"image size are correct and click \"continue\"."
"The firmware image has been transmitted. Please ensure the SHA-256 checksum "
"and image size are correct and click \"continue\"."
msgstr ""
msgid "The firmware is currently being upgraded."
......@@ -80,9 +83,6 @@ msgstr ""
msgid "Upgrade firmware"
msgstr ""
msgid "Upgrading firmware"
msgstr ""
msgid "Upload image"
msgstr ""
......
package 'gluon-web-admin'
local root = node()
if not root.target then
root.target = alias("admin")
end
entry({"admin"}, alias("admin", "info"), _("Advanced settings"), 10)
entry({"admin", "info"}, template("admin/info"), _("Information"), 1)
entry({"admin", "remote"}, model("admin/remote"), _("Remote access"), 10)
--[[
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
package 'gluon-web-admin'
local util = require 'gluon.util'
local unistd = require 'posix.unistd'
local file
local tmpfile = "/tmp/firmware.img"
local compat_option = "--ignore-minor-compat-version"
local function filehandler(_, chunk, eof)
if not unistd.access(tmpfile) and not file and chunk and #chunk > 0 then
file = io.open(tmpfile, "w")
end
if file and chunk then
file:write(chunk)
end
if file and eof then
file:close()
end
end
local function action_upgrade(http, renderer)
local fcntl = require 'posix.fcntl'
local stat = require 'posix.sys.stat'
local function fork_exec(argv)
local pid = unistd.fork()
if pid > 0 then
return
elseif pid == 0 then
-- change to root dir
unistd.chdir('/')
-- patch stdin, out, err to /dev/null
local null = fcntl.open('/dev/null', fcntl.O_RDWR)
if null then
unistd.dup2(null, unistd.STDIN_FILENO)
unistd.dup2(null, unistd.STDOUT_FILENO)
unistd.dup2(null, unistd.STDERR_FILENO)
if null > 2 then
unistd.close(null)
end
end
-- Sleep a little so the browser can fetch everything required to
-- display the reboot page, then reboot the device.
unistd.sleep(1)
-- replace with target command
unistd.exec(argv[0], argv)
end
end
local function image_supported(supported_tmpfile)
return (os.execute(string.format("exec /sbin/sysupgrade -T %s %q >/dev/null", compat_option, supported_tmpfile)) == 0)
end
local function storage_size()
local size = 0
if unistd.access("/proc/mtd") then
for l in io.lines("/proc/mtd") do
local s, n = l:match('^[^%s]+%s+([^%s]+)%s+[^%s]+%s+"([^%s]+)"')
if n == "firmware" then
size = tonumber(s, 16)
break
end
end
elseif unistd.access("/proc/partitions") then
for l in io.lines("/proc/partitions") do
local b, n = l:match('^%s*%d+%s+%d+%s+([^%s]+)%s+([^%s]+)')
if b and n and not n:match('[0-9]') then
size = tonumber(b) * 1024
break
end
end
end
return size
end
local function image_checksum(checksum_tmpfile)
return (util.exec(string.format("exec sha256sum %q", checksum_tmpfile)):match("^([^%s]+)"))
end
-- Determine state
local step = tonumber(http:getenv("REQUEST_METHOD") == "POST" and http:formvalue("step")) or 1
local has_image = unistd.access(tmpfile)
local has_support = has_image and image_supported(tmpfile)
-- Step 1: file upload, error on unsupported image format
if step == 1 or not has_support then
-- If there is an image but user has requested step 1
-- or type is not supported, then remove it.
if has_image then
unistd.unlink(tmpfile)
end
renderer.render_layout('admin/upgrade', {
bad_image = has_image and not has_support,
}, 'gluon-web-admin')
-- Step 2: present uploaded file, show checksum, confirmation
elseif step == 2 then
renderer.render_layout('admin/upgrade_confirm', {
checksum = image_checksum(tmpfile),
filesize = stat.stat(tmpfile).st_size,
flashsize = storage_size(),
keepconfig = (http:formvalue("keepcfg") == "1"),
}, 'gluon-web-admin')
elseif step == 3 then
local cmd = {[0] = '/sbin/sysupgrade', compat_option, tmpfile}
if http:formvalue('keepcfg') ~= '1' then
table.insert(cmd, 1, '-n')
end
fork_exec(cmd)
renderer.render_layout('admin/upgrade_reboot', nil, 'gluon-web-admin', {
hidenav = true,
})
end
end
local has_platform = unistd.access("/lib/upgrade/platform.sh")
if has_platform then
local upgrade = entry({"admin", "upgrade"}, call(action_upgrade), _("Upgrade firmware"), 90)
upgrade.filehandler = filehandler
end
--[[
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
Copyright 2013 Nils Schneider <nils@nilsschneider.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
local util = require 'gluon.util'
local site = require 'gluon.site'
local sp = util.subprocess
local unistd = require 'posix.unistd'
local wait = require 'posix.sys.wait'
local f_keys = Form(translate("SSH keys"), translate("You can provide your SSH keys here (one per line):"), 'keys')
local s = f_keys:section(Section)
local keys = s:option(TextValue, "keys")
keys.wrap = "off"
keys.rows = 5
keys.default = util.readfile("/etc/dropbear/authorized_keys") or ""
function keys:write(value)
value = util.trim(value:gsub("\r", ""))
if value ~= "" then
local f = io.open("/etc/dropbear/authorized_keys", "w")
f:write(value, "\n")
f:close()
else
unistd.unlink("/etc/dropbear/authorized_keys")
end
end
local config = site.config_mode.remote_login
if not config.show_password_form(false) then
-- password login is disabled in site.conf
return f_keys
end
local min_password_length = config.min_password_length(12)
local mintype = 'minlength(' .. min_password_length .. ')'
local length_hint
if min_password_length > 1 then
length_hint = translatef("%u characters min.", min_password_length)
end
local f_password = Form(translate("Password"), translate(
"Alternatively, you can set a password to access your node. Please choose a "
.. "secure password you don't use anywhere else.<br><br>If you set an empty "
.. "password, login via password will be disabled. This is the default."
), 'password'
)
f_password.reset = false
s = f_password:section(Section)
local pw1 = s:option(Value, "pw1", translate("Password"))
pw1.password = true
pw1.optional = true
pw1.datatype = mintype
function pw1.cfgvalue()
return ''
end
local pw2 = s:option(Value, "pw2", translate("Confirmation"), length_hint)
pw2.password = true
pw2.optional = true
pw2.datatype = mintype
function pw2.cfgvalue()
return ''
end
local function set_password(password)
local options = {
stdin = sp.PIPE,
stdout = sp.DEVNULL,
stderr = sp.DEVNULL,
}
local pid, pipe = sp.popen('passwd', {}, options)
if not pid then
return false
end
local inw = pipe.stdin
unistd.write(inw, string.format('%s\n%s\n', password, password))
unistd.close(inw)
local wpid, status, code = wait.wait(pid)
return wpid and status == 'exited' and code == 0
end
function f_password:write()
if pw1.data ~= pw2.data then
f_password.errmessage = translate("The password and the confirmation differ.")
return
end
local pw = pw1.data
if pw ~= nil and #pw > 0 then
if set_password(pw) then
f_password.message = translate("Password changed.")
else
f_password.errmessage = translate("Unable to change the password.")
end
else
-- We don't check the return code here as the error 'password for root is already locked' is normal...
os.execute('passwd -l root >/dev/null')
f_password.message = translate("Password removed.")
end
end
return f_keys, f_password
# Copyright (C) 2013 Nils Schneider <nils at nilsschneider.net>
# This is free software, licensed under the Apache 2.0 license.
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-web-autoupdater
include ../gluon.mk
define Package/gluon-web-autoupdater
TITLE:=gluon-web module for gluon-autoupdater
DEPENDS:=+gluon-web-admin +gluon-autoupdater
endef
$(eval $(call BuildPackageGluon,gluon-web-autoupdater))
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 01:55+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
......@@ -15,3 +15,6 @@ msgstr "Automatische Updates"
msgid "Branch"
msgstr "Branch"
msgid "Enable"
msgstr "Aktivieren"
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-19 20:20+0100\n"
"Last-Translator: Bernot Tobias <tqbs@airmail.cc>\n"
"Language-Team: French\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Automatic updates"
msgstr "Mise a jour automatique"
msgid "Branch"
msgstr "Branche"
msgid "Enable"
msgstr "Activer"
......@@ -6,3 +6,6 @@ msgstr ""
msgid "Branch"
msgstr ""
msgid "Enable"
msgstr ""
package 'gluon-web-autoupdater'
entry({"admin", "autoupdater"}, model("admin/autoupdater"), _("Automatic updates"), 80)
-- SPDX-FileCopyrightText: 2013 Nils Schneider <nils@nilsschneider.net>
-- SPDX-License-Identifier: Apache-2.0
local uci = require("simple-uci").cursor()
local autoupdater = uci:get_first("autoupdater", "autoupdater")
local f = Form(translate("Automatic updates"))
local s = f:section(Section)
local o
o = s:option(Flag, "enabled", translate("Enable"))
o.default = uci:get_bool("autoupdater", autoupdater, "enabled")
function o:write(data)
uci:set("autoupdater", autoupdater, "enabled", data)
end
o = s:option(ListValue, "branch", translate("Branch"))
local branches = {}
uci:foreach("autoupdater", "branch", function(branch)
table.insert(branches, branch)
end)
table.sort(branches, function(a, b)
return a.name < b.name
end)
for _, branch in ipairs(branches) do
o:value(branch[".name"], branch.name)
end
o.default = uci:get("autoupdater", autoupdater, "branch")
function o:write(data)
uci:set("autoupdater", autoupdater, "branch", data)
end
function f:write()
uci:commit("autoupdater")
end
return f
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-web-cellular
include ../gluon.mk
define Package/gluon-web-cellular
DEPENDS:=+gluon-web-admin
TITLE:=UI for activating cellular WAN
endef
$(eval $(call BuildPackageGluon,gluon-web-cellular))
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2023-01-23 13:33+0100\n"
"Last-Translator: Tom Herbers <mail@tomherbers.de>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "APN"
msgstr ""
msgid "Cellular"
msgstr ""
msgid "Enabled"
msgstr "Aktiviert"
msgid "IPv4"
msgstr ""
msgid "IPv4/IPv6"
msgstr ""
msgid "IPv6"
msgstr ""
msgid "Password"
msgstr "Passwort"
msgid "SIM PIN"
msgstr ""
msgid "Type"
msgstr "Typ"
msgid "Username"
msgstr "Nutzername"
msgid ""
"You can enable uplink via cellular service. If you decide so, the VPN "
"connection is established using the integrated WWAN modem."
msgstr ""
"Du kannst den Uplink über einen Mobilfunk Service aktivieren. Wenn du "
"dich dafür entscheidest, wird die VPN-Verbindung über das integrierte "
"Mobilfunk-Modem hergestellt."
msgid "Authentication"
msgstr "Authentifizierung"
msgid "None"
msgstr "Keine"
msgid "PAP"
msgstr ""
msgid "CHAP"
msgstr ""
msgid "Both"
msgstr "Beide"
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "APN"
msgstr ""
msgid "Cellular"
msgstr ""
msgid "Enabled"
msgstr ""
msgid "IPv4"
msgstr ""
msgid "IPv4/IPv6"
msgstr ""
msgid "IPv6"
msgstr ""
msgid "Password"
msgstr ""
msgid "SIM PIN"
msgstr ""
msgid "Type"
msgstr ""
msgid "Username"
msgstr ""
msgid ""
"You can enable uplink via cellular service. If you decide so, the VPN "
"connection is established using the integrated WWAN modem."
msgstr ""
msgid "Authentication"
msgstr ""
msgid "None"
msgstr ""
msgid "PAP"
msgstr ""
msgid "CHAP"
msgstr ""
msgid "Both"
msgstr ""
local platform = require 'gluon.platform'
package 'gluon-web-cellular'
if platform.is_cellular_device() then
entry({"admin", "cellular"}, model("admin/cellular"), _("Cellular"), 30)
end
local uci = require("simple-uci").cursor()
local f = Form(translate("Cellular"))
local s = f:section(Section, nil, translate(
'You can enable uplink via cellular service. If you decide so, the VPN connection is established '
.. 'using the integrated WWAN modem.'
))
local enabled = s:option(Flag, "enabled", translate("Enabled"))
enabled.default = uci:get('gluon', 'cellular') and uci:get_bool('gluon', 'cellular', 'enabled')
local pin = s:option(Value, "pin", translate("SIM PIN"))
pin:depends(enabled, true)
pin.default = uci:get('gluon', 'cellular', 'pin')
local apn = s:option(Value, "apn", translate("APN"))
apn:depends(enabled, true)
apn.default = uci:get('gluon', 'cellular', 'apn')
local pdptype = s:option(ListValue, "type", translate("Type"))
pdptype:depends(enabled, true)
pdptype:value("IP", translate("IPv4"))
pdptype:value("IPV6", translate("IPv6"))
pdptype:value("IPV4V6", translate("IPv4/IPv6"))
pdptype.default = uci:get('gluon', 'cellular', 'pdptype') or "IP"
local username = s:option(Value, "username", translate("Username"))
username:depends(enabled, true)
username.default = uci:get('gluon', 'cellular', 'username')
local password = s:option(Value, "password", translate("Password"))
password:depends(enabled, true)
password.default = uci:get('gluon', 'cellular', 'password')
local auth = s:option(ListValue, "auth", translate("Authentication"))
auth:depends(enabled, true)
auth:value("none", translate("None"))
auth:value("pap", translate("PAP"))
auth:value("chap", translate("CHAP"))
auth:value("both", translate("Both"))
auth.default = uci:get('gluon', 'cellular', 'auth') or "none"
function f:write()
local cellular_enabled = false
if enabled.data then
cellular_enabled = true
end
uci:section('gluon', 'cellular', 'cellular', {
enabled = cellular_enabled,
apn = apn.data,
pdptype = pdptype.data,
pin = pin.data,
username = username.data,
password = password.data,
auth = auth.data,
})
uci:commit('gluon')
end
return f