Skip to content

Commit

Permalink
Add LICENSE and manpage
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasKorbar committed Oct 11, 2023
1 parent 24d7eb6 commit 2bbabe9
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2023 Red Hat, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
using root, because without it we can not access resolv.conf or any other stub resolv.conf
location
- Improve logging. Improve logging prefixes.
- Add option for altering behaviour while handling wireless interfaces.
1 change: 1 addition & 0 deletions bin/dnsconfd
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if __name__ == "__main__":
print(dnsconfd_object.Status(dbus_interface='org.freedesktop.resolve1.Dnsconfd'))
except DBusException as e:
print("Was not able to call Status method, check your DBus policy")
exit(1)
exit(0)

dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
Expand Down
56 changes: 56 additions & 0 deletions distribution/dnsconfd.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.TH "dnsconfd" "8" "10 Oct 2023" "dnsconfd-0.0.1" ""

.SH NAME

Dnsconfd - local DNS cache configuration daemon

.SH SYNOPSIS

dnsconfd [-h] [-s] [--dbus-name DBUS_NAME] [--log-level {DEBUG,INFO,WARN}] [--resolv-conf-path RESOLV_CONF_PATH]

.SH DESCRIPTION

Dnsconfd is a local cache configuration daemon. It implements DBus interface of systemd-resolved
and translates it's use to dns service's configuration.

.SH OPTIONS

.IP "-h, --help"
Show help message and exit
.IP "-s, --status"
Print status of already running instance if any
.IP "--dbus-name DBUS_NAME"
DBus name that dnsconfd should use
.IP "--log-level {DEBUG,INFO,WARN}"
Log level of dnsconfd
.IP "--resolv-conf-path RESOLV_CONF_PATH"
Path to resolv.conf that the dnsconfd should manage

.SH "EXIT STATUS"
.IP 0
No error has occured. When status was requested, dnsconfd has been able to retrieve it successfully.
.IP 1
Error has occured or dnsconfd was not able to retrieve status successfully.

.SH ENVIRONMENT
Environment variables are overriden if their argument counterparts are used.

.IP DBUS_NAME
DBus name that dnsconfd should use
.IP RESOLV_CONF_PATH
Path to resolv.conf that the dnsconfd should manage
.IP LOG_LEVEL
Log level of dnsconfd

.SH FILES
Dnsconfd manages resolv.conf to route domain name resolution to local cache service.

.SH NOTES
The only currently supported backend is Unbound.

.SH "REPORTING BUGS"
Please for reporting bugs use Github repository https://github.com/InfrastructureServices/dnsconfd

.SH COPYRIGHT

Copyright (c) 2023 Red Hat, Inc.
7 changes: 7 additions & 0 deletions distribution/dnsconfd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Source2: dnsconfd.service
#Source3: dnsconfd.sysusers
Source4: dnsconfd.fc
Source5: dnsconfd.te
Source6: LICENSE
Source7: dnsconfd.8

BuildArch: noarch

Expand Down Expand Up @@ -69,6 +71,7 @@ mkdir -m 0755 -p %{buildroot}%{_unitdir}
mkdir -m 0755 -p %{buildroot}%{_sysconfdir}/sysconfig
mkdir -m 0755 -p %{buildroot}%{_sbindir}
mkdir -m 0755 -p %{buildroot}/var/log/dnsconfd
mkdir -m 0755 -p %{buildroot}/%{_mandir}/man8

install -m 0644 -p %{SOURCE1} %{buildroot}%{_sysconfdir}/dbus-1/system.d/com.redhat.dnsconfd.conf
install -m 0644 -p %{SOURCE2} %{buildroot}%{_unitdir}/dnsconfd.service
Expand All @@ -80,6 +83,8 @@ mv %{buildroot}%{_bindir}/dnsconfd %{buildroot}%{_sbindir}/dnsconfd

install -D -m 0644 %{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2

install -m 0644 -p %{SOURCE7} %{buildroot}/%{_mandir}/man8/dnsconfd.8

#install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/dnsconfd.conf

%pre selinux
Expand Down Expand Up @@ -116,13 +121,15 @@ systemctl enable dnsconfd.service &>/dev/null
%systemd_postun dnsconfd.service

%files
%license LICENSE
%{_sbindir}/dnsconfd
%{python3_sitelib}/dnsconfd/
%{python3_sitelib}/dnsconfd-%{version}*
%{_sysconfdir}/dbus-1/system.d/com.redhat.dnsconfd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/dnsconfd
%{_unitdir}/dnsconfd.service
%attr(0755,root,root) /var/log/dnsconfd
%{_mandir}/man8/dnsconfd.8*
#%{_sysusersdir}/dnsconfd.conf

%files selinux
Expand Down
1 change: 1 addition & 0 deletions tests/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

python3 setup.py sdist -d ./distribution
cp ./LICENSE distribution/LICENSE
pushd distribution
fedpkg local
mv ./noarch/*.noarch.rpm ../tests
Expand Down

0 comments on commit 2bbabe9

Please sign in to comment.