13 Commits

Author SHA1 Message Date
d8432315d5 Merge branch 'release/v1.1.0'
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-15 17:02:57 +02:00
7cd8ea9d50 bump version to 1.1.0 2023-04-15 17:02:40 +02:00
Fionn
80c961da81 Merge pull request #1 from MorpheusXAUT/configurable-base-path
Configurable base API path
2023-04-15 17:00:04 +02:00
Nick 'MorpheusXAUT' Müller
79e559a723 Fix Docker image URL in README 2023-03-25 17:34:37 +01:00
Nick 'MorpheusXAUT' Müller
80a354b456 Fix node_modules exclusion in dockerignore 2023-03-25 17:23:45 +01:00
Nick 'MorpheusXAUT' Müller
407f817c8d Add interrupt signal handling for graceful server shutdown 2023-03-25 17:23:15 +01:00
Nick 'MorpheusXAUT' Müller
759e4c3711 Make base API path configurable via env variable 2023-03-25 17:20:33 +01:00
8460445381 Merge branch 'release/v1.0.0' 2023-03-11 15:16:51 +01:00
131acbf75c Merge tag 'v1.0.0' into develop 2023-03-11 15:16:51 +01:00
627a39c02e remove LOVV test data, add EDXX data 2023-03-11 15:05:22 +01:00
248ac6620a add utility script for converting csv points to json 2023-03-11 15:05:05 +01:00
37db228cdd fix typo 2023-03-11 15:04:48 +01:00
2d7d2f5b5c typos 2023-03-10 21:51:30 +01:00
7 changed files with 483 additions and 12 deletions

View File

@@ -1,2 +1,2 @@
.git .git
node_modules **/node_modules

View File

@@ -2,11 +2,11 @@
## idea ## idea
This service is designed to gather weather data to be used by [IASsure](https://github.com/MorpheusXAUT/IASsure) by [MorpheusXAT](https://github.com/MorpheusXAUT). It is uses the [Open-Meteo.com](https://open-meteo.com)-API to gather the necessary data to provide to the plugin. This service is designed to gather weather data to be used by [IASsure](https://github.com/MorpheusXAUT/IASsure) by [MorpheusXAUT](https://github.com/MorpheusXAUT). It uses the [Open-Meteo.com](https://open-meteo.com)-API to gather the necessary data to provide to the plugin.
## Installation/Deployment ## Installation/Deployment
IASsure-WX can be installed using docker. The image is available at `git.fsisp.de/fionn/iassure`. IASsure-WX can be installed using docker. The image is available at `git.fsisp.de/fionn/iassure-wx`.
Tags: Tags:
- `latest` - The newest recommended build, built from `main` - `latest` - The newest recommended build, built from `main`

View File

@@ -1,6 +1,6 @@
{ {
"name": "app", "name": "app",
"version": "1.0.0", "version": "1.1.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",

View File

@@ -4,14 +4,14 @@ import morgan from 'morgan';
import router from './router'; import router from './router';
import wxService from './services/wx.service'; import wxService from './services/wx.service';
const { PORT = 3000 } = process.env; const { PORT = 3000, BASE_PATH = '/api' } = process.env;
const app = express(); const app = express();
app.set('trust proxy', true); app.set('trust proxy', true);
app.use(morgan('combined')); app.use(morgan('combined'));
app.use('/api', router.router); app.use(BASE_PATH, router.router);
const frontendRoot = '/opt/frontend/dist'; const frontendRoot = '/opt/frontend/dist';
app.use(express.static(frontendRoot)); app.use(express.static(frontendRoot));
@@ -28,8 +28,24 @@ app.use((err, req: Request, res: Response, next: NextFunction) => {
nodesched.scheduleJob('regenerate data', '*/30 * * * * *', wxService.wrappedGenerateData) nodesched.scheduleJob('regenerate data', '*/30 * * * * *', wxService.wrappedGenerateData)
wxService.wrappedGenerateData(); wxService.wrappedGenerateData();
app.listen(PORT, () => { const server = app.listen(PORT, () => {
console.log( console.log(
`application is listening on port ${PORT}`, `application is listening on port ${PORT}`,
); );
}); });
const shutdown = (signal: string) => {
console.log(`${signal} signal received. Shutting down.`);
server.close((err) => {
if (err) {
console.error(`Failed to shut down server gracefully: ${err}`);
process.exit(1);
}
console.log('Server closed');
process.exit(0);
});
};
process.on('SIGTERM', () => shutdown('SIGTERM'));
process.on('SIGINT', () => shutdown('SIGINT'));

View File

@@ -9,7 +9,7 @@ services:
args: args:
- NODE_ENV=development - NODE_ENV=development
ports: ports:
- '3030:3030/tcp' - '3030:3000/tcp'
- '9229:9229/tcp' - '9229:9229/tcp'
volumes: volumes:
- .:/opt:delegated - .:/opt:delegated

View File

@@ -0,0 +1,20 @@
/**
* This script can be used to convert a csv-file to the json format required by the wx-config.json
*
* the csv needs to follow the following format: <FIX>,<LAT>,<LON>
*/
const fs = require('fs');
const points = fs
.readFileSync('./fixes.csv')
.toString()
.split('\n')
.map(str => str.split(','))
.map(data => ({
name: data[0],
lat: Number(data[1]),
lon: Number(data[2]),
}));
fs.writeFileSync('./fixes.json', JSON.stringify(points, undefined, 2));

View File

@@ -32,17 +32,452 @@
] ]
}, },
{ {
"identifier": "LOVV", "identifier": "EDXX",
"fixes": [ "fixes": [
{
"name": "RDG",
"lat": 49.040139,
"lon": 12.526625
},
{
"name": "OTT",
"lat": 48.180394,
"lon": 11.816536
},
{
"name": "LNZ",
"lat": 48.229711,
"lon": 14.103156
},
{
"name": "VOZ",
"lat": 49.532328,
"lon": 14.874664
},
{
"name": "MASUR",
"lat": 48.520097,
"lon": 15.439292
},
{ {
"name": "VATET", "name": "VATET",
"lat": 47.600953, "lat": 47.600953,
"lon": 14.033119 "lon": 14.033119
}, },
{ {
"name": "LNZ", "name": "INSEL",
"lat": 48.229711, "lat": 47.155556,
"lon": 14.103156 "lon": 12.405278
},
{
"name": "TRA",
"lat": 47.6895,
"lon": 8.436972
},
{
"name": "NAXAV",
"lat": 46.463856,
"lon": 11.322183
},
{
"name": "HOC",
"lat": 47.466556,
"lon": 7.665444
},
{
"name": "LUPEN",
"lat": 48.435053,
"lon": 7.733622
},
{
"name": "LADAT",
"lat": 49.265256,
"lon": 7.839472
},
{
"name": "GTQ",
"lat": 48.986444,
"lon": 6.716222
},
{
"name": "VALEK",
"lat": 49.514444,
"lon": 5.781111
},
{
"name": "LNO",
"lat": 50.585833,
"lon": 5.710278
},
{
"name": "BUB",
"lat": 50.902333,
"lon": 4.538083
},
{
"name": "OKIDU",
"lat": 51.7894,
"lon": 4.85
},
{
"name": "SPY",
"lat": 52.540278,
"lon": 4.853778
},
{
"name": "NAPRO",
"lat": 51.855833,
"lon": 6.058889
},
{
"name": "RKN",
"lat": 52.133194,
"lon": 6.763889
},
{
"name": "EEL",
"lat": 53.164167,
"lon": 6.66675
},
{
"name": "EDUBU",
"lat": 54.183333,
"lon": 6.5
},
{
"name": "TIPAN",
"lat": 54.598369,
"lon": 4.398944
},
{
"name": "AMADA",
"lat": 55,
"lon": 6.35
},
{
"name": "BAVTA",
"lat": 55.603056,
"lon": 8.3
},
{
"name": "ODN",
"lat": 55.581011,
"lon": 10.652989
},
{
"name": "ERNOV",
"lat": 56.168861,
"lon": 12.573778
},
{
"name": "TIDVU",
"lat": 55.411306,
"lon": 13.557528
},
{
"name": "LUSID",
"lat": 54.916667,
"lon": 15.296111
},
{
"name": "VAVUN",
"lat": 53.475278,
"lon": 15.333056
},
{
"name": "DENKO",
"lat": 52.816861,
"lon": 15.8325
},
{
"name": "KELOD",
"lat": 52.233889,
"lon": 15.883333
},
{
"name": "VELAB",
"lat": 51.469722,
"lon": 16.748889
},
{
"name": "LAGAR",
"lat": 50.795275,
"lon": 15.367089
},
{
"name": "ELMEK",
"lat": 49.9039,
"lon": 14.029875
},
{
"name": "BRENO",
"lat": 46.98,
"lon": 11.376667
},
{
"name": "ALG",
"lat": 47.997381,
"lon": 10.262189
},
{
"name": "LBU",
"lat": 48.912975,
"lon": 9.340228
},
{
"name": "DKB",
"lat": 49.142753,
"lon": 10.238306
},
{
"name": "SULUS",
"lat": 50.075192,
"lon": 10.728808
},
{
"name": "BAMKI",
"lat": 50.718064,
"lon": 11.020208
},
{
"name": "KOJEC",
"lat": 51.512719,
"lon": 11.50445
},
{
"name": "OSKAN",
"lat": 51.460847,
"lon": 13.627669
},
{
"name": "MAREM",
"lat": 50.715467,
"lon": 13.628808
},
{
"name": "ABERU",
"lat": 50.069194,
"lon": 12.093719
},
{
"name": "LAMSI",
"lat": 48.653353,
"lon": 13.583442
},
{
"name": "SBG",
"lat": 47.967533,
"lon": 12.894072
},
{
"name": "ERKIR",
"lat": 47.537778,
"lon": 12.008889
},
{
"name": "WLD",
"lat": 48.579419,
"lon": 11.129386
},
{
"name": "UPALA",
"lat": 49.214372,
"lon": 11.221436
},
{
"name": "SUL",
"lat": 48.381586,
"lon": 8.644836
},
{
"name": "KRH",
"lat": 48.992944,
"lon": 8.584236
},
{
"name": "UMDAS",
"lat": 49.395864,
"lon": 8.824181
},
{
"name": "COSJE",
"lat": 49.717531,
"lon": 9.947
},
{
"name": "BOMBI",
"lat": 50.056667,
"lon": 8.800278
},
{
"name": "UBIDU",
"lat": 50.073333,
"lon": 7.906389
},
{
"name": "UMUPU",
"lat": 50.558611,
"lon": 7.431389
},
{
"name": "BITBU",
"lat": 49.98295,
"lon": 6.561628
},
{
"name": "NVO",
"lat": 50.822675,
"lon": 6.636533
},
{
"name": "GMH",
"lat": 51.170511,
"lon": 7.892039
},
{
"name": "DODEN",
"lat": 50.602256,
"lon": 8.09325
},
{
"name": "DEMAB",
"lat": 50.541111,
"lon": 9.955833
},
{
"name": "MAPOX",
"lat": 51.133611,
"lon": 8.813889
},
{
"name": "RIMET",
"lat": 51.333889,
"lon": 10.219444
},
{
"name": "PIROT",
"lat": 52.053431,
"lon": 9.236903
},
{
"name": "HMM",
"lat": 51.856867,
"lon": 7.708294
},
{
"name": "DIBIR",
"lat": 51.276944,
"lon": 6.124444
},
{
"name": "BASUM",
"lat": 52.771989,
"lon": 8.788539
},
{
"name": "MADOR",
"lat": 52.566667,
"lon": 9.9525
},
{
"name": "HLZ",
"lat": 52.363394,
"lon": 10.795219
},
{
"name": "MAG",
"lat": 51.994989,
"lon": 11.794306
},
{
"name": "KLF",
"lat": 52.019353,
"lon": 13.563414
},
{
"name": "KORUP",
"lat": 51.583056,
"lon": 14.738056
},
{
"name": "SUBIX",
"lat": 52.379722,
"lon": 14.585556
},
{
"name": "KETAP",
"lat": 52.927853,
"lon": 13.654947
},
{
"name": "OGBER",
"lat": 52.613889,
"lon": 12.724722
},
{
"name": "BKD",
"lat": 53.034525,
"lon": 11.546217
},
{
"name": "HAM",
"lat": 53.685575,
"lon": 10.204997
},
{
"name": "WSN",
"lat": 53.347169,
"lon": 8.874733
},
{
"name": "DHE",
"lat": 54.185686,
"lon": 7.9107
},
{
"name": "ATTUS",
"lat": 54.899722,
"lon": 8.782778
},
{
"name": "ALASA",
"lat": 54.808611,
"lon": 9.961667
},
{
"name": "BAGOS",
"lat": 54.572778,
"lon": 11.27
},
{
"name": "ROBUS",
"lat": 55.109444,
"lon": 11.719722
},
{
"name": "BANKU",
"lat": 54.795833,
"lon": 12.935278
},
{
"name": "UMSET",
"lat": 54.833056,
"lon": 14.158611
},
{
"name": "POBOX",
"lat": 54.158889,
"lon": 14.094167
},
{
"name": "FLD",
"lat": 53.762736,
"lon": 13.563136
},
{
"name": "TAGOB",
"lat": 53.734772,
"lon": 11.833056
} }
] ]
} }