This commit is contained in:
Sudo-Ivan
2024-12-30 03:50:52 -06:00
parent 0f5f5cbb13
commit decbd8f29a
16 changed files with 1046 additions and 970 deletions

View File

@@ -4,22 +4,22 @@ import (
"os"
"path/filepath"
"github.com/pelletier/go-toml"
"github.com/Sudo-Ivan/reticulum-go/pkg/common"
"github.com/pelletier/go-toml"
)
const (
DefaultSharedInstancePort = 37428
DefaultInstanceControlPort = 37429
DefaultLogLevel = 4
DefaultLogLevel = 4
)
func DefaultConfig() *common.ReticulumConfig {
return &common.ReticulumConfig{
EnableTransport: false,
ShareInstance: true,
SharedInstancePort: DefaultSharedInstancePort,
InstanceControlPort: DefaultInstanceControlPort,
EnableTransport: false,
ShareInstance: true,
SharedInstancePort: DefaultSharedInstancePort,
InstanceControlPort: DefaultInstanceControlPort,
PanicOnInterfaceErr: false,
LogLevel: DefaultLogLevel,
Interfaces: make(map[string]*common.InterfaceConfig),
@@ -85,7 +85,15 @@ func CreateDefaultConfig(path string) error {
Type: "TCPClientInterface",
Enabled: true,
TargetHost: "rns.quad4.io",
TargetPort: 4242,
TargetPort: 4242,
}
// Add default UDP interface
cfg.Interfaces["local udp"] = &common.InterfaceConfig{
Type: "UDPInterface",
Enabled: true,
Address: "0.0.0.0",
Port: 37428, // Default RNS port
}
data, err := toml.Marshal(cfg)
@@ -118,4 +126,4 @@ func InitConfig() (*common.ReticulumConfig, error) {
// Load config
return LoadConfig(configPath)
}
}