Add Arrtrix runtime, config, onboarding, and webhook support
- Implement runtime package for bridge startup, config loading, and env overrides - Add onboarding package for management room welcome messages - Add matrixcmd package for command processing and help - Add webhook package with Radarr webhook support and validation - Extend connector config for webhooks and validation - Update default config and example config for new options - Add tests for new packages and config validation - Change database type default to sqlite3-fk-wal
This commit is contained in:
parent
eeedb5268a
commit
fe627f3aab
19 changed files with 1855 additions and 35 deletions
42
packages/arrtrix/pkg/matrixcmd/help_test.go
Normal file
42
packages/arrtrix/pkg/matrixcmd/help_test.go
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package matrixcmd
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"maunium.net/go/mautrix/bridgev2"
|
||||
"maunium.net/go/mautrix/bridgev2/bridgeconfig"
|
||||
"maunium.net/go/mautrix/bridgev2/database"
|
||||
"maunium.net/go/mautrix/id"
|
||||
)
|
||||
|
||||
func TestFormatHelpManagementRoom(t *testing.T) {
|
||||
roomID := id.RoomID("!arrtrix:test")
|
||||
proc := &Processor{
|
||||
texts: bridgeconfig.ManagementRoomTexts{AdditionalHelp: "Extra help text."},
|
||||
command: make(map[string]Handler),
|
||||
alias: make(map[string]string),
|
||||
}
|
||||
proc.Add(NewHelpHandler(proc))
|
||||
|
||||
out := formatHelp(proc, &Context{
|
||||
Bridge: &bridgev2.Bridge{
|
||||
Config: &bridgeconfig.BridgeConfig{
|
||||
CommandPrefix: "!arr",
|
||||
},
|
||||
},
|
||||
RoomID: roomID,
|
||||
User: &bridgev2.User{User: &database.User{ManagementRoom: roomID}},
|
||||
Processor: proc,
|
||||
})
|
||||
|
||||
for _, fragment := range []string{
|
||||
"prefixing commands with `!arr` is not required",
|
||||
"**help** - Show this help message.",
|
||||
"Extra help text.",
|
||||
} {
|
||||
if !strings.Contains(out, fragment) {
|
||||
t.Fatalf("expected help output to contain %q, got:\n%s", fragment, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue