fix service

pull/27/head
accius 4 days ago
parent 5541d39231
commit 1007053c6e

@ -175,36 +175,43 @@ docker compose up -d
For the complete hybrid propagation system, deploy all three services:
**1. Main OpenHamClock Service**
```bash
# From repository root
railway init
railway up
**1. Deploy ITURHFProp Service First** (enables hybrid propagation)
```
**2. DX Spider Proxy** (optional - enables live DX cluster paths)
```bash
cd dxspider-proxy
railway init
railway up
# Note the URL, e.g., https://dxspider-proxy-xxxx.railway.app
├── Go to railway.app → New Project → Deploy from GitHub repo
├── Select your forked repository
├── Click "Add Service" → "GitHub Repo" (same repo)
├── In service settings, set "Root Directory" to: iturhfprop-service
├── If Root Directory option not visible:
│ - Go to Service → Settings → Build
│ - Add "Root Directory" and enter: iturhfprop-service
├── Deploy and wait for build to complete (~2-3 min)
└── Copy the public URL (Settings → Networking → Generate Domain)
```
**3. ITURHFProp Service** (optional - enables hybrid propagation)
```bash
cd iturhfprop-service
railway init
railway up
# Note the URL, e.g., https://iturhfprop-xxxx.railway.app
**2. Deploy DX Spider Proxy** (optional - for live DX cluster paths)
```
├── In same project, click "Add Service" → "GitHub Repo"
├── Set "Root Directory" to: dxspider-proxy
└── Deploy
```
**4. Link Services**
In the main OpenHamClock service, add environment variable:
**3. Deploy Main OpenHamClock**
```
ITURHFPROP_URL=https://your-iturhfprop-service.railway.app
├── In same project, click "Add Service" → "GitHub Repo"
├── Leave Root Directory empty (uses repo root)
├── Go to Variables tab, add:
│ ITURHFPROP_URL = https://[your-iturhfprop-service].up.railway.app
└── Deploy
```
#### Alternative: Separate Projects
If Root Directory doesn't work, create separate Railway projects:
1. Fork the repo 3 times (or use branches)
2. Move each service to its own repo root
3. Deploy each as separate Railway project
4. Link via environment variables
---
## ⚙️ Configuration

@ -0,0 +1,7 @@
node_modules
npm-debug.log
.git
.gitignore
README.md
.env
*.md

@ -3,27 +3,34 @@ FROM ubuntu:22.04
# Prevent interactive prompts during build
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools and Node.js
# Install Node.js and utilities
RUN apt-get update && apt-get install -y \
git \
build-essential \
curl \
unzip \
ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Clone and build ITURHFProp
WORKDIR /opt
RUN git clone https://github.com/G4FKH/ITURHFProp.git iturhfprop
# Create directory for ITURHFProp
WORKDIR /opt/iturhfprop
WORKDIR /opt/iturhfprop/Linux
RUN make
# Download the latest release (v14.2) - binaries zip
RUN curl -L -o binaries.zip "https://github.com/ITU-R-Study-Group-3/ITU-R-HF/releases/download/v14.2/ITURHFProp_14_02.zip" \
&& unzip binaries.zip \
&& rm binaries.zip
# Verify build
RUN ls -la /opt/iturhfprop/Linux/ITURHFProp
# Download required data files
RUN curl -L -o data.zip "https://github.com/ITU-R-Study-Group-3/ITU-R-HF/releases/download/v14.2/Data.zip" \
&& unzip data.zip \
&& rm data.zip
# Create data directory for coefficient files
RUN mkdir -p /opt/iturhfprop/data
# Make Linux binary executable and set library path
RUN chmod +x /opt/iturhfprop/ITURHFProp || true
ENV LD_LIBRARY_PATH=/opt/iturhfprop:$LD_LIBRARY_PATH
# List contents to verify
RUN echo "=== ITURHFProp files ===" && ls -la /opt/iturhfprop/ && echo "=== Data files ===" && ls -la /opt/iturhfprop/Data/ 2>/dev/null || ls -la /opt/iturhfprop/data/ 2>/dev/null || echo "Data dir not found"
# Set up the API service
WORKDIR /app
@ -32,9 +39,9 @@ RUN npm install --production
COPY server.js ./
# Environment
# Environment - adjust DATA path based on actual structure
ENV PORT=3000
ENV ITURHFPROP_PATH=/opt/iturhfprop/Linux/ITURHFProp
ENV ITURHFPROP_PATH=/opt/iturhfprop/ITURHFProp
ENV ITURHFPROP_DATA=/opt/iturhfprop/Data
EXPOSE 3000

@ -1,6 +1,6 @@
# ITURHFProp Service
REST API wrapper for the [ITURHFProp](https://github.com/G4FKH/ITURHFProp) HF propagation prediction engine, implementing **ITU-R P.533-14** "Method for the prediction of the performance of HF circuits".
REST API wrapper for the [ITURHFProp](https://github.com/ITU-R-Study-Group-3/ITU-R-HF) HF propagation prediction engine, implementing **ITU-R P.533-14** "Method for the prediction of the performance of HF circuits".
## Overview
@ -9,8 +9,8 @@ This microservice provides HF propagation predictions as a REST API, suitable fo
### Why ITURHFProp?
- **ITU-R P.533-14 Compliant** - The international standard for HF prediction
- **Open Source** - BSD licensed, freely available
- **Accurate** - Used by professional HF planning tools
- **Official ITU Release** - From ITU-R Study Group 3
- **Pre-built Binaries** - No compilation required
- **No API Restrictions** - Unlike web services, you control the engine
## API Endpoints
@ -115,17 +115,18 @@ curl http://localhost:3000/api/health
### Local Development
Requires ITURHFProp to be installed locally:
Download ITURHFProp binaries from the [official release](https://github.com/ITU-R-Study-Group-3/ITU-R-HF/releases):
```bash
# Install ITURHFProp (Linux)
git clone https://github.com/G4FKH/ITURHFProp.git
cd ITURHFProp/Linux
make
# Download binaries and data
wget https://github.com/ITU-R-Study-Group-3/ITU-R-HF/releases/download/v14.2/ITURHFProp_14_02.zip
wget https://github.com/ITU-R-Study-Group-3/ITU-R-HF/releases/download/v14.2/Data.zip
unzip ITURHFProp_14_02.zip
unzip Data.zip
# Set environment variables
export ITURHFPROP_PATH=/path/to/ITURHFProp/Linux/ITURHFProp
export ITURHFPROP_DATA=/path/to/ITURHFProp/Data
export ITURHFPROP_PATH=$(pwd)/ITURHFProp
export ITURHFPROP_DATA=$(pwd)/Data
# Run service
npm install
@ -187,12 +188,13 @@ For real-time enhancement, combine with ionosonde data from KC2G/GIRO network.
This service wrapper is MIT licensed.
ITURHFProp is BSD licensed - see [G4FKH/ITURHFProp](https://github.com/G4FKH/ITURHFProp) for details.
ITURHFProp is provided by ITU-R Study Group 3 - see [ITU-R-Study-Group-3/ITU-R-HF](https://github.com/ITU-R-Study-Group-3/ITU-R-HF) for details.
## Credits
- **ITURHFProp** by G4FKH (Martin) - The core prediction engine
- **ITU-R P.533** - International Telecommunication Union recommendation
- **ITURHFProp** by ITU-R Study Group 3 - The core prediction engine
- **ITU-R P.533-14** - International Telecommunication Union recommendation
- **Chris Behm & George Engelbrecht** - Original ITURHFProp developers
- **OpenHamClock** - Integration target
---

@ -21,7 +21,7 @@ const app = express();
const PORT = process.env.PORT || 3000;
// Paths to ITURHFProp
const ITURHFPROP_PATH = process.env.ITURHFPROP_PATH || '/opt/iturhfprop/Linux/ITURHFProp';
const ITURHFPROP_PATH = process.env.ITURHFPROP_PATH || '/opt/iturhfprop/ITURHFProp';
const ITURHFPROP_DATA = process.env.ITURHFPROP_DATA || '/opt/iturhfprop/Data';
// Temp directory for input/output files

@ -0,0 +1,12 @@
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"numReplicas": 1,
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Loading…
Cancel
Save

Powered by TurnKey Linux.