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
61
packages/arrtrix/pkg/config/config.go
Normal file
61
packages/arrtrix/pkg/config/config.go
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"go.mau.fi/util/dbutil"
|
||||
"go.mau.fi/zeroconfig"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"maunium.net/go/mautrix/bridgev2/bridgeconfig"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Network yaml.Node `yaml:"network"`
|
||||
|
||||
Bridge bridgeconfig.BridgeConfig `yaml:"bridge"`
|
||||
Database dbutil.Config `yaml:"database"`
|
||||
Homeserver bridgeconfig.HomeserverConfig `yaml:"homeserver"`
|
||||
AppService bridgeconfig.AppserviceConfig `yaml:"appservice"`
|
||||
Logging zeroconfig.Config `yaml:"logging"`
|
||||
|
||||
EnvConfigPrefix string `yaml:"env_config_prefix"`
|
||||
ManagementTexts bridgeconfig.ManagementRoomTexts `yaml:"management_room_texts"`
|
||||
}
|
||||
|
||||
func Load(data []byte) (*Config, error) {
|
||||
var cfg Config
|
||||
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg.applyDefaults()
|
||||
return &cfg, nil
|
||||
}
|
||||
|
||||
func (c *Config) applyDefaults() {
|
||||
if c.Homeserver.Software == "" {
|
||||
c.Homeserver.Software = bridgeconfig.SoftwareStandard
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Config) Compile() bridgeconfig.Config {
|
||||
return bridgeconfig.Config{
|
||||
Network: c.Network,
|
||||
Bridge: c.Bridge,
|
||||
Database: c.Database,
|
||||
Homeserver: c.Homeserver,
|
||||
AppService: c.AppService,
|
||||
Logging: c.Logging,
|
||||
EnvConfigPrefix: c.EnvConfigPrefix,
|
||||
ManagementRoomTexts: c.ManagementTexts,
|
||||
Matrix: bridgeconfig.MatrixConfig{
|
||||
MessageStatusEvents: false,
|
||||
DeliveryReceipts: false,
|
||||
MessageErrorNotices: true,
|
||||
SyncDirectChatList: false,
|
||||
FederateRooms: true,
|
||||
},
|
||||
DoublePuppet: bridgeconfig.DoublePuppetConfig{
|
||||
Servers: map[string]string{},
|
||||
Secrets: map[string]string{},
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue