summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-09-05 18:35:39 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-09-07 14:54:35 +0000
commita8e73794ec421ad2bb0053214504f20a1dc3b21a (patch)
treedef1b03e7a364803f21239a39dff56a1238b563a /interface-definitions
parent735767f09f891c438e43565f935b927e6f1b317d (diff)
downloadvyos-1x-a8e73794ec421ad2bb0053214504f20a1dc3b21a.tar.gz
vyos-1x-a8e73794ec421ad2bb0053214504f20a1dc3b21a.zip
update-check: T3476: Allow update-check for VyOS images
Ability to autocheck available new images Parse remote URL JSON image-version.json file and compare version VyOS with a local current version, if find diff sent wall message that the new image is available Also, add op-mode command to check images "show system image" With option "auto-check" check will be once per 12 hours set system update-check auto-check set system update-check url 'http://example.com/image-version.json' If new version is available shows it per login (MOTD)
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/include/url.xml.i15
-rw-r--r--interface-definitions/system-update-check.xml.in22
2 files changed, 37 insertions, 0 deletions
diff --git a/interface-definitions/include/url.xml.i b/interface-definitions/include/url.xml.i
new file mode 100644
index 000000000..caa6f67bd
--- /dev/null
+++ b/interface-definitions/include/url.xml.i
@@ -0,0 +1,15 @@
+<!-- include start from url.xml.i -->
+<leafNode name="url">
+ <properties>
+ <help>Remote URL</help>
+ <valueHelp>
+ <format>url</format>
+ <description>Remote URL</description>
+ </valueHelp>
+ <constraint>
+ <regex>^https?:\/\/?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\:[0-9]+)*(\/.*)?</regex>
+ </constraint>
+ <constraintErrorMessage>Incorrect URL format</constraintErrorMessage>
+ </properties>
+</leafNode>
+<!-- include end -->
diff --git a/interface-definitions/system-update-check.xml.in b/interface-definitions/system-update-check.xml.in
new file mode 100644
index 000000000..e4d7041ec
--- /dev/null
+++ b/interface-definitions/system-update-check.xml.in
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interfaceDefinition>
+ <node name="system">
+ <children>
+ <node name="update-check" owner="${vyos_conf_scripts_dir}/system_update_check.py">
+ <properties>
+ <help>Check available update images</help>
+ <priority>9999</priority>
+ </properties>
+ <children>
+ <leafNode name="auto-check">
+ <properties>
+ <help>Enable auto check for new images</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ #include <include/url.xml.i>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>