You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was not able to generate a configuration from cli input.
First, -u or --url cannot be passed as a flag (as described in the docs, see #77)
Second, if I use generate -s (even with -p key=value), it prompts me into something difficult to follow.
user@localhost:~/go/src/github.com/atighineanu/shoutrrr> go run cli/main.go generate -s slack
Generating URL for slack using basic generator
Enter the configuration values as prompted
: <----(*)
:
BotName: kured-bot
Token: T01EAU1DZ6K <-----(**)
panic: reflect: Elem of invalid type slack.Token
goroutine 1 [running]:
reflect.(*rtype).Elem(0x963460, 0x19, 0x199)
/home/user/go/src/reflect/type.go:918 +0x1a5
github.com/containrrr/shoutrrr/pkg/generators/basic.(*Generator).Generate(0xd43360, 0xa50920, 0xc00000e920, 0xc000095fb0, 0xc00000e8a0, 0x0, 0x2, 0x0, 0x7, 0xc0000975a8, ...)
/home/user/go/src/github.com/atighineanu/shoutrrr/pkg/generators/basic/basic.go:115 +0xa06
github.com/containrrr/shoutrrr/cli/cmd/generate.Run(0xd08ee0, 0xc00000e8a0, 0x0, 0x2)
/home/user/go/src/github.com/atighineanu/shoutrrr/cli/cmd/generate/generate.go:106 +0x6d4
github.com/spf13/cobra.(*Command).execute(0xd08ee0, 0xc00000e880, 0x2, 0x2, 0xd08ee0, 0xc00000e880)
/home/user/go/src/pkg/mod/github.com/spf13/[email protected]/command.go:842 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xd09180, 0x0, 0x0, 0x0)
/home/user/go/src/pkg/mod/github.com/spf13/[email protected]/command.go:943 +0x336
github.com/spf13/cobra.(*Command).Execute(...)
/home/user/go/src/pkg/mod/github.com/spf13/[email protected]/command.go:883
main.main()
/home/user/go/src/github.com/atighineanu/shoutrrr/cli/main.go:9 +0x31
exit status 2
are completely empty.
I would assume they are supposed to be the property key:value couple but I am not entirely sure. More description in docs would be welcome.
** - second, after inputing token from CLI - I always receive the panic error. I've printed the t.Kind() to see what is it in reflect type.go, but it was nil. Tried to put a default and avoid the panic, but ended with (from here
Yeah, sorry about that. Generate was planned early on, but never actually fully implemented until recently. I figured that the defaults should work for the current services without tags, but I guess not.
I will go through them and "whitelist" the ones that work and/or fix the ones that don't.
I think the problem with slack is that the "basic" generator doesn't know how to handle structs (Token in this case).
The short-term solution for this would be to add a custom generator for slack, or come up with a way to enable services to deserialize structs in their configs.
piksel
changed the title
shoutrrr generate -s <service> input issues
Basic generator doesn't work with all current services
Nov 15, 2020
I've found the reason for the empty fields, they were the Composition structs that was supposed to be skipped (since setting them through the generator makes no sense). I have fixed the bug that had them show up on some services in a general generator/config TLC branch that I hope to get done soon!
I was not able to generate a configuration from cli input.
First, -u or --url cannot be passed as a flag (as described in the docs, see #77)
Second, if I use generate -s (even with -p key=value), it prompts me into something difficult to follow.
shoutrrr/pkg/generators/basic/basic.go
Line 30 in ad97e5d
I would assume they are supposed to be the property key:value couple but I am not entirely sure. More description in docs would be welcome.
** - second, after inputing token from CLI - I always receive the panic error. I've printed the t.Kind() to see what is it in reflect type.go, but it was nil. Tried to put a default and avoid the panic, but ended with (from here
shoutrrr/pkg/generators/basic/basic.go
Line 126 in ad97e5d
And here I was lost because I have no idea of the package reflect. :)
The text was updated successfully, but these errors were encountered: