@factiii/stack 0.1.2
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/README.md +420 -0
- package/bin/factiii +229 -0
- package/dist/cli/check-config.d.ts +9 -0
- package/dist/cli/check-config.d.ts.map +1 -0
- package/dist/cli/check-config.js +19 -0
- package/dist/cli/check-config.js.map +1 -0
- package/dist/cli/deploy-secrets.d.ts +16 -0
- package/dist/cli/deploy-secrets.d.ts.map +1 -0
- package/dist/cli/deploy-secrets.js +227 -0
- package/dist/cli/deploy-secrets.js.map +1 -0
- package/dist/cli/deploy.d.ts +30 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +306 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/deployer.d.ts +13 -0
- package/dist/cli/deployer.d.ts.map +1 -0
- package/dist/cli/deployer.js +21 -0
- package/dist/cli/deployer.js.map +1 -0
- package/dist/cli/dev-sync.d.ts +30 -0
- package/dist/cli/dev-sync.d.ts.map +1 -0
- package/dist/cli/dev-sync.js +500 -0
- package/dist/cli/dev-sync.js.map +1 -0
- package/dist/cli/execute-plugin-command.d.ts +25 -0
- package/dist/cli/execute-plugin-command.d.ts.map +1 -0
- package/dist/cli/execute-plugin-command.js +237 -0
- package/dist/cli/execute-plugin-command.js.map +1 -0
- package/dist/cli/fix.d.ts +22 -0
- package/dist/cli/fix.d.ts.map +1 -0
- package/dist/cli/fix.js +267 -0
- package/dist/cli/fix.js.map +1 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +31 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +9 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +190 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/plugin-commands.d.ts +22 -0
- package/dist/cli/plugin-commands.d.ts.map +1 -0
- package/dist/cli/plugin-commands.js +121 -0
- package/dist/cli/plugin-commands.js.map +1 -0
- package/dist/cli/scan.d.ts +66 -0
- package/dist/cli/scan.d.ts.map +1 -0
- package/dist/cli/scan.js +511 -0
- package/dist/cli/scan.js.map +1 -0
- package/dist/cli/secrets.d.ts +19 -0
- package/dist/cli/secrets.d.ts.map +1 -0
- package/dist/cli/secrets.js +318 -0
- package/dist/cli/secrets.js.map +1 -0
- package/dist/cli/undeploy.d.ts +9 -0
- package/dist/cli/undeploy.d.ts.map +1 -0
- package/dist/cli/undeploy.js +95 -0
- package/dist/cli/undeploy.js.map +1 -0
- package/dist/cli/upgrade.d.ts +9 -0
- package/dist/cli/upgrade.d.ts.map +1 -0
- package/dist/cli/upgrade.js +24 -0
- package/dist/cli/upgrade.js.map +1 -0
- package/dist/cli/validate.d.ts +9 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +20 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/generators/generate-factiii-auto.d.ts +31 -0
- package/dist/generators/generate-factiii-auto.d.ts.map +1 -0
- package/dist/generators/generate-factiii-auto.js +251 -0
- package/dist/generators/generate-factiii-auto.js.map +1 -0
- package/dist/generators/generate-factiii-yml.d.ts +23 -0
- package/dist/generators/generate-factiii-yml.d.ts.map +1 -0
- package/dist/generators/generate-factiii-yml.js +228 -0
- package/dist/generators/generate-factiii-yml.js.map +1 -0
- package/dist/generators/index.d.ts +8 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +14 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/addons/server-mode/index.d.ts +57 -0
- package/dist/plugins/addons/server-mode/index.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/index.js +136 -0
- package/dist/plugins/addons/server-mode/index.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.d.ts +17 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.js +461 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.d.ts +12 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.js +246 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.d.ts +14 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.js +113 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.js.map +1 -0
- package/dist/plugins/approved.json +13 -0
- package/dist/plugins/frameworks/prisma-trpc/index.d.ts +65 -0
- package/dist/plugins/frameworks/prisma-trpc/index.d.ts.map +1 -0
- package/dist/plugins/frameworks/prisma-trpc/index.js +668 -0
- package/dist/plugins/frameworks/prisma-trpc/index.js.map +1 -0
- package/dist/plugins/index.d.ts +101 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +411 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/interfaces/addon.d.ts +43 -0
- package/dist/plugins/interfaces/addon.d.ts.map +1 -0
- package/dist/plugins/interfaces/addon.js +53 -0
- package/dist/plugins/interfaces/addon.js.map +1 -0
- package/dist/plugins/interfaces/framework.d.ts +43 -0
- package/dist/plugins/interfaces/framework.d.ts.map +1 -0
- package/dist/plugins/interfaces/framework.js +53 -0
- package/dist/plugins/interfaces/framework.js.map +1 -0
- package/dist/plugins/interfaces/index.d.ts +10 -0
- package/dist/plugins/interfaces/index.d.ts.map +1 -0
- package/dist/plugins/interfaces/index.js +17 -0
- package/dist/plugins/interfaces/index.js.map +1 -0
- package/dist/plugins/interfaces/pipeline.d.ts +78 -0
- package/dist/plugins/interfaces/pipeline.d.ts.map +1 -0
- package/dist/plugins/interfaces/pipeline.js +82 -0
- package/dist/plugins/interfaces/pipeline.js.map +1 -0
- package/dist/plugins/interfaces/server.d.ts +65 -0
- package/dist/plugins/interfaces/server.d.ts.map +1 -0
- package/dist/plugins/interfaces/server.js +72 -0
- package/dist/plugins/interfaces/server.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/ec2.d.ts +9 -0
- package/dist/plugins/pipelines/aws/configs/ec2.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/ec2.js +34 -0
- package/dist/plugins/pipelines/aws/configs/ec2.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.d.ts +13 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.js +86 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/index.d.ts +14 -0
- package/dist/plugins/pipelines/aws/configs/index.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/index.js +21 -0
- package/dist/plugins/pipelines/aws/configs/index.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/types.d.ts +36 -0
- package/dist/plugins/pipelines/aws/configs/types.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/types.js +9 -0
- package/dist/plugins/pipelines/aws/configs/types.js.map +1 -0
- package/dist/plugins/pipelines/aws/dev.d.ts +10 -0
- package/dist/plugins/pipelines/aws/dev.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/dev.js +70 -0
- package/dist/plugins/pipelines/aws/dev.js.map +1 -0
- package/dist/plugins/pipelines/aws/index.d.ts +118 -0
- package/dist/plugins/pipelines/aws/index.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/index.js +346 -0
- package/dist/plugins/pipelines/aws/index.js.map +1 -0
- package/dist/plugins/pipelines/aws/prod.d.ts +19 -0
- package/dist/plugins/pipelines/aws/prod.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/prod.js +362 -0
- package/dist/plugins/pipelines/aws/prod.js.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.d.ts +7 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.js +31 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.js.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/config.d.ts +7 -0
- package/dist/plugins/pipelines/aws/scanfix/config.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/config.js +134 -0
- package/dist/plugins/pipelines/aws/scanfix/config.js.map +1 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.d.ts +65 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.js +221 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.js.map +1 -0
- package/dist/plugins/pipelines/factiii/index.d.ts +195 -0
- package/dist/plugins/pipelines/factiii/index.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/index.js +862 -0
- package/dist/plugins/pipelines/factiii/index.js.map +1 -0
- package/dist/plugins/pipelines/factiii/prod.d.ts +17 -0
- package/dist/plugins/pipelines/factiii/prod.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/prod.js +282 -0
- package/dist/plugins/pipelines/factiii/prod.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.js +80 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.js +43 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.js +237 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.js +169 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.js.map +1 -0
- package/dist/plugins/pipelines/factiii/staging.d.ts +25 -0
- package/dist/plugins/pipelines/factiii/staging.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/staging.js +223 -0
- package/dist/plugins/pipelines/factiii/staging.js.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/detection.d.ts +36 -0
- package/dist/plugins/pipelines/factiii/utils/detection.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/detection.js +140 -0
- package/dist/plugins/pipelines/factiii/utils/detection.js.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.d.ts +16 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.js +129 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.js.map +1 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-cicd-prod.yml +112 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-cicd-staging.yml +112 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-command.yml +130 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-deploy.yml +198 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-dev-sync.yml +179 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-fix.yml +176 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-scan.yml +176 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-undeploy.yml +95 -0
- package/dist/plugins/servers/amazon-linux/index.d.ts +93 -0
- package/dist/plugins/servers/amazon-linux/index.d.ts.map +1 -0
- package/dist/plugins/servers/amazon-linux/index.js +217 -0
- package/dist/plugins/servers/amazon-linux/index.js.map +1 -0
- package/dist/plugins/servers/mac/dev.d.ts +10 -0
- package/dist/plugins/servers/mac/dev.d.ts.map +1 -0
- package/dist/plugins/servers/mac/dev.js +71 -0
- package/dist/plugins/servers/mac/dev.js.map +1 -0
- package/dist/plugins/servers/mac/index.d.ts +101 -0
- package/dist/plugins/servers/mac/index.d.ts.map +1 -0
- package/dist/plugins/servers/mac/index.js +257 -0
- package/dist/plugins/servers/mac/index.js.map +1 -0
- package/dist/plugins/servers/mac/scanfix/config.d.ts +7 -0
- package/dist/plugins/servers/mac/scanfix/config.d.ts.map +1 -0
- package/dist/plugins/servers/mac/scanfix/config.js +168 -0
- package/dist/plugins/servers/mac/scanfix/config.js.map +1 -0
- package/dist/plugins/servers/mac/scanfix/containers.d.ts +7 -0
- package/dist/plugins/servers/mac/scanfix/containers.d.ts.map +1 -0
- package/dist/plugins/servers/mac/scanfix/containers.js +167 -0
- package/dist/plugins/servers/mac/scanfix/containers.js.map +1 -0
- package/dist/plugins/servers/mac/scanfix/system.d.ts +7 -0
- package/dist/plugins/servers/mac/scanfix/system.d.ts.map +1 -0
- package/dist/plugins/servers/mac/scanfix/system.js +144 -0
- package/dist/plugins/servers/mac/scanfix/system.js.map +1 -0
- package/dist/plugins/servers/mac/staging.d.ts +21 -0
- package/dist/plugins/servers/mac/staging.d.ts.map +1 -0
- package/dist/plugins/servers/mac/staging.js +708 -0
- package/dist/plugins/servers/mac/staging.js.map +1 -0
- package/dist/plugins/servers/ubuntu/index.d.ts +93 -0
- package/dist/plugins/servers/ubuntu/index.d.ts.map +1 -0
- package/dist/plugins/servers/ubuntu/index.js +224 -0
- package/dist/plugins/servers/ubuntu/index.js.map +1 -0
- package/dist/plugins/servers/windows/index.d.ts +90 -0
- package/dist/plugins/servers/windows/index.d.ts.map +1 -0
- package/dist/plugins/servers/windows/index.js +205 -0
- package/dist/plugins/servers/windows/index.js.map +1 -0
- package/dist/scanfix/commands/index.d.ts +27 -0
- package/dist/scanfix/commands/index.d.ts.map +1 -0
- package/dist/scanfix/commands/index.js +97 -0
- package/dist/scanfix/commands/index.js.map +1 -0
- package/dist/scanfix/commands/mac.d.ts +11 -0
- package/dist/scanfix/commands/mac.d.ts.map +1 -0
- package/dist/scanfix/commands/mac.js +31 -0
- package/dist/scanfix/commands/mac.js.map +1 -0
- package/dist/scanfix/commands/ubuntu.d.ts +11 -0
- package/dist/scanfix/commands/ubuntu.d.ts.map +1 -0
- package/dist/scanfix/commands/ubuntu.js +30 -0
- package/dist/scanfix/commands/ubuntu.js.map +1 -0
- package/dist/scanfix/fixes/certbot.d.ts +25 -0
- package/dist/scanfix/fixes/certbot.d.ts.map +1 -0
- package/dist/scanfix/fixes/certbot.js +136 -0
- package/dist/scanfix/fixes/certbot.js.map +1 -0
- package/dist/scanfix/fixes/docker.d.ts +29 -0
- package/dist/scanfix/fixes/docker.d.ts.map +1 -0
- package/dist/scanfix/fixes/docker.js +149 -0
- package/dist/scanfix/fixes/docker.js.map +1 -0
- package/dist/scanfix/fixes/git.d.ts +20 -0
- package/dist/scanfix/fixes/git.d.ts.map +1 -0
- package/dist/scanfix/fixes/git.js +71 -0
- package/dist/scanfix/fixes/git.js.map +1 -0
- package/dist/scanfix/fixes/index.d.ts +11 -0
- package/dist/scanfix/fixes/index.d.ts.map +1 -0
- package/dist/scanfix/fixes/index.js +27 -0
- package/dist/scanfix/fixes/index.js.map +1 -0
- package/dist/scanfix/fixes/node.d.ts +20 -0
- package/dist/scanfix/fixes/node.d.ts.map +1 -0
- package/dist/scanfix/fixes/node.js +71 -0
- package/dist/scanfix/fixes/node.js.map +1 -0
- package/dist/scanfix/fixes/pnpm.d.ts +20 -0
- package/dist/scanfix/fixes/pnpm.d.ts.map +1 -0
- package/dist/scanfix/fixes/pnpm.js +122 -0
- package/dist/scanfix/fixes/pnpm.js.map +1 -0
- package/dist/scanfix/index.d.ts +23 -0
- package/dist/scanfix/index.d.ts.map +1 -0
- package/dist/scanfix/index.js +44 -0
- package/dist/scanfix/index.js.map +1 -0
- package/dist/scanfix/platform.d.ts +20 -0
- package/dist/scanfix/platform.d.ts.map +1 -0
- package/dist/scanfix/platform.js +48 -0
- package/dist/scanfix/platform.js.map +1 -0
- package/dist/scanfix/ssl-cert-helper.d.ts +27 -0
- package/dist/scanfix/ssl-cert-helper.d.ts.map +1 -0
- package/dist/scanfix/ssl-cert-helper.js +117 -0
- package/dist/scanfix/ssl-cert-helper.js.map +1 -0
- package/dist/scanfix/types.d.ts +27 -0
- package/dist/scanfix/types.d.ts.map +1 -0
- package/dist/scanfix/types.js +8 -0
- package/dist/scanfix/types.js.map +1 -0
- package/dist/scripts/check-existing-secrets.d.ts +6 -0
- package/dist/scripts/check-existing-secrets.d.ts.map +1 -0
- package/dist/scripts/check-existing-secrets.js +86 -0
- package/dist/scripts/check-existing-secrets.js.map +1 -0
- package/dist/scripts/generate-all.d.ts +40 -0
- package/dist/scripts/generate-all.d.ts.map +1 -0
- package/dist/scripts/generate-all.js +373 -0
- package/dist/scripts/generate-all.js.map +1 -0
- package/dist/scripts/get-repo-name.d.ts +6 -0
- package/dist/scripts/get-repo-name.d.ts.map +1 -0
- package/dist/scripts/get-repo-name.js +54 -0
- package/dist/scripts/get-repo-name.js.map +1 -0
- package/dist/scripts/index.d.ts +7 -0
- package/dist/scripts/index.d.ts.map +1 -0
- package/dist/scripts/index.js +14 -0
- package/dist/scripts/index.js.map +1 -0
- package/dist/scripts/validate-env-files.d.ts +6 -0
- package/dist/scripts/validate-env-files.d.ts.map +1 -0
- package/dist/scripts/validate-env-files.js +126 -0
- package/dist/scripts/validate-env-files.js.map +1 -0
- package/dist/scripts/validate-example-values.d.ts +8 -0
- package/dist/scripts/validate-example-values.d.ts.map +1 -0
- package/dist/scripts/validate-example-values.js +88 -0
- package/dist/scripts/validate-example-values.js.map +1 -0
- package/dist/scripts/validate-factiii-yml.d.ts +6 -0
- package/dist/scripts/validate-factiii-yml.d.ts.map +1 -0
- package/dist/scripts/validate-factiii-yml.js +71 -0
- package/dist/scripts/validate-factiii-yml.js.map +1 -0
- package/dist/types/cli.d.ts +138 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +8 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/config.d.ts +113 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +8 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/plugin.d.ts +352 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +8 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/utils/ansible-vault-secrets.d.ts +95 -0
- package/dist/utils/ansible-vault-secrets.d.ts.map +1 -0
- package/dist/utils/ansible-vault-secrets.js +406 -0
- package/dist/utils/ansible-vault-secrets.js.map +1 -0
- package/dist/utils/config-helpers.d.ts +72 -0
- package/dist/utils/config-helpers.d.ts.map +1 -0
- package/dist/utils/config-helpers.js +171 -0
- package/dist/utils/config-helpers.js.map +1 -0
- package/dist/utils/config-schema.d.ts +17 -0
- package/dist/utils/config-schema.d.ts.map +1 -0
- package/dist/utils/config-schema.js +100 -0
- package/dist/utils/config-schema.js.map +1 -0
- package/dist/utils/config-validator.d.ts +29 -0
- package/dist/utils/config-validator.d.ts.map +1 -0
- package/dist/utils/config-validator.js +146 -0
- package/dist/utils/config-validator.js.map +1 -0
- package/dist/utils/deployment-report.d.ts +100 -0
- package/dist/utils/deployment-report.d.ts.map +1 -0
- package/dist/utils/deployment-report.js +225 -0
- package/dist/utils/deployment-report.js.map +1 -0
- package/dist/utils/dns-validator.d.ts +19 -0
- package/dist/utils/dns-validator.d.ts.map +1 -0
- package/dist/utils/dns-validator.js +94 -0
- package/dist/utils/dns-validator.js.map +1 -0
- package/dist/utils/env-validator.d.ts +108 -0
- package/dist/utils/env-validator.d.ts.map +1 -0
- package/dist/utils/env-validator.js +342 -0
- package/dist/utils/env-validator.js.map +1 -0
- package/dist/utils/github-workflow-monitor.d.ts +49 -0
- package/dist/utils/github-workflow-monitor.d.ts.map +1 -0
- package/dist/utils/github-workflow-monitor.js +145 -0
- package/dist/utils/github-workflow-monitor.js.map +1 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +48 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/secret-prompts.d.ts +67 -0
- package/dist/utils/secret-prompts.d.ts.map +1 -0
- package/dist/utils/secret-prompts.js +369 -0
- package/dist/utils/secret-prompts.js.map +1 -0
- package/dist/utils/server-check.d.ts +43 -0
- package/dist/utils/server-check.d.ts.map +1 -0
- package/dist/utils/server-check.js +397 -0
- package/dist/utils/server-check.js.map +1 -0
- package/dist/utils/ssh-deploy.d.ts +70 -0
- package/dist/utils/ssh-deploy.d.ts.map +1 -0
- package/dist/utils/ssh-deploy.js +268 -0
- package/dist/utils/ssh-deploy.js.map +1 -0
- package/dist/utils/ssh-helper.d.ts +40 -0
- package/dist/utils/ssh-helper.d.ts.map +1 -0
- package/dist/utils/ssh-helper.js +221 -0
- package/dist/utils/ssh-helper.js.map +1 -0
- package/dist/utils/template-generator.d.ts +42 -0
- package/dist/utils/template-generator.d.ts.map +1 -0
- package/dist/utils/template-generator.js +223 -0
- package/dist/utils/template-generator.js.map +1 -0
- package/dist/utils/version-check.d.ts +69 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +211 -0
- package/dist/utils/version-check.js.map +1 -0
- package/package.json +82 -0
package/README.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# Factiii Stack
|
|
2
|
+
|
|
3
|
+
Infrastructure management CLI for deploying full-stack applications with plugin-based configuration.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install in your project
|
|
9
|
+
npm install @factiii/stack
|
|
10
|
+
|
|
11
|
+
# Initialize configuration (run this first!)
|
|
12
|
+
npx factiii init
|
|
13
|
+
|
|
14
|
+
# This creates:
|
|
15
|
+
# - factiii.yml (user-editable config)
|
|
16
|
+
# - factiiiAuto.yml (auto-detected config)
|
|
17
|
+
# - .github/workflows/ (CI/CD workflows)
|
|
18
|
+
|
|
19
|
+
# Edit factiii.yml to replace EXAMPLE- values
|
|
20
|
+
# Then run:
|
|
21
|
+
npx factiii scan # Check for issues
|
|
22
|
+
npx factiii fix # Auto-fix issues
|
|
23
|
+
npx factiii deploy --staging # Deploy to staging
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## How It Works
|
|
27
|
+
|
|
28
|
+
Factiii Stack uses a **plugin-based architecture** where each plugin:
|
|
29
|
+
1. Defines its own configuration schema
|
|
30
|
+
2. Auto-detects project settings
|
|
31
|
+
3. Validates and fixes issues
|
|
32
|
+
4. Handles deployment for its domain
|
|
33
|
+
|
|
34
|
+
### The Two Config Files
|
|
35
|
+
|
|
36
|
+
**`factiii.yml`** - User-Editable Configuration
|
|
37
|
+
```yaml
|
|
38
|
+
name: my-app
|
|
39
|
+
|
|
40
|
+
# Environment configurations
|
|
41
|
+
staging:
|
|
42
|
+
domain: staging.myapp.com
|
|
43
|
+
server: mac # OS type: mac, ubuntu, windows, amazon-linux
|
|
44
|
+
server_mode: true # Enable server hardening (default: true)
|
|
45
|
+
|
|
46
|
+
prod:
|
|
47
|
+
domain: myapp.com
|
|
48
|
+
server: ubuntu # OS type for production
|
|
49
|
+
pipeline: aws # Use AWS pipeline for deployment
|
|
50
|
+
config: free-tier # AWS tier: ec2, free-tier, standard, enterprise
|
|
51
|
+
access_key_id: AKIAXXXXXXXX
|
|
52
|
+
region: us-east-1
|
|
53
|
+
|
|
54
|
+
prisma:
|
|
55
|
+
schema_path: null # Optional override
|
|
56
|
+
version: null # Optional override
|
|
57
|
+
|
|
58
|
+
# Exclude Docker containers from unmanaged container cleanup
|
|
59
|
+
container_exclusions:
|
|
60
|
+
- factiii_postgres
|
|
61
|
+
- legacy_container
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**`factiiiAuto.yml`** - Auto-Detected Configuration
|
|
65
|
+
```yaml
|
|
66
|
+
# Auto-detected by plugins
|
|
67
|
+
factiii_version: 1.0.0
|
|
68
|
+
has_prisma: true
|
|
69
|
+
has_trpc: true
|
|
70
|
+
prisma_schema: prisma/schema.prisma
|
|
71
|
+
prisma_version: 5.0.0
|
|
72
|
+
ssh_user: ubuntu
|
|
73
|
+
dockerfile: Dockerfile
|
|
74
|
+
package_manager: pnpm
|
|
75
|
+
node_version: 20
|
|
76
|
+
pnpm_version: 9
|
|
77
|
+
aws_cli_installed: true
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## CLI Commands
|
|
81
|
+
|
|
82
|
+
### Init (Run This First!)
|
|
83
|
+
|
|
84
|
+
Scans your project and generates configuration files:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx factiii init # Initialize Factiii Stack
|
|
88
|
+
npx factiii init --force # Regenerate configs
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**What it does:**
|
|
92
|
+
- Detects which plugins are relevant to your project
|
|
93
|
+
- Generates `factiii.yml` with only relevant sections
|
|
94
|
+
- Generates `factiiiAuto.yml` with auto-detected values
|
|
95
|
+
- Creates GitHub Actions workflows
|
|
96
|
+
|
|
97
|
+
### Scan
|
|
98
|
+
|
|
99
|
+
Checks all environments for issues:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx factiii scan # Scan all (dev, secrets, staging, prod)
|
|
103
|
+
npx factiii scan --dev # Scan dev only
|
|
104
|
+
npx factiii scan --staging # Scan staging only
|
|
105
|
+
npx factiii scan --prod # Scan prod only
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Note:** Requires `factiii.yml` to exist. Run `npx factiii init` first.
|
|
109
|
+
|
|
110
|
+
### Fix
|
|
111
|
+
|
|
112
|
+
Automatically fixes issues where possible:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npx factiii fix # Fix all environments
|
|
116
|
+
npx factiii fix --dev # Fix dev only
|
|
117
|
+
npx factiii fix --staging # Fix staging only
|
|
118
|
+
npx factiii fix --prod # Fix prod only
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Note:** Requires `factiii.yml` to exist. Run `npx factiii init` first.
|
|
122
|
+
|
|
123
|
+
### Deploy
|
|
124
|
+
|
|
125
|
+
Deploys to environments (runs scan first, aborts on issues):
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npx factiii deploy --dev # Start local dev containers
|
|
129
|
+
npx factiii deploy --staging # Deploy to staging server
|
|
130
|
+
npx factiii deploy --prod # Deploy to production server
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Note:** Requires `factiii.yml` to exist. Run `npx factiii init` first.
|
|
134
|
+
|
|
135
|
+
### Secrets Management
|
|
136
|
+
|
|
137
|
+
Manage secrets via Ansible Vault and deploy them directly to servers:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# List all secrets (SSH keys + environment variables)
|
|
141
|
+
npx factiii secrets list
|
|
142
|
+
|
|
143
|
+
# Set SSH keys (required for deployment)
|
|
144
|
+
npx factiii secrets set STAGING_SSH
|
|
145
|
+
npx factiii secrets set PROD_SSH
|
|
146
|
+
|
|
147
|
+
# Set environment variables for each stage
|
|
148
|
+
npx factiii secrets set-env DATABASE_URL --staging
|
|
149
|
+
npx factiii secrets set-env JWT_SECRET --staging
|
|
150
|
+
npx factiii secrets set-env DATABASE_URL --prod
|
|
151
|
+
npx factiii secrets set-env JWT_SECRET --prod
|
|
152
|
+
|
|
153
|
+
# List environment variables
|
|
154
|
+
npx factiii secrets list-env --staging
|
|
155
|
+
npx factiii secrets list-env --prod
|
|
156
|
+
|
|
157
|
+
# Deploy secrets to servers via SSH
|
|
158
|
+
npx factiii secrets deploy --staging # Deploy to staging server
|
|
159
|
+
npx factiii secrets deploy --prod # Deploy to production server
|
|
160
|
+
npx factiii secrets deploy --all # Deploy to all servers
|
|
161
|
+
|
|
162
|
+
# Options
|
|
163
|
+
npx factiii secrets deploy --staging --restart # Restart container after deploy
|
|
164
|
+
npx factiii secrets deploy --staging --dry-run # Show what would be deployed
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**How it works:**
|
|
168
|
+
1. Secrets are stored locally in Ansible Vault (encrypted)
|
|
169
|
+
2. When you run `secrets deploy`, Factiii:
|
|
170
|
+
- Reads the SSH key from the vault
|
|
171
|
+
- Connects to the server via SSH
|
|
172
|
+
- Writes a `.env.{stage}` file with your environment variables
|
|
173
|
+
3. Your application reads the `.env.{stage}` file on startup
|
|
174
|
+
|
|
175
|
+
**Note:** Requires `factiii.yml` with Ansible Vault configured. Run `npx factiii init` first.
|
|
176
|
+
|
|
177
|
+
## Stage Execution
|
|
178
|
+
|
|
179
|
+
Factiii commands work with four stages: `dev`, `secrets`, `staging`, `prod`.
|
|
180
|
+
|
|
181
|
+
### Running Commands
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npx factiii scan # Scan all reachable stages
|
|
185
|
+
npx factiii scan --dev # Scan only dev stage
|
|
186
|
+
npx factiii scan --staging # Scan only staging stage
|
|
187
|
+
|
|
188
|
+
npx factiii fix # Fix all reachable stages
|
|
189
|
+
npx factiii fix --staging # Fix only staging stage
|
|
190
|
+
|
|
191
|
+
npx factiii deploy --staging # Deploy to staging
|
|
192
|
+
npx factiii deploy --prod # Deploy to prod
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### How Stages Are Reached
|
|
196
|
+
|
|
197
|
+
The pipeline plugin decides how to reach each stage:
|
|
198
|
+
|
|
199
|
+
| Stage | How it's reached |
|
|
200
|
+
|-------|------------------|
|
|
201
|
+
| dev | Always runs locally |
|
|
202
|
+
| secrets | Runs locally (needs Ansible Vault configured) |
|
|
203
|
+
| staging | Via workflow → SSH → runs with `--staging` |
|
|
204
|
+
| prod | Via workflow → SSH → runs with `--prod` |
|
|
205
|
+
|
|
206
|
+
### For Pipeline Plugin Authors
|
|
207
|
+
|
|
208
|
+
When your CI/CD workflow SSHs to a server to run commands, you **MUST** specify the stage:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# In your workflow, after SSH to staging server:
|
|
212
|
+
GITHUB_ACTIONS=true npx factiii fix --staging # ✅ Correct
|
|
213
|
+
npx factiii fix # ❌ Wrong - will try to run all stages
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
This prevents the command from trying to reach stages it can't access from the server.
|
|
217
|
+
|
|
218
|
+
See [STANDARDS.md](STANDARDS.md) for full documentation of the stage execution pattern.
|
|
219
|
+
|
|
220
|
+
## Plugin Architecture
|
|
221
|
+
|
|
222
|
+
### Built-in Plugins
|
|
223
|
+
|
|
224
|
+
**Pipelines**
|
|
225
|
+
- `factiii` - GitHub Actions CI/CD with thin workflows
|
|
226
|
+
- `aws` - AWS infrastructure (EC2, ECR, free-tier configs)
|
|
227
|
+
|
|
228
|
+
**Servers (OS Types)**
|
|
229
|
+
- `mac` - macOS (Homebrew, launchctl)
|
|
230
|
+
- `ubuntu` - Ubuntu Linux (apt, systemd)
|
|
231
|
+
- `windows` - Windows Server (Chocolatey) - template
|
|
232
|
+
- `amazon-linux` - Amazon Linux 2023 (dnf, systemd)
|
|
233
|
+
|
|
234
|
+
**Frameworks**
|
|
235
|
+
- `prisma-trpc` - Prisma database + tRPC API
|
|
236
|
+
|
|
237
|
+
**Addons**
|
|
238
|
+
- `server-mode` - Configure machines as deployment servers (disable sleep, enable SSH, etc.)
|
|
239
|
+
|
|
240
|
+
### How Plugins Work
|
|
241
|
+
|
|
242
|
+
Each plugin defines:
|
|
243
|
+
|
|
244
|
+
```javascript
|
|
245
|
+
class MyPlugin {
|
|
246
|
+
static id = 'my-plugin';
|
|
247
|
+
static category = 'framework'; // or: pipeline, server, addon
|
|
248
|
+
|
|
249
|
+
// Schema for factiii.yml (user-editable)
|
|
250
|
+
static configSchema = {
|
|
251
|
+
my_plugin: {
|
|
252
|
+
setting: 'default-value'
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// Schema for factiiiAuto.yml (auto-detected)
|
|
257
|
+
static autoConfigSchema = {
|
|
258
|
+
has_my_plugin: 'boolean',
|
|
259
|
+
my_plugin_version: 'string'
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// Auto-detect configuration
|
|
263
|
+
static async detectConfig(rootDir) {
|
|
264
|
+
return {
|
|
265
|
+
has_my_plugin: true,
|
|
266
|
+
my_plugin_version: '1.0.0'
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Fixes array - issues this plugin can detect and resolve
|
|
271
|
+
static fixes = [
|
|
272
|
+
{
|
|
273
|
+
id: 'missing-config',
|
|
274
|
+
stage: 'dev',
|
|
275
|
+
severity: 'critical',
|
|
276
|
+
description: 'Configuration missing',
|
|
277
|
+
scan: async (config, rootDir) => {
|
|
278
|
+
// Return true if problem exists
|
|
279
|
+
return !config.my_plugin;
|
|
280
|
+
},
|
|
281
|
+
fix: async (config, rootDir) => {
|
|
282
|
+
// Auto-fix the problem
|
|
283
|
+
return true;
|
|
284
|
+
},
|
|
285
|
+
manualFix: 'Add my_plugin config to factiii.yml'
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
|
|
289
|
+
// Deploy method
|
|
290
|
+
async deploy(config, environment) {
|
|
291
|
+
// Handle deployment for this environment
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Thin Workflows
|
|
297
|
+
|
|
298
|
+
GitHub Actions workflows are intentionally minimal - they just SSH into servers and call the CLI:
|
|
299
|
+
|
|
300
|
+
```yaml
|
|
301
|
+
# .github/workflows/factiii-staging.yml
|
|
302
|
+
- name: Deploy via CLI
|
|
303
|
+
run: |
|
|
304
|
+
ssh user@host << EOF
|
|
305
|
+
cd ~/.factiii/my-app
|
|
306
|
+
git pull
|
|
307
|
+
GITHUB_ACTIONS=true npx factiii deploy --staging
|
|
308
|
+
EOF
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**CRITICAL: Workflows MUST specify the stage flag (`--staging` or `--prod`) when running commands on servers.**
|
|
312
|
+
|
|
313
|
+
All deployment logic runs on the server in testable JavaScript, not in workflow bash scripts.
|
|
314
|
+
|
|
315
|
+
## Secrets Management
|
|
316
|
+
|
|
317
|
+
Factiii uses **Ansible Vault** to store and manage deployment secrets (SSH keys, API keys, etc.).
|
|
318
|
+
|
|
319
|
+
### Configuration
|
|
320
|
+
|
|
321
|
+
Add Ansible Vault configuration to `factiii.yml`:
|
|
322
|
+
|
|
323
|
+
```yaml
|
|
324
|
+
# Ansible Vault configuration (for secrets)
|
|
325
|
+
ansible:
|
|
326
|
+
vault_path: group_vars/all/vault.yml # Path to vault file
|
|
327
|
+
vault_password_file: ~/.vault_pass # Optional: path to password file
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Vault Password
|
|
331
|
+
|
|
332
|
+
Provide the vault password via one of:
|
|
333
|
+
- **Password file:** Set `ansible.vault_password_file` in `factiii.yml` (e.g. `~/.vault_pass`)
|
|
334
|
+
- **Environment variable:** `ANSIBLE_VAULT_PASSWORD` or `ANSIBLE_VAULT_PASSWORD_FILE`
|
|
335
|
+
|
|
336
|
+
**Security:** Never commit the vault password or decrypted vault file to git.
|
|
337
|
+
|
|
338
|
+
### Managing Secrets
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# List all secrets
|
|
342
|
+
npx factiii secrets list
|
|
343
|
+
|
|
344
|
+
# Set a secret (interactive prompt)
|
|
345
|
+
npx factiii secrets set STAGING_SSH
|
|
346
|
+
|
|
347
|
+
# Set a secret (non-interactive)
|
|
348
|
+
npx factiii secrets set STAGING_SSH --value "your-key-here"
|
|
349
|
+
|
|
350
|
+
# Check if secrets exist
|
|
351
|
+
npx factiii secrets check
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Required Secrets
|
|
355
|
+
|
|
356
|
+
- **STAGING_SSH** - SSH private key for staging server
|
|
357
|
+
- **PROD_SSH** - SSH private key for production server
|
|
358
|
+
- **AWS_SECRET_ACCESS_KEY** - AWS secret key (if using AWS pipeline)
|
|
359
|
+
|
|
360
|
+
### CI/CD Integration
|
|
361
|
+
|
|
362
|
+
In GitHub Actions workflows, provide the vault password as a GitHub secret:
|
|
363
|
+
|
|
364
|
+
1. Add `ANSIBLE_VAULT_PASSWORD` to your repository secrets
|
|
365
|
+
2. Workflows automatically load SSH keys from Ansible Vault using this password
|
|
366
|
+
|
|
367
|
+
The workflow step `npx factiii secrets write-ssh-keys` extracts secrets from the vault and writes SSH keys to `~/.ssh/` for deployment steps.
|
|
368
|
+
|
|
369
|
+
## Environment Variables
|
|
370
|
+
|
|
371
|
+
Plugins declare required environment variables:
|
|
372
|
+
|
|
373
|
+
```javascript
|
|
374
|
+
class MyPlugin {
|
|
375
|
+
static requiredEnvVars = ['DATABASE_URL', 'API_KEY'];
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
These are automatically validated against:
|
|
380
|
+
- `.env.example` (template, committed to git)
|
|
381
|
+
- `.env` (local dev, gitignored, auto-created from example)
|
|
382
|
+
- `.env.staging` (staging values, user creates)
|
|
383
|
+
- `.env.prod` (production values, user creates)
|
|
384
|
+
|
|
385
|
+
## AWS Configuration Bundles
|
|
386
|
+
|
|
387
|
+
The AWS plugin supports multiple configuration bundles:
|
|
388
|
+
|
|
389
|
+
```yaml
|
|
390
|
+
# factiii.yml
|
|
391
|
+
aws:
|
|
392
|
+
config: free-tier # Choose your bundle
|
|
393
|
+
region: us-east-1
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
**Available Bundles:**
|
|
397
|
+
- `ec2` - Basic EC2 instance
|
|
398
|
+
- `free-tier` - Complete free tier (EC2 + RDS + S3 + ECR)
|
|
399
|
+
- `standard` - Production-ready setup (coming soon)
|
|
400
|
+
- `enterprise` - HA, multi-AZ, auto-scaling (coming soon)
|
|
401
|
+
|
|
402
|
+
## External Plugins
|
|
403
|
+
|
|
404
|
+
Install external plugins via npm:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
npm install @factiii/stack-plugin-nextjs
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Factiii automatically loads plugins from `node_modules` that match:
|
|
411
|
+
- `@factiii/stack-plugin-*`
|
|
412
|
+
- Listed in `factiii.yml` under `plugins`
|
|
413
|
+
|
|
414
|
+
## Development
|
|
415
|
+
|
|
416
|
+
See [STANDARDS.md](STANDARDS.md) for plugin development guide.
|
|
417
|
+
|
|
418
|
+
## License
|
|
419
|
+
|
|
420
|
+
MIT
|
package/bin/factiii
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Import plugin command registration
|
|
7
|
+
const { registerPluginCommands } = require('../dist/cli/plugin-commands');
|
|
8
|
+
|
|
9
|
+
// Import CLI commands from compiled TypeScript
|
|
10
|
+
const { init } = require('../dist/cli/init');
|
|
11
|
+
const { scan } = require('../dist/cli/scan');
|
|
12
|
+
const { fix } = require('../dist/cli/fix');
|
|
13
|
+
const { deploy } = require('../dist/cli/deploy');
|
|
14
|
+
const { undeploy } = require('../dist/cli/undeploy');
|
|
15
|
+
const { secrets } = require('../dist/cli/secrets');
|
|
16
|
+
const { upgrade } = require('../dist/cli/upgrade');
|
|
17
|
+
const { validate } = require('../dist/cli/validate');
|
|
18
|
+
const { checkConfig } = require('../dist/cli/check-config');
|
|
19
|
+
const { devSync } = require('../dist/cli/dev-sync');
|
|
20
|
+
|
|
21
|
+
// Read version from package.json
|
|
22
|
+
const packageJson = require('../package.json');
|
|
23
|
+
|
|
24
|
+
program
|
|
25
|
+
.name('factiii')
|
|
26
|
+
.description('Factiii Stack - Infrastructure management CLI')
|
|
27
|
+
.version(packageJson.version);
|
|
28
|
+
|
|
29
|
+
// Init command (primary setup command)
|
|
30
|
+
program
|
|
31
|
+
.command('init')
|
|
32
|
+
.description('Initialize Factiii Stack in your project (run this first)')
|
|
33
|
+
.option('-f, --force', 'Overwrite existing config files')
|
|
34
|
+
.action(async (options) => {
|
|
35
|
+
await init(options);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Default action: show help when no subcommand provided
|
|
39
|
+
program
|
|
40
|
+
.action((options, command) => {
|
|
41
|
+
if (command.args.length === 0) {
|
|
42
|
+
program.help();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Scan command (explicit)
|
|
47
|
+
program
|
|
48
|
+
.command('scan')
|
|
49
|
+
.description('Scan all environments for issues')
|
|
50
|
+
.option('--dev', 'Scan dev environment only')
|
|
51
|
+
.option('--staging', 'Scan staging environment only')
|
|
52
|
+
.option('--prod', 'Scan production environment only')
|
|
53
|
+
.option('--secrets', 'Scan secrets only')
|
|
54
|
+
.option('--commit <hash>', 'Commit hash to verify (for deployment verification)')
|
|
55
|
+
.action(async (options) => {
|
|
56
|
+
await scan(options);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Fix command
|
|
60
|
+
program
|
|
61
|
+
.command('fix')
|
|
62
|
+
.description('Fix all environments including uploading secrets to GitHub and installing server dependencies')
|
|
63
|
+
.option('--dev', 'Fix dev environment only')
|
|
64
|
+
.option('--staging', 'Fix staging environment only')
|
|
65
|
+
.option('--prod', 'Fix production environment only')
|
|
66
|
+
.option('--secrets', 'Fix secrets only')
|
|
67
|
+
.option('--token <token>', 'GitHub token (or set GITHUB_TOKEN env var)')
|
|
68
|
+
.option('--continue-on-error', 'Continue even if some fixes fail')
|
|
69
|
+
.action(async (options) => {
|
|
70
|
+
await fix(options);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Deploy command
|
|
74
|
+
program
|
|
75
|
+
.command('deploy')
|
|
76
|
+
.description('Deploy to environments (runs scan first, aborts on issues)')
|
|
77
|
+
.option('--dev', 'Deploy dev environment only (local containers)')
|
|
78
|
+
.option('--staging', 'Deploy staging environment only')
|
|
79
|
+
.option('--prod', 'Deploy production environment only')
|
|
80
|
+
.option('-e, --environment <env>', 'Environment (staging|prod)')
|
|
81
|
+
.option('-b, --branch <branch>', 'Branch to deploy from (defaults to current branch)')
|
|
82
|
+
.option('--commit <hash>', 'Commit hash to deploy (passed by workflow)')
|
|
83
|
+
.option('--token <token>', 'GitHub token (or set GITHUB_TOKEN env var)')
|
|
84
|
+
.option('--secrets', 'Deploy secrets from Ansible Vault before deploying')
|
|
85
|
+
.option('--dry-run', 'Show deployment plan without actually deploying')
|
|
86
|
+
.action(async (options) => {
|
|
87
|
+
// Determine which environment to deploy
|
|
88
|
+
let environment = options.environment;
|
|
89
|
+
if (options.dev) environment = 'dev';
|
|
90
|
+
if (options.staging) environment = 'staging';
|
|
91
|
+
if (options.prod) environment = 'prod';
|
|
92
|
+
|
|
93
|
+
if (!environment) {
|
|
94
|
+
console.log('Please specify an environment: --dev, --staging, or --prod');
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Map --secrets CLI flag to deploySecrets option
|
|
99
|
+
if (options.secrets) {
|
|
100
|
+
options.deploySecrets = true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const result = await deploy(environment, options);
|
|
104
|
+
if (!result.success) {
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Undeploy command
|
|
110
|
+
program
|
|
111
|
+
.command('undeploy')
|
|
112
|
+
.description('Remove deployment from servers')
|
|
113
|
+
.option('--dev', 'Undeploy dev environment only')
|
|
114
|
+
.option('--staging', 'Undeploy staging environment only')
|
|
115
|
+
.option('--prod', 'Undeploy production environment only')
|
|
116
|
+
.option('-e, --environment <env>', 'Environment (staging|prod|all)', 'all')
|
|
117
|
+
.action(async (options) => {
|
|
118
|
+
// Determine which environment to undeploy
|
|
119
|
+
let environment = options.environment;
|
|
120
|
+
if (options.dev) environment = 'dev';
|
|
121
|
+
if (options.staging) environment = 'staging';
|
|
122
|
+
if (options.prod) environment = 'prod';
|
|
123
|
+
|
|
124
|
+
await undeploy(environment, options);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Generate workflows command
|
|
128
|
+
program
|
|
129
|
+
.command('generate-workflows')
|
|
130
|
+
.description('Generate GitHub workflow files')
|
|
131
|
+
.option('-o, --output <dir>', 'Output directory', '.github/workflows')
|
|
132
|
+
.action(async (options) => {
|
|
133
|
+
const FactiiiPipeline = require('../dist/plugins/pipelines/factiii').default;
|
|
134
|
+
await FactiiiPipeline.generateWorkflows(process.cwd());
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Secrets command
|
|
138
|
+
program
|
|
139
|
+
.command('secrets [action] [name]')
|
|
140
|
+
.description('Manage secrets and deploy to servers')
|
|
141
|
+
.option('--value <value>', 'Secret value (for scripting)')
|
|
142
|
+
.option('--staging', 'Target staging environment')
|
|
143
|
+
.option('--prod', 'Target production environment')
|
|
144
|
+
.option('--restart', 'Restart containers after deploying secrets')
|
|
145
|
+
.option('--dry-run', 'Show what would be deployed without deploying')
|
|
146
|
+
.option('--token <token>', 'GitHub token (or use GITHUB_TOKEN env var)')
|
|
147
|
+
.action(async (action, name, options) => {
|
|
148
|
+
// Valid actions for secrets command
|
|
149
|
+
const validActions = ['list', 'set', 'check', 'set-env', 'list-env', 'deploy', 'write-ssh-keys'];
|
|
150
|
+
|
|
151
|
+
if (!action || !validActions.includes(action)) {
|
|
152
|
+
// Show help if no valid action provided
|
|
153
|
+
console.log('');
|
|
154
|
+
console.log('Usage: npx factiii secrets <action> [name] [options]');
|
|
155
|
+
console.log('');
|
|
156
|
+
console.log('Actions:');
|
|
157
|
+
console.log(' list List all secrets (SSH keys + env vars)');
|
|
158
|
+
console.log(' set <name> Set a secret (STAGING_SSH, PROD_SSH, etc.)');
|
|
159
|
+
console.log(' check [name] Check if secrets exist');
|
|
160
|
+
console.log(' set-env <name> Set environment variable for a stage');
|
|
161
|
+
console.log(' list-env List environment variable keys for a stage');
|
|
162
|
+
console.log(' deploy Deploy secrets to staging/prod servers');
|
|
163
|
+
console.log(' write-ssh-keys Write SSH keys to ~/.ssh/ (for workflows)');
|
|
164
|
+
console.log('');
|
|
165
|
+
console.log('Examples:');
|
|
166
|
+
console.log(' npx factiii secrets list');
|
|
167
|
+
console.log(' npx factiii secrets set STAGING_SSH');
|
|
168
|
+
console.log(' npx factiii secrets set-env DATABASE_URL --staging');
|
|
169
|
+
console.log(' npx factiii secrets list-env --staging');
|
|
170
|
+
console.log(' npx factiii secrets deploy --staging');
|
|
171
|
+
console.log(' npx factiii secrets deploy --all');
|
|
172
|
+
console.log('');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
await secrets(action, name, options);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Upgrade command
|
|
180
|
+
program
|
|
181
|
+
.command('upgrade')
|
|
182
|
+
.description('Check for updates and regenerate configs for new version')
|
|
183
|
+
.option('--check', 'Only check for updates, do not upgrade')
|
|
184
|
+
.action(async (options) => {
|
|
185
|
+
await upgrade(options);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Dev sync command - only available in dev mode
|
|
189
|
+
if (process.env.DEV_MODE === 'true') {
|
|
190
|
+
program
|
|
191
|
+
.command('dev-sync')
|
|
192
|
+
.description('Sync locally built infrastructure to servers')
|
|
193
|
+
.option('--staging', 'Sync to staging environment only')
|
|
194
|
+
.option('--prod', 'Sync to production environment only')
|
|
195
|
+
.option('--deploy', 'Deploy after syncing')
|
|
196
|
+
.action(async (options) => {
|
|
197
|
+
await devSync(options);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Legacy commands (for backwards compatibility)
|
|
202
|
+
program
|
|
203
|
+
.command('validate')
|
|
204
|
+
.description('[Legacy] Validate factiii.yml config file')
|
|
205
|
+
.option('-c, --config <path>', 'Path to config file', 'factiii.yml')
|
|
206
|
+
.action(async (options) => {
|
|
207
|
+
await validate(options);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
program
|
|
211
|
+
.command('check-config')
|
|
212
|
+
.description('[Legacy] Check and regenerate configs on servers')
|
|
213
|
+
.option('-e, --environment <env>', 'Environment (staging|prod|all)', 'all')
|
|
214
|
+
.action(async (options) => {
|
|
215
|
+
await checkConfig(options);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// Register plugin commands (db, ops, backup)
|
|
219
|
+
// Pipeline plugin provides these commands via static commands array
|
|
220
|
+
try {
|
|
221
|
+
const FactiiiPipeline = require('../dist/plugins/pipelines/factiii').default;
|
|
222
|
+
if (FactiiiPipeline.commands && FactiiiPipeline.commands.length > 0) {
|
|
223
|
+
registerPluginCommands(program, FactiiiPipeline);
|
|
224
|
+
}
|
|
225
|
+
} catch (e) {
|
|
226
|
+
// Plugin commands not available - continue without them
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
program.parse();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check Config Command (Legacy)
|
|
3
|
+
*
|
|
4
|
+
* Checks configuration for an environment
|
|
5
|
+
*/
|
|
6
|
+
import type { CheckConfigOptions } from '../types/index.js';
|
|
7
|
+
export declare function checkConfig(options?: CheckConfigOptions): Promise<boolean>;
|
|
8
|
+
export default checkConfig;
|
|
9
|
+
//# sourceMappingURL=check-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-config.d.ts","sourceRoot":"","sources":["../../src/cli/check-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAS,MAAM,mBAAmB,CAAC;AAEnE,wBAAsB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAUpF;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Check Config Command (Legacy)
|
|
4
|
+
*
|
|
5
|
+
* Checks configuration for an environment
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.checkConfig = checkConfig;
|
|
9
|
+
const scan_js_1 = require("./scan.js");
|
|
10
|
+
async function checkConfig(options = {}) {
|
|
11
|
+
console.log('[!] The check-config command is deprecated. Use: npx factiii scan\n');
|
|
12
|
+
const environment = options.environment ?? 'staging';
|
|
13
|
+
const stages = [environment];
|
|
14
|
+
const problems = await (0, scan_js_1.scan)({ rootDir: process.cwd(), stages });
|
|
15
|
+
const envProblems = problems[environment] ?? [];
|
|
16
|
+
return envProblems.length === 0;
|
|
17
|
+
}
|
|
18
|
+
exports.default = checkConfig;
|
|
19
|
+
//# sourceMappingURL=check-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-config.js","sourceRoot":"","sources":["../../src/cli/check-config.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAKH,kCAUC;AAbD,uCAAiC;AAG1B,KAAK,UAAU,WAAW,CAAC,UAA8B,EAAE;IAChE,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IAEnF,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,SAAS,CAAC;IACrD,MAAM,MAAM,GAAY,CAAC,WAAoB,CAAC,CAAC;IAE/C,MAAM,QAAQ,GAAG,MAAM,IAAA,cAAI,EAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAEhE,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAoC,CAAC,IAAI,EAAE,CAAC;IACzE,OAAO,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DeploySecretsOptions {
|
|
2
|
+
rootDir?: string;
|
|
3
|
+
restart?: boolean;
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface DeploySecretsResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
message?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Deploy secrets to staging and/or production servers
|
|
13
|
+
*/
|
|
14
|
+
export declare function deploySecrets(environment: 'staging' | 'prod' | 'all', options?: DeploySecretsOptions): Promise<DeploySecretsResult>;
|
|
15
|
+
export default deploySecrets;
|
|
16
|
+
//# sourceMappingURL=deploy-secrets.d.ts.map
|