feat: complete install wizard with db, mail, storage, security & third-party config#8
Open
feat: complete install wizard with db, mail, storage, security & third-party config#8
Conversation
…d-party config Add a comprehensive multi-step installation wizard to the install-fleetbase command, replacing the minimal 4-variable setup with a full production-ready configuration flow. Changes: - Pre-flight checks: verify Docker, Docker Compose v2, and Git are installed; warn on port conflicts for 8000, 4200, 3306, and 38000 - Step 1 (core): add app name prompt alongside existing host/environment/directory - Step 3 (database): choose bundled Docker MySQL (auto-generated secure credentials) or external MySQL/RDS; sets DATABASE_URL, MYSQL_ROOT_PASSWORD, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_ALLOW_EMPTY_PASSWORD - Step 4 (mail): select driver (SMTP, Mailgun, Postmark, SendGrid, Resend, SES, or log); collect driver-specific credentials; sets MAIL_MAILER, MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM_ADDRESS, MAIL_FROM_NAME - Step 5 (storage): choose local disk, AWS S3, or Google Cloud Storage; sets FILESYSTEM_DRIVER, AWS_* / GOOGLE_CLOUD_* variables - Step 6 (security/CORS): auto-derive SESSION_DOMAIN and SOCKETCLUSTER_OPTIONS origins from the configured host; prompt for additional FRONTEND_HOSTS - Step 7 (third-party): optional IPINFO_API_KEY, GOOGLE_MAPS_API_KEY, GOOGLE_MAPS_LOCALE, TWILIO_SID, TWILIO_TOKEN, TWILIO_FROM - Write a complete docker-compose.override.yml covering application, socket, and database services; back up any existing override file - Active database readiness polling (mysqladmin ping) instead of a fixed sleep - Rich post-install summary showing configured/skipped items and next steps - Add --non-interactive flag to skip all optional prompts with safe defaults (useful for CI/CD pipelines) - Add helper functions: isPortAvailable(), execAsync(), buildEnvBlock()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the minimal 4-variable
install-fleetbasecommand with a full 9-step interactive installation wizard, making the Fleetbase CLI suitable for both development and production deployments out of the box.Problem
The existing
install-fleetbasecommand only configured four environment variables (APP_KEY,CONSOLE_HOST,ENVIRONMENT,APP_DEBUG). This left critical configuration gaps:MYSQL_ALLOW_EMPTY_PASSWORD: yes) and had no path to an external managed databaseSOCKETCLUSTER_OPTIONSwas never set)localhost, breaking session cookies on real domainsChanges
Pre-flight Checks (Step 0)
docker,docker compose(v2),git, andopensslare installedCore Configuration (Step 1)
APP_NAMEprompt alongside existing host/environment/directory optionsDatabase Configuration (Step 3)
crypto.randomBytes) or external MySQL/RDSDATABASE_URL,MYSQL_ROOT_PASSWORD,MYSQL_USER,MYSQL_PASSWORD,MYSQL_DATABASE,MYSQL_ALLOW_EMPTY_PASSWORD: noMail Configuration (Step 4)
MAIL_MAILER,MAIL_HOST,MAIL_PORT,MAIL_USERNAME,MAIL_PASSWORD,MAIL_FROM_ADDRESS,MAIL_FROM_NAMEand driver-specific keysFile Storage (Step 5)
FILESYSTEM_DRIVER,AWS_*/GOOGLE_CLOUD_*variablesSecurity & CORS (Step 6)
SESSION_DOMAINfrom the configured hostSOCKETCLUSTER_OPTIONSorigins to the configured hostFRONTEND_HOSTSfor CORSThird-Party APIs (Step 7)
IPINFO_API_KEY,GOOGLE_MAPS_API_KEY,GOOGLE_MAPS_LOCALE,TWILIO_SID,TWILIO_TOKEN,TWILIO_FROMConfig Writing (Step 8)
docker-compose.override.ymlcoveringapplication,socket, anddatabaseservicesmysqladmin ping) instead of a fixed sleepPost-Install Summary (Step 9)
Non-Interactive Mode
--non-interactiveflag skips all optional prompts with safe defaults (useful for CI/CD)New Helper Functions
isPortAvailable()— TCP port conflict detectionexecAsync()— promisified child process executionbuildEnvBlock()— clean YAML environment block builder