Deploy to K8s / deploy (push) Successful in 20s
Go (go/) becomes the primary implementation. The original Python version moves to legacy/ and is kept runnable; new features are still built in both (see the Dual implementation rule in CLAUDE.md). - git mv app.py, scripts/, templates/, tests/, pyproject.toml, uv.lock and build/ into legacy/ - Makefile: Python targets point at legacy/, venv in legacy/.venv, CREDENTIALS_PATH exported for the root .secret/ file - CI and make image build the Python image with legacy/ as context; the Makefile is no longer copied into the image - legacy/.dockerignore moved to the context root so it takes effect - CLAUDE.md, docs/README.md, Go comments, fixture README, capture script and VS Code launch config updated to the new layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
1.9 KiB
Python
53 lines
1.9 KiB
Python
"""Centralized configuration for FUJ management scripts.
|
|
|
|
External service IDs, credentials, and tunable parameters.
|
|
Domain-specific constants (fees, column indices) stay in their respective modules.
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# Paths
|
|
PROJECT_ROOT = Path(__file__).parent.parent
|
|
CREDENTIALS_PATH = Path(os.environ.get(
|
|
"CREDENTIALS_PATH",
|
|
str(PROJECT_ROOT / ".secret" / "fuj-management-bot-credentials.json"),
|
|
))
|
|
|
|
# Google Sheets IDs
|
|
ATTENDANCE_SHEET_ID = "1E2e_gT_K5AwSRCDLDTa2UetZTkHmBOcz0kFbBUNUNBA"
|
|
PAYMENTS_SHEET_ID = "1Om0YPoDVCH5cV8BrNz5LG5eR5MMU05ypQC7UMN1xn_Y"
|
|
|
|
# Attendance sheet tab GIDs
|
|
JUNIOR_SHEET_GID = "1213318614"
|
|
|
|
# Bank accounts — hardcoded list mirroring go/internal/config/config.go.
|
|
# The entry with primary=True is used for QR codes and as the BANK_ACCOUNT default.
|
|
ACCOUNTS = [
|
|
{"iban": "CZ0820100000002502035405", "acct_num": "2502035405", "token_env": "FIO_API_TOKEN_NEW", "primary": True},
|
|
{"iban": "CZ8520100000002800359168", "acct_num": "2800359168", "token_env": "FIO_API_TOKEN_OLD", "primary": False},
|
|
]
|
|
# Resolve API tokens from the environment once at import time.
|
|
LOADED_ACCOUNTS = [
|
|
{**a, "token": os.environ.get(a["token_env"], "")}
|
|
for a in ACCOUNTS
|
|
]
|
|
BANK_ACCOUNT = next(a["iban"] for a in ACCOUNTS if a["primary"])
|
|
|
|
# Cache settings
|
|
CACHE_DIR = PROJECT_ROOT / "tmp"
|
|
DRIVE_TIMEOUT = 10 # seconds
|
|
CACHE_TTL_SECONDS = int(os.environ.get("CACHE_TTL_SECONDS", 300)) # 5 min default
|
|
CACHE_API_CHECK_TTL_SECONDS = int(os.environ.get("CACHE_API_CHECK_TTL_SECONDS", 300)) # 5 min default
|
|
|
|
# Display settings
|
|
MONTHS_TO_SHOW = int(os.environ.get("MONTHS_TO_SHOW", 5)) # show last N months; 0 = show all
|
|
|
|
# Maps cache keys to their source sheet IDs (used by cache_utils)
|
|
CACHE_SHEET_MAP = {
|
|
"attendance_regular": ATTENDANCE_SHEET_ID,
|
|
"attendance_juniors": ATTENDANCE_SHEET_ID,
|
|
"exceptions_dict": PAYMENTS_SHEET_ID,
|
|
"payments_transactions": PAYMENTS_SHEET_ID,
|
|
}
|