Skip to content

chore: improve first-run setup with init-generated secrets and actionable doctor - #60

Merged
samithreddychinni merged 16 commits into
mainfrom
dev
Aug 2, 2026
Merged

chore: improve first-run setup with init-generated secrets and actionable doctor#60
samithreddychinni merged 16 commits into
mainfrom
dev

Conversation

@samithreddychinni

Copy link
Copy Markdown
Collaborator

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.

samithreddychinni and others added 16 commits July 9, 2026 17:07
- `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
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
paystable Ready Ready Preview Aug 2, 2026 10:44am

@samithreddychinni
samithreddychinni merged commit d0f4516 into main Aug 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Improve first-run setup in installer and doctor

2 participants