4
0
Files
dnscrypt-proxy/dnscrypt-proxy.spec

182 lines
6.7 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package dnscrypt-proxy
#
Accepting request 1236957 from home:ramdomPTM:branches:server:dns - Update to version 2.1.6 * Forwarding: in the list of servers for a zone, the `$BOOTSTRAP` keyword can be included as a shortcut to forward to the bootstrap servers. And the `$DHCP` keyword can be included to forward to the DNS resolvers provided by the local DHCP server. Based on work by YX Hao, thanks! DHCP forwarding should be considered experimental and my not work on all operating systems. A rule for a zone can mix and match multiple forwarder types, such as `10.0.0.1,10.0.0.254,$DHCP,192.168.1.1,$BOOTSTRAP`. Note that this is not implemented for captive portals yet. * Lying resolvers are now skipped, instead of just printing an error. This doesn't apply to captive portal and forwarding entries, which are the only reasonable use case for lying resolvers. * Support for XSalsa20 in DNSCrypt has been removed. This was not documented, and was supserseded by XChaCha20 in 2016. * Source files are now fetched with compression. * DNS64: compatibility has been improved. * Forwarding: the root domain (`.`) can now be forwarded. * The ARC caching algorithm has been replaced by the SIEVE algorithm. * Properties of multiple servers are now updated simultaneously. The concurrency level can be adjusted with the new `cert_refresh_concurrency` setting. Contributed by YX Hao. * MSI packages for DNSCrypt can now easily be built. * New command-line flag: `-include-relays` to include relays in `-list` and `-list-all`. * Support for DNS extended error codes has been added. * Documentation updates, bug fixes, dependency updates. - Drop quic-go.patch, for dnscrypt-proxy already pulls fixed quic-go v0.48.2 OBS-URL: https://build.opensuse.org/request/show/1236957 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=53
2025-01-11 16:35:35 +00:00
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Accepting request 860171 from home:namtrac:branches:server:dns - Update to version 2.0.45 * Configuration changes (to be required in versions 2.1.x): - [blacklist] has been renamed to [blocked_names] - [ip_blacklist] has been renamed to [blocked_ips] - [whitelist] has been renamed to [allowed_names] - generate-domains-blacklist.py has been renamed to generate-domains-blocklist.py, and the configuration files have been renamed as well. * dnscrypt-proxy -resolve has been completely revamped, and now requires the configuration file to be accessible. It will send a query to an IP address of the dnscrypt-proxy server by default. Sending queries to arbitrary servers is also supported with the new -resolve name,address syntax. * Relay lists can be set to * for automatic relay selection. When a wildcard is used, either for the list of servers or relays, the proxy ensures that relays and servers are on distinct networks. * Lying resolvers are detected and reported. * New return code: NOT_READY for queries received before the proxy has been initialized. * Server lists can't be older than a week any more, even if directory permissions are incorrect and cache files cannot be written. * New feature: allowed_ips, to configure a set of IP addresses to never block no matter what DNS name resolves to them. * Hard-coded IP addresses can be immediately returned for test queries sent by operating systems in order to check for connectivity and captive portals. Such responses can be sent even before an interface is considered as enabled by the operating system. This can be configured in a new section called [captive_portals]. * On Linux, OpenBSD and FreeBSD, listen_addresses can now include IP addresses that haven't been assigned to an interface yet. * generate-domains-blocklist.py: regular expressions are now ignored in time-based entries. OBS-URL: https://build.opensuse.org/request/show/860171 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=30
2021-01-04 18:36:28 +00:00
%define _buildshell /bin/bash
%define user_group dnscrypt
%define config_dir %{_sysconfdir}/%{name}
%define home_dir %{_localstatedir}/lib/%{name}
%define home_dir_escaped \\%{_localstatedir}\\/lib\\/%{name}
%define log_dir %{_localstatedir}/log/%{name}
%define services %{name}.socket %{name}.service %{name}-resolvconf.service
Name: dnscrypt-proxy
Version: 2.1.13
Release: 0
Summary: A tool for securing communications between a client and a DNS resolver
License: ISC
Group: Productivity/Networking/DNS/Utilities
URL: https://dnscrypt.info/
Source0: https://codeload.github.com/DNSCrypt/%{name}/tar.gz/%{version}#/%{name}-%{version}.tar.gz
Source1: %{name}.service
Source2: %{name}.socket
Source3: %{name}-resolvconf.service
# File to use with sed to modify default configuration.
Source4: example-dnscrypt-proxy.toml.sed
# Some words
Source5: README.openSUSE
# Example how to override socket unit
Source6: %{name}.socket.conf
# dnscrypt user configuration
Source7: %{user_group}-user.conf
BuildRequires: golang-packaging
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: sysuser-tools
Accepting request 1236957 from home:ramdomPTM:branches:server:dns - Update to version 2.1.6 * Forwarding: in the list of servers for a zone, the `$BOOTSTRAP` keyword can be included as a shortcut to forward to the bootstrap servers. And the `$DHCP` keyword can be included to forward to the DNS resolvers provided by the local DHCP server. Based on work by YX Hao, thanks! DHCP forwarding should be considered experimental and my not work on all operating systems. A rule for a zone can mix and match multiple forwarder types, such as `10.0.0.1,10.0.0.254,$DHCP,192.168.1.1,$BOOTSTRAP`. Note that this is not implemented for captive portals yet. * Lying resolvers are now skipped, instead of just printing an error. This doesn't apply to captive portal and forwarding entries, which are the only reasonable use case for lying resolvers. * Support for XSalsa20 in DNSCrypt has been removed. This was not documented, and was supserseded by XChaCha20 in 2016. * Source files are now fetched with compression. * DNS64: compatibility has been improved. * Forwarding: the root domain (`.`) can now be forwarded. * The ARC caching algorithm has been replaced by the SIEVE algorithm. * Properties of multiple servers are now updated simultaneously. The concurrency level can be adjusted with the new `cert_refresh_concurrency` setting. Contributed by YX Hao. * MSI packages for DNSCrypt can now easily be built. * New command-line flag: `-include-relays` to include relays in `-list` and `-list-all`. * Support for DNS extended error codes has been added. * Documentation updates, bug fixes, dependency updates. - Drop quic-go.patch, for dnscrypt-proxy already pulls fixed quic-go v0.48.2 OBS-URL: https://build.opensuse.org/request/show/1236957 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=53
2025-01-11 16:35:35 +00:00
BuildRequires: vendored_licenses_packager
BuildRequires: golang(API) >= 1.24
BuildRequires: pkgconfig(libsystemd)
%sysusers_requires
%{?systemd_requires}
# For systemd pidfile solution.
Requires: bash
Recommends: ca-certificates
# needed for resolvconf support
Suggests: openresolv
Provides: dnscrypt = %{version}-%{release}
Obsoletes: dnscrypt < %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A flexible DNS proxy, with support for modern encrypted DNS protocols
such as DNSCrypt v2, DNS-over-HTTPS, Anonymized DNSCrypt
and ODoH (Oblivious DoH).
%prep
%autosetup -p1 -n %{name}-%{version}
# replace with home directory from spec
sed -i "s/home_dir_placeholder/%{home_dir_escaped}/" %{SOURCE7}
# duplicate original config file
cp ./%{name}/example-%{name}.toml ./%{name}.toml.default
# Edit default port and file locations
sed -i -f %{SOURCE4} ./%{name}.toml.default
# duplicate edited config file
cp ./%{name}.toml.default ./%{name}.toml
# Delete "example" to prevent fdupes from deleting the backup config file if run for buildroot
sed -i "s/## This is an example configuration file./## This is a configuration file./" ./dnscrypt-proxy.toml
# python path instead of env
Accepting request 860171 from home:namtrac:branches:server:dns - Update to version 2.0.45 * Configuration changes (to be required in versions 2.1.x): - [blacklist] has been renamed to [blocked_names] - [ip_blacklist] has been renamed to [blocked_ips] - [whitelist] has been renamed to [allowed_names] - generate-domains-blacklist.py has been renamed to generate-domains-blocklist.py, and the configuration files have been renamed as well. * dnscrypt-proxy -resolve has been completely revamped, and now requires the configuration file to be accessible. It will send a query to an IP address of the dnscrypt-proxy server by default. Sending queries to arbitrary servers is also supported with the new -resolve name,address syntax. * Relay lists can be set to * for automatic relay selection. When a wildcard is used, either for the list of servers or relays, the proxy ensures that relays and servers are on distinct networks. * Lying resolvers are detected and reported. * New return code: NOT_READY for queries received before the proxy has been initialized. * Server lists can't be older than a week any more, even if directory permissions are incorrect and cache files cannot be written. * New feature: allowed_ips, to configure a set of IP addresses to never block no matter what DNS name resolves to them. * Hard-coded IP addresses can be immediately returned for test queries sent by operating systems in order to check for connectivity and captive portals. Such responses can be sent even before an interface is considered as enabled by the operating system. This can be configured in a new section called [captive_portals]. * On Linux, OpenBSD and FreeBSD, listen_addresses can now include IP addresses that haven't been assigned to an interface yet. * generate-domains-blocklist.py: regular expressions are now ignored in time-based entries. OBS-URL: https://build.opensuse.org/request/show/860171 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=30
2021-01-04 18:36:28 +00:00
sed -i "1s/#! \/usr\/bin\/env python3/#! \/usr\/bin\/python3/" utils/generate-domains-blocklist/generate-domains-blocklist.py
%vendored_licenses_packager_prep
%build
%sysusers_generate_pre %{SOURCE7} %{user_group} %{user_group}.conf
cd %{name}
go build -mod=vendor -buildmode=pie
%install
# Directories
install -D -d -m 0750 \
%{buildroot}%{log_dir} \
%{buildroot}%{home_dir} \
%{buildroot}%{config_dir}
install -D -d -m 0755 %{buildroot}%{_datadir}/%{name}/
# Binary
install -D -m 0755 %{name}/%{name} %{buildroot}%{_sbindir}/%{name}
Accepting request 860171 from home:namtrac:branches:server:dns - Update to version 2.0.45 * Configuration changes (to be required in versions 2.1.x): - [blacklist] has been renamed to [blocked_names] - [ip_blacklist] has been renamed to [blocked_ips] - [whitelist] has been renamed to [allowed_names] - generate-domains-blacklist.py has been renamed to generate-domains-blocklist.py, and the configuration files have been renamed as well. * dnscrypt-proxy -resolve has been completely revamped, and now requires the configuration file to be accessible. It will send a query to an IP address of the dnscrypt-proxy server by default. Sending queries to arbitrary servers is also supported with the new -resolve name,address syntax. * Relay lists can be set to * for automatic relay selection. When a wildcard is used, either for the list of servers or relays, the proxy ensures that relays and servers are on distinct networks. * Lying resolvers are detected and reported. * New return code: NOT_READY for queries received before the proxy has been initialized. * Server lists can't be older than a week any more, even if directory permissions are incorrect and cache files cannot be written. * New feature: allowed_ips, to configure a set of IP addresses to never block no matter what DNS name resolves to them. * Hard-coded IP addresses can be immediately returned for test queries sent by operating systems in order to check for connectivity and captive portals. Such responses can be sent even before an interface is considered as enabled by the operating system. This can be configured in a new section called [captive_portals]. * On Linux, OpenBSD and FreeBSD, listen_addresses can now include IP addresses that haven't been assigned to an interface yet. * generate-domains-blocklist.py: regular expressions are now ignored in time-based entries. OBS-URL: https://build.opensuse.org/request/show/860171 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=30
2021-01-04 18:36:28 +00:00
# blocklist generator
cp -a utils/generate-domains-blocklist/ %{buildroot}%{_datadir}/%{name}/
# Config files
install -D -m 0640 ./%{name}.toml %{buildroot}/%{config_dir}/%{name}.toml
install -D -m 0640 ./%{name}.toml.default %{buildroot}/%{config_dir}/%{name}.toml.default
install -D -m 0640 ./%{name}/example-allowed-ips.txt %{buildroot}/%{config_dir}/allowed-ips.txt
install -D -m 0640 ./%{name}/example-allowed-names.txt %{buildroot}/%{config_dir}/allowed-names.txt
Accepting request 860171 from home:namtrac:branches:server:dns - Update to version 2.0.45 * Configuration changes (to be required in versions 2.1.x): - [blacklist] has been renamed to [blocked_names] - [ip_blacklist] has been renamed to [blocked_ips] - [whitelist] has been renamed to [allowed_names] - generate-domains-blacklist.py has been renamed to generate-domains-blocklist.py, and the configuration files have been renamed as well. * dnscrypt-proxy -resolve has been completely revamped, and now requires the configuration file to be accessible. It will send a query to an IP address of the dnscrypt-proxy server by default. Sending queries to arbitrary servers is also supported with the new -resolve name,address syntax. * Relay lists can be set to * for automatic relay selection. When a wildcard is used, either for the list of servers or relays, the proxy ensures that relays and servers are on distinct networks. * Lying resolvers are detected and reported. * New return code: NOT_READY for queries received before the proxy has been initialized. * Server lists can't be older than a week any more, even if directory permissions are incorrect and cache files cannot be written. * New feature: allowed_ips, to configure a set of IP addresses to never block no matter what DNS name resolves to them. * Hard-coded IP addresses can be immediately returned for test queries sent by operating systems in order to check for connectivity and captive portals. Such responses can be sent even before an interface is considered as enabled by the operating system. This can be configured in a new section called [captive_portals]. * On Linux, OpenBSD and FreeBSD, listen_addresses can now include IP addresses that haven't been assigned to an interface yet. * generate-domains-blocklist.py: regular expressions are now ignored in time-based entries. OBS-URL: https://build.opensuse.org/request/show/860171 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=30
2021-01-04 18:36:28 +00:00
install -D -m 0640 ./%{name}/example-blocked-ips.txt %{buildroot}/%{config_dir}/blocked-ips.txt
install -D -m 0640 ./%{name}/example-blocked-names.txt %{buildroot}/%{config_dir}/blocked-names.txt
install -D -m 0640 ./%{name}/example-captive-portals.txt %{buildroot}/%{config_dir}/captive-portals.txt
install -D -m 0640 ./%{name}/example-cloaking-rules.txt %{buildroot}/%{config_dir}/cloaking-rules.txt
install -D -m 0640 ./%{name}/example-forwarding-rules.txt %{buildroot}/%{config_dir}/forwarding-rules.txt
# Systemd
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.socket
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}-resolvconf.service
# sysuser
install -D -m 0644 %{SOURCE7} %{buildroot}%{_sysusersdir}/%{user_group}.conf
# service link
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-resolvconf
%vendored_licenses_packager_install
# Some hints. Improvements and feedback welcome!
cp %{SOURCE5} README.openSUSE
# Example drop-in.
cp %{SOURCE6} %{name}.socket.conf
%pre -f %{user_group}.pre
%service_add_pre %{services}
%post
%service_add_post %{services}
%preun
%service_del_preun %{services}
%postun
%service_del_postun %{services}
%files
%doc ChangeLog README.md README.openSUSE %{name}.socket.conf %{name}.toml.default
%doc %{name}/example-*
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/%{name}.toml
%config %attr(-,root,%{user_group}) %{config_dir}/%{name}.toml.default
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/allowed-ips.txt
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/allowed-names.txt
Accepting request 860171 from home:namtrac:branches:server:dns - Update to version 2.0.45 * Configuration changes (to be required in versions 2.1.x): - [blacklist] has been renamed to [blocked_names] - [ip_blacklist] has been renamed to [blocked_ips] - [whitelist] has been renamed to [allowed_names] - generate-domains-blacklist.py has been renamed to generate-domains-blocklist.py, and the configuration files have been renamed as well. * dnscrypt-proxy -resolve has been completely revamped, and now requires the configuration file to be accessible. It will send a query to an IP address of the dnscrypt-proxy server by default. Sending queries to arbitrary servers is also supported with the new -resolve name,address syntax. * Relay lists can be set to * for automatic relay selection. When a wildcard is used, either for the list of servers or relays, the proxy ensures that relays and servers are on distinct networks. * Lying resolvers are detected and reported. * New return code: NOT_READY for queries received before the proxy has been initialized. * Server lists can't be older than a week any more, even if directory permissions are incorrect and cache files cannot be written. * New feature: allowed_ips, to configure a set of IP addresses to never block no matter what DNS name resolves to them. * Hard-coded IP addresses can be immediately returned for test queries sent by operating systems in order to check for connectivity and captive portals. Such responses can be sent even before an interface is considered as enabled by the operating system. This can be configured in a new section called [captive_portals]. * On Linux, OpenBSD and FreeBSD, listen_addresses can now include IP addresses that haven't been assigned to an interface yet. * generate-domains-blocklist.py: regular expressions are now ignored in time-based entries. OBS-URL: https://build.opensuse.org/request/show/860171 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=30
2021-01-04 18:36:28 +00:00
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/blocked-ips.txt
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/blocked-names.txt
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/captive-portals.txt
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/cloaking-rules.txt
%config(noreplace) %attr(-,root,%{user_group}) %{config_dir}/forwarding-rules.txt
%{_sysusersdir}/%{user_group}.conf
%{_sbindir}/%{name}
%{_sbindir}/rc%{name}
%{_sbindir}/rc%{name}-resolvconf
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_unitdir}/%{name}-resolvconf.service
%{_datadir}/%{name}/
%dir %attr(0750,root,%{user_group}) %{config_dir}
%dir %attr(0750,%{user_group},%{user_group}) %{home_dir}
%dir %attr(0750,%{user_group},%{user_group}) %{log_dir}
%license LICENSE
%vendored_licenses_packager_files
%changelog