@platformatic/watt-extra 1.12.0-alpha.4 → 1.12.0-alpha.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/.claude/settings.local.json +7 -0
- package/lib/watt.js +7 -17
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(node -e \"const schema = require\\(''''@platformatic/runtime/lib/schema.js''''\\); console.log\\(JSON.stringify\\(schema.default?.properties?.services?.items?.properties || schema.properties?.services?.items?.properties, null, 2\\)\\)\")"
|
|
5
|
+
]
|
|
6
|
+
}
|
|
7
|
+
}
|
package/lib/watt.js
CHANGED
|
@@ -515,6 +515,7 @@ class Watt {
|
|
|
515
515
|
const config = runtime.getRuntimeConfig(true)
|
|
516
516
|
|
|
517
517
|
for (const app of config.applications ?? []) {
|
|
518
|
+
process._rawDebug('--------APP TYPE:', app.type)
|
|
518
519
|
if (app.type === 'next') {
|
|
519
520
|
await this.#configureNextService(runtime, app)
|
|
520
521
|
} else if (
|
|
@@ -525,11 +526,9 @@ class Watt {
|
|
|
525
526
|
].includes(app.type)
|
|
526
527
|
) {
|
|
527
528
|
await this.#configurePlatformaticServices(runtime, app)
|
|
529
|
+
} else if (app.type === '@platformatic/regina') {
|
|
530
|
+
await this.#configureReginaService(runtime, app)
|
|
528
531
|
}
|
|
529
|
-
// else if (app.type === '@platformatic/regina') {
|
|
530
|
-
// this.#configureReginaService(runtime, app)
|
|
531
|
-
// }
|
|
532
|
-
this.#configureReginaService(runtime, app)
|
|
533
532
|
}
|
|
534
533
|
}
|
|
535
534
|
|
|
@@ -606,27 +605,18 @@ class Watt {
|
|
|
606
605
|
}
|
|
607
606
|
|
|
608
607
|
async #configureReginaService (runtime, app) {
|
|
609
|
-
process._rawDebug('--------INSTANCE CONFIG--------', this.#instanceConfig)
|
|
610
|
-
|
|
611
608
|
const privateIp = await this.#getPrivateIp()
|
|
612
609
|
const port = this.#getRuntimePort()
|
|
613
|
-
|
|
614
|
-
if (!privateIp) {
|
|
615
|
-
this.#logger.warn('Missing private IP address, not setting up Regina member address')
|
|
616
|
-
return
|
|
617
|
-
}
|
|
618
|
-
|
|
619
610
|
const address = `http://${privateIp}:${port}`
|
|
620
|
-
process._rawDebug('--------
|
|
611
|
+
process._rawDebug('--------Patching Regina service', address)
|
|
621
612
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
613
|
+
this.#patchService(runtime, app.id, [
|
|
614
|
+
{ op: 'add', path: '/regina/memberAddress', value: address }
|
|
615
|
+
])
|
|
625
616
|
}
|
|
626
617
|
|
|
627
618
|
async #getPrivateIp () {
|
|
628
619
|
const { address } = await dns.lookup(os.hostname())
|
|
629
|
-
process._rawDebug('--------IP--------', address)
|
|
630
620
|
return address
|
|
631
621
|
}
|
|
632
622
|
|