Skip to content

Commit baa11d9

Browse files
author
3aa49ec6bfc910647fa1c5a013e48eef
committed
Preparing for packaging as npm
1 parent df5fe2a commit baa11d9

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

deploy/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/3aa49ec6bfc910647fa
3535
mkdir /logs
3636

3737
# Create config directory
38-
mkdir /config
38+
# mkdir /config
3939

4040
# Set default config
41-
cat << EOF > /config/node-teslausb.json
41+
cat << EOF > /etc/node-teslausb.json
4242
{
4343
"archive": {
4444
"rcloneConfig": "node-teslausb",

deploy/uninstall.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/3aa49ec6bfc910647fa1c5a013e48eef/node-teslausb/main/deploy/uninstall.sh)"
2+
3+
# This is not a full uninstall script, but it's a start
4+
5+
systemctl stop node-teslausb
6+
systemctl disable node-teslausb
7+
rm /etc/systemd/system/node-teslausb.service
8+
9+
systemctl stop node-teslausb-www
10+
systemctl disable node-teslausb-www
11+
rm /etc/systemd/system/node-teslausb-www.service
12+
13+
# Remove the worker
14+
rm -rf /bin/node-teslausb
15+
16+
# Remove the worker config
17+
rm -rf /etc/node-teslausb.json

website/src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ export const logNameToPathMapping: { [key: string]: string } = {
99

1010
export const configNameToPathMapping: { [key: string]: string } = {
1111
'rclone': isDevMode ? '/Users/blake/logs/rclone.log' : '/root/.config/rclone/rclone.conf',
12-
'node-teslausb': isDevMode ? '/Users/blake/config/node-teslausb.json' : '/config/node-teslausb.json',
12+
'node-teslausb': isDevMode ? '/Users/blake/etc/node-teslausb.json' : '/etc/node-teslausb.json',
1313
};

worker/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"scripts": {
88
"test": "echo \"Error: no test specified\" && exit 1",
99
"build": "tsup && npm run copy-package-json",
10-
"copy-package-json": "cp package.json ../build/worker/package.json"
10+
"copy-package-json": "cp package.json ../build/worker/package.json",
11+
"setup": "/path/to/setup.js",
12+
"configure": "/path/to/config.js"
1113
},
1214
"keywords": [],
1315
"author": "",

worker/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { checkLockChime } from './modules/lockChimes.js';
88
import { readConfigFile } from './modules/config.js';
99
import { checkAndInstallUpdate, installUpdate } from './modules/update.js';
1010

11-
const configFilePath = '/config/node-teslausb.json';
11+
const configFilePath = '/etc/node-teslausb.json';
1212
const config = await readConfigFile(configFilePath);
1313

1414
interface WorkerState {

0 commit comments

Comments
 (0)