2016-01-28 10:16:26 -05:00
|
|
|
package config
|
|
|
|
|
2024-06-29 00:23:42 -04:00
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
2016-01-28 10:16:26 -05:00
|
|
|
// router.config options
|
|
|
|
type RouterConfig struct {
|
2024-06-29 00:23:42 -04:00
|
|
|
// the path to the base config directory where per-system defaults are stored
|
|
|
|
BaseDir string
|
|
|
|
// the path to the working config directory where files are changed
|
|
|
|
WorkingDir string
|
2016-08-17 09:19:56 -04:00
|
|
|
// netdb configuration
|
|
|
|
NetDb *NetDbConfig
|
|
|
|
// configuration for bootstrapping into the network
|
|
|
|
Bootstrap *BootstrapConfig
|
2016-01-28 10:16:26 -05:00
|
|
|
}
|
|
|
|
|
2024-06-29 00:23:42 -04:00
|
|
|
func defaultBase() string {
|
2025-03-05 00:40:43 +00:00
|
|
|
return filepath.Join(BuildI2PDirPath(), "base")
|
2024-06-29 00:23:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func defaultConfig() string {
|
2025-03-05 00:40:43 +00:00
|
|
|
return filepath.Join(BuildI2PDirPath(), "config")
|
2024-06-29 00:23:42 -04:00
|
|
|
}
|
|
|
|
|
2016-01-28 10:16:26 -05:00
|
|
|
// defaults for router
|
2024-06-29 00:23:42 -04:00
|
|
|
var defaultRouterConfig = &RouterConfig{
|
2024-06-30 23:14:48 -04:00
|
|
|
NetDb: &DefaultNetDbConfig,
|
|
|
|
Bootstrap: &DefaultBootstrapConfig,
|
|
|
|
BaseDir: defaultBase(),
|
2024-06-29 00:23:42 -04:00
|
|
|
WorkingDir: defaultConfig(),
|
2016-01-28 10:16:26 -05:00
|
|
|
}
|
2024-06-29 00:23:42 -04:00
|
|
|
|
|
|
|
func DefaultRouterConfig() *RouterConfig {
|
|
|
|
return defaultRouterConfig
|
|
|
|
}
|
|
|
|
|
2024-06-30 23:14:48 -04:00
|
|
|
var RouterConfigProperties = DefaultRouterConfig()
|