v2.0.0: claims model - signed MMUR2 votes in a truth DB, merged view in a rebuildable cache DB; POST /api/claims, claims and merge routes, unsigned writes answer 410
Build and Push Docker Image / build (push) Successful in 5m1s
Build and Push Docker Image / build (push) Successful in 5m1s
This commit is contained in:
@@ -20,7 +20,8 @@ type Config struct {
|
||||
PublicURL string // Browser-facing URL for the service-bar nav; overrides BaseURL when set (e.g. a debug-direct port with no Caddy in front)
|
||||
|
||||
// Storage configuration
|
||||
DBPathOverride string // META_CORE_DB_PATH; empty = <MetaCorePath>/db/meta-core.db
|
||||
DBPathOverride string // META_CORE_DB_PATH; empty = <MetaCorePath>/db/meta-core.db (truth)
|
||||
CachePathOverride string // META_CORE_CACHE_PATH; empty = <MetaCorePath>/db-cache/cache.db
|
||||
|
||||
// HTTP API configuration
|
||||
HTTPPort int // HTTP API port (default: 9000)
|
||||
@@ -61,6 +62,7 @@ func Load() *Config {
|
||||
BaseURL: getEnv("BASE_URL", ""),
|
||||
PublicURL: getEnv("META_CORE_PUBLIC_URL", ""),
|
||||
DBPathOverride: getEnv("META_CORE_DB_PATH", ""),
|
||||
CachePathOverride: getEnv("META_CORE_CACHE_PATH", ""),
|
||||
HTTPPort: getEnvInt("META_CORE_HTTP_PORT", 9000),
|
||||
HTTPHost: getEnv("META_CORE_HTTP_HOST", "0.0.0.0"),
|
||||
HealthCheckIntervalMS: getEnvInt("HEALTH_CHECK_INTERVAL_MS", 5000),
|
||||
@@ -91,7 +93,7 @@ func (c *Config) LockFilePath() string {
|
||||
return c.MetaCorePath + "/locks/kv-leader.lock"
|
||||
}
|
||||
|
||||
// DBPath returns the path of meta-core's SQLite database file.
|
||||
// DBPath returns the path of meta-core's truth database (backed up).
|
||||
func (c *Config) DBPath() string {
|
||||
if c.DBPathOverride != "" {
|
||||
return c.DBPathOverride
|
||||
@@ -99,6 +101,15 @@ func (c *Config) DBPath() string {
|
||||
return c.MetaCorePath + "/db/meta-core.db"
|
||||
}
|
||||
|
||||
// CachePath returns the path of meta-core's cache database: everything
|
||||
// derived from truth, never backed up, rebuilt when missing.
|
||||
func (c *Config) CachePath() string {
|
||||
if c.CachePathOverride != "" {
|
||||
return c.CachePathOverride
|
||||
}
|
||||
return c.MetaCorePath + "/db-cache/cache.db"
|
||||
}
|
||||
|
||||
// MountsFilePath returns the path to the mounts configuration file
|
||||
func (c *Config) MountsFilePath() string {
|
||||
return c.MountsDir + "/mounts.json"
|
||||
|
||||
Reference in New Issue
Block a user