#!/usr/bin/env sh # Genera config.local.yml para LibreTime desde variables de entorno. # No guarda secretos en el repositorio. CFG_PATH=${1:-./config.local.yml} # Generar claves si no están provistas API_KEY=${LIBRETIME_API_KEY:-} SECRET_KEY=${LIBRETIME_SECRET_KEY:-} if [ -z "$API_KEY" ]; then API_KEY=$(head -c 48 /dev/urandom | base64 | tr -d '/+=' | cut -c1-40) fi if [ -z "$SECRET_KEY" ]; then SECRET_KEY=$(head -c 48 /dev/urandom | base64 | tr -d '/+=' | cut -c1-40) fi cat > "$CFG_PATH" <