refactor: Separate static and runtime configuration
This commit is contained in:
parent
59f2f00314
commit
84b70620b5
3 changed files with 38 additions and 30 deletions
6
Makefile
6
Makefile
|
|
@ -3,10 +3,10 @@
|
|||
# Orchestrates the setup and management of the knowledge base.
|
||||
# =============================================================================
|
||||
|
||||
include config.env
|
||||
export $(shell sed 's/=.*//' config.env)
|
||||
include globals.env
|
||||
export $(shell grep -v '^[#[:space:]]' globals.env | sed 's/=.*//')
|
||||
|
||||
.PHONY: setup add-genome status lint lock help
|
||||
.PHONY: setup add-genome status lint lock doctor sync help
|
||||
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
|
|
|
|||
25
globals.env
Normal file
25
globals.env
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# =============================================================================
|
||||
# globals.env
|
||||
# Static configuration — pure KEY=VALUE.
|
||||
# Safe to: make include, docker-compose, env parsers, shell source.
|
||||
# =============================================================================
|
||||
|
||||
# --- PROVIDER SELECTION ---
|
||||
PROVIDER=forgejo
|
||||
|
||||
# --- FORGEJO ---
|
||||
FORGEJO_URL=https://git.keruhomelab.com
|
||||
FORGEJO_USER=keru
|
||||
FORGEJO_SSH_PORT=222
|
||||
|
||||
# --- GITHUB (used when PROVIDER=github) ---
|
||||
# GITHUB_USER=your-username
|
||||
# GITHUB_ORG=your-org # Optional: set only for org repos; overrides GITHUB_USER
|
||||
# Note: GITHUB_TOKEN must be exported in your shell for security.
|
||||
|
||||
# --- VAULTWARDEN ---
|
||||
VAULTWARDEN_URL=https://vault.keruhomelab.com
|
||||
|
||||
# --- MASTER REPOSITORY ---
|
||||
MASTER_REPO=master-knowledge-genome
|
||||
GIST_URL=https://gist.github.com/442a6bf555914893e9891c11519de94f.git
|
||||
|
|
@ -1,24 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
# =============================================================================
|
||||
# config.env
|
||||
# Single Source of Truth for the Knowledge Genome Framework.
|
||||
# registry.sh
|
||||
# Bash-only runtime config: dynamic paths and genome registry array.
|
||||
# Source this in shell scripts — never included by Make or env parsers.
|
||||
# =============================================================================
|
||||
|
||||
# --- PROVIDER SELECTION ---
|
||||
PROVIDER="forgejo" # Options: "forgejo", "github"
|
||||
|
||||
# --- FORGEJO CONFIGURATION ---
|
||||
FORGEJO_URL="https://git.keruhomelab.com"
|
||||
FORGEJO_USER="keru"
|
||||
# Note: FORGEJO_TOKEN must be exported in your shell for security.
|
||||
|
||||
# --- VAULTWARDEN CONFIGURATION ---
|
||||
# Used for rendering template instructions
|
||||
VAULTWARDEN_URL="https://vault.keruhomelab.com"
|
||||
|
||||
# --- MASTER REPOSITORY ---
|
||||
MASTER_REPO="master-knowledge-genome"
|
||||
GIST_URL="https://gist.github.com/442a6bf555914893e9891c11519de94f.git"
|
||||
# Dynamic paths — resolved relative to this file at source time
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
WORK_DIR="${HOME}/knowledge-genome-setup"
|
||||
KEYS_DIR="${WORK_DIR}/keys"
|
||||
TEMPLATES_DIR="${SCRIPT_DIR}/templates"
|
||||
LIB_DIR="${SCRIPT_DIR}/lib"
|
||||
PROVIDERS_DIR="${SCRIPT_DIR}/providers"
|
||||
|
||||
# --- GENOME REGISTRY ---
|
||||
# Format: "name|description"
|
||||
|
|
@ -27,13 +20,3 @@ GENOMES=(
|
|||
"genome-finance|Personal finance, investments, market analysis"
|
||||
"genome-homelab|Keru infrastructure, network configs, architecture logs"
|
||||
)
|
||||
|
||||
# --- SYSTEM PATHS ---
|
||||
WORK_DIR="${HOME}/knowledge-genome-setup"
|
||||
KEYS_DIR="${WORK_DIR}/keys"
|
||||
|
||||
# Core directory resolution (DO NOT CHANGE)
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
TEMPLATES_DIR="${SCRIPT_DIR}/templates"
|
||||
LIB_DIR="${SCRIPT_DIR}/lib"
|
||||
PROVIDERS_DIR="${SCRIPT_DIR}/providers"
|
||||
Loading…
Add table
Reference in a new issue