Request for option to parse schema version. #4952

Closed
opened 2026-03-04 05:41:38 -05:00 by deekerman · 7 comments
Owner

Originally created by @jumpsmm7 on GitHub (Dec 15, 2023).

Originally assigned to: @ainar-g on GitHub.

Prerequisites

  • I have checked the Wiki and Discussions and found no answer

  • I have searched other issues and found no duplicates

  • I want to request a feature or enhancement and not ask a question

The problem

As the installation script writer for Asuswrt-Merlin Addon AdGuardHome installer which installs AdGuardHome in a method for user friendly access, it has became apparent that there is no easy way of parsing the latest schema version. Currently the only method I have found is:
curl -sL "https://api.github.com/repos/AdguardTeam/AdGuardHome/releases" | grep -m1 -oE 'schema.*to[[:space:]][0-9]{1,2}' | awk '{ print $NF }' .

and

image

Proposed solution

I want to request a feature that allows for the latest schema version to be read from the AdGuardHome binary, similar to how the AdGuardHome binary version can be read.

e.g.
AdGuardHome --version

I know this sounds trivial, but I think such a feature could be useful in a practical since for developers who incorporate AdGuardHome as addons.

Alternatives considered and additional information

Make it easier to parse the latest schema version from the upstream.

Originally created by @jumpsmm7 on GitHub (Dec 15, 2023). Originally assigned to: @ainar-g on GitHub. ### Prerequisites - [X] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) and found no answer - [X] I have searched other issues and found no duplicates - [X] I want to request a feature or enhancement and not ask a question ### The problem As the installation script writer for Asuswrt-Merlin Addon AdGuardHome installer which installs AdGuardHome in a method for user friendly access, it has became apparent that there is no easy way of parsing the latest schema version. Currently the only method I have found is: `curl -sL "https://api.github.com/repos/AdguardTeam/AdGuardHome/releases" | grep -m1 -oE 'schema.*to[[:space:]][0-9]{1,2}' | awk '{ print $NF }'` . and ![image](https://github.com/AdguardTeam/AdGuardHome/assets/49514613/576e0312-08b6-4060-bd9d-a1061e7d47e0) ### Proposed solution I want to request a feature that allows for the latest schema version to be read from the AdGuardHome binary, similar to how the AdGuardHome binary version can be read. e.g. `AdGuardHome --version` I know this sounds trivial, but I think such a feature could be useful in a practical since for developers who incorporate AdGuardHome as addons. ### Alternatives considered and additional information Make it easier to parse the latest schema version from the upstream.
deekerman 2026-03-04 05:41:38 -05:00
Author
Owner

@ainar-g commented on GitHub (Dec 15, 2023):

In general there shouldn't be a need to parse the version. What is the feature you're trying to support through that?

@ainar-g commented on GitHub (Dec 15, 2023): In general there shouldn't be a need to parse the version. What is the feature you're trying to support through that?
Author
Owner

@jumpsmm7 commented on GitHub (Dec 15, 2023):

In general there shouldn't be a need to parse the version. What is the feature you're trying to support through that?

Maintaining schema accuracy across upgrades.

I have noticed on a few occasions that this number not being accurate as give errors in adguardhome when major syntax changes were introduced to adguardhome. For example, when the way the bind port was handled changed. It introduced issues for people who had not been monitoring the changes very well.

@jumpsmm7 commented on GitHub (Dec 15, 2023): > In general there shouldn't be a need to parse the version. What is the feature you're trying to support through that? Maintaining schema accuracy across upgrades. I have noticed on a few occasions that this number not being accurate as give errors in adguardhome when major syntax changes were introduced to adguardhome. For example, when the way the bind port was handled changed. It introduced issues for people who had not been monitoring the changes very well.
Author
Owner

@ainar-g commented on GitHub (Dec 15, 2023):

My question was more about why you're making changes to the configuration file directly instead of using the documented API? Unattended changes directly to the configuration file probably won't ever be safe.

@ainar-g commented on GitHub (Dec 15, 2023): My question was more about why you're making changes to the configuration file directly instead of using the documented API? Unattended changes directly to the configuration file probably won't ever be safe.
Author
Owner

@jumpsmm7 commented on GitHub (Dec 15, 2023):

My question was more about why you're making changes to the configuration file directly instead of using the documented API? Unattended changes directly to the configuration file probably won't ever be safe.

The changes aren't unattended. Typically the user has to physically run the upgrade process just to get the next version. That doesnt guarantee they are fully paying attention to this minor detail when doing such. I have just had issues in the past with this being a minor annoyance for users who do not actually pay attention to changing this number when necessary.

@jumpsmm7 commented on GitHub (Dec 15, 2023): > My question was more about why you're making changes to the configuration file directly instead of using the documented API? Unattended changes directly to the configuration file probably won't ever be safe. The changes aren't unattended. Typically the user has to physically run the upgrade process just to get the next version. That doesnt guarantee they are fully paying attention to this minor detail when doing such. I have just had issues in the past with this being a minor annoyance for users who do not actually pay attention to changing this number when necessary.
Author
Owner

@ainar-g commented on GitHub (Dec 15, 2023):

I guess I see your point, and adding it shouldn't be hard. But just to be clear, using the API is the preferred option, when possible.

Related: #4067.

@ainar-g commented on GitHub (Dec 15, 2023): I guess I see your point, and adding it shouldn't be hard. But just to be clear, using the API is the preferred option, when possible. Related: #4067.
Author
Owner

@ainar-g commented on GitHub (Dec 15, 2023):

@jumpsmm7, see the latest Edge release. We've added the schema version to the output of -v --version.

@ainar-g commented on GitHub (Dec 15, 2023): @jumpsmm7, see the latest Edge release. We've added the schema version to the output of `-v --version`.
Author
Owner

@jumpsmm7 commented on GitHub (Dec 16, 2023):

@jumpsmm7, see the latest Edge release. We've added the schema version to the output of -v --version.

That is actually great! @ainar-g , I appreciate you taking the extra time on this. Below is the output:

