Commit 74cdfd88 authored by jan.koester's avatar jan.koester
Browse files

test

parent d1605be3
Loading
Loading
Loading
Loading
+4 −3
Changes for modules/containers/containers.cpp: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *   list                  -> {containers, images, jobs, bridges} or
 *                            {unavailable} when containerd isn't there
 *       containers: [{name, image, state, pid, started, exitCode, restarts,
 *           error?, network, address?, address6?, ipv6? (false if off), vlan?, lease?, autostart, restart, memory, tasks}]
 *           error?, network, address?, address6?, ipv6? (false if off), vlan?, lease?, lease6?, autostart, restart, memory, tasks}]
 *       images: [{image, id, digest, size, layers, created, pulled,
 *           architecture, entrypoint?, cmd?, workdir?, user?, env[], ports[],
 *           volumes[], usedBy[]}]
@@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *   create {container}    a container: name, image, entrypoint[], args[],
 *   update {name, container}   env[], user, workdir, hostname, boot,
 *                         autostart, restart, network, bridge, address,
 *                         gateway, address6, gateway6, ipv6, mac, vlan (0: none), dns[], binds[], tmpfs[], devices[], readOnly,
 *                         gateway, address6, gateway6, ipv6, dhcp6, mac, vlan (0: none), dns[], binds[], tmpfs[], devices[], readOnly,
 *                         memoryMax, tasksMax, capabilities[],
 *                         dropCapabilities[] (update: name renames)
 *   delete {name}         (its files go in the background)
@@ -93,7 +93,7 @@ namespace {

using Fields = std::vector<std::pair<std::string, std::string>>;

const std::set<std::string> Flags = {"boot", "autostart", "read_only", "ipv6"};
const std::set<std::string> Flags = {"boot", "autostart", "read_only", "ipv6", "dhcp6"};
const std::set<std::string> Numbers = {"pid", "started", "exit_code", "restarts", "memory", "tasks", "size", "layers",
                                       "pulled", "memory_max", "tasks_max", "seconds", "finished", "vlan"};
// repeated keys -> JSON list names
@@ -264,6 +264,7 @@ std::string settingsFields(json_object *c, Fields &f, bool create) {
    text("address6", "address6");
    text("gateway6", "gateway6");
    flag("ipv6", "ipv6");
    flag("dhcp6", "dhcp6");
    text("mac", "mac");
    number("vlan", "vlan");
    flag("readOnly", "read_only");
+10 −2
Changes for www/modules/containers.js: 10 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@
    'empty: by SLAAC': 'leer: per SLAAC', 'empty: from router advertisements': 'leer: aus Router-Advertisements',
    'Without an IPv6 address the container takes one by SLAAC when a router in the bridge advertises a prefix.':
      'Ohne IPv6-Adresse bezieht der Container eine per SLAAC, wenn ein Router in der Bridge ein Präfix ankündigt.',
    'DHCPv6 when the router asks for it': 'DHCPv6, wenn der Router es verlangt',
    'Router advertisements also bring name servers (they go into the container\'s resolv.conf unless DNS servers are set). DHCPv6 starts when they ask for it: for an address (M flag) or for name servers only (O flag); not with an IPv6 gateway set.':
      'Router-Advertisements bringen auch Nameserver mit (sie kommen in die resolv.conf des Containers, wenn keine DNS-Server eingetragen sind). DHCPv6 startet, wenn sie es verlangen: für eine Adresse (M-Flag) oder nur für Nameserver (O-Flag); nicht bei eingetragenem IPv6-Gateway.',
    'DHCPv6: {0}': 'DHCPv6: {0}',
    'VLAN (0: none)': 'VLAN (0: keins)', 'VLAN {0}': 'VLAN {0}',
    'The VLAN must be between 0 and 4094.': 'Das VLAN muss zwischen 0 und 4094 liegen.',
    'With a VLAN the container is an access port of it: the bridge filters VLANs (its other ports stay untagged), its uplinks carry the VLAN tagged, so the switch port must too.':
@@ -319,7 +323,9 @@
          h('div', {class: 'row'},
            h('label', {}, t('IPv6 address (CIDR)'), h('input', {name: 'address6', value: c.address6 || '', placeholder: t('empty: by SLAAC')})),
            h('label', {}, t('IPv6 gateway'), h('input', {name: 'gateway6', value: c.gateway6 || '', placeholder: t('empty: from router advertisements')}))),
          h('p', {class: 'hint'}, t('Without an IPv6 address the container takes one by SLAAC when a router in the bridge advertises a prefix.')));
          h('label', {class: 'check'}, h('input', {type: 'checkbox', name: 'dhcp6', checked: !!c.dhcp6}), t('DHCPv6 when the router asks for it')),
          h('p', {class: 'hint'}, t('Without an IPv6 address the container takes one by SLAAC when a router in the bridge advertises a prefix.') + ' ' +
            t('Router advertisements also bring name servers (they go into the container\'s resolv.conf unless DNS servers are set). DHCPv6 starts when they ask for it: for an address (M flag) or for name servers only (O flag); not with an IPv6 gateway set.')));
        ipv6.addEventListener('change', () => { ipv6Box.hidden = !ipv6.checked; });
        ipv6Box.hidden = !ipv6.checked;
        const portsHint = h('p', {class: 'hint'});
@@ -399,7 +405,8 @@
          gateway: d.network === 'bridge' && !d.dhcp ? d.gateway.trim() : '',
          ipv6: d.network !== 'bridge' || d.ipv6,
          address6: d.network === 'bridge' && d.ipv6 ? d.address6.trim() : '',
          gateway6: d.network === 'bridge' && d.ipv6 ? d.gateway6.trim() : '', mac: d.network === 'bridge' ? d.mac.trim() : '', vlan,
          gateway6: d.network === 'bridge' && d.ipv6 ? d.gateway6.trim() : '',
          dhcp6: d.network === 'bridge' && d.ipv6 && !!d.dhcp6, mac: d.network === 'bridge' ? d.mac.trim() : '', vlan,
          dns: words(d.dns), args: words(d.args),
          entrypoint: words(d.entrypoint), env: lines(d.env), binds: lines(d.binds), tmpfs: lines(d.tmpfs), devices: lines(d.devices),
          user: d.user.trim(), workdir: d.workdir.trim(), hostname: d.hostname.trim(),
@@ -449,6 +456,7 @@
            : [c.address === 'dhcp' ? h('span', {class: 'mono'}, c.lease ? t('DHCP: {0}', c.lease) : t('DHCP'))
                                    : h('span', {class: 'mono'}, c.address || t('bridge')),
               c.address6 ? [h('br'), h('span', {class: 'mono'}, c.address6)] : null,
               c.lease6 ? [h('br'), h('span', {class: 'mono'}, t('DHCPv6: {0}', c.lease6))] : null,
               c.vlan ? [' ', h('span', {class: 'badge'}, t('VLAN {0}', c.vlan))] : null]},
          {title: t('Memory'), render: c => c.state === 'running' && c.memory ? mib(c.memory) : ''},
          {title: '', class: 'actions', render: c => {