dx proxy url

pull/98/head
accius 1 day ago
parent ae5f89ffb3
commit 17709ff0ec

@ -67,6 +67,13 @@ LAYOUT=modern
# Only uncomment if you have your own proxy running # Only uncomment if you have your own proxy running
# DXSPIDER_PROXY_URL=https://your-dxspider-proxy.com # DXSPIDER_PROXY_URL=https://your-dxspider-proxy.com
# DX Cluster source: auto | proxy | hamqth | dxspider
# auto = tries proxy first, then HamQTH, then direct telnet
# proxy = use DX Spider Proxy (set DXSPIDER_PROXY_URL above)
# hamqth = HamQTH CSV feed (HTTP, works everywhere)
# dxspider = direct telnet to DX Spider nodes (works locally/Pi)
# DX_CLUSTER_SOURCE=auto
# OpenWeatherMap API key (for local weather display) # OpenWeatherMap API key (for local weather display)
# Get a free key at https://openweathermap.org/api # Get a free key at https://openweathermap.org/api
# OPENWEATHER_API_KEY=your_api_key_here # OPENWEATHER_API_KEY=your_api_key_here

@ -148,7 +148,7 @@ const CONFIG = {
// DX Cluster settings // DX Cluster settings
spotRetentionMinutes: parseInt(process.env.SPOT_RETENTION_MINUTES) || jsonConfig.dxCluster?.spotRetentionMinutes || 30, spotRetentionMinutes: parseInt(process.env.SPOT_RETENTION_MINUTES) || jsonConfig.dxCluster?.spotRetentionMinutes || 30,
dxClusterSource: jsonConfig.dxCluster?.source || 'auto', dxClusterSource: process.env.DX_CLUSTER_SOURCE || jsonConfig.dxCluster?.source || 'auto',
// API keys (don't expose to frontend) // API keys (don't expose to frontend)
_openWeatherApiKey: process.env.OPENWEATHER_API_KEY || '', _openWeatherApiKey: process.env.OPENWEATHER_API_KEY || '',
@ -983,7 +983,7 @@ let dxSpiderCache = { spots: [], timestamp: 0 };
const DXSPIDER_CACHE_TTL = 90000; // 90 seconds cache - reduces reconnection frequency const DXSPIDER_CACHE_TTL = 90000; // 90 seconds cache - reduces reconnection frequency
app.get('/api/dxcluster/spots', async (req, res) => { app.get('/api/dxcluster/spots', async (req, res) => {
const source = (req.query.source || 'auto').toLowerCase(); const source = (req.query.source || CONFIG.dxClusterSource || 'auto').toLowerCase();
// Helper function for HamQTH (HTTP-based, works everywhere) // Helper function for HamQTH (HTTP-based, works everywhere)
async function fetchHamQTH() { async function fetchHamQTH() {

@ -89,7 +89,7 @@ export const useDXCluster = (source = 'auto', filters = {}) => {
useEffect(() => { useEffect(() => {
const fetchData = async () => { const fetchData = async () => {
try { try {
const response = await fetch('/api/dxcluster/spots'); const response = await fetch(`/api/dxcluster/spots?source=${encodeURIComponent(source)}`);
if (response.ok) { if (response.ok) {
const newSpots = await response.json(); const newSpots = await response.json();

Loading…
Cancel
Save

Powered by TurnKey Linux.