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
30
packages/arrtrix/pkg/runtime/main_test.go
Normal file
30
packages/arrtrix/pkg/runtime/main_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package runtime
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"maunium.net/go/mautrix/bridgev2/bridgeconfig"
|
||||
)
|
||||
|
||||
func TestLoadRegistrationTokens(t *testing.T) {
|
||||
tempDir := t.TempDir()
|
||||
registrationPath := filepath.Join(tempDir, "registration.yaml")
|
||||
if err := os.WriteFile(registrationPath, []byte("as_token: app-token\nhs_token: hs-token\n"), 0o600); err != nil {
|
||||
t.Fatalf("failed to write registration file: %v", err)
|
||||
}
|
||||
|
||||
cfg := &bridgeconfig.Config{}
|
||||
main := &Main{RegistrationPath: registrationPath}
|
||||
if err := main.loadRegistrationTokens(cfg); err != nil {
|
||||
t.Fatalf("loadRegistrationTokens returned error: %v", err)
|
||||
}
|
||||
|
||||
if cfg.AppService.ASToken != "app-token" {
|
||||
t.Fatalf("expected as token to be loaded, got %q", cfg.AppService.ASToken)
|
||||
}
|
||||
if cfg.AppService.HSToken != "hs-token" {
|
||||
t.Fatalf("expected hs token to be loaded, got %q", cfg.AppService.HSToken)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue