mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
doc update
This commit is contained in:
@ -251,6 +251,7 @@ option.
|
||||
| `--openvpn` | openvpn-status.log file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/openvpn) |
|
||||
| `--os-prober` | `os-prober` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/os_prober) |
|
||||
| `--os-release` | `/etc/os-release` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/os_release) |
|
||||
| `--pacman` | `pacman` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pacman) |
|
||||
| `--passwd` | `/etc/passwd` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd) |
|
||||
| `--path` | POSIX path string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/path) |
|
||||
| `--path-list` | POSIX path list string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/path_list) |
|
||||
@ -317,6 +318,7 @@ option.
|
||||
| `--vmstat-s` | `vmstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s) |
|
||||
| `--w` | `w` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/w) |
|
||||
| `--wc` | `wc` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wc) |
|
||||
| `--wg-show` | `wg show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wg_show) |
|
||||
| `--who` | `who` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
||||
| `--x509-cert` | X.509 PEM and DER certificate file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert) |
|
||||
| `--x509-csr` | X.509 PEM and DER certificate request file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_csr) |
|
||||
|
@ -3,8 +3,8 @@ _jc()
|
||||
local cur prev words cword jc_commands jc_parsers jc_options \
|
||||
jc_about_options jc_about_mod_options jc_help_options jc_special_options
|
||||
|
||||
jc_commands=(acpi airport apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
||||
jc_parsers=(--acpi --airport --airport-s --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_commands=(acpi airport apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pacman pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc wg who xrandr zipinfo zpool)
|
||||
jc_parsers=(--acpi --airport --airport-s --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --slurp -s --unbuffer -u --yaml-out -y)
|
||||
jc_about_options=(--about -a)
|
||||
jc_about_mod_options=(--pretty -p --yaml-out -y --monochrome -m --force-color -C)
|
||||
|
@ -9,7 +9,7 @@ _jc() {
|
||||
jc_help_options jc_help_options_describe \
|
||||
jc_special_options jc_special_options_describe
|
||||
|
||||
jc_commands=(acpi airport apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
||||
jc_commands=(acpi airport apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pacman pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc wg who xrandr zipinfo zpool)
|
||||
jc_commands_describe=(
|
||||
'acpi:run "acpi" command with magic syntax.'
|
||||
'airport:run "airport" command with magic syntax.'
|
||||
@ -72,6 +72,7 @@ _jc() {
|
||||
'nsd-control:run "nsd-control" command with magic syntax.'
|
||||
'ntpq:run "ntpq" command with magic syntax.'
|
||||
'os-prober:run "os-prober" command with magic syntax.'
|
||||
'pacman:run "pacman" command with magic syntax.'
|
||||
'pidstat:run "pidstat" command with magic syntax.'
|
||||
'ping:run "ping" command with magic syntax.'
|
||||
'ping6:run "ping6" command with magic syntax.'
|
||||
@ -117,12 +118,13 @@ _jc() {
|
||||
'vmstat:run "vmstat" command with magic syntax.'
|
||||
'w:run "w" command with magic syntax.'
|
||||
'wc:run "wc" command with magic syntax.'
|
||||
'wg:run "wg" command with magic syntax.'
|
||||
'who:run "who" command with magic syntax.'
|
||||
'xrandr:run "xrandr" command with magic syntax.'
|
||||
'zipinfo:run "zipinfo" command with magic syntax.'
|
||||
'zpool:run "zpool" command with magic syntax.'
|
||||
)
|
||||
jc_parsers=(--acpi --airport --airport-s --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_parsers=(--acpi --airport --airport-s --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_parsers_describe=(
|
||||
'--acpi:`acpi` command parser'
|
||||
'--airport:`airport -I` command parser'
|
||||
@ -219,6 +221,7 @@ _jc() {
|
||||
'--openvpn:openvpn-status.log file parser'
|
||||
'--os-prober:`os-prober` command parser'
|
||||
'--os-release:`/etc/os-release` file parser'
|
||||
'--pacman:`pacman` command parser'
|
||||
'--passwd:`/etc/passwd` file parser'
|
||||
'--path:POSIX path string parser'
|
||||
'--path-list:POSIX path list string parser'
|
||||
@ -336,6 +339,7 @@ _jc() {
|
||||
'--vmstat-s:`vmstat` command streaming parser'
|
||||
'--w:`w` command parser'
|
||||
'--wc:`wc` command parser'
|
||||
'--wg-show:`wg show` command parser'
|
||||
'--who:`who` command parser'
|
||||
'--x509-cert:X.509 PEM and DER certificate file parser'
|
||||
'--x509-csr:X.509 PEM and DER certificate request file parser'
|
||||
|
@ -56,7 +56,7 @@ Schema:
|
||||
{
|
||||
"address": string,
|
||||
"status": string,
|
||||
"prefix_length": int,
|
||||
"prefix_length": integer,
|
||||
}
|
||||
],
|
||||
"ipv4_addresses": [
|
||||
@ -77,12 +77,16 @@ Schema:
|
||||
string
|
||||
],
|
||||
"primary_wins_server": string,
|
||||
"lease_expires": string, # [0]
|
||||
"lease_obtained": string, # [0]
|
||||
"lease_expires": string,
|
||||
"lease_expires_epoch": integer, # [0]
|
||||
"lease_expires_iso": string,
|
||||
"lease_obtained": string,
|
||||
"lease_obtained_epoch": integer, # [0]
|
||||
"lease_obtained_iso": string,
|
||||
"netbios_over_tcpip": boolean,
|
||||
"media_state": string,
|
||||
"extras": [
|
||||
string: string
|
||||
<string>: string
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -90,9 +94,8 @@ Schema:
|
||||
}
|
||||
|
||||
Notes:
|
||||
[0] - 'lease_expires' and 'lease_obtained' are parsed to ISO8601
|
||||
format date strings. if the value was unable to be parsed by
|
||||
datetime, the fields will be in their raw form
|
||||
[0] - The epoch calculated timestamp field is naive. (i.e. based on
|
||||
the local time of the system the parser is run on)
|
||||
[1] - 'autoconfigured' under 'ipv4_address' is only providing
|
||||
indication if the ipv4 address was labeled as "Autoconfiguration
|
||||
IPv4 Address" vs "IPv4 Address". It does not infer any
|
||||
|
@ -380,4 +380,4 @@ Compatibility: linux, darwin, freebsd, win32
|
||||
|
||||
Source: [`jc/parsers/netstat.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/netstat.py)
|
||||
|
||||
Version 1.15 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.16 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
@ -33,9 +33,13 @@ Schema:
|
||||
"zone": string
|
||||
"status": {
|
||||
"state": string,
|
||||
"pattern": string, # Additional
|
||||
"catalog-member-id": string, # Additional
|
||||
"served-serial": string,
|
||||
"commit-serial": string,
|
||||
"wait": string
|
||||
"notified-serial": string, # Conditional
|
||||
"wait": string,
|
||||
"transfer": string # Conditional
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -89,4 +93,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/nsd_control.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/nsd_control.py)
|
||||
|
||||
Version 1.1 by Pettai (pettai@sunet.se)
|
||||
Version 1.2 by Pettai (pettai@sunet.se)
|
||||
|
195
docs/parsers/pacman.md
Normal file
195
docs/parsers/pacman.md
Normal file
@ -0,0 +1,195 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pacman"></a>
|
||||
|
||||
# jc.parsers.pacman
|
||||
|
||||
jc - JSON Convert `pacman` command output parser
|
||||
|
||||
Supports the following `pacman` arguments:
|
||||
|
||||
- `-Si`
|
||||
- `-Sii`
|
||||
- `-Qi`
|
||||
- `-Qii`
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ pacman -Si <package> | jc --pacman
|
||||
|
||||
or
|
||||
|
||||
$ jc pacman -Si <package>
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('pacman', pacman_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"repository": string,
|
||||
"name": string,
|
||||
"version": string,
|
||||
"description": string,
|
||||
"architecture": string,
|
||||
"url": string,
|
||||
"licenses": [
|
||||
string
|
||||
],
|
||||
"groups": [
|
||||
string
|
||||
],
|
||||
"provides": [
|
||||
string
|
||||
],
|
||||
"depends_on": [
|
||||
string
|
||||
],
|
||||
"optional_deps": [
|
||||
{
|
||||
"name": string,
|
||||
"description": string
|
||||
}
|
||||
],
|
||||
"optional_for": [
|
||||
string
|
||||
],
|
||||
"conflicts_with": [
|
||||
string
|
||||
],
|
||||
"replaces": [
|
||||
string
|
||||
],
|
||||
"download_size": integer, # in bytes
|
||||
"installed_size": integer, # in bytes
|
||||
"packager": string,
|
||||
"build_date": string,
|
||||
"validated_by": [
|
||||
string
|
||||
],
|
||||
"backup_files": [
|
||||
string
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ pacman -qii zstd | jc --pacman -p
|
||||
[
|
||||
{
|
||||
"name": "zstd",
|
||||
"version": "1.5.6-1",
|
||||
"description": "Zstandard - Fast real-time compression algorithm",
|
||||
"architecture": "x86_64",
|
||||
"url": "https://facebook.github.io/zstd/",
|
||||
"licenses": [
|
||||
"BSD-3-Clause",
|
||||
"GPL-2.0-only"
|
||||
],
|
||||
"groups": [],
|
||||
"provides": [
|
||||
"libzstd.so=1-64"
|
||||
],
|
||||
"depends_on": [
|
||||
"glibc",
|
||||
"gcc-libs",
|
||||
"zlib",
|
||||
"xz",
|
||||
"lz4"
|
||||
],
|
||||
"required_by": [
|
||||
"android-tools",
|
||||
"appstream",
|
||||
...
|
||||
"tiled",
|
||||
"vulkan-radeon",
|
||||
"wireshark-cli"
|
||||
],
|
||||
"optional_for": [
|
||||
"xarchiver"
|
||||
],
|
||||
"conflicts_with": [],
|
||||
"replaces": [],
|
||||
"installed_size": "1563648",
|
||||
"packager": "Levente Polyak <anthraxx@archlinux.org>",
|
||||
"build_date": "Sat 11 May 2024 06:14:19 AM +08",
|
||||
"install_date": "Fri 24 May 2024 09:50:31 AM +08",
|
||||
"install_reason": "Installed as a dependency for another package",
|
||||
"install_script": "No",
|
||||
"validated_by": [
|
||||
"Signature"
|
||||
],
|
||||
"extended_data": "pkgtype=pkg"
|
||||
}
|
||||
]
|
||||
|
||||
$ pacman -qii zstd | jc --pacman -p -r
|
||||
[
|
||||
{
|
||||
"name": "zstd",
|
||||
"version": "1.5.6-1",
|
||||
"description": "Zstandard - Fast real-time compression algorithm",
|
||||
"architecture": "x86_64",
|
||||
"url": "https://facebook.github.io/zstd/",
|
||||
"licenses": "BSD-3-Clause GPL-2.0-only",
|
||||
"groups": null,
|
||||
"provides": "libzstd.so=1-64",
|
||||
"depends_on": "glibc gcc-libs zlib xz lz4",
|
||||
"required_by": [
|
||||
"android-tools appstream avr-gcc binutils blender blosc",
|
||||
"boost-libs btrfs-progs cloudflare-warp-bin comgr curl",
|
||||
"dolphin-emu file flatpak gcc gdal gnutls karchive",
|
||||
"karchive5 kmod lib32-zstd libarchive libelf libtiff",
|
||||
"libva-mesa-driver libxmlb libzip lld llvm-libs mariadb-libs",
|
||||
"mesa mesa-vdpau minizip-ng mkinitcpio mold netcdf",
|
||||
"opencl-clover-mesa opencl-rusticl-mesa openucx postgresql",
|
||||
"postgresql-libs ppsspp qemu-img qemu-system-riscv",
|
||||
"qemu-system-x86 qgis qt6-base qt6-tools rsync rustup",
|
||||
"squashfs-tools squashfuse systemd-libs tiled vulkan-radeon",
|
||||
"wireshark-cli"
|
||||
],
|
||||
"optional_for": "xarchiver",
|
||||
"conflicts_with": null,
|
||||
"replaces": null,
|
||||
"installed_size": "1527.00 KiB",
|
||||
"packager": "Levente Polyak <anthraxx@archlinux.org>",
|
||||
"build_date": "Sat 11 May 2024 06:14:19 AM +08",
|
||||
"install_date": "Fri 24 May 2024 09:50:31 AM +08",
|
||||
"install_reason": "Installed as a dependency for another package",
|
||||
"install_script": "No",
|
||||
"validated_by": "Signature",
|
||||
"extended_data": "pkgtype=pkg"
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.pacman.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/pacman.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pacman.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
@ -210,4 +210,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/rpm_qi.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/rpm_qi.py)
|
||||
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
@ -145,4 +145,4 @@ Compatibility: linux, darwin, freebsd
|
||||
|
||||
Source: [`jc/parsers/traceroute.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/traceroute.py)
|
||||
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
172
docs/parsers/wg_show.md
Normal file
172
docs/parsers/wg_show.md
Normal file
@ -0,0 +1,172 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.wg_show"></a>
|
||||
|
||||
# jc.parsers.wg_show
|
||||
|
||||
jc - JSON Convert `wg show` command output parser
|
||||
|
||||
Parses the output of the `wg show all dump` command, providing structured JSON output for easy integration and analysis.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ wg show all dump | jc --wg-show
|
||||
|
||||
or
|
||||
|
||||
$ jc wg show all dump
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('wg-show', wg_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"device": string,
|
||||
"private_key": string,
|
||||
"public_key": string,
|
||||
"listen_port": integer,
|
||||
"fwmark": integer,
|
||||
"peers": [
|
||||
{
|
||||
"public_key": string,
|
||||
"preshared_key": string,
|
||||
"endpoint": string,
|
||||
"latest_handshake": integer,
|
||||
"transfer_rx": integer,
|
||||
"transfer_sx": integer,
|
||||
"persistent_keepalive": integer,
|
||||
"allowed_ips": [
|
||||
string
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ wg show all dump | jc --wg-show -p
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"private_key": "aEbVdvHSEp3oofHDNVCsUoaRSxk1Og8/pTLof5yF+1M=",
|
||||
"public_key": "OIxbQszw1chdO5uigAxpsl4fc/h04yMYafl72gUbakM=",
|
||||
"listen_port": 51820,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"public_key": "sQFGAhSdx0aC7DmTFojzBOW8Ccjv1XV5+N9FnkZu5zc=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:40036",
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 1378724,
|
||||
"transfer_sx": 406524,
|
||||
"persistent_keepalive": null,
|
||||
"allowed_ips": ["10.10.0.2/32"]
|
||||
},
|
||||
{
|
||||
"public_key": "B9csmpvrv4Q7gpjc6zAbNNO8hIOYfpBqxmik2aNpwwE=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:35946",
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 4884248,
|
||||
"transfer_sx": 3544596,
|
||||
"persistent_keepalive": null,
|
||||
"allowed_ips": ["10.10.0.3/32"]
|
||||
},
|
||||
{
|
||||
"public_key": "miiSYR5UdevREhlWpmnci+vv/dEGLHbNtKu7u1CuOD4=",
|
||||
"preshared_key": null,
|
||||
"allowed_ips": ["10.10.0.4/32"]
|
||||
},
|
||||
{
|
||||
"public_key": "gx9+JHLHJvOfBNjTmZ8KQAnThFFiZMQrX1kRaYcIYzw=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "173.244.225.194:45014",
|
||||
"latest_handshake": 1728809827,
|
||||
"transfer_rx": 1363652,
|
||||
"transfer_sx": 458252,
|
||||
"persistent_keepalive": null,
|
||||
"allowed_ips": ["10.10.0.5/32"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
$ wg show all dump | jc --wg-show -p -r
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"private_key": "aEbVdvHSEp3oofHDNVCsUoaRSxk1Og8/pTLof5yF+1M=",
|
||||
"public_key": "OIxbQszw1chdO5uigAxpsl4fc/h04yMYafl72gUbakM=",
|
||||
"listen_port": 51820,
|
||||
"fwmark": null,
|
||||
"peers": {
|
||||
"sQFGAhSdx0aC7DmTFojzBOW8Ccjv1XV5+N9FnkZu5zc=": {
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:40036",
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 1378724,
|
||||
"transfer_sx": 406524,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": ["10.10.0.2/32"]
|
||||
},
|
||||
"B9csmpvrv4Q7gpjc6zAbNNO8hIOYfpBqxmik2aNpwwE=": {
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:35946",
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 4884248,
|
||||
"transfer_sx": 3544596,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": ["10.10.0.3/32"]
|
||||
},
|
||||
"miiSYR5UdevREhlWpmnci+vv/dEGLHbNtKu7u1CuOD4=": {
|
||||
"preshared_key": null,
|
||||
"allowed_ips": ["10.10.0.4/32"]
|
||||
},
|
||||
"gx9+JHLHJvOfBNjTmZ8KQAnThFFiZMQrX1kRaYcIYzw=": {
|
||||
"preshared_key": null,
|
||||
"endpoint": "173.244.225.194:45014",
|
||||
"latest_handshake": 1728809827,
|
||||
"transfer_rx": 1363652,
|
||||
"transfer_sx": 458252,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": ["10.10.0.5/32"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.wg_show.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function.
|
||||
|
||||
Parses the output of the `wg` command, specifically `wg show all dump`, into structured JSON format.
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (str) Text data to parse, typically the output from `wg show all dump`
|
||||
raw: (bool) If True, returns unprocessed output
|
||||
quiet: (bool) Suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List[Dict]: Parsed data in JSON-friendly format, either raw or processed.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/wg_show.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/wg_show.py)
|
||||
|
||||
Version 1.0 by Hamza Saht (hamzasaht01@gmail.com)
|
@ -111,4 +111,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/yaml.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/yaml.py)
|
||||
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
@ -20,20 +20,22 @@ Schema:
|
||||
[
|
||||
{
|
||||
"device": string,
|
||||
"privateKey": string,
|
||||
"publicKey": string,
|
||||
"listenPort": integer,
|
||||
"private_key": string,
|
||||
"public_key": string,
|
||||
"listen_port": integer,
|
||||
"fwmark": integer,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": string,
|
||||
"presharedKey": string,
|
||||
"public_key": string,
|
||||
"preshared_key": string,
|
||||
"endpoint": string,
|
||||
"latestHandshake": integer,
|
||||
"transferRx": integer,
|
||||
"transferSx": integer,
|
||||
"persistentKeepalive": integer,
|
||||
"allowedIps": [string]
|
||||
"latest_handshake": integer,
|
||||
"transfer_rx": integer,
|
||||
"transfer_sx": integer,
|
||||
"persistent_keepalive": integer,
|
||||
"allowed_ips": [
|
||||
string
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -45,43 +47,47 @@ Examples:
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "aEbVdvHSEp3oofHDNVCsUoaRSxk1Og8/pTLof5yF+1M=",
|
||||
"publicKey": "OIxbQszw1chdO5uigAxpsl4fc/h04yMYafl72gUbakM=",
|
||||
"listenPort": 51820,
|
||||
"private_key": "aEbVdvHSEp3oofHDNVCsUoaRSxk1Og8/pTLof5yF+1M=",
|
||||
"public_key": "OIxbQszw1chdO5uigAxpsl4fc/h04yMYafl72gUbakM=",
|
||||
"listen_port": 51820,
|
||||
"fwmark": null,
|
||||
"peers": {
|
||||
"sQFGAhSdx0aC7DmTFojzBOW8Ccjv1XV5+N9FnkZu5zc=": {
|
||||
"presharedKey": null,
|
||||
"peers": [
|
||||
{
|
||||
"public_key": "sQFGAhSdx0aC7DmTFojzBOW8Ccjv1XV5+N9FnkZu5zc=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:40036",
|
||||
"latestHandshake": 1728809756,
|
||||
"transferRx": 1378724,
|
||||
"transferSx": 406524,
|
||||
"persistentKeepalive": null,
|
||||
"allowedIps": ["10.10.0.2/32"]
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 1378724,
|
||||
"transfer_sx": 406524,
|
||||
"persistent_keepalive": null,
|
||||
"allowed_ips": ["10.10.0.2/32"]
|
||||
},
|
||||
"B9csmpvrv4Q7gpjc6zAbNNO8hIOYfpBqxmik2aNpwwE=": {
|
||||
"presharedKey": null,
|
||||
{
|
||||
"public_key": "B9csmpvrv4Q7gpjc6zAbNNO8hIOYfpBqxmik2aNpwwE=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:35946",
|
||||
"latestHandshake": 1728809756,
|
||||
"transferRx": 4884248,
|
||||
"transferSx": 3544596,
|
||||
"persistentKeepalive": null,
|
||||
"allowedIps": ["10.10.0.3/32"]
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 4884248,
|
||||
"transfer_sx": 3544596,
|
||||
"persistent_keepalive": null,
|
||||
"allowed_ips": ["10.10.0.3/32"]
|
||||
},
|
||||
"miiSYR5UdevREhlWpmnci+vv/dEGLHbNtKu7u1CuOD4=": {
|
||||
"presharedKey": null,
|
||||
"allowedIps": ["10.10.0.4/32"]
|
||||
{
|
||||
"public_key": "miiSYR5UdevREhlWpmnci+vv/dEGLHbNtKu7u1CuOD4=",
|
||||
"preshared_key": null,
|
||||
"allowed_ips": ["10.10.0.4/32"]
|
||||
},
|
||||
"gx9+JHLHJvOfBNjTmZ8KQAnThFFiZMQrX1kRaYcIYzw=": {
|
||||
"presharedKey": null,
|
||||
{
|
||||
"public_key": "gx9+JHLHJvOfBNjTmZ8KQAnThFFiZMQrX1kRaYcIYzw=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "173.244.225.194:45014",
|
||||
"latestHandshake": 1728809827,
|
||||
"transferRx": 1363652,
|
||||
"transferSx": 458252,
|
||||
"persistentKeepalive": null,
|
||||
"allowedIps": ["10.10.0.5/32"]
|
||||
}
|
||||
"latest_handshake": 1728809827,
|
||||
"transfer_rx": 1363652,
|
||||
"transfer_sx": 458252,
|
||||
"persistent_keepalive": null,
|
||||
"allowed_ips": ["10.10.0.5/32"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -89,41 +95,41 @@ Examples:
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "aEbVdvHSEp3oofHDNVCsUoaRSxk1Og8/pTLof5yF+1M=",
|
||||
"publicKey": "OIxbQszw1chdO5uigAxpsl4fc/h04yMYafl72gUbakM=",
|
||||
"listenPort": 51820,
|
||||
"private_key": "aEbVdvHSEp3oofHDNVCsUoaRSxk1Og8/pTLof5yF+1M=",
|
||||
"public_key": "OIxbQszw1chdO5uigAxpsl4fc/h04yMYafl72gUbakM=",
|
||||
"listen_port": 51820,
|
||||
"fwmark": null,
|
||||
"peers": {
|
||||
"sQFGAhSdx0aC7DmTFojzBOW8Ccjv1XV5+N9FnkZu5zc=": {
|
||||
"presharedKey": null,
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:40036",
|
||||
"latestHandshake": 1728809756,
|
||||
"transferRx": 1378724,
|
||||
"transferSx": 406524,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": ["10.10.0.2/32"]
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 1378724,
|
||||
"transfer_sx": 406524,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": ["10.10.0.2/32"]
|
||||
},
|
||||
"B9csmpvrv4Q7gpjc6zAbNNO8hIOYfpBqxmik2aNpwwE=": {
|
||||
"presharedKey": null,
|
||||
"preshared_key": null,
|
||||
"endpoint": "79.134.136.199:35946",
|
||||
"latestHandshake": 1728809756,
|
||||
"transferRx": 4884248,
|
||||
"transferSx": 3544596,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": ["10.10.0.3/32"]
|
||||
"latest_handshake": 1728809756,
|
||||
"transfer_rx": 4884248,
|
||||
"transfer_sx": 3544596,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": ["10.10.0.3/32"]
|
||||
},
|
||||
"miiSYR5UdevREhlWpmnci+vv/dEGLHbNtKu7u1CuOD4=": {
|
||||
"presharedKey": null,
|
||||
"allowedIps": ["10.10.0.4/32"]
|
||||
"preshared_key": null,
|
||||
"allowed_ips": ["10.10.0.4/32"]
|
||||
},
|
||||
"gx9+JHLHJvOfBNjTmZ8KQAnThFFiZMQrX1kRaYcIYzw=": {
|
||||
"presharedKey": null,
|
||||
"preshared_key": null,
|
||||
"endpoint": "173.244.225.194:45014",
|
||||
"latestHandshake": 1728809827,
|
||||
"transferRx": 1363652,
|
||||
"transferSx": 458252,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": ["10.10.0.5/32"]
|
||||
"latest_handshake": 1728809827,
|
||||
"transfer_rx": 1363652,
|
||||
"transfer_sx": 458252,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": ["10.10.0.5/32"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -143,9 +149,7 @@ class info:
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
|
||||
version = "1.0"
|
||||
description = (
|
||||
"Parses the output of the `wg show` command to provide structured JSON data"
|
||||
)
|
||||
description = "`wg show` command parser"
|
||||
author = "Hamza Saht"
|
||||
author_email = "hamzasaht01@gmail.com"
|
||||
compatible = ["linux", "darwin", "cygwin", "win32", "aix", "freebsd"]
|
||||
@ -172,20 +176,20 @@ def _process(proc_data: List[DeviceData]) -> List[JSONDictType]:
|
||||
for device in proc_data:
|
||||
processed_device = {
|
||||
"device": device["device"],
|
||||
"privateKey": device.get("privateKey"),
|
||||
"publicKey": device.get("publicKey"),
|
||||
"listenPort": device.get("listenPort"),
|
||||
"private_key": device.get("private_key"),
|
||||
"public_key": device.get("public_key"),
|
||||
"listen_port": device.get("listen_port"),
|
||||
"fwmark": device.get("fwmark"),
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": peer_key,
|
||||
"presharedKey": peer_data.get("presharedKey"),
|
||||
"public_key": peer_key,
|
||||
"preshared_key": peer_data.get("preshared_key"),
|
||||
"endpoint": peer_data.get("endpoint"),
|
||||
"latestHandshake": peer_data.get("latestHandshake", 0),
|
||||
"transferRx": peer_data.get("transferRx", 0),
|
||||
"transferSx": peer_data.get("transferSx", 0),
|
||||
"persistentKeepalive": peer_data.get("persistentKeepalive", -1),
|
||||
"allowedIps": peer_data.get("allowedIps", []),
|
||||
"latest_handshake": peer_data.get("latest_handshake", 0),
|
||||
"transfer_rx": peer_data.get("transfer_rx", 0),
|
||||
"transfer_sx": peer_data.get("transfer_sx", 0),
|
||||
"persistent_keepalive": peer_data.get("persistent_keepalive", -1),
|
||||
"allowed_ips": peer_data.get("allowed_ips", []),
|
||||
}
|
||||
for peer_key, peer_data in device.get("peers", {}).items()
|
||||
],
|
||||
@ -194,7 +198,7 @@ def _process(proc_data: List[DeviceData]) -> List[JSONDictType]:
|
||||
return processed_data
|
||||
|
||||
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[DeviceData]:
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[JSONDictType]:
|
||||
"""
|
||||
Main text parsing function.
|
||||
|
||||
@ -226,9 +230,9 @@ def parse(data: str, raw: bool = False, quiet: bool = False) -> List[DeviceData]
|
||||
raw_output.append({"device": current_device, **device_data})
|
||||
current_device = device
|
||||
device_data = {
|
||||
"privateKey": private_key if private_key != "(none)" else None,
|
||||
"publicKey": public_key if public_key != "(none)" else None,
|
||||
"listenPort": int(listen_port) if listen_port != "0" else None,
|
||||
"private_key": private_key if private_key != "(none)" else None,
|
||||
"public_key": public_key if public_key != "(none)" else None,
|
||||
"listen_port": int(listen_port) if listen_port != "0" else None,
|
||||
"fwmark": int(fwmark) if fwmark != "off" else None,
|
||||
"peers": {},
|
||||
}
|
||||
@ -245,17 +249,17 @@ def parse(data: str, raw: bool = False, quiet: bool = False) -> List[DeviceData]
|
||||
persistent_keepalive,
|
||||
) = fields
|
||||
peer_data: PeerData = {
|
||||
"presharedKey": preshared_key
|
||||
"preshared_key": preshared_key
|
||||
if preshared_key != "(none)"
|
||||
else None,
|
||||
"endpoint": endpoint if endpoint != "(none)" else None,
|
||||
"latestHandshake": int(latest_handshake),
|
||||
"transferRx": int(transfer_rx),
|
||||
"transferSx": int(transfer_tx),
|
||||
"persistentKeepalive": int(persistent_keepalive)
|
||||
"latest_handshake": int(latest_handshake),
|
||||
"transfer_rx": int(transfer_rx),
|
||||
"transfer_sx": int(transfer_tx),
|
||||
"persistent_keepalive": int(persistent_keepalive)
|
||||
if persistent_keepalive != "off"
|
||||
else -1,
|
||||
"allowedIps": allowed_ips.split(",")
|
||||
"allowed_ips": allowed_ips.split(",")
|
||||
if allowed_ips != "(none)"
|
||||
else [],
|
||||
}
|
||||
|
12
man/jc.1
12
man/jc.1
@ -1,4 +1,4 @@
|
||||
.TH jc 1 2024-10-18 1.25.4 "JSON Convert"
|
||||
.TH jc 1 2024-11-24 1.25.4 "JSON Convert"
|
||||
.SH NAME
|
||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
||||
and strings
|
||||
@ -512,6 +512,11 @@ openvpn-status.log file parser
|
||||
\fB--os-release\fP
|
||||
`/etc/os-release` file parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--pacman\fP
|
||||
`pacman` command parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--passwd\fP
|
||||
@ -1097,6 +1102,11 @@ Version string parser
|
||||
\fB--wc\fP
|
||||
`wc` command parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--wg-show\fP
|
||||
`wg show` command parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--who\fP
|
||||
|
104
tests/fixtures/ubuntu-22.04/wg_show--one_device.json
vendored
104
tests/fixtures/ubuntu-22.04/wg_show--one_device.json
vendored
@ -1,92 +1,92 @@
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "ZkG2dvJSUq5ohkDFNWBqToaVSyk4Pp8/bULaf6yX+3N=",
|
||||
"publicKey": "PQsbRs4w2fidQ7uhjgCypl5fc/804bHZbfl83gGvakN=",
|
||||
"listenPort": 51820,
|
||||
"private_key": "ZkG2dvJSUq5ohkDFNWBqToaVSyk4Pp8/bULaf6yX+3N=",
|
||||
"public_key": "PQsbRs4w2fidQ7uhjgCypl5fc/804bHZbfl83gGvakN=",
|
||||
"listen_port": 51820,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "rQFRAjRdx1aD8DnTFpkcBOY9Edjt3ZU7+P9HokZv7xe=",
|
||||
"presharedKey": null,
|
||||
"public_key": "rQFRAjRdx1aD8DnTFpkcBOY9Edjt3ZU7+P9HokZv7xe=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "82.132.137.204:50024",
|
||||
"latestHandshake": 1829439251,
|
||||
"transferRx": 1536642,
|
||||
"transferSx": 492320,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 1829439251,
|
||||
"transfer_rx": 1536642,
|
||||
"transfer_sx": 492320,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.2/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "A0fsnrwsv7S9hrk8yzCgOON9gKPYfpCrzqil4bPpxAE=",
|
||||
"presharedKey": null,
|
||||
"public_key": "A0fsnrwsv7S9hrk8yzCgOON9gKPYfpCrzqil4bPpxAE=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "82.132.137.204:49732",
|
||||
"latestHandshake": 1829439125,
|
||||
"transferRx": 5641359,
|
||||
"transferSx": 4206783,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 1829439125,
|
||||
"transfer_rx": 5641359,
|
||||
"transfer_sx": 4206783,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.3/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "pkjVZR5VdfnSFhlWsqnkf+wv/eHGLHzOtKu8v2CvOD5=",
|
||||
"presharedKey": null,
|
||||
"public_key": "pkjVZR5VdfnSFhlWsqnkf+wv/eHGLHzOtKu8v2CvOD5=",
|
||||
"preshared_key": null,
|
||||
"endpoint": null,
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 0,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 0,
|
||||
"transfer_rx": 0,
|
||||
"transfer_sx": 0,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.4/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "hz0+KJRHJyXfDNjUnZ9LRAnShFFjZNTrW2jRbXjIazx=",
|
||||
"presharedKey": null,
|
||||
"public_key": "hz0+KJRHJyXfDNjUnZ9LRAnShFFjZNTrW2jRbXjIazx=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "180.255.226.203:21678",
|
||||
"latestHandshake": 1829439243,
|
||||
"transferRx": 1555523,
|
||||
"transferSx": 544780,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 1829439243,
|
||||
"transfer_rx": 1555523,
|
||||
"transfer_sx": 544780,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.5/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "kujr4Z8eutQ8ebzFf33DLc3PNKrO3J+ZVy3jkrR1cUZ=",
|
||||
"presharedKey": null,
|
||||
"public_key": "kujr4Z8eutQ8ebzFf33DLc3PNKrO3J+ZVy3jkrR1cUZ=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "82.132.137.204:67130",
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 0,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 0,
|
||||
"transfer_rx": 0,
|
||||
"transfer_sx": 0,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.6/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "XcgkMRmxhQiIgXowYqsxUt1SlwUydXJd4Zmi8dgGeYe=",
|
||||
"presharedKey": null,
|
||||
"public_key": "XcgkMRmxhQiIgXowYqsxUt1SlwUydXJd4Zmi8dgGeYe=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "180.255.226.203:56092",
|
||||
"latestHandshake": 1829439121,
|
||||
"transferRx": 1900247,
|
||||
"transferSx": 1352639,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 1829439121,
|
||||
"transfer_rx": 1900247,
|
||||
"transfer_sx": 1352639,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.8/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "tB9yFqLmyvcDD1rJ1rTgeKtKK98hdUL1jefMRt4XbDh=",
|
||||
"presharedKey": null,
|
||||
"public_key": "tB9yFqLmyvcDD1rJ1rTgeKtKK98hdUL1jefMRt4XbDh=",
|
||||
"preshared_key": null,
|
||||
"endpoint": "82.132.137.204:60184",
|
||||
"latestHandshake": 1829037182,
|
||||
"transferRx": 75047,
|
||||
"transferSx": 184725,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"latest_handshake": 1829037182,
|
||||
"transfer_rx": 75047,
|
||||
"transfer_sx": 184725,
|
||||
"persistent_keepalive": -1,
|
||||
"allowed_ips": [
|
||||
"10.10.0.7/32"
|
||||
]
|
||||
}
|
||||
|
@ -1,245 +1 @@
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "ZkG2dvJSUq5ohkDFNWBqToaVSyk4Pp8/bULaf6yX+3N=",
|
||||
"publicKey": "PQsbRs4w2fidQ7uhjgCypl5fc/804bHZbfl83gGvakN=",
|
||||
"listenPort": 51820,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "rQFRAjRdx1aD8DnTFpkcBOY9Edjt3ZU7+P9HokZv7xe=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "82.132.137.204:50024",
|
||||
"latestHandshake": 1829439251,
|
||||
"transferRx": 1536642,
|
||||
"transferSx": 492320,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.2/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "A0fsnrwsv7S9hrk8yzCgOON9gKPYfpCrzqil4bPpxAE=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "82.132.137.204:49732",
|
||||
"latestHandshake": 1829439125,
|
||||
"transferRx": 5641359,
|
||||
"transferSx": 4206783,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.3/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "pkjVZR5VdfnSFhlWsqnkf+wv/eHGLHzOtKu8v2CvOD5=",
|
||||
"presharedKey": null,
|
||||
"endpoint": null,
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 0,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.4/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "hz0+KJRHJyXfDNjUnZ9LRAnShFFjZNTrW2jRbXjIazx=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "180.255.226.203:21678",
|
||||
"latestHandshake": 1829439243,
|
||||
"transferRx": 1555523,
|
||||
"transferSx": 544780,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.5/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "kujr4Z8eutQ8ebzFf33DLc3PNKrO3J+ZVy3jkrR1cUZ=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "82.132.137.204:67130",
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 0,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.6/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "XcgkMRmxhQiIgXowYqsxUt1SlwUydXJd4Zmi8dgGeYe=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "180.255.226.203:56092",
|
||||
"latestHandshake": 1829439121,
|
||||
"transferRx": 1900247,
|
||||
"transferSx": 1352639,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.8/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "tB9yFqLmyvcDD1rJ1rTgeKtKK98hdUL1jefMRt4XbDh=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "82.132.137.204:60184",
|
||||
"latestHandshake": 1829037182,
|
||||
"transferRx": 75047,
|
||||
"transferSx": 184725,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.7/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "JH8Fz8KGH5vDYu3eUuWwRcTUcvRqFHZfMlNtsg2xZwF=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "91.142.150.210:51478",
|
||||
"latestHandshake": 1829037123,
|
||||
"transferRx": 985632,
|
||||
"transferSx": 723582,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.9/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "Yx6kNq8xhPmKhYq0YqTxVt2ZmxZvdYKg5Ymj9fgHkGh=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "92.233.144.193:61112",
|
||||
"latestHandshake": 1829037212,
|
||||
"transferRx": 1350235,
|
||||
"transferSx": 945301,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.0.10/32"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"device": "wg1",
|
||||
"privateKey": "JnR8bwIHKq7yqfNDOWBlTohSTxl7Wa9/sTLcf6tQ+4O=",
|
||||
"publicKey": "MUocVr6x4gjhT9vkkDrzm6hc/906dJHYcgk93iHvbmR=",
|
||||
"listenPort": 51821,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "yQHRBjVgy2fC9EkUFlhdDPZ0Lekv4YM9+Q0GmnXw9gf=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "72.144.138.212:50135",
|
||||
"latestHandshake": 1929850372,
|
||||
"transferRx": 1678923,
|
||||
"transferSx": 513470,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.2/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "C1gsotwrx9S9jsq9yzJgPPO0hNRYgrDsblmj6dSrkZE=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "59.232.145.213:49364",
|
||||
"latestHandshake": 1929850156,
|
||||
"transferRx": 5982563,
|
||||
"transferSx": 4378204,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.3/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "qjkYZR6WfgnTGjnXrqokf+xw/fIFMHyPtLu9w3DwOF6=",
|
||||
"presharedKey": null,
|
||||
"endpoint": null,
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 0,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.4/32"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"device": "wg1",
|
||||
"privateKey": "JpK6HvHKLp9zmqDFQXBqUmxTSvW6Vp9/zTLbf6pT+7N=",
|
||||
"publicKey": "LQdcXs5y5dkgU0vmkCszm8hf/907fKHYdhk94jHvbnQ=",
|
||||
"listenPort": 51821,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "tRFGGjUhy3hD0GmVEljeDQY0Mhlv5YM7+Q2HmnWy9je=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "69.157.149.222:51049",
|
||||
"latestHandshake": 1929851223,
|
||||
"transferRx": 1680921,
|
||||
"transferSx": 523451,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.5/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "K2hzotyrx8S1jsq0yzHgTQO1kOYVhrDwblmj7eTrkZF=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "61.242.155.214:48012",
|
||||
"latestHandshake": 1929851045,
|
||||
"transferRx": 6052145,
|
||||
"transferSx": 4435280,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.6/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "VliYZS7WggpUFkWNralkg+wz/eIHMHyStMpu0x4EoEJ=",
|
||||
"presharedKey": null,
|
||||
"endpoint": null,
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 0,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.7/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "kB8yFrKmyvaDF1uL2uUgeOsLL99jeUL2kefKRt3ZoFh=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "72.132.145.206:62084",
|
||||
"latestHandshake": 1929137285,
|
||||
"transferRx": 95023,
|
||||
"transferSx": 197982,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.8/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "Z9fsqvwty8U9jqj1zyKgPRQ1hOXYgrFtcmli8fSprHF=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "68.243.154.222:54321",
|
||||
"latestHandshake": 1929137125,
|
||||
"transferRx": 1200475,
|
||||
"transferSx": 890678,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.9/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"publicKey": "Lx9lNq9xhPnJhYr1YqYxVt3ZmyawdZLg5Zmj0fhGlJk=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "71.233.144.204:59012",
|
||||
"latestHandshake": 1929137243,
|
||||
"transferRx": 1450234,
|
||||
"transferSx": 1006235,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.10.1.10/32"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
[{"device":"wg0","private_key":"ZkG2dvJSUq5ohkDFNWBqToaVSyk4Pp8/bULaf6yX+3N=","public_key":"PQsbRs4w2fidQ7uhjgCypl5fc/804bHZbfl83gGvakN=","listen_port":51820,"fwmark":null,"peers":[{"public_key":"rQFRAjRdx1aD8DnTFpkcBOY9Edjt3ZU7+P9HokZv7xe=","preshared_key":null,"endpoint":"82.132.137.204:50024","latest_handshake":1829439251,"transfer_rx":1536642,"transfer_sx":492320,"persistent_keepalive":-1,"allowed_ips":["10.10.0.2/32"]},{"public_key":"A0fsnrwsv7S9hrk8yzCgOON9gKPYfpCrzqil4bPpxAE=","preshared_key":null,"endpoint":"82.132.137.204:49732","latest_handshake":1829439125,"transfer_rx":5641359,"transfer_sx":4206783,"persistent_keepalive":-1,"allowed_ips":["10.10.0.3/32"]},{"public_key":"pkjVZR5VdfnSFhlWsqnkf+wv/eHGLHzOtKu8v2CvOD5=","preshared_key":null,"endpoint":null,"latest_handshake":0,"transfer_rx":0,"transfer_sx":0,"persistent_keepalive":-1,"allowed_ips":["10.10.0.4/32"]},{"public_key":"hz0+KJRHJyXfDNjUnZ9LRAnShFFjZNTrW2jRbXjIazx=","preshared_key":null,"endpoint":"180.255.226.203:21678","latest_handshake":1829439243,"transfer_rx":1555523,"transfer_sx":544780,"persistent_keepalive":-1,"allowed_ips":["10.10.0.5/32"]},{"public_key":"kujr4Z8eutQ8ebzFf33DLc3PNKrO3J+ZVy3jkrR1cUZ=","preshared_key":null,"endpoint":"82.132.137.204:67130","latest_handshake":0,"transfer_rx":0,"transfer_sx":0,"persistent_keepalive":-1,"allowed_ips":["10.10.0.6/32"]},{"public_key":"XcgkMRmxhQiIgXowYqsxUt1SlwUydXJd4Zmi8dgGeYe=","preshared_key":null,"endpoint":"180.255.226.203:56092","latest_handshake":1829439121,"transfer_rx":1900247,"transfer_sx":1352639,"persistent_keepalive":-1,"allowed_ips":["10.10.0.8/32"]},{"public_key":"tB9yFqLmyvcDD1rJ1rTgeKtKK98hdUL1jefMRt4XbDh=","preshared_key":null,"endpoint":"82.132.137.204:60184","latest_handshake":1829037182,"transfer_rx":75047,"transfer_sx":184725,"persistent_keepalive":-1,"allowed_ips":["10.10.0.7/32"]},{"public_key":"JH8Fz8KGH5vDYu3eUuWwRcTUcvRqFHZfMlNtsg2xZwF=","preshared_key":null,"endpoint":"91.142.150.210:51478","latest_handshake":1829037123,"transfer_rx":985632,"transfer_sx":723582,"persistent_keepalive":-1,"allowed_ips":["10.10.0.9/32"]},{"public_key":"Yx6kNq8xhPmKhYq0YqTxVt2ZmxZvdYKg5Ymj9fgHkGh=","preshared_key":null,"endpoint":"92.233.144.193:61112","latest_handshake":1829037212,"transfer_rx":1350235,"transfer_sx":945301,"persistent_keepalive":-1,"allowed_ips":["10.10.0.10/32"]}]},{"device":"wg1","private_key":"JnR8bwIHKq7yqfNDOWBlTohSTxl7Wa9/sTLcf6tQ+4O=","public_key":"MUocVr6x4gjhT9vkkDrzm6hc/906dJHYcgk93iHvbmR=","listen_port":51821,"fwmark":null,"peers":[{"public_key":"yQHRBjVgy2fC9EkUFlhdDPZ0Lekv4YM9+Q0GmnXw9gf=","preshared_key":null,"endpoint":"72.144.138.212:50135","latest_handshake":1929850372,"transfer_rx":1678923,"transfer_sx":513470,"persistent_keepalive":-1,"allowed_ips":["10.10.1.2/32"]},{"public_key":"C1gsotwrx9S9jsq9yzJgPPO0hNRYgrDsblmj6dSrkZE=","preshared_key":null,"endpoint":"59.232.145.213:49364","latest_handshake":1929850156,"transfer_rx":5982563,"transfer_sx":4378204,"persistent_keepalive":-1,"allowed_ips":["10.10.1.3/32"]},{"public_key":"qjkYZR6WfgnTGjnXrqokf+xw/fIFMHyPtLu9w3DwOF6=","preshared_key":null,"endpoint":null,"latest_handshake":0,"transfer_rx":0,"transfer_sx":0,"persistent_keepalive":-1,"allowed_ips":["10.10.1.4/32"]}]},{"device":"wg1","private_key":"JpK6HvHKLp9zmqDFQXBqUmxTSvW6Vp9/zTLbf6pT+7N=","public_key":"LQdcXs5y5dkgU0vmkCszm8hf/907fKHYdhk94jHvbnQ=","listen_port":51821,"fwmark":null,"peers":[{"public_key":"tRFGGjUhy3hD0GmVEljeDQY0Mhlv5YM7+Q2HmnWy9je=","preshared_key":null,"endpoint":"69.157.149.222:51049","latest_handshake":1929851223,"transfer_rx":1680921,"transfer_sx":523451,"persistent_keepalive":-1,"allowed_ips":["10.10.1.5/32"]},{"public_key":"K2hzotyrx8S1jsq0yzHgTQO1kOYVhrDwblmj7eTrkZF=","preshared_key":null,"endpoint":"61.242.155.214:48012","latest_handshake":1929851045,"transfer_rx":6052145,"transfer_sx":4435280,"persistent_keepalive":-1,"allowed_ips":["10.10.1.6/32"]},{"public_key":"VliYZS7WggpUFkWNralkg+wz/eIHMHyStMpu0x4EoEJ=","preshared_key":null,"endpoint":null,"latest_handshake":0,"transfer_rx":0,"transfer_sx":0,"persistent_keepalive":-1,"allowed_ips":["10.10.1.7/32"]},{"public_key":"kB8yFrKmyvaDF1uL2uUgeOsLL99jeUL2kefKRt3ZoFh=","preshared_key":null,"endpoint":"72.132.145.206:62084","latest_handshake":1929137285,"transfer_rx":95023,"transfer_sx":197982,"persistent_keepalive":-1,"allowed_ips":["10.10.1.8/32"]},{"public_key":"Z9fsqvwty8U9jqj1zyKgPRQ1hOXYgrFtcmli8fSprHF=","preshared_key":null,"endpoint":"68.243.154.222:54321","latest_handshake":1929137125,"transfer_rx":1200475,"transfer_sx":890678,"persistent_keepalive":-1,"allowed_ips":["10.10.1.9/32"]},{"public_key":"Lx9lNq9xhPnJhYr1YqYxVt3ZmyawdZLg5Zmj0fhGlJk=","preshared_key":null,"endpoint":"71.233.144.204:59012","latest_handshake":1929137243,"transfer_rx":1450234,"transfer_sx":1006235,"persistent_keepalive":-1,"allowed_ips":["10.10.1.10/32"]}]}]
|
||||
|
95
tests/fixtures/windows/windows-10/wg_show.json
vendored
95
tests/fixtures/windows/windows-10/wg_show.json
vendored
@ -1,94 +1 @@
|
||||
[
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "Xa4Bq8AUFrjKp+Z283VDzEUVeOOn2wX/uuLTMUkkJens=",
|
||||
"publicKey": "mL2Co/VecYWtXSY6YUZAI6cAsFZDCEV+9iZKibNcWTu=",
|
||||
"listenPort": 45321,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "bN9QoMEqlKUpncq0Q8ye9yURczKwmbXzwVsG7A+RV2B=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "123.45.67.89:51820",
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 1532,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"0.0.0.0/0"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "yJ3PoNAqlNUpmcq0P7xv8zURdyKwmbZwwUsG9B+SV3C=",
|
||||
"publicKey": "kP2Lo/WfgVWtYSY7ZUZAJ7cBsEZECFV+8jYKidOcVTv=",
|
||||
"listenPort": 53211,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "dQ5AoNAqpOUlncq0P9ze8xURayLwmbYwwVsH8C+TV4D=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "203.0.113.4:51820",
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 2001,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"192.168.1.0/24"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "pR6DoOBqmNUlncq0P1wq9zUSeyJwmbVxxWsF7D+RU5E=",
|
||||
"publicKey": "qN2Mo/XghWWtXSY8YVZBK8cDsFZDCFQ+7kZKjbNcWTx=",
|
||||
"listenPort": 67514,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "tA8AoPCqoPUlncq0P8xe7xUSayKwmbWxxVsG8E+UV6F=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "198.51.100.15:51820",
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 1403,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"10.0.0.0/8"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "zU9CoQCqmQUlncq0P4wo6yUTbyJwmbYyyWsF9F+SV7G=",
|
||||
"publicKey": "vM2Ko/YigXWtYSY9YUZCJ9dCsGZECFV+5lZLjcOcVVy=",
|
||||
"listenPort": 79812,
|
||||
"fwmark": null,
|
||||
"peers": [
|
||||
{
|
||||
"publicKey": "xC7DoRDqnRUlncq0P2wq9yUScyKwmbXzyWsH8F+TU8H=",
|
||||
"presharedKey": null,
|
||||
"endpoint": "172.16.0.1:51820",
|
||||
"latestHandshake": 0,
|
||||
"transferRx": 0,
|
||||
"transferSx": 1872,
|
||||
"persistentKeepalive": -1,
|
||||
"allowedIps": [
|
||||
"172.16.0.0/16"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"device": "wg0",
|
||||
"privateKey": "rE4AoSCqnSUlncq0P7wv9zURdyLwmbZxzWsG9G+UV9I=",
|
||||
"publicKey": "fN2Oo/ZjhYUtXSZ0YUZDK8eDsFZDCFQ+4jYKjcNcVVw=",
|
||||
"listenPort": 91114,
|
||||
"fwmark": null,
|
||||
"peers": []
|
||||
}
|
||||
]
|
||||
[{"device":"wg0","private_key":"Xa4Bq8AUFrjKp+Z283VDzEUVeOOn2wX/uuLTMUkkJens=","public_key":"mL2Co/VecYWtXSY6YUZAI6cAsFZDCEV+9iZKibNcWTu=","listen_port":45321,"fwmark":null,"peers":[{"public_key":"bN9QoMEqlKUpncq0Q8ye9yURczKwmbXzwVsG7A+RV2B=","preshared_key":null,"endpoint":"123.45.67.89:51820","latest_handshake":0,"transfer_rx":0,"transfer_sx":1532,"persistent_keepalive":-1,"allowed_ips":["0.0.0.0/0"]}]},{"device":"wg0","private_key":"yJ3PoNAqlNUpmcq0P7xv8zURdyKwmbZwwUsG9B+SV3C=","public_key":"kP2Lo/WfgVWtYSY7ZUZAJ7cBsEZECFV+8jYKidOcVTv=","listen_port":53211,"fwmark":null,"peers":[{"public_key":"dQ5AoNAqpOUlncq0P9ze8xURayLwmbYwwVsH8C+TV4D=","preshared_key":null,"endpoint":"203.0.113.4:51820","latest_handshake":0,"transfer_rx":0,"transfer_sx":2001,"persistent_keepalive":-1,"allowed_ips":["192.168.1.0/24"]}]},{"device":"wg0","private_key":"pR6DoOBqmNUlncq0P1wq9zUSeyJwmbVxxWsF7D+RU5E=","public_key":"qN2Mo/XghWWtXSY8YVZBK8cDsFZDCFQ+7kZKjbNcWTx=","listen_port":67514,"fwmark":null,"peers":[{"public_key":"tA8AoPCqoPUlncq0P8xe7xUSayKwmbWxxVsG8E+UV6F=","preshared_key":null,"endpoint":"198.51.100.15:51820","latest_handshake":0,"transfer_rx":0,"transfer_sx":1403,"persistent_keepalive":-1,"allowed_ips":["10.0.0.0/8"]}]},{"device":"wg0","private_key":"zU9CoQCqmQUlncq0P4wo6yUTbyJwmbYyyWsF9F+SV7G=","public_key":"vM2Ko/YigXWtYSY9YUZCJ9dCsGZECFV+5lZLjcOcVVy=","listen_port":79812,"fwmark":null,"peers":[{"public_key":"xC7DoRDqnRUlncq0P2wq9yUScyKwmbXzyWsH8F+TU8H=","preshared_key":null,"endpoint":"172.16.0.1:51820","latest_handshake":0,"transfer_rx":0,"transfer_sx":1872,"persistent_keepalive":-1,"allowed_ips":["172.16.0.0/16"]}]},{"device":"wg0","private_key":"rE4AoSCqnSUlncq0P7wv9zURdyLwmbZxzWsG9G+UV9I=","public_key":"fN2Oo/ZjhYUtXSZ0YUZDK8eDsFZDCFQ+4jYKjcNcVVw=","listen_port":91114,"fwmark":null,"peers":[]}]
|
||||
|
@ -13,7 +13,6 @@ sys.path.pop()
|
||||
# - `{parser_name}--{some_test_description}.json` for expected JSON after parsing.
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
maxDiff = None
|
||||
|
||||
def test_pacman_nodata(self):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user