mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(irc): support optional SASL and NickServ auth (#511)
* feat(irc): support SASL and NickServ auth * feat(irc): add missing fields * feat(irc): support SASL and NickServ auth * feat(irc): add missing fields * feat(irc): add validation * feat(indexers): unify and set required values * feat(irc): add postgres migrations * feat(irc): use nick as handlerkey * feat(irc): use account for nickserv * fix(irc): pg db migration
This commit is contained in:
parent
4ef0408f33
commit
4bf023d030
65 changed files with 1404 additions and 631 deletions
|
@ -14,9 +14,18 @@ type IrcChannel struct {
|
|||
Monitoring bool `json:"monitoring"`
|
||||
}
|
||||
|
||||
type NickServ struct {
|
||||
Account string `json:"account,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
type IRCAuthMechanism string
|
||||
|
||||
const (
|
||||
IRCAuthMechanismNone IRCAuthMechanism = "NONE"
|
||||
IRCAuthMechanismSASLPlain IRCAuthMechanism = "SASL_PLAIN"
|
||||
IRCAuthMechanismNickServ IRCAuthMechanism = "NICKSERV"
|
||||
)
|
||||
|
||||
type IRCAuth struct {
|
||||
Mechanism IRCAuthMechanism `json:"mechanism,omitempty"`
|
||||
Account string `json:"account,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
type IrcNetwork struct {
|
||||
|
@ -27,8 +36,9 @@ type IrcNetwork struct {
|
|||
Port int `json:"port"`
|
||||
TLS bool `json:"tls"`
|
||||
Pass string `json:"pass"`
|
||||
Nick string `json:"nick"`
|
||||
Auth IRCAuth `json:"auth,omitempty"`
|
||||
InviteCommand string `json:"invite_command"`
|
||||
NickServ NickServ `json:"nickserv,omitempty"`
|
||||
Channels []IrcChannel `json:"channels"`
|
||||
Connected bool `json:"connected"`
|
||||
ConnectedSince *time.Time `json:"connected_since"`
|
||||
|
@ -42,8 +52,9 @@ type IrcNetworkWithHealth struct {
|
|||
Port int `json:"port"`
|
||||
TLS bool `json:"tls"`
|
||||
Pass string `json:"pass"`
|
||||
Nick string `json:"nick"`
|
||||
Auth IRCAuth `json:"auth,omitempty"`
|
||||
InviteCommand string `json:"invite_command"`
|
||||
NickServ NickServ `json:"nickserv,omitempty"`
|
||||
CurrentNick string `json:"current_nick"`
|
||||
PreferredNick string `json:"preferred_nick"`
|
||||
Channels []ChannelWithHealth `json:"channels"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue