Adding new release

hi,

Im using dnscrypt-proxy V2 and I just saw the new release from January, version 2.0.45, do you know if it possible to adding that version in my next image compilation?
Or just need to packages feeds update?
https://github.com/dnscrypt/dnscrypt-proxy/releases/tag/2.0.45

thanks

The latest package in master is based on 2.0.44: https://github.com/openwrt/packages/commit/01ff758894d4efecdd69bf79f86014d82b91dd01

You can email the maintainer asking them to update OpenWrt package in master and release. Then it will be available for compiling from scratch or a few days later for inclusion in an Image Builder-produced image.

3 Likes

Additionally, if you are already building from source (rather than an ImageBuilder), you can update the package Makefile locally until it is updated in the upstream

2 Likes

Im looking at it, dont know if I just have to update version in makefile ; 2.0.44 to 2.0.45..?

ames@e6530:~$ cd openwrt
james@e6530:~/openwrt$ nano feeds/packages/net/dnscrypt-proxy2/Makefile
james@e6530:~/openwrt$ make feeds/packages/net/dnscrypt-proxy2/check V=s FIXUP=1
Collecting package info: done
make[1]: Entering directory '/home/james/openwrt'
make[1]: *** No rule to make target 'feeds/packages/net/dnscrypt-proxy2/check'.  Stop.
make[1]: Leaving directory '/home/james/openwrt'
make: *** [/home/james/openwrt/include/toplevel.mk:234: feeds/packages/net/dnscrypt-proxy2/check] Error 2

You would need to change the version number, the release number back to 1, and the HASH to the sha256sum result of the downloaded .tar.xz (or tar.gz) file in ./dl

Assuming no other requirements were added to the release (like deps), then it should work fine.

Should be make package/feeds/packages/dnscrypt-proxy2

When packages in ./feeds are installed, they are symlinked to package/feeds/packages/xxxx without the net/ libs/ etc part.. Just the package name for the xxx

Stealth Edit on the above, so ping @ninjanoir78 for the notification :slight_smile:

1 Like

Here is an updated Makefile, let me know if it works and I'll put in a PR to update the package

#
# Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=dnscrypt-proxy2
PKG_VERSION:=2.0.45
PKG_RELEASE:=1

PKG_SOURCE:=dnscrypt-proxy-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/DNSCrypt/dnscrypt-proxy/tar.gz/$(PKG_VERSION)?
PKG_HASH:=f7aac28c6a60404683d436072b89d18ed3bb309f8d8a95c8e87ad250da190821
PKG_BUILD_DIR:=$(BUILD_DIR)/dnscrypt-proxy-$(PKG_VERSION)

PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=LICENSE

PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0

GO_PKG:=github.com/DNSCrypt/dnscrypt-proxy

include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-package.mk

define Package/dnscrypt-proxy2
  SECTION:=net
  CATEGORY:=Network
  TITLE:=Flexible DNS proxy with encrypted DNS protocols
  URL:=https://github.com/DNSCrypt/dnscrypt-proxy
  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  CONFLICTS:=dnscrypt-proxy
endef

define Package/dnscrypt-proxy2/install
        $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))

        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/sbin/

        $(INSTALL_DIR) $(1)/etc/dnscrypt-proxy2
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/dnscrypt-proxy/example-dnscrypt-proxy.toml $(1)/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
        $(INSTALL_CONF) ./files/blacklist.txt $(1)/etc/dnscrypt-proxy2/blacklist.txt

        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy

        sed -i "s/^listen_addresses = .*/listen_addresses = ['127.0.0.53:53']/" $(1)/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
        sed -i "s/^  # blacklist_file = 'blacklist.txt'/blacklist_file = 'blacklist.txt'/" $(1)/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
endef

define Package/dnscrypt-proxy2/description
  A flexible DNS proxy, with support for modern encrypted DNS protocols
  such as DNSCrypt v2 and DNS-over-HTTPS.
endef

define Package/dnscrypt-proxy2/conffiles
/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
endef

define Package/golang-github-jedisct1-dnscrypt-proxy2-dev
$(call Package/dnscrypt-proxy2)
$(call GoPackage/GoSubMenu)
  TITLE+= (source files)
  PKGARCH:=all
endef

define Package/golang-github-jedisct1-dnscrypt-proxy2-dev/description
$(call Package/dnscrypt-proxy2/description)

  This package provides the source files for the client/bridge program.
endef

$(eval $(call GoBinPackage,dnscrypt-proxy2))
$(eval $(call BuildPackage,dnscrypt-proxy2))
$(eval $(call GoSrcPackage,golang-github-jedisct1-dnscrypt-proxy2-dev))
$(eval $(call BuildPackage,golang-github-jedisct1-dnscrypt-proxy2-dev))

And, to make this educational :slight_smile: The changed lines were:

PKG_VERSION:=2.0.45
PKG_HASH:=f7aac28c6a60404683d436072b89d18ed3bb309f8d8a95c8e87ad250da190821

Gotten by:

Setting PKG_HASH to skip, then doing make package/feeds/packages/dnscrypt-proxy2/download

Then

grommish@DESKTOP-N35LRJ4:~/openwrt$ sha256sum dl/dnscrypt-proxy-2.0.45.tar.gz
f7aac28c6a60404683d436072b89d18ed3bb309f8d8a95c8e87ad250da190821  dl/dnscrypt-proxy-2.0.45.tar.gz

and resetting the proper HASH value from skip to the value it should be. You can't force a download unless changing the PKG_HASH because the values won't match, but it'll be set for future users to not mess with once it's done

2 Likes

An update to the new 2.84 DNSMASQ from current test3 in master via the above:

vi package/network/services/dnsmasq/Makefile
make package/network/services/dnsmasq/check V=s FIXUP=1

yields

PKG_HASH:=603195c64b73137609b07e1024ae0b37f652b2f5fe467dce66985b3d1850050c

as per wiki.

4 Likes

thanks to @anomeome and @Grommish
really appreciated

Yes, but I usually don't bother since I'm already in the Makefile when I'm doing it, and set the HASH to skip when I'm testing (due to usually multiple versions I'm testing)

ifdef FIXUP
F_hash_deprecated = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile fix-hash $(3) $(call gen_sha256sum,$(1)) $(2)
F_hash_mismatch = $(F_hash_deprecated)
F_hash_missing = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile add-hash $(3) $(call gen_sha256sum,$(1))
endif

FIXUP calls the scripts to do the same things though, yes. :slight_smile:

1 Like

I just noticed that the dnscrypt-proxy2 Makefile advertises DNS-over-HTTPS support, I realize it's a shamepless plug, but if all you need is DoH, I'd totally recommend the https-dns-proxy and luci-app-https-dns-proxy instead. Just compare the package sizes between the dnscrypt-proxy2 written in Go (~3.5Mb) and https-dns-proxy written in C (~12Kb):

EdgeRouterX in ~ # opkg info dnscrypt-proxy2 https-dns-proxy
Package: dnscrypt-proxy2
Version: 2.0.44-1
...
Size: 3564613
Filename: dnscrypt-proxy2_2.0.44-1_mipsel_24kc.ipk
Description: A flexible DNS proxy, with support for modern encrypted DNS protocols
 such as DNSCrypt v2 and DNS-over-HTTPS.

EdgeRouterX in ~ # opkg info https-dns-proxy
Package: https-dns-proxy
Version: 2021-01-17-1
...
Size: 12913
Filename: https-dns-proxy_2021-01-17-1_mipsel_24kc.ipk
Description: https-dns-proxy is a light-weight DNS<-->HTTPS, non-caching translation proxy for the RFC 8484 DoH standard.
 It receives regular (UDP) DNS requests and issues them via DoH.
 Please see https://docs.openwrt.melmac.net/https-dns-proxy/ for more information.

The stubby package which supports DNS-over-TLS is also under 20Kb:

EdgeRouterX in ~ # opkg info stubby
Package: stubby
Version: 0.3.0-1
...
Size: 19219
Filename: stubby_0.3.0-1_mipsel_24kc.ipk
Description: This package contains the Stubby daemon (which utilizes the getdns library).
 See https://github.com/openwrt/packages/blob/master/net/stubby/files/README.md for more details.
1 Like

Ya, big question as to whether a GO app belongs on an embedded device, but maybe that's just me.

yes but dnscrypt-proxy2 is very versatile and we have many options in the configuration

I've got Rust-lang for my device, can't be any sillier than Go-Lang :wink:

Someone want to test this? I don't use the package, but if it tests out, the PR is up.

3 Likes

works great from ipk install.

For context, I build the ipk for @ninjanoir78 to test on his device.. The PR still needs proper testing :slight_smile:

1 Like

This has been updated in the repo.

2 Likes

Do you know who maintains the dnscrypt proxy 2?
New release since 3 days.
Thanks

makefile

1 Like