@maka/maka-cli 5.6.0 → 5.8.0
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/bundle/typescript/package.json +2 -2
- package/bundle/typescript/src/commands/_index.d.ts +4 -0
- package/bundle/typescript/src/commands/_index.js +4 -0
- package/bundle/typescript/src/commands/_index.js.map +1 -1
- package/bundle/typescript/src/commands/debug.js +1 -7
- package/bundle/typescript/src/commands/debug.js.map +1 -1
- package/bundle/typescript/src/commands/deploy/ubuntu.sub.cmd.js +33 -32
- package/bundle/typescript/src/commands/deploy/ubuntu.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/env/_index.d.ts +3 -0
- package/bundle/typescript/src/commands/env/_index.js +4 -0
- package/bundle/typescript/src/commands/env/_index.js.map +1 -0
- package/bundle/typescript/src/commands/env/env.command.d.ts +3 -0
- package/bundle/typescript/src/commands/env/env.command.js +22 -0
- package/bundle/typescript/src/commands/env/env.command.js.map +1 -0
- package/bundle/typescript/src/commands/env/get.sub.cmd.d.ts +1 -0
- package/bundle/typescript/src/commands/env/get.sub.cmd.js +46 -0
- package/bundle/typescript/src/commands/env/get.sub.cmd.js.map +1 -0
- package/bundle/typescript/src/commands/env/prompt-for-env.d.ts +10 -0
- package/bundle/typescript/src/commands/env/prompt-for-env.js +27 -0
- package/bundle/typescript/src/commands/env/prompt-for-env.js.map +1 -0
- package/bundle/typescript/src/commands/env/set.sub.cmd.d.ts +1 -0
- package/bundle/typescript/src/commands/env/set.sub.cmd.js +59 -0
- package/bundle/typescript/src/commands/env/set.sub.cmd.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +81 -2
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/augmentations.d.ts +31 -0
- package/bundle/typescript/src/commands/game/sideQuest/augmentations.js +125 -0
- package/bundle/typescript/src/commands/game/sideQuest/augmentations.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.d.ts +17 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js +113 -15
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/ask.d.ts +37 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js +197 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js +3 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +21 -11
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.d.ts +3 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +13 -5
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.js +7 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/buy.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/buy.js +97 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/buy.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.d.ts +21 -10
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js +41 -27
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.d.ts +6 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +54 -20
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.d.ts +35 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +306 -55
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/companions.d.ts +33 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/companions.js +137 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/companions.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js +37 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drink.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drink.js +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drink.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js +7 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/eat.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/eat.js +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/eat.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/edge.js +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/edge.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +3 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js +101 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.d.ts +6 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +67 -22
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +15 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js +58 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/initiate.d.ts +26 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/initiate.js +125 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/initiate.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/install.d.ts +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/install.js +125 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/install.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/jump.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/jump.js +83 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/jump.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lifestyle.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lifestyle.js +76 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lifestyle.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.js +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +7 -6
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/order.d.ts +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/order.js +151 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/order.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pay.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pay.js +39 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pay.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js +5 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js +6 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/quality-trade.d.ts +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/quality-trade.js +121 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/quality-trade.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +60 -12
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +27 -10
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +15 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sell.d.ts +17 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sell.js +125 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sell.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js +36 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js +9 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js +27 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/stance.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/stance.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/summon.d.ts +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/summon.js +112 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/summon.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/treat.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/treat.js +67 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/treat.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js +7 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.d.ts +29 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +118 -11
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/work.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/work.js +68 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/work.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.d.ts +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +132 -5
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.d.ts +6 -2
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +10 -6
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +196 -0
- package/bundle/typescript/src/commands/game/sideQuest/game.js +828 -31
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/item.d.ts +28 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js +111 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +33 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +232 -10
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +111 -5
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +432 -41
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.d.ts +6 -6
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +38 -14
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +9 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +48 -8
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/qualities.d.ts +44 -0
- package/bundle/typescript/src/commands/game/sideQuest/qualities.js +155 -0
- package/bundle/typescript/src/commands/game/sideQuest/qualities.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +274 -5
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +17 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +82 -8
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.d.ts +13 -6
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js +28 -15
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +15 -3
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +207 -34
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/commerce.d.ts +56 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/commerce.js +144 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/commerce.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.d.ts +7 -4
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js +8 -5
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/log-style.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/log-style.js +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/log-style.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js +49 -4
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/outdoors.d.ts +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/outdoors.js +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/outdoors.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.d.ts +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +107 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/terminal-reset.d.ts +17 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/terminal-reset.js +23 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/terminal-reset.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +51 -15
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/remote/reconfig.sub.cmd.js +27 -1
- package/bundle/typescript/src/commands/remote/reconfig.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/run/run.command.js +1 -7
- package/bundle/typescript/src/commands/run/run.command.js.map +1 -1
- package/bundle/typescript/src/commands/ssl.js +10 -15
- package/bundle/typescript/src/commands/ssl.js.map +1 -1
- package/bundle/typescript/src/commands/testCmd/mocha.sub.cmd.js +1 -6
- package/bundle/typescript/src/commands/testCmd/mocha.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/generators/config.js +11 -10
- package/bundle/typescript/src/generators/config.js.map +1 -1
- package/bundle/typescript/src/templates/meteor/config/pm2.config.js +3 -3
- package/bundle/typescript/src/templates/meteor/project/gitignore +2 -1
- package/bundle/typescript/src/templates/react/kit/mui/auth/password-reset/basic-password-reset-page.js.tsx +3 -4
- package/bundle/typescript/src/tool.d.ts +2 -0
- package/bundle/typescript/src/tool.js +3 -0
- package/bundle/typescript/src/tool.js.map +1 -1
- package/bundle/typescript/src/tools/aws/aws.class.js +6 -4
- package/bundle/typescript/src/tools/aws/aws.class.js.map +1 -1
- package/bundle/typescript/src/tools/dotenvx/dotenvx.class.d.ts +24 -0
- package/bundle/typescript/src/tools/dotenvx/dotenvx.class.js +66 -0
- package/bundle/typescript/src/tools/dotenvx/dotenvx.class.js.map +1 -0
- package/bundle/typescript/src/tools/ssh/ssh.class.js +1 -1
- package/bundle/typescript/src/tools/ssh/ssh.class.js.map +1 -1
- package/bundle/typescript/src/tools/ssl/ssl.class.d.ts +8 -0
- package/bundle/typescript/src/tools/ssl/ssl.class.js +53 -0
- package/bundle/typescript/src/tools/ssl/ssl.class.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class DOTENVX {
|
|
2
|
+
private static instance;
|
|
3
|
+
static getInstance(): DOTENVX;
|
|
4
|
+
/**
|
|
5
|
+
* Loads a process.env-style file into process.env. Drop-in replacement for
|
|
6
|
+
* dotenv.config({ path }) that also transparently decrypts the file if it
|
|
7
|
+
* was encrypted with dotenvx (using a sibling .env.keys file or a
|
|
8
|
+
* DOTENV_PRIVATE_KEY* environment variable).
|
|
9
|
+
*/
|
|
10
|
+
load(filePath: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Sets a single KEY=value pair into a .env-style file, creating the file's
|
|
13
|
+
* keypair on first use if needed. Encrypted by default (matching encrypt());
|
|
14
|
+
* pass plain: true to write it unencrypted (used for the local environment).
|
|
15
|
+
*/
|
|
16
|
+
set(key: string, value: string, filePath: string, opts?: {
|
|
17
|
+
plain?: boolean;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Reads and decrypts a single key's value from a .env-style file. Returns
|
|
21
|
+
* undefined if the key isn't set.
|
|
22
|
+
*/
|
|
23
|
+
get(key: string, filePath: string): Promise<string | undefined>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Dotenvx wrapper: loads (and transparently decrypts) process.env-style files,
|
|
2
|
+
// and sets/gets individual secrets, encrypting on first use for non-local envs.
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import dotenvxPkg from '@dotenvx/dotenvx';
|
|
5
|
+
import { Log } from '../log/log.class.js';
|
|
6
|
+
const { config: loadDotenvxConfig, set: setDotenvxValue, get: getDotenvxValue } = dotenvxPkg;
|
|
7
|
+
const errorHandler = (caller, error) => {
|
|
8
|
+
if (process.env['MAKA_DEV'] === 'True') {
|
|
9
|
+
Log.error(`Error in ${caller}`);
|
|
10
|
+
}
|
|
11
|
+
if (error) {
|
|
12
|
+
console.error(error);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export class DOTENVX {
|
|
16
|
+
static instance;
|
|
17
|
+
static getInstance() {
|
|
18
|
+
if (!DOTENVX.instance) {
|
|
19
|
+
DOTENVX.instance = new DOTENVX();
|
|
20
|
+
}
|
|
21
|
+
return DOTENVX.instance;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Loads a process.env-style file into process.env. Drop-in replacement for
|
|
25
|
+
* dotenv.config({ path }) that also transparently decrypts the file if it
|
|
26
|
+
* was encrypted with dotenvx (using a sibling .env.keys file or a
|
|
27
|
+
* DOTENV_PRIVATE_KEY* environment variable).
|
|
28
|
+
*/
|
|
29
|
+
load(filePath) {
|
|
30
|
+
try {
|
|
31
|
+
loadDotenvxConfig({ path: filePath, quiet: true });
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
errorHandler('load()', e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sets a single KEY=value pair into a .env-style file, creating the file's
|
|
39
|
+
* keypair on first use if needed. Encrypted by default (matching encrypt());
|
|
40
|
+
* pass plain: true to write it unencrypted (used for the local environment).
|
|
41
|
+
*/
|
|
42
|
+
async set(key, value, filePath, opts = {}) {
|
|
43
|
+
try {
|
|
44
|
+
const envKeysFile = path.join(path.dirname(filePath), '.env.keys');
|
|
45
|
+
await setDotenvxValue(key, value, { path: filePath, envKeysFile, encrypt: !opts.plain });
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
errorHandler('set()', e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Reads and decrypts a single key's value from a .env-style file. Returns
|
|
53
|
+
* undefined if the key isn't set.
|
|
54
|
+
*/
|
|
55
|
+
async get(key, filePath) {
|
|
56
|
+
try {
|
|
57
|
+
const envKeysFile = path.join(path.dirname(filePath), '.env.keys');
|
|
58
|
+
return await getDotenvxValue(key, { path: filePath, envKeysFile });
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
errorHandler('get()', e);
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=dotenvx.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotenvx.class.js","sourceRoot":"","sources":["../../../../../src/tools/dotenvx/dotenvx.class.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC;AAE7F,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,KAAY,EAAE,EAAE;IACpD,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,EAAE,CAAC;QACvC,GAAG,CAAC,KAAK,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QAEV,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAA;AAED,MAAM,OAAO,OAAO;IACV,MAAM,CAAC,QAAQ,CAAU;IAE1B,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,OAAO,CAAC,QAAQ,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACI,IAAI,CAAC,QAAgB;QAC1B,IAAI,CAAC;YACH,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB,EAAE,OAA4B,EAAE;QAC3F,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;YACnE,MAAM,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3F,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,QAAgB;QAC5C,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;YACnE,OAAO,MAAM,eAAe,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;QACrE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACzB,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -80,7 +80,7 @@ export class SSH {
|
|
|
80
80
|
]);
|
|
81
81
|
// Control stdio based on `silentOutput`
|
|
82
82
|
const stdioOption = silentOutput ? 'pipe' : 'inherit';
|
|
83
|
-
const result = spawnSync(`ssh`, args, { encoding: 'utf-8', stdio: [stdioOption,
|
|
83
|
+
const result = spawnSync(`ssh`, args, { encoding: 'utf-8', stdio: [stdioOption, stdioOption, stdioOption] });
|
|
84
84
|
if (silentOutput) {
|
|
85
85
|
return {
|
|
86
86
|
stdout: result.stdout || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssh.class.js","sourceRoot":"","sources":["../../../../../src/tools/ssh/ssh.class.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,OAAO,GAAG;IACP,MAAM,CAAC,GAAG,GAAG,CAAC,GAAW,EAAE,MAAqB,EAAE,IAAW,EAAiB,EAAE;QACrF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;YACnD,MAAM,GAAG,GAAG,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC;YAC/B,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,IAAI,KAAK,CAAC;YAE7C,IAAI,IAAI,GAAa,EAAE,CAAC;YAExB,IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YAED,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;gBACjB,IAAI;gBACJ,kBAAkB;gBAClB,IAAI;gBACJ,QAAQ;gBACR,IAAI;gBACJ,MAAM,CAA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CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3E,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IDefaultProps } from '../ssh/ssh.interfaces.js';
|
|
1
2
|
interface ISSLGenCSR {
|
|
2
3
|
keyName: string;
|
|
3
4
|
csrName: string;
|
|
@@ -10,8 +11,15 @@ interface ISSLGenSSC {
|
|
|
10
11
|
cwd?: string;
|
|
11
12
|
useConfig?: boolean;
|
|
12
13
|
}
|
|
14
|
+
interface ILetsEncryptSetup {
|
|
15
|
+
domains: string;
|
|
16
|
+
email: string;
|
|
17
|
+
retries?: number;
|
|
18
|
+
retryDelayMs?: number;
|
|
19
|
+
}
|
|
13
20
|
export declare class SSL {
|
|
14
21
|
static genCSR(opts: ISSLGenCSR): void;
|
|
15
22
|
static genSSC(opts: ISSLGenSSC): void;
|
|
23
|
+
static setupLetsEncrypt(sshConfig: IDefaultProps, opts: ILetsEncryptSetup): Promise<void>;
|
|
16
24
|
}
|
|
17
25
|
export {};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { spawnSync } from 'child_process';
|
|
2
|
+
import { SSH } from '../ssh/ssh.class.js';
|
|
3
|
+
import { Log } from '../log/log.class.js';
|
|
4
|
+
// Errors that mean "already in the desired state" rather than a real failure -
|
|
5
|
+
// these commands are re-run on every deploy/ssl invocation and aren't idempotent
|
|
6
|
+
// on their own.
|
|
7
|
+
const LETSENCRYPT_IGNORE_ERRORS = [
|
|
8
|
+
'snap "core" is already installed',
|
|
9
|
+
'snap "core" has no updates available',
|
|
10
|
+
'snap "certbot" is already installed',
|
|
11
|
+
"ln: failed to create symbolic link '/usr/bin/certbot': File exists",
|
|
12
|
+
'Certificate not yet due for renewal'
|
|
13
|
+
];
|
|
14
|
+
function sleep(ms) {
|
|
15
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
16
|
+
}
|
|
2
17
|
export class SSL {
|
|
3
18
|
static genCSR(opts) {
|
|
4
19
|
const cwd = (opts.cwd) ? opts.cwd : process.cwd();
|
|
@@ -50,5 +65,43 @@ export class SSL {
|
|
|
50
65
|
spawnSync('openssl', args, { stdio: 'inherit', cwd });
|
|
51
66
|
}
|
|
52
67
|
}
|
|
68
|
+
// Installs certbot via snap and obtains/renews a cert with the nginx plugin.
|
|
69
|
+
// Shared by `maka ssl --env <env> letsencrypt` and `maka deploy:ubuntu --letsencrypt`
|
|
70
|
+
// so both paths behave identically and stay idempotent on re-runs.
|
|
71
|
+
static async setupLetsEncrypt(sshConfig, opts) {
|
|
72
|
+
const retries = opts.retries ?? 3;
|
|
73
|
+
const retryDelayMs = opts.retryDelayMs ?? 15000;
|
|
74
|
+
function run(command) {
|
|
75
|
+
const result = SSH.sshSync(command, sshConfig, { silentOutput: true });
|
|
76
|
+
if (!result) {
|
|
77
|
+
throw new Error(`No result received from command: ${command}`);
|
|
78
|
+
}
|
|
79
|
+
const shouldIgnore = LETSENCRYPT_IGNORE_ERRORS.some(err => result.stderr.includes(err));
|
|
80
|
+
if (result.status !== 0 && !shouldIgnore) {
|
|
81
|
+
throw new Error(`Command failed (status ${result.status}): ${command}\n${(result.stderr || result.stdout).trim()}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// On a freshly-booted Ubuntu host, snapd may not have finished seeding yet;
|
|
85
|
+
// `snap install` fails with "too early for operation" if it's not waited for.
|
|
86
|
+
run('sudo snap wait system seed.loaded');
|
|
87
|
+
run('sudo snap install core; sudo snap refresh core');
|
|
88
|
+
run('sudo snap install --classic certbot');
|
|
89
|
+
run('sudo ln -s /snap/bin/certbot /usr/bin/certbot');
|
|
90
|
+
const certbotCmd = `sudo certbot --nginx --agree-tos --expand -n --domains ${opts.domains} --email ${opts.email}`;
|
|
91
|
+
for (let attempt = 1; attempt <= retries; attempt++) {
|
|
92
|
+
try {
|
|
93
|
+
run(certbotCmd);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
const isLastAttempt = attempt === retries;
|
|
98
|
+
if (isLastAttempt)
|
|
99
|
+
throw e;
|
|
100
|
+
Log.warn(`Certbot attempt ${attempt}/${retries} failed, retrying in ${retryDelayMs / 1000}s (DNS may still be propagating, or a firewall rule hasn't taken effect yet):`);
|
|
101
|
+
Log.warn(String(e instanceof Error ? e.message : e));
|
|
102
|
+
await sleep(retryDelayMs);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
53
106
|
}
|
|
54
107
|
//# sourceMappingURL=ssl.class.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssl.class.js","sourceRoot":"","sources":["../../../../../src/tools/ssl/ssl.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ssl.class.js","sourceRoot":"","sources":["../../../../../src/tools/ssl/ssl.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AA0B1C,+EAA+E;AAC/E,iFAAiF;AACjF,gBAAgB;AAChB,MAAM,yBAAyB,GAAG;IAChC,kCAAkC;IAClC,sCAAsC;IACtC,qCAAqC;IACrC,oEAAoE;IACpE,qCAAqC;CACtC,CAAC;AAEF,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,OAAO,GAAG;IACP,MAAM,CAAC,MAAM,CAAC,IAAgB;QACnC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAElD,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AI,CAAC,KAAK,EAAE,CAAC;QAElH,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC;YACpD,IAAI,CAAC;gBACH,GAAG,CAAC,UAAU,CAAC,CAAC;gBAChB,OAAO;YACT,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,aAAa,GAAG,OAAO,KAAK,OAAO,CAAC;gBAC1C,IAAI,aAAa;oBAAE,MAAM,CAAC,CAAC;gBAC3B,GAAG,CAAC,IAAI,CAAC,mBAAmB,OAAO,IAAI,OAAO,wBAAwB,YAAY,GAAG,IAAI,+EAA+E,CAAC,CAAC;gBAC1K,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrD,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@aws-sdk/client-ecr": "^3.1111.0",
|
|
41
41
|
"@aws-sdk/client-route-53": "^3.1111.0",
|
|
42
42
|
"@aws-sdk/client-route-53-domains": "^3.1111.0",
|
|
43
|
+
"@dotenvx/dotenvx": "^2.21.0",
|
|
43
44
|
"@inquirer/prompts": "^8.5.2",
|
|
44
45
|
"@maka/tar": "^6.2.2",
|
|
45
46
|
"blessed": "^0.1.81",
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
"cli-table": "^0.3.11",
|
|
50
51
|
"cross-spawn": "^7.0.6",
|
|
51
52
|
"date-fns": "^4.1.0",
|
|
52
|
-
"dotenv": "^17.4.2",
|
|
53
53
|
"ejs": "^6.0.1",
|
|
54
54
|
"elegant-spinner": "^3.0.0",
|
|
55
55
|
"http-proxy": "^1.18.1",
|