// Package config provides path and endpoint configuration for the exo system. package config import ( "os" "path/filepath" ) // Config holds all runtime configuration for exo. type Config struct { // BasePath is the root directory for all exo data. BasePath string // DatabasePath is the path to the unified SQLite database. DatabasePath string // BlobStorePath is the root of the content-addressable blob store. BlobStorePath string // MinioEndpoint is the S3-compatible endpoint for remote blob backup. MinioEndpoint string // MinioBucket is the bucket name for blob backup. MinioBucket string // GRPCListenAddr is the address exod listens on for gRPC connections. GRPCListenAddr string } // DefaultBasePath returns $HOME/exo. func DefaultBasePath() string { return filepath.Join(os.Getenv("HOME"), "exo") } // Default returns a Config with sensible defaults rooted at $HOME/exo. func Default() Config { base := DefaultBasePath() return FromBasePath(base) } // FromBasePath returns a Config rooted at the given base path. func FromBasePath(base string) Config { return Config{ BasePath: base, DatabasePath: filepath.Join(base, "exo.db"), BlobStorePath: filepath.Join(base, "blobs"), MinioEndpoint: "", MinioBucket: "exo-blobs", GRPCListenAddr: "localhost:9090", } }