smbcloud-cli 1.1.0__tar.gz → 1.1.2__tar.gz
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.
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/Cargo.lock +18 -17
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/Cargo.toml +12 -12
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/PKG-INFO +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/Cargo.toml +2 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cli/mod.rs +6 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_nextjs_ssr.rs +362 -2
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/lib.rs +1 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/main.rs +2 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/mcp.rs +49 -5
- smbcloud_cli-1.1.2/crates/cli/src/run.rs +171 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-network/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-utils/Cargo.toml +1 -1
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/xcrs/Cargo.toml +1 -1
- smbcloud_cli-1.1.2/crates/xcrs/README.md +59 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/xcrs/src/mcp.rs +332 -13
- smbcloud_cli-1.1.2/crates/xcrs/src/webdriver.rs +764 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/xcrs/src/xcrs.rs +1 -0
- smbcloud_cli-1.1.0/crates/xcrs/README.md +0 -34
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/cli.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/forgot/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/login/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/login/process.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/logout/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/me/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/signup/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/account/signup/process.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ci.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/auth_app.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/cli.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/process.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/render.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/request.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-auth/url_builder.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/git.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_artifact.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_astro_ssr.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_rails.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_rust.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_static_site.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_swift.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_migrate.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/remote_messages.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/setup.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/setup_create_new_project.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/setup_project.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/setup_select_project.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-mail/cli.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-mail/current_project.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-mail/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-mail/process.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-mail/render.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-mail/send.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/controlkit.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/interface.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/mcp_apps/auth_app.html +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/mcp_apps/deployments.html +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/mcp_apps/inbox.html +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/mcp_xcrs.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/cli.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/crud_create.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/crud_delete.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/crud_read.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/crud_update.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/deploy_target.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/deployment.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/project/process.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/session_config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/cli.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/process.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/render.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/request.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/tenant_client.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/tenant/url_builder.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/token/clear_smb_token.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/token/get_smb_token.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/token/is_logged_in.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/token/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/token/smb_token_file_path.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/confirm_dialog.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/deployment_detail_view.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/deployment_table.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/me_view.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/plain.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/project_detail_view.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/project_table.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/prompt.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/reporter.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/ui/theme.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/.gitignore +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/check_email.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/login.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/logout.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/me.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/oauth/get_account_status.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/oauth/get_consent_url.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/oauth/get_profile.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/oauth/get_token.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/oauth/mod.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/oauth/provider.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/remove.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/resend_email_verification.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/resend_reset_password_instruction.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/reset_password.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-auth/src/signup.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/artifact.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/build.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/error.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/known_hosts.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/report.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/runner.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-deploy/src/transport.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/src/client.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/src/client_credentials.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/src/error.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/src/message.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-email-sdk/src/smbcloud_email_sdk.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/src/mail_app.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/src/mail_inbox.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/src/mail_message.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/src/request.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/src/smbcloud_mail.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-mail/src/url_builder.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/account.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/app_auth.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/artifact_deployment.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/deploy_config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/deploy_config_update.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/error_codes.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/forgot.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/frontend_app.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/login.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/mail.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/oauth.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/project.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/repository.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/reset_password_response.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/runner.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/signup.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-model/src/tenant.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-network/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-network/src/environment.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-network/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-network/src/network.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking/src/constants.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking/src/smb_client.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_app_deploy_config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_artifact_deployment.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_deploy_repo_create.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_frontend_app_create.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_frontend_app_deploy_config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_frontend_app_read.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_frontend_app_update_deploy_config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_create.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_delete.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_deployment_create.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_deployment_read.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_deployment_update.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_read.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/crud_project_update.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/request.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-networking-project/src/url_builder.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-utils/README.md +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-utils/src/config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-utils/src/lib.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/smbcloud-utils/src/write_config.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/xcrs/src/main.rs +0 -0
- {smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/pyproject.toml +0 -0
|
@@ -2653,7 +2653,7 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
|
|
|
2653
2653
|
|
|
2654
2654
|
[[package]]
|
|
2655
2655
|
name = "smbcloud-auth"
|
|
2656
|
-
version = "1.1.
|
|
2656
|
+
version = "1.1.2"
|
|
2657
2657
|
dependencies = [
|
|
2658
2658
|
"log",
|
|
2659
2659
|
"reqwest",
|
|
@@ -2668,7 +2668,7 @@ dependencies = [
|
|
|
2668
2668
|
|
|
2669
2669
|
[[package]]
|
|
2670
2670
|
name = "smbcloud-auth-sdk"
|
|
2671
|
-
version = "1.1.
|
|
2671
|
+
version = "1.1.2"
|
|
2672
2672
|
dependencies = [
|
|
2673
2673
|
"base64 0.22.1",
|
|
2674
2674
|
"reqwest",
|
|
@@ -2683,7 +2683,7 @@ dependencies = [
|
|
|
2683
2683
|
|
|
2684
2684
|
[[package]]
|
|
2685
2685
|
name = "smbcloud-auth-sdk-py"
|
|
2686
|
-
version = "1.1.
|
|
2686
|
+
version = "1.1.2"
|
|
2687
2687
|
dependencies = [
|
|
2688
2688
|
"pyo3",
|
|
2689
2689
|
"pythonize",
|
|
@@ -2697,7 +2697,7 @@ dependencies = [
|
|
|
2697
2697
|
|
|
2698
2698
|
[[package]]
|
|
2699
2699
|
name = "smbcloud-auth-sdk-wasm"
|
|
2700
|
-
version = "1.1.
|
|
2700
|
+
version = "1.1.2"
|
|
2701
2701
|
dependencies = [
|
|
2702
2702
|
"serde-wasm-bindgen",
|
|
2703
2703
|
"smbcloud-auth-sdk",
|
|
@@ -2710,9 +2710,10 @@ dependencies = [
|
|
|
2710
2710
|
|
|
2711
2711
|
[[package]]
|
|
2712
2712
|
name = "smbcloud-cli"
|
|
2713
|
-
version = "1.1.
|
|
2713
|
+
version = "1.1.2"
|
|
2714
2714
|
dependencies = [
|
|
2715
2715
|
"anyhow",
|
|
2716
|
+
"base64 0.22.1",
|
|
2716
2717
|
"chrono",
|
|
2717
2718
|
"clap 4.6.6",
|
|
2718
2719
|
"clap_mangen",
|
|
@@ -2758,7 +2759,7 @@ dependencies = [
|
|
|
2758
2759
|
|
|
2759
2760
|
[[package]]
|
|
2760
2761
|
name = "smbcloud-deploy"
|
|
2761
|
-
version = "1.1.
|
|
2762
|
+
version = "1.1.2"
|
|
2762
2763
|
dependencies = [
|
|
2763
2764
|
"anyhow",
|
|
2764
2765
|
"ignore",
|
|
@@ -2778,7 +2779,7 @@ dependencies = [
|
|
|
2778
2779
|
|
|
2779
2780
|
[[package]]
|
|
2780
2781
|
name = "smbcloud-email-sdk"
|
|
2781
|
-
version = "1.1.
|
|
2782
|
+
version = "1.1.2"
|
|
2782
2783
|
dependencies = [
|
|
2783
2784
|
"anyhow",
|
|
2784
2785
|
"log",
|
|
@@ -2793,7 +2794,7 @@ dependencies = [
|
|
|
2793
2794
|
|
|
2794
2795
|
[[package]]
|
|
2795
2796
|
name = "smbcloud-gresiq"
|
|
2796
|
-
version = "1.1.
|
|
2797
|
+
version = "1.1.2"
|
|
2797
2798
|
dependencies = [
|
|
2798
2799
|
"native-tls",
|
|
2799
2800
|
"postgres-native-tls",
|
|
@@ -2807,7 +2808,7 @@ dependencies = [
|
|
|
2807
2808
|
|
|
2808
2809
|
[[package]]
|
|
2809
2810
|
name = "smbcloud-gresiq-sdk"
|
|
2810
|
-
version = "1.1.
|
|
2811
|
+
version = "1.1.2"
|
|
2811
2812
|
dependencies = [
|
|
2812
2813
|
"anyhow",
|
|
2813
2814
|
"log",
|
|
@@ -2821,7 +2822,7 @@ dependencies = [
|
|
|
2821
2822
|
|
|
2822
2823
|
[[package]]
|
|
2823
2824
|
name = "smbcloud-mail"
|
|
2824
|
-
version = "1.1.
|
|
2825
|
+
version = "1.1.2"
|
|
2825
2826
|
dependencies = [
|
|
2826
2827
|
"reqwest",
|
|
2827
2828
|
"serde",
|
|
@@ -2833,7 +2834,7 @@ dependencies = [
|
|
|
2833
2834
|
|
|
2834
2835
|
[[package]]
|
|
2835
2836
|
name = "smbcloud-model"
|
|
2836
|
-
version = "1.1.
|
|
2837
|
+
version = "1.1.2"
|
|
2837
2838
|
dependencies = [
|
|
2838
2839
|
"chrono",
|
|
2839
2840
|
"log",
|
|
@@ -2849,7 +2850,7 @@ dependencies = [
|
|
|
2849
2850
|
|
|
2850
2851
|
[[package]]
|
|
2851
2852
|
name = "smbcloud-network"
|
|
2852
|
-
version = "1.1.
|
|
2853
|
+
version = "1.1.2"
|
|
2853
2854
|
dependencies = [
|
|
2854
2855
|
"clap 4.6.6",
|
|
2855
2856
|
"log",
|
|
@@ -2863,7 +2864,7 @@ dependencies = [
|
|
|
2863
2864
|
|
|
2864
2865
|
[[package]]
|
|
2865
2866
|
name = "smbcloud-networking"
|
|
2866
|
-
version = "1.1.
|
|
2867
|
+
version = "1.1.2"
|
|
2867
2868
|
dependencies = [
|
|
2868
2869
|
"smbcloud-network",
|
|
2869
2870
|
"url-builder",
|
|
@@ -2871,7 +2872,7 @@ dependencies = [
|
|
|
2871
2872
|
|
|
2872
2873
|
[[package]]
|
|
2873
2874
|
name = "smbcloud-networking-project"
|
|
2874
|
-
version = "1.1.
|
|
2875
|
+
version = "1.1.2"
|
|
2875
2876
|
dependencies = [
|
|
2876
2877
|
"anyhow",
|
|
2877
2878
|
"async-trait",
|
|
@@ -2889,11 +2890,11 @@ dependencies = [
|
|
|
2889
2890
|
|
|
2890
2891
|
[[package]]
|
|
2891
2892
|
name = "smbcloud-s6n"
|
|
2892
|
-
version = "1.1.
|
|
2893
|
+
version = "1.1.2"
|
|
2893
2894
|
|
|
2894
2895
|
[[package]]
|
|
2895
2896
|
name = "smbcloud-utils"
|
|
2896
|
-
version = "1.1.
|
|
2897
|
+
version = "1.1.2"
|
|
2897
2898
|
dependencies = [
|
|
2898
2899
|
"anyhow",
|
|
2899
2900
|
"dirs",
|
|
@@ -4141,7 +4142,7 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
|
|
|
4141
4142
|
|
|
4142
4143
|
[[package]]
|
|
4143
4144
|
name = "xcrs"
|
|
4144
|
-
version = "1.1.
|
|
4145
|
+
version = "1.1.2"
|
|
4145
4146
|
dependencies = [
|
|
4146
4147
|
"anyhow",
|
|
4147
4148
|
"base64 0.22.1",
|
|
@@ -31,17 +31,17 @@ serde = "1"
|
|
|
31
31
|
serde_json = "1.0.82"
|
|
32
32
|
serde_repr = "0.1"
|
|
33
33
|
sha2 = "0.10"
|
|
34
|
-
smbcloud-auth = { version = "1.1.
|
|
35
|
-
smbcloud-auth-sdk = { version = "1.1.
|
|
36
|
-
smbcloud-deploy = { version = "1.1.
|
|
37
|
-
smbcloud-email-sdk = { version = "1.1.
|
|
38
|
-
smbcloud-gresiq-sdk = { version = "1.1.
|
|
39
|
-
smbcloud-mail = { version = "1.1.
|
|
40
|
-
smbcloud-model = { version = "1.1.
|
|
41
|
-
smbcloud-network = { version = "1.1.
|
|
42
|
-
smbcloud-networking = { version = "1.1.
|
|
43
|
-
smbcloud-networking-project = { version = "1.1.
|
|
44
|
-
smbcloud-utils = { version = "1.1.
|
|
34
|
+
smbcloud-auth = { version = "1.1.2", path = "crates/smbcloud-auth" }
|
|
35
|
+
smbcloud-auth-sdk = { version = "1.1.2", path = "crates/smbcloud-auth-sdk" }
|
|
36
|
+
smbcloud-deploy = { version = "1.1.2", path = "crates/smbcloud-deploy" }
|
|
37
|
+
smbcloud-email-sdk = { version = "1.1.2", path = "crates/smbcloud-email-sdk" }
|
|
38
|
+
smbcloud-gresiq-sdk = { version = "1.1.2", path = "crates/smbcloud-gresiq-sdk" }
|
|
39
|
+
smbcloud-mail = { version = "1.1.2", path = "crates/smbcloud-mail" }
|
|
40
|
+
smbcloud-model = { version = "1.1.2", path = "crates/smbcloud-model" }
|
|
41
|
+
smbcloud-network = { version = "1.1.2", path = "crates/smbcloud-network" }
|
|
42
|
+
smbcloud-networking = { version = "1.1.2", path = "crates/smbcloud-networking" }
|
|
43
|
+
smbcloud-networking-project = { version = "1.1.2", path = "crates/smbcloud-networking-project" }
|
|
44
|
+
smbcloud-utils = { version = "1.1.2", path = "crates/smbcloud-utils" }
|
|
45
45
|
spinners = "4.1.0"
|
|
46
46
|
strum = "0.27"
|
|
47
47
|
strum_macros = "0.27"
|
|
@@ -59,4 +59,4 @@ uniffi = "0.31"
|
|
|
59
59
|
url-builder = "0.1.1"
|
|
60
60
|
wiremock = "0.6"
|
|
61
61
|
wasm-bindgen = "0.2"
|
|
62
|
-
xcrs = { version = "1.1.
|
|
62
|
+
xcrs = { version = "1.1.2", path = "crates/xcrs" }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "smbcloud-cli"
|
|
3
|
-
version = "1.1.
|
|
3
|
+
version = "1.1.2"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["Seto Elkahfi <seto@smbcloud.xyz>"]
|
|
6
6
|
description = "smbCloud command line interface."
|
|
@@ -23,6 +23,7 @@ path = "src/main.rs"
|
|
|
23
23
|
|
|
24
24
|
[dependencies]
|
|
25
25
|
anyhow = { workspace = true }
|
|
26
|
+
base64 = { workspace = true }
|
|
26
27
|
chrono = { workspace = true }
|
|
27
28
|
clap = { workspace = true, features = ["derive", "env"] }
|
|
28
29
|
clap_mangen = { workspace = true }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use {
|
|
2
|
-
crate::{account, cloud_auth, mail, project, tenant},
|
|
2
|
+
crate::{account, cloud_auth, mail, project, run, tenant},
|
|
3
3
|
clap::{Parser, Subcommand, ValueEnum},
|
|
4
4
|
smbcloud_network::environment::Environment,
|
|
5
5
|
spinners::Spinner,
|
|
@@ -108,6 +108,11 @@ pub enum Commands {
|
|
|
108
108
|
#[clap(subcommand)]
|
|
109
109
|
command: project::cli::Commands,
|
|
110
110
|
},
|
|
111
|
+
#[clap(about = "Inspect and tag Run runners (admin only).")]
|
|
112
|
+
Run {
|
|
113
|
+
#[clap(subcommand)]
|
|
114
|
+
command: run::Commands,
|
|
115
|
+
},
|
|
111
116
|
#[clap(about = "Manage your tenants.")]
|
|
112
117
|
Tenant {
|
|
113
118
|
#[clap(subcommand)]
|
{smbcloud_cli-1.1.0 → smbcloud_cli-1.1.2}/crates/cli/src/cloud-deploy/process_deploy_nextjs_ssr.rs
RENAMED
|
@@ -6,6 +6,7 @@ use {
|
|
|
6
6
|
ui::{fail_message, fail_symbol, succeed_message, succeed_symbol},
|
|
7
7
|
},
|
|
8
8
|
anyhow::{anyhow, Result},
|
|
9
|
+
base64::{engine::general_purpose::STANDARD as BASE64, Engine as _},
|
|
9
10
|
chrono::Utc,
|
|
10
11
|
smbcloud_auth::me::me,
|
|
11
12
|
smbcloud_model::project::{DeploymentPayload, DeploymentStatus},
|
|
@@ -16,6 +17,7 @@ use {
|
|
|
16
17
|
smbcloud_utils::config::Config,
|
|
17
18
|
spinners::{Spinner, Spinners},
|
|
18
19
|
std::{
|
|
20
|
+
collections::HashMap,
|
|
19
21
|
io::Write,
|
|
20
22
|
process::{Command, Stdio},
|
|
21
23
|
},
|
|
@@ -85,6 +87,91 @@ fn prune_dangling_symlinks(root: &std::path::Path) -> std::io::Result<usize> {
|
|
|
85
87
|
Ok(removed)
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
/// Node program run on the host to apply the app's env vars to an existing PM2
|
|
91
|
+
/// ecosystem file. It reads the values from `SMB_ENV_B64` (base64 of a JSON
|
|
92
|
+
/// object), so no value is ever interpolated into shell source.
|
|
93
|
+
///
|
|
94
|
+
/// It sets every managed key in `env_production` of the app named
|
|
95
|
+
/// `SMB_PM2_APP` (in `{ apps: [...] }` or a bare array, both of which pm2 loads), removes keys the previous deploy managed that are gone now,
|
|
96
|
+
/// and records the managed key names (never values) in
|
|
97
|
+
/// `.smbcloud-env-keys.json`. Keys nobody told smbCloud about stay untouched.
|
|
98
|
+
/// The first rewrite keeps the original as `ecosystem.config.cjs.smbcloud.bak`,
|
|
99
|
+
/// because the file is re-serialised and comments do not survive.
|
|
100
|
+
const ECOSYSTEM_ENV_MERGE_JS: &str = r#"
|
|
101
|
+
var fs = require('fs');
|
|
102
|
+
var path = require('path');
|
|
103
|
+
var file = 'ecosystem.config.cjs';
|
|
104
|
+
var keysFile = '.smbcloud-env-keys.json';
|
|
105
|
+
var app = process.env.SMB_PM2_APP;
|
|
106
|
+
var vars = JSON.parse(Buffer.from(process.env.SMB_ENV_B64, 'base64').toString('utf8'));
|
|
107
|
+
function plain(v) {
|
|
108
|
+
if (typeof v === 'function' || typeof v === 'symbol') return false;
|
|
109
|
+
if (v && typeof v === 'object') return Object.keys(v).every(function (k) { return plain(v[k]); });
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
var cfg = require(path.resolve(file));
|
|
113
|
+
if (!plain(cfg)) {
|
|
114
|
+
console.error('smbCloud: ' + file + ' contains functions, so env vars cannot be merged into it safely. Edit it by hand or remove the functions.');
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
var apps = Array.isArray(cfg) ? cfg : (cfg.apps || []);
|
|
118
|
+
var entry = apps.filter(function (a) { return a.name === app; })[0];
|
|
119
|
+
if (!entry) {
|
|
120
|
+
console.error('smbCloud: no app named ' + app + ' in ' + file + '.');
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
entry.env_production = entry.env_production || {};
|
|
124
|
+
var previous = [];
|
|
125
|
+
try { previous = JSON.parse(fs.readFileSync(keysFile, 'utf8')); } catch (e) {}
|
|
126
|
+
previous.forEach(function (k) { if (!Object.prototype.hasOwnProperty.call(vars, k)) delete entry.env_production[k]; });
|
|
127
|
+
Object.keys(vars).forEach(function (k) { entry.env_production[k] = vars[k]; });
|
|
128
|
+
if (!fs.existsSync(file + '.smbcloud.bak')) fs.copyFileSync(file, file + '.smbcloud.bak');
|
|
129
|
+
fs.writeFileSync(file, 'module.exports = ' + JSON.stringify(cfg, null, 2) + ';\n');
|
|
130
|
+
fs.writeFileSync(keysFile, JSON.stringify(Object.keys(vars).sort()) + '\n');
|
|
131
|
+
"#;
|
|
132
|
+
|
|
133
|
+
/// Shell that applies `pm2_env` to the host's ecosystem file on every deploy.
|
|
134
|
+
///
|
|
135
|
+
/// Returns an empty string when the server sent no env map at all (`None`),
|
|
136
|
+
/// so a failed lookup never strips keys. An empty map is authoritative: the
|
|
137
|
+
/// merge still runs when a previous deploy recorded managed keys, to remove
|
|
138
|
+
/// them. Needs `PM2_APP` set in the surrounding script.
|
|
139
|
+
pub(super) fn ecosystem_env_merge_snippet(
|
|
140
|
+
pm2_env: Option<&HashMap<String, serde_json::Value>>,
|
|
141
|
+
) -> String {
|
|
142
|
+
let Some(pm2_env) = pm2_env else {
|
|
143
|
+
return String::new();
|
|
144
|
+
};
|
|
145
|
+
// The deploy sets these itself; the API rejects them, and a stale local
|
|
146
|
+
// config must not override the port the restart stanza passes.
|
|
147
|
+
let vars: std::collections::BTreeMap<&str, String> = pm2_env
|
|
148
|
+
.iter()
|
|
149
|
+
.filter(|(k, _)| !matches!(k.as_str(), "NODE_ENV" | "PORT" | "HOSTNAME"))
|
|
150
|
+
.map(|(k, v)| {
|
|
151
|
+
let value = match v {
|
|
152
|
+
serde_json::Value::String(s) => s.clone(),
|
|
153
|
+
other => other.to_string(),
|
|
154
|
+
};
|
|
155
|
+
(k.as_str(), value)
|
|
156
|
+
})
|
|
157
|
+
.collect();
|
|
158
|
+
let blob = BASE64.encode(serde_json::to_string(&vars).unwrap_or_else(|_| "{}".to_string()));
|
|
159
|
+
let guard = if vars.is_empty() {
|
|
160
|
+
r#"[ -f ecosystem.config.cjs ] && [ -f .smbcloud-env-keys.json ]"#
|
|
161
|
+
} else {
|
|
162
|
+
r#"[ -f ecosystem.config.cjs ]"#
|
|
163
|
+
};
|
|
164
|
+
format!(
|
|
165
|
+
r#"# Apply smbCloud env vars to the ecosystem file on every deploy.
|
|
166
|
+
if {guard}; then
|
|
167
|
+
SMB_PM2_APP="$PM2_APP" SMB_ENV_B64='{blob}' node --input-type=commonjs - << 'SMB_ENV_EOF'
|
|
168
|
+
{js}SMB_ENV_EOF
|
|
169
|
+
fi
|
|
170
|
+
"#,
|
|
171
|
+
js = ECOSYSTEM_ENV_MERGE_JS.trim_start_matches('\n'),
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
88
175
|
/// Build the shell snippet that (re)starts the app after the standalone bundle
|
|
89
176
|
/// is on the server.
|
|
90
177
|
///
|
|
@@ -617,6 +704,8 @@ pub async fn process_deploy_nextjs_ssr(env: Environment, config: Config) -> Resu
|
|
|
617
704
|
)
|
|
618
705
|
};
|
|
619
706
|
|
|
707
|
+
let env_merge = ecosystem_env_merge_snippet(config.project.pm2_env.as_ref());
|
|
708
|
+
|
|
620
709
|
// Runtime supervisor: pm2 (default) or a git-owned systemd --user service.
|
|
621
710
|
let restart_stanza = restart_stanza(config.project.process_manager.as_deref(), port)?;
|
|
622
711
|
|
|
@@ -659,6 +748,7 @@ ECOSYSTEM_EOF
|
|
|
659
748
|
" "$APP_PATH" 2>/dev/null || true
|
|
660
749
|
fi
|
|
661
750
|
|
|
751
|
+
{env_merge}
|
|
662
752
|
# The monorepo root package.json may declare "type": "module", which
|
|
663
753
|
# Next.js copies into .next/standalone/. Standalone server.js and our
|
|
664
754
|
# shims use require() (CJS). Strip the field so Node treats .js as CJS.
|
|
@@ -758,6 +848,7 @@ EOF
|
|
|
758
848
|
runtime_subdir = runtime_subdir_for_shell,
|
|
759
849
|
restart = restart_stanza,
|
|
760
850
|
ecosystem_config = ecosystem_config_content,
|
|
851
|
+
env_merge = env_merge,
|
|
761
852
|
);
|
|
762
853
|
|
|
763
854
|
let mut restart_spinner = Spinner::new(
|
|
@@ -904,8 +995,9 @@ pub(super) async fn mark_failed(
|
|
|
904
995
|
#[cfg(all(test, unix))]
|
|
905
996
|
mod tests {
|
|
906
997
|
use {
|
|
907
|
-
super::{prune_dangling_symlinks, restart_stanza},
|
|
908
|
-
|
|
998
|
+
super::{ecosystem_env_merge_snippet, prune_dangling_symlinks, restart_stanza},
|
|
999
|
+
serde_json::{json, Value},
|
|
1000
|
+
std::{collections::HashMap, os::unix::fs::symlink, path::Path, process::Command},
|
|
909
1001
|
tempfile::tempdir,
|
|
910
1002
|
};
|
|
911
1003
|
|
|
@@ -1030,4 +1122,272 @@ mod tests {
|
|
|
1030
1122
|
// Case-insensitive selector.
|
|
1031
1123
|
assert_eq!(s, restart_stanza(Some("SystemD"), 3025).unwrap());
|
|
1032
1124
|
}
|
|
1125
|
+
|
|
1126
|
+
// ── Ecosystem env merge ──────────────────────────────────────────────────
|
|
1127
|
+
//
|
|
1128
|
+
// These run the generated shell under real bash and node, since the point
|
|
1129
|
+
// is what lands in the file on the host.
|
|
1130
|
+
|
|
1131
|
+
const HAND_FILE: &str = r#"module.exports = {
|
|
1132
|
+
apps: [
|
|
1133
|
+
{ name: "web", script: "server.js", cwd: "/srv/web",
|
|
1134
|
+
env_production: { NODE_ENV: "production", PORT: 3026, HAND_KEPT: "mine", OLD: "x" } },
|
|
1135
|
+
{ name: "other", script: "o.js", env_production: { UNTOUCHED: "1" } },
|
|
1136
|
+
],
|
|
1137
|
+
};
|
|
1138
|
+
"#;
|
|
1139
|
+
|
|
1140
|
+
fn have_bash_and_node() -> bool {
|
|
1141
|
+
["bash", "node"].iter().all(|bin| {
|
|
1142
|
+
Command::new(bin)
|
|
1143
|
+
.arg("--version")
|
|
1144
|
+
.output()
|
|
1145
|
+
.map(|o| o.status.success())
|
|
1146
|
+
.unwrap_or(false)
|
|
1147
|
+
})
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
fn vars(pairs: &[(&str, Value)]) -> HashMap<String, Value> {
|
|
1151
|
+
pairs
|
|
1152
|
+
.iter()
|
|
1153
|
+
.map(|(k, v)| (k.to_string(), v.clone()))
|
|
1154
|
+
.collect()
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/// Runs the snippet in `dir` the way the deploy does, with PM2_APP set.
|
|
1158
|
+
fn run_merge(dir: &Path, env: Option<&HashMap<String, Value>>) -> std::process::Output {
|
|
1159
|
+
let script = format!(
|
|
1160
|
+
"set -e\nPM2_APP=\"web\"\n{}",
|
|
1161
|
+
ecosystem_env_merge_snippet(env)
|
|
1162
|
+
);
|
|
1163
|
+
Command::new("bash")
|
|
1164
|
+
.arg("-c")
|
|
1165
|
+
.arg(script)
|
|
1166
|
+
.current_dir(dir)
|
|
1167
|
+
.output()
|
|
1168
|
+
.unwrap()
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/// The env_production of an app, as the host's pm2 would load it.
|
|
1172
|
+
fn env_of(dir: &Path, app: &str) -> Value {
|
|
1173
|
+
let out = Command::new("node")
|
|
1174
|
+
.arg("-e")
|
|
1175
|
+
.arg(format!(
|
|
1176
|
+
"var c=require('./ecosystem.config.cjs');\
|
|
1177
|
+
console.log(JSON.stringify(c.apps.find(a=>a.name==='{app}').env_production))"
|
|
1178
|
+
))
|
|
1179
|
+
.current_dir(dir)
|
|
1180
|
+
.output()
|
|
1181
|
+
.unwrap();
|
|
1182
|
+
assert!(
|
|
1183
|
+
out.status.success(),
|
|
1184
|
+
"{}",
|
|
1185
|
+
String::from_utf8_lossy(&out.stderr)
|
|
1186
|
+
);
|
|
1187
|
+
serde_json::from_slice(&out.stdout).unwrap()
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/// Like `env_of`, for a file that exports a bare array of apps.
|
|
1191
|
+
fn env_of_array(dir: &Path, app: &str) -> Value {
|
|
1192
|
+
let out = Command::new("node")
|
|
1193
|
+
.arg("-e")
|
|
1194
|
+
.arg(format!(
|
|
1195
|
+
"var c=require('./ecosystem.config.cjs');\
|
|
1196
|
+
console.log(JSON.stringify(c.find(a=>a.name==='{app}').env_production))"
|
|
1197
|
+
))
|
|
1198
|
+
.current_dir(dir)
|
|
1199
|
+
.output()
|
|
1200
|
+
.unwrap();
|
|
1201
|
+
assert!(
|
|
1202
|
+
out.status.success(),
|
|
1203
|
+
"{}",
|
|
1204
|
+
String::from_utf8_lossy(&out.stderr)
|
|
1205
|
+
);
|
|
1206
|
+
serde_json::from_slice(&out.stdout).unwrap()
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
#[test]
|
|
1210
|
+
fn env_merge_sets_keys_and_keeps_hand_maintained_ones() {
|
|
1211
|
+
if !have_bash_and_node() {
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
let dir = tempdir().unwrap();
|
|
1215
|
+
std::fs::write(dir.path().join("ecosystem.config.cjs"), HAND_FILE).unwrap();
|
|
1216
|
+
|
|
1217
|
+
let env = vars(&[("STRIPE_WEBHOOK_SECRET", json!("whsec_1")), ("N", json!(5))]);
|
|
1218
|
+
let out = run_merge(dir.path(), Some(&env));
|
|
1219
|
+
assert!(
|
|
1220
|
+
out.status.success(),
|
|
1221
|
+
"{}",
|
|
1222
|
+
String::from_utf8_lossy(&out.stderr)
|
|
1223
|
+
);
|
|
1224
|
+
|
|
1225
|
+
let web = env_of(dir.path(), "web");
|
|
1226
|
+
assert_eq!(web["STRIPE_WEBHOOK_SECRET"], "whsec_1");
|
|
1227
|
+
assert_eq!(web["N"], "5");
|
|
1228
|
+
assert_eq!(web["HAND_KEPT"], "mine");
|
|
1229
|
+
assert_eq!(web["PORT"], 3026);
|
|
1230
|
+
assert_eq!(env_of(dir.path(), "other"), json!({"UNTOUCHED": "1"}));
|
|
1231
|
+
|
|
1232
|
+
let sidecar = std::fs::read_to_string(dir.path().join(".smbcloud-env-keys.json")).unwrap();
|
|
1233
|
+
assert_eq!(
|
|
1234
|
+
serde_json::from_str::<Value>(&sidecar).unwrap(),
|
|
1235
|
+
json!(["N", "STRIPE_WEBHOOK_SECRET"])
|
|
1236
|
+
);
|
|
1237
|
+
assert!(!sidecar.contains("whsec_1"), "the sidecar holds names only");
|
|
1238
|
+
assert!(dir
|
|
1239
|
+
.path()
|
|
1240
|
+
.join("ecosystem.config.cjs.smbcloud.bak")
|
|
1241
|
+
.exists());
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
#[test]
|
|
1245
|
+
fn env_merge_removes_keys_deleted_since_last_deploy_but_not_hand_kept_ones() {
|
|
1246
|
+
if !have_bash_and_node() {
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
let dir = tempdir().unwrap();
|
|
1250
|
+
std::fs::write(dir.path().join("ecosystem.config.cjs"), HAND_FILE).unwrap();
|
|
1251
|
+
|
|
1252
|
+
let first = vars(&[("A", json!("1")), ("B", json!("2"))]);
|
|
1253
|
+
assert!(run_merge(dir.path(), Some(&first)).status.success());
|
|
1254
|
+
let second = vars(&[("A", json!("1"))]);
|
|
1255
|
+
assert!(run_merge(dir.path(), Some(&second)).status.success());
|
|
1256
|
+
|
|
1257
|
+
let web = env_of(dir.path(), "web");
|
|
1258
|
+
assert_eq!(web["A"], "1");
|
|
1259
|
+
assert!(web.get("B").is_none(), "B was managed and is now deleted");
|
|
1260
|
+
assert_eq!(web["HAND_KEPT"], "mine");
|
|
1261
|
+
assert_eq!(web["OLD"], "x");
|
|
1262
|
+
|
|
1263
|
+
// Deleting the last key still cleans up, via the empty-map path.
|
|
1264
|
+
let empty = vars(&[]);
|
|
1265
|
+
assert!(run_merge(dir.path(), Some(&empty)).status.success());
|
|
1266
|
+
assert!(env_of(dir.path(), "web").get("A").is_none());
|
|
1267
|
+
assert_eq!(env_of(dir.path(), "web")["HAND_KEPT"], "mine");
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
#[test]
|
|
1271
|
+
fn env_merge_is_a_no_op_without_a_map_or_a_previous_sidecar() {
|
|
1272
|
+
assert_eq!(ecosystem_env_merge_snippet(None), "");
|
|
1273
|
+
|
|
1274
|
+
if !have_bash_and_node() {
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
let dir = tempdir().unwrap();
|
|
1278
|
+
std::fs::write(dir.path().join("ecosystem.config.cjs"), HAND_FILE).unwrap();
|
|
1279
|
+
assert!(run_merge(dir.path(), Some(&vars(&[]))).status.success());
|
|
1280
|
+
assert_eq!(
|
|
1281
|
+
std::fs::read_to_string(dir.path().join("ecosystem.config.cjs")).unwrap(),
|
|
1282
|
+
HAND_FILE
|
|
1283
|
+
);
|
|
1284
|
+
assert!(!dir.path().join(".smbcloud-env-keys.json").exists());
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
#[test]
|
|
1288
|
+
fn env_merge_carries_quotes_newlines_and_dollars_verbatim() {
|
|
1289
|
+
if !have_bash_and_node() {
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
let nasty = "a'b\"c\nline2 $HOME `id` $(whoami) \\n end";
|
|
1293
|
+
let dir = tempdir().unwrap();
|
|
1294
|
+
std::fs::write(dir.path().join("ecosystem.config.cjs"), HAND_FILE).unwrap();
|
|
1295
|
+
|
|
1296
|
+
let env = vars(&[
|
|
1297
|
+
("NASTY", json!(nasty)),
|
|
1298
|
+
("PEM", json!("-----BEGIN-----\nabc\n-----END-----")),
|
|
1299
|
+
]);
|
|
1300
|
+
let out = run_merge(dir.path(), Some(&env));
|
|
1301
|
+
assert!(
|
|
1302
|
+
out.status.success(),
|
|
1303
|
+
"{}",
|
|
1304
|
+
String::from_utf8_lossy(&out.stderr)
|
|
1305
|
+
);
|
|
1306
|
+
|
|
1307
|
+
let web = env_of(dir.path(), "web");
|
|
1308
|
+
assert_eq!(web["NASTY"], nasty);
|
|
1309
|
+
assert_eq!(web["PEM"], "-----BEGIN-----\nabc\n-----END-----");
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
#[test]
|
|
1313
|
+
fn env_merge_never_overrides_the_deploy_owned_keys() {
|
|
1314
|
+
if !have_bash_and_node() {
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
let dir = tempdir().unwrap();
|
|
1318
|
+
std::fs::write(dir.path().join("ecosystem.config.cjs"), HAND_FILE).unwrap();
|
|
1319
|
+
|
|
1320
|
+
let env = vars(&[
|
|
1321
|
+
("PORT", json!("1")),
|
|
1322
|
+
("NODE_ENV", json!("dev")),
|
|
1323
|
+
("K", json!("v")),
|
|
1324
|
+
]);
|
|
1325
|
+
assert!(run_merge(dir.path(), Some(&env)).status.success());
|
|
1326
|
+
|
|
1327
|
+
let web = env_of(dir.path(), "web");
|
|
1328
|
+
assert_eq!(web["PORT"], 3026);
|
|
1329
|
+
assert_eq!(web["NODE_ENV"], "production");
|
|
1330
|
+
assert_eq!(web["K"], "v");
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
#[test]
|
|
1334
|
+
fn env_merge_handles_an_array_form_ecosystem_file() {
|
|
1335
|
+
if !have_bash_and_node() {
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
let dir = tempdir().unwrap();
|
|
1339
|
+
std::fs::write(
|
|
1340
|
+
dir.path().join("ecosystem.config.cjs"),
|
|
1341
|
+
"module.exports = [{ name: 'web', script: 'server.js', env_production: { HAND_KEPT: 'mine' } }];\n",
|
|
1342
|
+
)
|
|
1343
|
+
.unwrap();
|
|
1344
|
+
|
|
1345
|
+
let out = run_merge(dir.path(), Some(&vars(&[("K", json!("v"))])));
|
|
1346
|
+
assert!(
|
|
1347
|
+
out.status.success(),
|
|
1348
|
+
"{}",
|
|
1349
|
+
String::from_utf8_lossy(&out.stderr)
|
|
1350
|
+
);
|
|
1351
|
+
|
|
1352
|
+
let web = env_of_array(dir.path(), "web");
|
|
1353
|
+
assert_eq!(web["K"], "v");
|
|
1354
|
+
assert_eq!(web["HAND_KEPT"], "mine");
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
#[test]
|
|
1358
|
+
fn env_merge_removes_a_managed_key_named_like_an_object_property() {
|
|
1359
|
+
if !have_bash_and_node() {
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
let dir = tempdir().unwrap();
|
|
1363
|
+
std::fs::write(dir.path().join("ecosystem.config.cjs"), HAND_FILE).unwrap();
|
|
1364
|
+
|
|
1365
|
+
let first = vars(&[("constructor", json!("x")), ("toString", json!("y"))]);
|
|
1366
|
+
assert!(run_merge(dir.path(), Some(&first)).status.success());
|
|
1367
|
+
assert_eq!(env_of(dir.path(), "web")["constructor"], "x");
|
|
1368
|
+
|
|
1369
|
+
let second = vars(&[("K", json!("v"))]);
|
|
1370
|
+
assert!(run_merge(dir.path(), Some(&second)).status.success());
|
|
1371
|
+
let web = env_of(dir.path(), "web");
|
|
1372
|
+
assert!(!web.as_object().unwrap().contains_key("constructor"));
|
|
1373
|
+
assert!(!web.as_object().unwrap().contains_key("toString"));
|
|
1374
|
+
assert_eq!(web["K"], "v");
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
#[test]
|
|
1378
|
+
fn env_merge_fails_loudly_when_the_app_is_not_in_the_file() {
|
|
1379
|
+
if !have_bash_and_node() {
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
let dir = tempdir().unwrap();
|
|
1383
|
+
std::fs::write(
|
|
1384
|
+
dir.path().join("ecosystem.config.cjs"),
|
|
1385
|
+
"module.exports = { apps: [{ name: 'else' }] };\n",
|
|
1386
|
+
)
|
|
1387
|
+
.unwrap();
|
|
1388
|
+
|
|
1389
|
+
let out = run_merge(dir.path(), Some(&vars(&[("K", json!("v"))])));
|
|
1390
|
+
assert!(!out.status.success());
|
|
1391
|
+
assert!(String::from_utf8_lossy(&out.stderr).contains("no app named web"));
|
|
1392
|
+
}
|
|
1033
1393
|
}
|
|
@@ -14,6 +14,7 @@ use {
|
|
|
14
14
|
},
|
|
15
15
|
mail::process::process_mail,
|
|
16
16
|
project::{crud_create::process_project_init, process::process_project},
|
|
17
|
+
run::process_run,
|
|
17
18
|
tenant::process::process_tenant,
|
|
18
19
|
},
|
|
19
20
|
smbcloud_network::environment::Environment,
|
|
@@ -207,6 +208,7 @@ async fn run(cli: Cli) -> Result<CommandResult> {
|
|
|
207
208
|
Some(Commands::Mail { command }) => process_mail(cli.environment, command).await,
|
|
208
209
|
Some(Commands::Auth { command }) => process_cloud_auth(cli.environment, command).await,
|
|
209
210
|
Some(Commands::Project { command }) => process_project(cli.environment, command).await,
|
|
211
|
+
Some(Commands::Run { command }) => process_run(cli.environment, command).await,
|
|
210
212
|
Some(Commands::Tenant { command }) => process_tenant(cli.environment, command).await,
|
|
211
213
|
Some(Commands::ControlKit { command }) => process_controlkit(command).await,
|
|
212
214
|
Some(Commands::Migrate {}) => process_migrate(cli.environment).await,
|