mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-02 10:52:57 +02:00
NetAuth: update to 0.6.2.
This commit is contained in:
parent
4edb56c96e
commit
153a3da1e7
4 changed files with 3 additions and 154 deletions
|
@ -1,36 +0,0 @@
|
||||||
From cb7cfa5bc0530e43fdbc227783187a141d857139 Mon Sep 17 00:00:00 2001
|
|
||||||
From: classabbyamp <dev@placeviolette.net>
|
|
||||||
Date: Sat, 24 Sep 2022 17:40:11 -0400
|
|
||||||
Subject: [PATCH] internal/ctl/system-ctl: don't run initialize(), rename to
|
|
||||||
system-cli
|
|
||||||
|
|
||||||
the default initialize() is not necessary when generating completions
|
|
||||||
and docs, so we can override it with an empty function.
|
|
||||||
|
|
||||||
Also, the file was renamed to `system-cli` to put it more inline with
|
|
||||||
other files' naming conventions.
|
|
||||||
---
|
|
||||||
internal/ctl/{system-ctl.go => system-cli.go} | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
rename internal/ctl/{system-ctl.go => system-cli.go} (68%)
|
|
||||||
|
|
||||||
diff --git a/internal/ctl/system-ctl.go b/internal/ctl/system-cli.go
|
|
||||||
similarity index 68%
|
|
||||||
rename from internal/ctl/system-ctl.go
|
|
||||||
rename to internal/ctl/system-cli.go
|
|
||||||
index 3dbd9d3..0a42d05 100644
|
|
||||||
--- a/internal/ctl/system-ctl.go
|
|
||||||
+++ b/internal/ctl/system-cli.go
|
|
||||||
@@ -8,9 +8,12 @@ var (
|
|
||||||
cliCmd = &cobra.Command{
|
|
||||||
Use: "cli",
|
|
||||||
Short: "Extra utilities for the CLI",
|
|
||||||
+ PersistentPreRun: cli_initialize,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
systemCmd.AddCommand(cliCmd)
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+func cli_initialize(*cobra.Command, []string) {}
|
|
|
@ -1,87 +0,0 @@
|
||||||
From 1df568cd25d6ccac79e56451406e021ead49c0c4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michael Aldridge <aldridge.mac@gmail.com>
|
|
||||||
Date: Wed, 31 Aug 2022 16:44:40 -0500
|
|
||||||
Subject: [PATCH] pkg/netauth: Handle config loading in library layer
|
|
||||||
|
|
||||||
---
|
|
||||||
cmd/netauth/main.go | 7 -------
|
|
||||||
internal/ctl/root.go | 9 ---------
|
|
||||||
pkg/netauth/netauth.go | 13 +++++++++++++
|
|
||||||
3 files changed, 13 insertions(+), 16 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cmd/netauth/main.go b/cmd/netauth/main.go
|
|
||||||
index d66dd8a..7695cd5 100644
|
|
||||||
--- a/cmd/netauth/main.go
|
|
||||||
+++ b/cmd/netauth/main.go
|
|
||||||
@@ -4,7 +4,6 @@ import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/hashicorp/go-hclog"
|
|
||||||
- "github.com/spf13/viper"
|
|
||||||
|
|
||||||
"github.com/netauth/netauth/internal/ctl"
|
|
||||||
|
|
||||||
@@ -22,12 +21,6 @@ var (
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
- // This runs here so we can reset the defaults that are set
|
|
||||||
- // during various init() methods.
|
|
||||||
- viper.SetDefault("token.cache", "fs")
|
|
||||||
- viper.SetDefault("token.keyprovider", "fs")
|
|
||||||
- viper.SetDefault("token.backend", "jwt-rsa")
|
|
||||||
-
|
|
||||||
level, set := os.LookupEnv("NETAUTH_LOGLEVEL")
|
|
||||||
if !set {
|
|
||||||
appLogger = hclog.NewNullLogger()
|
|
||||||
diff --git a/internal/ctl/root.go b/internal/ctl/root.go
|
|
||||||
index faf35b0..b20c0d2 100644
|
|
||||||
--- a/internal/ctl/root.go
|
|
||||||
+++ b/internal/ctl/root.go
|
|
||||||
@@ -61,15 +61,6 @@ func onInit() {
|
|
||||||
viper.BindPFlags(pflag.CommandLine)
|
|
||||||
if cfg != "" {
|
|
||||||
viper.SetConfigFile(cfg)
|
|
||||||
- } else {
|
|
||||||
- viper.SetConfigName("config")
|
|
||||||
- viper.AddConfigPath(".")
|
|
||||||
- viper.AddConfigPath("$HOME/.netauth")
|
|
||||||
- viper.AddConfigPath("/etc/netauth/")
|
|
||||||
- }
|
|
||||||
- if err := viper.ReadInConfig(); err != nil {
|
|
||||||
- fmt.Println("Error reading config:", err)
|
|
||||||
- os.Exit(1)
|
|
||||||
}
|
|
||||||
viper.Set("client.ServiceName", "netauth")
|
|
||||||
|
|
||||||
diff --git a/pkg/netauth/netauth.go b/pkg/netauth/netauth.go
|
|
||||||
index 831d64f..77a203c 100644
|
|
||||||
--- a/pkg/netauth/netauth.go
|
|
||||||
+++ b/pkg/netauth/netauth.go
|
|
||||||
@@ -17,6 +17,14 @@ import (
|
|
||||||
func init() {
|
|
||||||
viper.SetDefault("core.port", 1729)
|
|
||||||
viper.SetDefault("tls.certificate", "keys/tls.pem")
|
|
||||||
+ viper.SetDefault("token.cache", "fs")
|
|
||||||
+ viper.SetDefault("token.keyprovider", "fs")
|
|
||||||
+ viper.SetDefault("token.backend", "jwt-rsa")
|
|
||||||
+
|
|
||||||
+ viper.SetConfigName("config")
|
|
||||||
+ viper.AddConfigPath(".")
|
|
||||||
+ viper.AddConfigPath("$HOME/.netauth")
|
|
||||||
+ viper.AddConfigPath("/etc/netauth/")
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewWithLog uses the specified logger to contruct a NetAuth client.
|
|
||||||
@@ -24,6 +32,11 @@ func init() {
|
|
||||||
// handler that is provided should have the correct name and be
|
|
||||||
// parented to the correct point on the log tree.
|
|
||||||
func NewWithLog(l hclog.Logger) (*Client, error) {
|
|
||||||
+ if err := viper.ReadInConfig(); err != nil {
|
|
||||||
+ fmt.Println("Error reading config:", err)
|
|
||||||
+ os.Exit(1)
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if viper.GetString("core.conf") == "" {
|
|
||||||
viper.Set("core.conf", filepath.Dir(viper.ConfigFileUsed()))
|
|
||||||
l.Debug("Config relative load path set", "path", viper.GetString("core.conf"))
|
|
|
@ -1,28 +0,0 @@
|
||||||
From b1d12b4b7956d25fd4b23a92d1683cc389d163a2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: classabbyamp <dev@placeviolette.net>
|
|
||||||
Date: Wed, 19 Oct 2022 12:17:37 -0400
|
|
||||||
Subject: [PATCH] internal/ctl/root.go: only set the default entity if no error
|
|
||||||
|
|
||||||
when using qemu-user-static to run netauth in the xbps-src chroot on
|
|
||||||
cross (for generating completions/manpages), netauth segfaults because
|
|
||||||
it tries to access a field in a nil value after `user.Current()` errors.
|
|
||||||
This patch makes it so that the field is only accessed when it exists.
|
|
||||||
---
|
|
||||||
internal/ctl/root.go | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/internal/ctl/root.go b/internal/ctl/root.go
|
|
||||||
index b20c0d2..842815e 100644
|
|
||||||
--- a/internal/ctl/root.go
|
|
||||||
+++ b/internal/ctl/root.go
|
|
||||||
@@ -67,8 +67,9 @@ func onInit() {
|
|
||||||
user, err := user.Current()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Could not get default user:", err)
|
|
||||||
+ } else {
|
|
||||||
+ viper.SetDefault("entity", user.Username)
|
|
||||||
}
|
|
||||||
- viper.SetDefault("entity", user.Username)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute serves as the entrypoint to the ctl package.
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'NetAuth'
|
# Template file for 'NetAuth'
|
||||||
pkgname=NetAuth
|
pkgname=NetAuth
|
||||||
version=0.6.1
|
version=0.6.2
|
||||||
revision=6
|
revision=1
|
||||||
build_style=go
|
build_style=go
|
||||||
build_helper="qemu"
|
build_helper="qemu"
|
||||||
go_import_path="github.com/netauth/netauth"
|
go_import_path="github.com/netauth/netauth"
|
||||||
|
@ -13,7 +13,7 @@ maintainer="Michael Aldridge <maldridge@netauth.org>"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="https://netauth.org"
|
homepage="https://netauth.org"
|
||||||
distfiles="https://github.com/NetAuth/NetAuth/archive/v$version.tar.gz"
|
distfiles="https://github.com/NetAuth/NetAuth/archive/v$version.tar.gz"
|
||||||
checksum=cf84b2e63b7a59ec6e415ead1a94994b040b30fee2b27e482073371cfb0fb444
|
checksum=f1b5f547f55222db66a74c0eb7ffdf1cfa2fde88d97e245a58ade54cfdd7d20b
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
for sh in bash zsh; do
|
for sh in bash zsh; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue