Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,18 @@ func RootInitConfig() {
}

if tapir.GlobalCF.UseTLS { // default = true
cd := viper.GetString("certs.certdir")
if cd == "" {
log.Fatalf("Error: missing config key: certs.certdir")
certPath := viper.GetString("certs.cert")
keyPath := viper.GetString("certs.key")
caCertPath := viper.GetString("certs.cacertfile")
if certPath == "" || keyPath == "" || caCertPath == "" {
log.Fatalf("Error: missing TLS config keys: certs.cert, certs.key and/or certs.cacertfile in %s", viper.ConfigFileUsed())
}
cert := cd + "/" + tapir.GlobalCF.Certname
tlsConfig, err := tapir.NewClientConfig(viper.GetString("certs.cacertfile"),
cert+".key", cert+".crt")
for _, f := range []string{certPath, keyPath, caCertPath} {
if _, statErr := os.Stat(f); statErr != nil {
log.Fatalf("Error: TLS file not accessible: %s (%v)", f, statErr)
}
}
tlsConfig, err := tapir.NewClientConfig(caCertPath, keyPath, certPath)
if err != nil {
log.Fatalf("Error: Could not set up TLS: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23.0
toolchain go1.23.7

require (
github.com/dnstapir/tapir v0.0.0-20250527085005-d2d7ecec0b06
github.com/dnstapir/tapir v0.0.0-20250916134600-6f3506c45053
github.com/go-playground/validator/v10 v10.9.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.18.1
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnN
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/dnstapir/tapir v0.0.0-20250527085005-d2d7ecec0b06 h1:HNjMEjsZDgdg6iCaoxqRMK4ueZtiUhGEojyZfdH8yd4=
github.com/dnstapir/tapir v0.0.0-20250527085005-d2d7ecec0b06/go.mod h1:A6BFxLXbsLJNj80yFy/OWVb7RmLyFIvXDgvFtRSN3ho=
github.com/dnstapir/tapir v0.0.0-20250910084357-f6a1ab6381f1 h1:f1Z4o90RdoKOONUnasLbDBimCtzkgZN7kvpdLmLUlgI=
github.com/dnstapir/tapir v0.0.0-20250910084357-f6a1ab6381f1/go.mod h1:A6BFxLXbsLJNj80yFy/OWVb7RmLyFIvXDgvFtRSN3ho=
github.com/dnstapir/tapir v0.0.0-20250910091651-19067e68eca0 h1:Yyo6qjy8LcFuNLOU3/qIxYZE72sCZ6JVKXtRsd1f8+U=
github.com/dnstapir/tapir v0.0.0-20250910091651-19067e68eca0/go.mod h1:A6BFxLXbsLJNj80yFy/OWVb7RmLyFIvXDgvFtRSN3ho=
github.com/dnstapir/tapir v0.0.0-20250911072630-abc0ba3af0fe h1:1If23nTBEY1koJZIGba1Tygbig1eVEZ6Kv3e5aO9/p4=
github.com/dnstapir/tapir v0.0.0-20250911072630-abc0ba3af0fe/go.mod h1:A6BFxLXbsLJNj80yFy/OWVb7RmLyFIvXDgvFtRSN3ho=
github.com/dnstapir/tapir v0.0.0-20250916134600-6f3506c45053 h1:UtoWJ0I3FkYjOiSnJf8NFzUzGc/nN+xzVGRB8+Vrxi4=
github.com/dnstapir/tapir v0.0.0-20250916134600-6f3506c45053/go.mod h1:A6BFxLXbsLJNj80yFy/OWVb7RmLyFIvXDgvFtRSN3ho=
github.com/eclipse/paho.golang v0.21.0 h1:cxxEReu+iFbA5RrHfRGxJOh8tXZKDywuehneoeBeyn8=
github.com/eclipse/paho.golang v0.21.0/go.mod h1:GHF6vy7SvDbDHBguaUpfuBkEB5G6j0zKxMG4gbh6QRQ=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
Expand Down
Empty file removed rpm/SOURCES/tapir-cli.yaml
Empty file.
9 changes: 6 additions & 3 deletions rpm/SPECS/tapir-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ URL: https://www.github.com/dnstapir/cli
Source0: %{name}-%{version}.tar.gz
Source1: tapir-renew.service
Source2: tapir-renew.timer
Source3: tapir-cli.yaml
BuildRequires: git
BuildRequires: golang

%description
DNSTAPIR EDGE ClI Tool for managing an EDGE deployment

# Disable building of debug packages for RHEL (we include symbols per default)
%if 0%{?rhel} >= 9
%global debug_package %{nil}
%endif

%{!?_unitdir: %define _unitdir /usr/lib/systemd/system/}
%{!?_sysusersdir: %define _sysusersdir /usr/lib/sysusers.d/}

Expand All @@ -33,13 +37,12 @@ mkdir -p %{buildroot}%{_sysconfdir}/dnstapir/certs
install -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
install -m 0640 %{SOURCE3} %{buildroot}%{_sysconfdir}/dnstapir/

%files
%attr(0770,root,dnstapir) %dir %{_sysconfdir}/dnstapir
%attr(0770,root,dnstapir) %dir %{_sysconfdir}/dnstapir/certs
%attr(0770,root,dnstapir) %{_bindir}/%{name}
%attr(0660,root,dnstapir) %{_sysconfdir}/dnstapir/tapir-cli.yaml
%attr(0660,-,dnstapir) %ghost %{_sysconfdir}/dnstapir/tapir-cli.yaml
%attr(0644,root,dnstapir) %{_unitdir}/tapir-renew.service
%attr(0644,root,dnstapir) %{_unitdir}/tapir-renew.timer

Expand Down
Loading