nappup 1.0.3 → 1.0.5
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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "git+https://github.com/44billion/nappup.git"
|
|
7
7
|
},
|
|
8
8
|
"license": "GPL-3.0-or-later",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.5",
|
|
10
10
|
"description": "Nostr App Uploader",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dotenv": "^17.2.0",
|
|
20
20
|
"file-type": "^21.0.0",
|
|
21
21
|
"mime-types": "^3.0.1",
|
|
22
|
-
"nmmr": "^1.0.
|
|
22
|
+
"nmmr": "^1.0.4",
|
|
23
23
|
"nostr-tools": "^2.15.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
2
3
|
import { fileURLToPath } from 'node:url'
|
|
3
4
|
import * as dotenv from 'dotenv'
|
|
4
5
|
import { getPublicKey, finalizeEvent } from 'nostr-tools/pure'
|
|
@@ -6,8 +7,9 @@ import { getConversationKey, encrypt, decrypt } from 'nostr-tools/nip44'
|
|
|
6
7
|
import nostrRelays, { seedRelays, freeRelays } from '#services/nostr-relays.js'
|
|
7
8
|
const __dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
8
9
|
|
|
10
|
+
const dotenvPath = process.env.DOTENV_CONFIG_PATH ?? `${__dirname}/../../.env`
|
|
9
11
|
dotenv.config({
|
|
10
|
-
path:
|
|
12
|
+
path: dotenvPath,
|
|
11
13
|
quiet: true
|
|
12
14
|
})
|
|
13
15
|
|
|
@@ -40,7 +42,7 @@ export default class NostrSigner {
|
|
|
40
42
|
} else {
|
|
41
43
|
isNewSk = true
|
|
42
44
|
skHex = generateSecretKey()
|
|
43
|
-
fs.appendFileSync(
|
|
45
|
+
fs.appendFileSync(path.resolve(dotenvPath), `NOSTR_SECRET_KEY=${skHex}\n`)
|
|
44
46
|
skBytes = hexToBytes(skHex)
|
|
45
47
|
}
|
|
46
48
|
const ret = new this(createToken, skBytes)
|