Files
hyprcrd/config.php
T
tuandClaude Opus 4.7 efd3f9d5ae v2.0.13 — oumta-dashboard via PHP proxy; quiet support poll
Dashboard now reachable across the internet: browser calls /api/dashboard/*
same-origin, PHP forwards to OUMTA_DASHBOARD_URL (configurable via env,
with docker-compose defaults pointing at host.docker.internal:8085).
Keeps the bearer token server-side and lets the dashboard live on a
private network.

Plumbing bits: polling indicator now green (no reason to look anxious
about a healthy poll loop), and the support plugin returns 200 pulled=0
when its relay isn't configured instead of flooding the network tab
with 502s on every background tick.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 13:37:06 +02:00

29 lines
1.5 KiB
PHP

<?php
define('APP_NAME', 'hyprcrd');
define('APP_VERSION', '2.0.13');
// APP_DEBUG: gates verbose error responses (curl traces, upstream bodies).
// Off by default; enable via env for local troubleshooting only.
define('APP_DEBUG', getenv('APP_DEBUG') === '1' || getenv('APP_DEBUG') === 'true');
// Database path — writable directory, outside webroot
// DB_PATH / UPLOAD_DIR can be pre-defined by the Electron router for app isolation
if (!defined('DB_PATH')) define('DB_PATH', __DIR__ . '/data/hyprcrd.db');
if (!defined('UPLOAD_DIR')) define('UPLOAD_DIR', __DIR__ . '/public/uploads');
// Base URL auto-detection (works in Docker and hosted environments)
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
$scriptDir = dirname($_SERVER['SCRIPT_NAME']);
$basePath = ($scriptDir === '/' || $scriptDir === '\\') ? '' : $scriptDir;
define('BASE_URL', $protocol . '://' . $host . $basePath);
// Oumta dashboard upstream. The browser only talks to /api/dashboard/*
// same-origin; the PHP proxy below forwards to this URL. Override via env
// for remote deployments. Inside Docker on Linux, localhost points at the
// container itself — use http://host.docker.internal:8085 (needs
// extra_hosts) or a routable URL to reach a host-side dashboard.
define('OUMTA_DASHBOARD_URL', getenv('OUMTA_DASHBOARD_URL') ?: 'http://localhost:8085');
define('OUMTA_DASHBOARD_TOKEN', getenv('OUMTA_DASHBOARD_TOKEN') ?: '');