Skip to content

chore: improve first-run setup with init-generated secrets and action… - #56

Merged
samithreddychinni merged 1 commit into
mainfrom
issue28
Aug 1, 2026
Merged

chore: improve first-run setup with init-generated secrets and action…#56
samithreddychinni merged 1 commit into
mainfrom
issue28

Conversation

@samithreddychinni

Copy link
Copy Markdown
Collaborator

…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.

…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.
@vercel

vercel Bot commented Aug 1, 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 1, 2026 11:39am

@samithreddychinni
samithreddychinni merged commit ab32068 into main Aug 1, 2026
5 of 6 checks passed
samithreddychinni added a commit that referenced this pull request Aug 1, 2026
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.

2 participants