@noforeignland/signalk-to-noforeignland 1.0.1-beta.1 → 1.0.1-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "@noforeignland/signalk-to-noforeignland",
3
- "signalk": {
4
- "id": "@noforeignland/signalk-to-noforeignland"
5
- },
6
- "version": "1.0.1-beta.1",
7
- "description": "SignalK track logger to noforeignland.com",
8
- "main": "index.js",
9
- "keywords": [
10
- "signalk-node-server-plugin",
11
- "signalk-category-utility"
12
- ],
13
- "author": "Dirk Wahrheit",
14
- "license": "MIT",
15
- "homepage": "https://github.com/noforeignland/nfl-signalk",
16
- "bugs": {
17
- "url": "https://github.com/noforeignland/nfl-signalk/issues"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/noforeignland/nfl-signalk.git"
22
- },
23
- "engines": {
24
- "node": ">=18.0.0"
25
- },
26
- "scripts": {
27
- "test": "echo \"No tests specified\" && exit 0",
28
- "postinstall": "node migrate-config.js && (npm uninstall signalk-to-noforeignland 2>/dev/null || rm -rf ../signalk-to-noforeignland || true)"
29
- },
30
- "dependencies": {
31
- "cron": "^2.1.0",
32
- "fs-extra": "^10.1.0",
33
- "node-fetch": "^2.6.7"
34
- }
35
- }
1
+ {
2
+ "name": "@noforeignland/signalk-to-noforeignland",
3
+ "signalk": {
4
+ "id": "@noforeignland/signalk-to-noforeignland"
5
+ },
6
+ "version": "1.0.1-beta.8",
7
+ "description": "SignalK track logger to noforeignland.com",
8
+ "main": "index.js",
9
+ "keywords": [
10
+ "signalk-node-server-plugin",
11
+ "signalk-category-utility"
12
+ ],
13
+ "author": "Dirk Wahrheit",
14
+ "license": "MIT",
15
+ "homepage": "https://github.com/noforeignland/nfl-signalk",
16
+ "bugs": {
17
+ "url": "https://github.com/noforeignland/nfl-signalk/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/noforeignland/nfl-signalk.git"
22
+ },
23
+ "engines": {
24
+ "node": ">=18.0.0"
25
+ },
26
+ "scripts": {
27
+ "test": "echo \"No tests specified\" && exit 0",
28
+ "postinstall": "node cleanup-old-plugin.js"
29
+ },
30
+ "dependencies": {
31
+ "cron": "^2.1.0",
32
+ "fs-extra": "^10.1.0",
33
+ "node-fetch": "^2.6.7"
34
+ }
35
+ }
@@ -1,60 +0,0 @@
1
- How-to install the latest beta on your device?
2
-
3
- This guide assumes you have a default install with default folders.
4
- This is written for a Cerbo GX or a RPI, jump to the section you need want to go to.
5
- It is recommended to enable the Debug Log for this plugin in Server -> Plugin Config before updating.
6
-
7
- **For Raspberry PI:**
8
-
9
- 1. Backup old data
10
-
11
- ```
12
- cd ~
13
- mkdir nfl-backup
14
- cp -a .signalk/node_modules/signalk-to-noforeignland/* nfl-backup/
15
- ```
16
-
17
- 2. Get new files from repo (main for latest)
18
-
19
- ```
20
- cd ~/.signalk/node_modules/signalk-to-noforeignland/
21
- rm -rf *
22
- wget https://github.com/noforeignland/nfl-signalk/archive/refs/heads/main.zip
23
- unzip main.zip
24
- cp -r nfl-signalk-main/* .
25
- rm main.zip
26
- rm -rf nfl-signalk-main/
27
- ```
28
-
29
- 3. Restart Server & Check logs
30
-
31
- ```
32
- sudo systemctl restart signalk.service && sudo journalctl -u signalk.service -f
33
- ```
34
-
35
-
36
- **For Cerbo GX with Image Large:**
37
- 1. Backup old data
38
-
39
- ```
40
- cd ~
41
- mkdir nfl-backup
42
- cp -a /data/conf/signalk/node_modules/signalk-to-noforeignland/* nfl-backup
43
- ```
44
-
45
- 2. Get new files from repo (main for latest)
46
-
47
- ```
48
- cd /data/conf/signalk/node_modules/signalk-to-noforeignland/
49
- rm -rf *
50
- wget https://github.com/noforeignland/nfl-signalk/archive/refs/heads/main.zip
51
- unzip main.zip
52
- cp -r nfl-signalk-main/* .
53
- rm main.zip
54
- rm -rf nfl-signalk-main/
55
- ```
56
-
57
- 3. Restart Server & Check logs
58
- ```
59
- Restart Server vom Webgui and check logs in Webgui
60
- ```
package/migrate-config.js DELETED
@@ -1,56 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- function migrateConfig() {
5
- try {
6
- const configDir = process.env.SIGNALK_NODE_CONFIG_DIR ||
7
- path.join(process.env.HOME || process.env.USERPROFILE, '.signalk');
8
-
9
- const oldPluginId = 'signalk-to-noforeignland';
10
- // SignalK speichert scoped packages ohne den Scope oder mit - statt /
11
- const newPluginId = '@noforeignland-signalk-to-noforeignland'; // @ bleibt, / wird zu -
12
-
13
- const configPath = path.join(configDir, 'plugin-config-data');
14
-
15
- // Sicherstellen dass configPath existiert
16
- if (!fs.existsSync(configPath)) {
17
- console.log(`Config directory does not exist: ${configPath}`);
18
- return;
19
- }
20
-
21
- const oldConfigFile = path.join(configPath, `${oldPluginId}.json`);
22
- const newConfigFile = path.join(configPath, `${newPluginId}.json`);
23
-
24
- console.log(`Looking for old config at: ${oldConfigFile}`);
25
- console.log(`Will create new config at: ${newConfigFile}`);
26
- console.log(`Old config exists: ${fs.existsSync(oldConfigFile)}`);
27
- console.log(`New config exists: ${fs.existsSync(newConfigFile)}`);
28
-
29
- // Prüfen ob alte Config existiert und neue noch nicht
30
- if (fs.existsSync(oldConfigFile) && !fs.existsSync(newConfigFile)) {
31
- console.log('Migrating configuration from old plugin...');
32
-
33
- // Config kopieren
34
- const oldConfig = fs.readFileSync(oldConfigFile, 'utf8');
35
- fs.writeFileSync(newConfigFile, oldConfig);
36
-
37
- console.log('Configuration migrated successfully!');
38
- console.log('Old configuration file can be safely deleted after verification.');
39
-
40
- // Backup erstellen
41
- const backupFile = `${oldConfigFile}.backup`;
42
- fs.copyFileSync(oldConfigFile, backupFile);
43
- console.log(`Backup created at: ${backupFile}`);
44
- } else if (fs.existsSync(newConfigFile)) {
45
- console.log('New configuration already exists, no migration needed.');
46
- } else if (!fs.existsSync(oldConfigFile)) {
47
- console.log('No old configuration found to migrate.');
48
- }
49
-
50
- } catch (error) {
51
- console.warn('Could not migrate configuration:', error.message);
52
- console.warn('You may need to reconfigure the plugin manually.');
53
- }
54
- }
55
-
56
- migrateConfig();