chore: improve first-run setup with init-generated secrets and actionable doctor - #60
Merged
Conversation
This reverts commit ce51df7.
- `GenerateSecureKey`: Returns 32 random bytes encoded as a 64 character hex string. - `GenerateAll`: Provides a set of default secret keys required for a fresh installation (Webhook, Merchant Callback, Admin API, and Encryption keys).
- Added `init` command logic and usage instructions - Included an embedded `.env.template` for consistent environment configuration - Updated the `doctor` command to identify missing generated secrets and suggest running `init` - Refined required environment variable checks in `doctor` to improve onboarding clarity
- Updated installation script to handle downloads and setup more robustly - Updated onboarding instructions generated during installation
- Grouped environment variable checks into generated secrets and gateway credentials. - Improved error messages and actionable advice for missing configuration. - Added structured output sections for "Environment", "Database", and "Migrations". - Enhanced database connection error handling with context-aware advice. - Added logic to report and apply pending migrations automatically. - Differentiated between fatal configuration errors and non-fatal gateway warnings.
- Added `paystable init` command to automatically generate local secrets into a `.env` file, replacing the manual `.env.example` copy process. - Updated the installer to use `./paystable init` for initial environment setup. - Enhanced `paystable doctor` with structured sections for Environment, Database, and Migrations, providing clearer instructions for next steps. - Refactored status line printing in `doctor.go` to use an overridable `io.Writer` for better testability.
- Added `doctor_test.go` to verify database URL parsing and connection error explanations. - Included tests for various PostgreSQL error scenarios (missing database, authentication failures, connection refused) with platform-specific hints. - Added `init_test.go` to validate environment file creation and configuration defaults.
The `curl` command for downloading checksums was incorrectly split across multiple lines, causing it to fail. Now I joined the command into a single line to ensure the checksums.txt file is downloaded correctly before verification.
…able doctor (#55) * feat(secrets): add secure key generation utilities - `GenerateSecureKey`: Returns 32 random bytes encoded as a 64 character hex string. - `GenerateAll`: Provides a set of default secret keys required for a fresh installation (Webhook, Merchant Callback, Admin API, and Encryption keys). * feat(cmd): add init command for automated environment setup - Added `init` command logic and usage instructions - Included an embedded `.env.template` for consistent environment configuration - Updated the `doctor` command to identify missing generated secrets and suggest running `init` - Refined required environment variable checks in `doctor` to improve onboarding clarity * docs: update installation script - Updated installation script to handle downloads and setup more robustly - Updated onboarding instructions generated during installation * feat(cmd/doctor): improve local setup check and error reporting - Grouped environment variable checks into generated secrets and gateway credentials. - Improved error messages and actionable advice for missing configuration. - Added structured output sections for "Environment", "Database", and "Migrations". - Enhanced database connection error handling with context-aware advice. - Added logic to report and apply pending migrations automatically. - Differentiated between fatal configuration errors and non-fatal gateway warnings. * feat: add paystable init and enhance doctor command - Added `paystable init` command to automatically generate local secrets into a `.env` file, replacing the manual `.env.example` copy process. - Updated the installer to use `./paystable init` for initial environment setup. - Enhanced `paystable doctor` with structured sections for Environment, Database, and Migrations, providing clearer instructions for next steps. - Refactored status line printing in `doctor.go` to use an overridable `io.Writer` for better testability. * test: add unit tests for doctor and init commands - Added `doctor_test.go` to verify database URL parsing and connection error explanations. - Included tests for various PostgreSQL error scenarios (missing database, authentication failures, connection refused) with platform-specific hints. - Added `init_test.go` to validate environment file creation and configuration defaults. * fix(install): fix broken curl command in installation script The `curl` command for downloading checksums was incorrectly split across multiple lines, causing it to fail. Now I joined the command into a single line to ensure the checksums.txt file is downloaded correctly before verification.
fix(lint): resolve errcheck and ineffassign warnings
chore: improve first-run setup with init-generated secrets and actionable doctor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Promotes the verified first-run setup improvements from #59 into
main.All dev CI checks passed: lint, tests, dashboard, build, GitGuardian, and Vercel.
Closes #28.