AdGuardHome -v --version
AdGuard Home
Version: v0.108.0-a.795+d3283273
Schema version: 27
Channel: edge
Go version: go1.20.12
Commit time: 2023-12-15 17:27:47 +0000 UTC
GOOS: linux
GOARCH: arm64
Race: false
Dependencies:
github.com/AdguardTeam/dnsproxy@v0.60.1(sum: h1:YveGe7UZLaAiePkaV3orkc0IIfPX9vi/qQDIFdeO//A=)
github.com/AdguardTeam/golibs@v0.18.0(sum: h1:ckS2YK7t2Ub6UkXl0fnreVaM15Zb07Hh1gmFqttjpWg=)
github.com/AdguardTeam/urlfilter@v0.17.3(sum: h1:fg/ObbnO0Cv6aw0tW6N/ETDMhhNvmcUUOZ7HlmKC3rw=)
github.com/NYTimes/gziphandler@v1.1.1(sum: h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=)
github.com/aead/chacha20@v0.0.0-20180709150244-8b13a72661da(sum: h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=)
github.com/aead/poly1305@v0.0.0-20180717145839-3fee0db0b635(sum: h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=)
github.com/ameshkov/dnscrypt/v2@v2.2.7(sum: h1:aEitLIR8HcxVodZ79mgRcCiC0A0I5kZPBuWGFwwulAw=)
github.com/ameshkov/dnsstamps@v1.0.3(sum: h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo=)
github.com/beefsack/go-rate@v0.0.0-20220214233405-116f4ca011a0(sum: h1:0b2vaepXIfMsG++IsjHiI2p4bxALD1Y2nQKGMR5zDQM=)
github.com/bluele/gcache@v0.0.2(sum: h1:WcbfdXICg7G/DGBh1PFfcirkWOQV+v077yF1pSy3DGw=)
github.com/digineo/go-ipset/v2@v2.2.1(sum: h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g=)
github.com/fsnotify/fsnotify@v1.7.0(sum: h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=)
github.com/go-ping/ping@v1.1.0(sum: h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw=)
github.com/google/go-cmp@v0.6.0(sum: h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=)
github.com/google/gopacket@v1.1.19(sum: h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=)
github.com/google/renameio/v2@v2.0.0(sum: h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=)
github.com/google/uuid@v1.4.0(sum: h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=)
github.com/insomniacslk/dhcp@v0.0.0-20231206064809-8c70d406f6d2(sum: h1:9K06NfxkBh25x56yVhWWlKFE8YpicaSfHwoV8SFbueA=)
github.com/josharian/native@v1.1.1-0.20230202152459-5c7d0dd6ab86(sum: h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk=)
github.com/kardianos/service@v1.2.2(sum: h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60=)
github.com/mdlayher/ethernet@v0.0.0-20220221185849-529eae5b6118(sum: h1:2oDp6OOhLxQ9JBoUuysVz9UZ9uI6oLUbvAZu0x8o+vE=)
github.com/mdlayher/netlink@v1.7.2(sum: h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g=)
github.com/mdlayher/packet@v1.1.2(sum: h1:3Up1NG6LZrsgDVn6X4L9Ge/iyRyxFEFD9o6Pr3Q1nQY=)
github.com/mdlayher/socket@v0.4.1(sum: h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U=)
github.com/miekg/dns@v1.1.57(sum: h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=)
github.com/patrickmn/go-cache@v2.1.0+incompatible(sum: h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=)
github.com/pierrec/lz4/v4@v4.1.19(sum: h1:tYLzDnjDXh9qIxSTKHwXwOYmm9d887Y7Y1ZkyXYHAN4=)
github.com/pkg/errors@v0.9.1(sum: h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=)
github.com/quic-go/qpack@v0.4.0(sum: h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=)
github.com/quic-go/qtls-go1-20@v0.4.1(sum: h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs=)
github.com/quic-go/quic-go@v0.40.0(sum: h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw=)
github.com/ti-mo/netfilter@v0.5.1(sum: h1:cqamEd1c1zmpfpqvInLOro0Znq/RAfw2QL5wL2rAR/8=)
github.com/u-root/uio@v0.0.0-20230305220412-3e8cd9d6bf63(sum: h1:YcojQL98T/OO+rybuzn2+5KrD5dBwXIvYBvQ2cD3Avg=)
go.etcd.io/bbolt@v1.3.8(sum: h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=)
golang.org/x/crypto@v0.16.0(sum: h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=)
golang.org/x/exp@v0.0.0-20231206192017-f3f8817b8deb(sum: h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8=)
golang.org/x/net@v0.19.0(sum: h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=)
golang.org/x/sync@v0.5.0(sum: h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=)
golang.org/x/sys@v0.15.0(sum: h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=)
golang.org/x/text@v0.14.0(sum: h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=)
gopkg.in/natefinch/lumberjack.v2@v2.2.1(sum: h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=)
gopkg.in/yaml.v3@v3.0.1(sum: h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=)
howett.net/plist@v1.0.1(sum: h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM=)

and easily able to be read:

AdGuardHome -v --version | awk '/Schema version:/{ print $NF }'
27

I hope at some point it is incorporated in the documentation. While this is not really a critical feature for those who follow the changelogs and understand what's going on behind the scenes, it is easy in our day to day lives to not pay attention to something so significant for the actual functionality of AdGuardHome. You have taken one extra step to help your user base keep track of things. As always, the efforts taken by the AGH team will always be appreciated. Consider this a quick win.

@jumpsmm7 commented on GitHub (Dec 16, 2023): > @jumpsmm7, see the latest Edge release. We've added the schema version to the output of `-v --version`. That is actually great! @ainar-g , I appreciate you taking the extra time on this. Below is the output: > AdGuardHome -v --version AdGuard Home Version: v0.108.0-a.795+d3283273 Schema version: 27 Channel: edge Go version: go1.20.12 Commit time: 2023-12-15 17:27:47 +0000 UTC GOOS: linux GOARCH: arm64 Race: false Dependencies: github.com/AdguardTeam/dnsproxy@v0.60.1(sum: h1:YveGe7UZLaAiePkaV3orkc0IIfPX9vi/qQDIFdeO//A=) github.com/AdguardTeam/golibs@v0.18.0(sum: h1:ckS2YK7t2Ub6UkXl0fnreVaM15Zb07Hh1gmFqttjpWg=) github.com/AdguardTeam/urlfilter@v0.17.3(sum: h1:fg/ObbnO0Cv6aw0tW6N/ETDMhhNvmcUUOZ7HlmKC3rw=) github.com/NYTimes/gziphandler@v1.1.1(sum: h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=) github.com/aead/chacha20@v0.0.0-20180709150244-8b13a72661da(sum: h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=) github.com/aead/poly1305@v0.0.0-20180717145839-3fee0db0b635(sum: h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=) github.com/ameshkov/dnscrypt/v2@v2.2.7(sum: h1:aEitLIR8HcxVodZ79mgRcCiC0A0I5kZPBuWGFwwulAw=) github.com/ameshkov/dnsstamps@v1.0.3(sum: h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo=) github.com/beefsack/go-rate@v0.0.0-20220214233405-116f4ca011a0(sum: h1:0b2vaepXIfMsG++IsjHiI2p4bxALD1Y2nQKGMR5zDQM=) github.com/bluele/gcache@v0.0.2(sum: h1:WcbfdXICg7G/DGBh1PFfcirkWOQV+v077yF1pSy3DGw=) github.com/digineo/go-ipset/v2@v2.2.1(sum: h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g=) github.com/fsnotify/fsnotify@v1.7.0(sum: h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=) github.com/go-ping/ping@v1.1.0(sum: h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw=) github.com/google/go-cmp@v0.6.0(sum: h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=) github.com/google/gopacket@v1.1.19(sum: h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=) github.com/google/renameio/v2@v2.0.0(sum: h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=) github.com/google/uuid@v1.4.0(sum: h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=) github.com/insomniacslk/dhcp@v0.0.0-20231206064809-8c70d406f6d2(sum: h1:9K06NfxkBh25x56yVhWWlKFE8YpicaSfHwoV8SFbueA=) github.com/josharian/native@v1.1.1-0.20230202152459-5c7d0dd6ab86(sum: h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk=) github.com/kardianos/service@v1.2.2(sum: h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60=) github.com/mdlayher/ethernet@v0.0.0-20220221185849-529eae5b6118(sum: h1:2oDp6OOhLxQ9JBoUuysVz9UZ9uI6oLUbvAZu0x8o+vE=) github.com/mdlayher/netlink@v1.7.2(sum: h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g=) github.com/mdlayher/packet@v1.1.2(sum: h1:3Up1NG6LZrsgDVn6X4L9Ge/iyRyxFEFD9o6Pr3Q1nQY=) github.com/mdlayher/socket@v0.4.1(sum: h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U=) github.com/miekg/dns@v1.1.57(sum: h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=) github.com/patrickmn/go-cache@v2.1.0+incompatible(sum: h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=) github.com/pierrec/lz4/v4@v4.1.19(sum: h1:tYLzDnjDXh9qIxSTKHwXwOYmm9d887Y7Y1ZkyXYHAN4=) github.com/pkg/errors@v0.9.1(sum: h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=) github.com/quic-go/qpack@v0.4.0(sum: h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=) github.com/quic-go/qtls-go1-20@v0.4.1(sum: h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs=) github.com/quic-go/quic-go@v0.40.0(sum: h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw=) github.com/ti-mo/netfilter@v0.5.1(sum: h1:cqamEd1c1zmpfpqvInLOro0Znq/RAfw2QL5wL2rAR/8=) github.com/u-root/uio@v0.0.0-20230305220412-3e8cd9d6bf63(sum: h1:YcojQL98T/OO+rybuzn2+5KrD5dBwXIvYBvQ2cD3Avg=) go.etcd.io/bbolt@v1.3.8(sum: h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=) golang.org/x/crypto@v0.16.0(sum: h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=) golang.org/x/exp@v0.0.0-20231206192017-f3f8817b8deb(sum: h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8=) golang.org/x/net@v0.19.0(sum: h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=) golang.org/x/sync@v0.5.0(sum: h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=) golang.org/x/sys@v0.15.0(sum: h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=) golang.org/x/text@v0.14.0(sum: h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=) gopkg.in/natefinch/lumberjack.v2@v2.2.1(sum: h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=) gopkg.in/yaml.v3@v3.0.1(sum: h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=) howett.net/plist@v1.0.1(sum: h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM=) and easily able to be read: `AdGuardHome -v --version | awk '/Schema version:/{ print $NF }'` `27` I hope at some point it is incorporated in the documentation. While this is not really a critical feature for those who follow the changelogs and understand what's going on behind the scenes, it is easy in our day to day lives to not pay attention to something so significant for the actual functionality of AdGuardHome. You have taken one extra step to help your user base keep track of things. As always, the efforts taken by the AGH team will always be appreciated. Consider this a quick win.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AdGuardHome#4952
No description provided.