Commit Graph

2877 Commits

Author SHA1 Message Date
Bilal Godil
00390be2d8 fix tests 2026-03-26 20:15:57 -07:00
Bilal Godil
de0a5daff1 lint / typecheck fixes 2026-03-26 17:23:42 -07:00
Bilal Godil
3cd32cc2b1 Merge remote-tracking branch 'origin/emu-with-a-q' into emulator-perms-and-sdk-changes 2026-03-26 16:28:31 -07:00
Bilal Godil
0907f506c9 fix emulator race conditions, update ports to 167xx, improve onboarding flow 2026-03-26 11:15:04 -07:00
Bilal Godil
73455677c4 emulator and client sdk changes 2026-03-24 19:46:33 -07:00
Bilal Godil
815320a3d2 Merge branch 'client-sdk-local-emulator-support' into emulator-perms-and-sdk-changes 2026-03-23 18:41:49 -07:00
Bilal Godil
bc1f95124b local emulator allow localhost callback, add ssh debugging, fix file perms 2026-03-23 18:34:19 -07:00
mantrakp04
771ed156fe Update CLI tests for emulator commands
- Replaced the 'run' command expectation with 'start' in the emulator help output.
- Removed the test for 'emulator build' help as it is no longer relevant.
- Updated error message for invalid architecture in the 'emulator pull' test to improve clarity.

These changes enhance the accuracy and relevance of the CLI tests for the emulator functionality.
2026-03-23 18:06:20 -07:00
mantrakp04
6d9d4e793d Merge branch 'dev' into emu-with-a-q 2026-03-23 17:23:51 -07:00
mantrakp04
bef4aab955 Enhance QEMU emulator build workflow and add documentation
- Updated the GitHub Actions workflow to include specific paths for the QEMU emulator build, ensuring that changes in the local emulator directory trigger the workflow.
- Added a new README.md file for the QEMU local emulator, detailing its architecture, usage, and scripts for building and running the emulator, improving clarity for developers.
- Documented the build process and optimizations taken, providing comprehensive guidance for users on how to utilize the local emulator effectively.

These changes improve the usability and maintainability of the QEMU emulator setup, facilitating a smoother development experience.
2026-03-23 17:20:48 -07:00
Mantra
cfa6204c2d
Replace Web3Forms with internal feedback emails (#1244)
## Summary
- replace the dashboard feedback form's Web3Forms submission with an
authenticated internal backend endpoint
- send support and feature-request notifications through Stack Auth's
native internal email pipeline
- share internal project auth headers in the dashboard and add backend
E2E coverage for support feedback

## Testing
- pnpm typecheck
- pnpm lint -- "src/components/feedback-form.tsx"
"src/components/stack-companion/feature-request-board.tsx"

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Internal feedback submission endpoint with automated internal email
notifications
* New internal email builder and sending utility; recipient list
configurable via env

* **Enhancements**
* Feedback form requires sign-in, disables submit when unauthenticated,
and tightens validation
  * Centralized header helper for authenticated internal requests
* Feature request board gates actions for signed-out users and improves
upvote/submit reliability
* Runtime retrieval/validation of the feature-tracking API key and
streamlined user handling

* **Tests**
* End-to-end tests covering internal feedback flows, validation, and
email delivery
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-23 17:07:37 -07:00
mantrakp04
77d87fd2dd Refactor local emulator setup and enhance GitHub Actions workflow
- Updated the local emulator scripts to streamline command usage, replacing the previous docker-compose setup with a QEMU-based approach for improved performance and simplicity.
- Removed the outdated `docker-compose.yaml` file and adjusted related scripts to utilize QEMU for running the emulator, enhancing clarity and maintainability.
- Enhanced the GitHub Actions workflow to include a smoke test for the emulator, ensuring that services are healthy after startup.
- Updated environment variable handling in the emulator scripts to reflect new port configurations, improving service accessibility.
- Adjusted documentation to reflect the new emulator commands and usage patterns, providing clearer guidance for developers.

These changes improve the usability and reliability of the local emulator setup, facilitating a smoother development experience.
2026-03-23 15:25:05 -07:00
Mantra
3efb226c59
make publishable client keys truly optional ig (i hope) (#1274)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Documentation

* Updated setup instructions across all documentation to clarify that
the publishable client key is only required when your project
configuration enforces it, removing confusion about unconditional
requirements.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-23 15:09:01 -07:00
Mantra
736c1a19b1
make signed up at default to now (#1284) 2026-03-23 15:02:43 -07:00
Konstantin Wohlwend
238ed06120 Hover tooltip for signup rules 2026-03-23 12:34:23 -07:00
Mantra
d22593d535
private files n sm build shit (#1276)
- Introduced a fallback mechanism for the private sign-up risk engine,
allowing for zero-score assessments when the primary engine is
unavailable.
- Updated Next.js configuration to support dynamic resolution of the
private risk engine, including aliasing for both Turbopack and Webpack.
- Added a new fallback implementation in
`private-sign-up-risk-engine-fallback.ts` to ensure consistent behavior
during builds.
- Adjusted `risk-scores.tsx` to utilize the new compiled engine,
improving error handling and logging for risk assessment failures.

This update improves the robustness of the sign-up risk scoring system
and enhances the development experience by streamlining engine
resolution.

<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Sign-up risk engine is initialized and validated at startup for more
predictable performance.
* If the risk engine is unavailable or invalid, the system immediately
returns safe zero-risk scores to avoid runtime failures.
* **Tests**
* End-to-end tests updated to match the new engine initialization and
detection behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
2026-03-23 12:31:36 -07:00
mantrakp04
9d0f7c1acd Refactor local emulator scripts and configuration management
- Updated local emulator scripts to standardize command names and improve clarity, changing references from `generate-local-emulator-env` to `emulator:generate-env` and similar adjustments for other commands.
- Introduced a new configuration file (`stack.config.ts`) to centralize authentication and team settings, enhancing the management of user permissions and onboarding processes.
- Removed the outdated `.env.development` file to streamline environment handling, ensuring that the local emulator relies on generated configurations.
- Adjusted documentation and example usage to reflect the new command structure and configuration file, improving developer experience.

These changes enhance the usability and maintainability of the local emulator setup, providing a clearer structure for configuration and command usage.
2026-03-23 11:43:09 -07:00
mantrakp04
14f816449f Enhance local emulator project handling and configuration validation
- Introduced file existence checks in the local emulator project route to ensure the specified config file is present before proceeding with project creation.
- Updated the `setBranchConfigOverride` function to streamline writing configurations directly to the file when the local emulator is enabled, improving reliability.
- Refactored the `readConfigFromFile` function to handle empty file scenarios by writing a default config, enhancing user experience.
- Adjusted related tests to reflect changes in error handling and file creation logic, ensuring robust validation of local emulator functionality.

These updates improve the local emulator's configuration management and enhance the overall developer experience.
2026-03-23 11:02:59 -07:00
BilalG1
381e057c1f
fix query route safe clickhouse error codes (#1268)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Refined analytics query error classification so certain database
errors are treated as known/handled, reducing exposure of internal
diagnostics in responses.

* **Tests**
* Added end-to-end tests verifying safe (masked) error responses,
preventing leakage of restricted column/identifier details and
constraining suggestion text in error messages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-23 10:30:00 -07:00
BilalG1
d51c303fb0
fix clickhouse surrogate pair bug (#1270)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Enhanced analytics event processing to properly handle edge cases when
data contains certain truncated special characters or emoji sequences,
ensuring data integrity.

* **Tests**
  * Added coverage for analytics data edge case handling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-23 10:09:04 -07:00
Aman Ganapathy
1d00ed2c64
[Fix]: Investigate Memory Leak on Verify Data Integrity (#1269)
### Context
We encountered an out of memory error when running verify-data-integrity
against the prod database. This was the error:
`FATAL ERROR: Ineffective mark-compacts near heap limit Allocation
failed - JavaScript heap out of memory`. This was one of the things
preventing verify-data-integrity from running successfully in prod.

### Summary of Changes
Local stress testing with constrained heap and memory telemetry revealed
that the rise in used heap memory was directly proportional to the
number of api calls. Investigation revealed that the `currentOutputData`
array was growing with each api call and was kept in memory. Since it
was still being appended to, it was actively kept in the heap. We
refactor the script to no longer use it, and for the two flags
`--save-output` and `--verify-output` that used it before, we refactor
them to not need to. `--save-output` now streams responses to disk as
JSONL and `--verify-output` now compares each response immediately and
discards it.
We also note a potential source of a future memory leak in the
`allUsers` array that is populated in memory for each project. We
refactor to paginate instead. Note that this didn't cause a memory leak
on local, this is a preventive measure.

### Out of Scope
fetching all transactions in the payments section of the script is
another potential cause for concern, but since the payments section of
the script will be refactored soon, we defer that discussion.
2026-03-23 08:55:10 -07:00
Mantra
0886586aa7
risk score calculation debug logs (#1275)
- Updated pnpm-lock.yaml to include 'rolldown' as a new optional
dependency and upgraded 'minimatch' to version 10.2.4.
- Added a debug log statement in risk-scores.tsx to indicate when the
sign-up risk engine is disabled in the public build.

<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Signup risk scoring now returns a neutral (zero) score when the
scoring engine is unavailable; scoring errors are logged and surfaced
consistently instead of being silently swallowed.
* Invalid engine shapes now fail loudly rather than falling back
silently.

* **Chores**
* Updated private engine reference and adjusted tests to reflect the new
loading/resolution behavior.
* Expanded Next.js output tracing to include private package files used
by API routes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-21 05:26:28 +00:00
Mantra
e59a70783e
Turnstile integration for fraud protection (#1239)
Enhances sign-up process with Turnstile integration for fraud
protection. Builds on top of fraud-protection-temp-emails.

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Cloudflare Turnstile bot-protection across signup/sign-in flows
(including SDK JSON mode).
  * Email deliverability checks via Emailable.
* Sign-up risk scoring with persisted risk metrics and country code
tracking.
* UI: country-code selector, risk-score editing in user details, users
list refresh button, and Turnstile signup demo pages.

* **Bug Fixes**
  * Use actual sign-up timestamp for reporting/metrics.

* **Documentation**
* Expanded knowledge base on Turnstile, risk scoring, and env
configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
Co-authored-by: BilalG1 <bg2002@gmail.com>
Co-authored-by: Armaan Jain <84474476+Developing-Gamer@users.noreply.github.com>
Co-authored-by: nams1570 <amanganapathy@gmail.com>
2026-03-20 21:26:45 +00:00
mantrakp04
a233e64b8e Update local emulator environment handling and documentation
- Modified the local emulator scripts to replace references from `.env.development` to `base.env`, ensuring consistency in environment variable sourcing.
- Updated the QEMU runtime path in the documentation to clarify the cause of a regression in the local emulator's startup time.
- Enhanced the `.dockerignore` file to exclude new emulator-related files, improving build efficiency.

These changes streamline the local emulator setup and improve clarity in documentation regarding environment configurations.
2026-03-19 21:57:41 -07:00
mantrakp04
ad2db193b6 Refactor local emulator configuration validation and enhance CLI tests
- Improved the `readConfigFromFile` function in `local-emulator.ts` to provide clearer error handling for invalid configurations, ensuring robust validation of the exported config object.
- Added a new test in `cli.test.ts` to verify that the emulator CLI correctly rejects invalid architecture values, enhancing test coverage for the emulator command.
- Simplified the startup time logging in `run-emulator.sh` by removing unnecessary Python calls, improving script efficiency.

These changes enhance the reliability and usability of the local emulator and its CLI interface.
2026-03-19 19:42:15 -07:00
mantrakp04
e5099471e4 Enhance local emulator setup with environment generation and configuration updates
- Introduced a new script to generate the local emulator environment file (`.env.development`) based on existing backend and dashboard configurations, ensuring consistency and ease of use.
- Updated `docker-compose.yaml` to reference the new environment file, improving configuration management for the local emulator.
- Modified emulator startup scripts to include environment generation, streamlining the process for developers.
- Added a new environment file for local development, containing necessary credentials and settings for the emulator.

These changes improve the local emulator's usability and configuration management, facilitating a smoother development experience.
2026-03-19 18:05:12 -07:00
mantrakp04
d5d2a0916d Increase EMULATOR_READY_TIMEOUT in QEMU emulator build workflow
- Updated the EMULATOR_READY_TIMEOUT variable from 600 to 3200 seconds in the GitHub Actions workflow for the QEMU emulator build process.
- This change aims to provide additional time for the emulator to become ready, enhancing reliability during the build and testing phases.

These adjustments improve the overall performance and stability of the QEMU emulator setup.
2026-03-19 17:52:41 -07:00
mantrakp04
f3514f8fdd Refactor QEMU emulator build and local emulator configuration
- Updated the GitHub Actions workflow to streamline the QEMU emulator image build process, including improved handling of existing releases and enhanced error reporting.
- Refactored local emulator configuration management to support reading from host-mounted paths, ensuring robust file handling and error reporting for configuration reads and writes.
- Added tests to validate new configuration handling features, improving reliability for developers working with local emulator setups.

These changes enhance the overall performance and usability of the QEMU emulator and local emulator configuration management.
2026-03-19 17:49:05 -07:00
mantrakp04
4be8a8299b Update QEMU emulator build workflow for improved performance and reliability
- Changed the runner to `ubicloud-standard-8` and increased the timeout to 120 minutes for the build job, enhancing resource allocation.
- Added a step to set up QEMU user-mode emulation, improving compatibility for different architectures.
- Adjusted environment variables for the build and emulator run scripts to optimize execution time and reliability.

These changes enhance the QEMU emulator build process and ensure better performance during image creation and testing.
2026-03-19 16:41:53 -07:00
mantrakp04
42bc12587c Enhance setBranchConfigOverride for local emulator file handling
- Updated the `setBranchConfigOverride` function to write branch configuration directly to a file when the local emulator is enabled, ensuring the file serves as the single source of truth.
- Added tests to verify that configuration writes to the local emulator file are handled correctly and that database operations are skipped when writing to the file.
- Improved error handling to surface file write failures before attempting database updates.

These changes enhance the local emulator's configuration management and improve reliability for developers working with branch configurations.
2026-03-19 15:31:17 -07:00
Mantra
80ee1ab9fb
Merge branch 'dev' into emu-with-a-q 2026-03-19 15:09:17 -07:00
mantrakp04
578593a6da Enhance QEMU emulator build workflow and local emulator configuration
- Updated the GitHub Actions workflow to improve the release process for QEMU emulator images, including checks for existing releases and editing them if necessary.
- Refactored local emulator configuration handling to ensure proper file writing and directory creation, enhancing robustness.
- Added tests for writing configuration files to validate functionality and improve reliability.

These changes improve the automation of the QEMU emulator build process and enhance the local emulator's configuration management for developers.
2026-03-19 15:09:04 -07:00
Mantra
1e44a8c5ba
Fix Convex dashboard route (#1255)
## Summary
- add the missing Convex dashboard route
- redirect the Convex project page to the Convex docs instead of 404ing

## Testing
- pnpm lint --
"src/app/(main)/(protected)/projects/[projectId]/convex/page.tsx"
- pnpm typecheck
2026-03-19 14:36:24 -07:00
Bilal Godil
25f8b1ca48 Gate server and admin emulator requests on credential init
Some checks failed
DB migration compat / Check if migrations changed (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled
Add prepareRequest callbacks to StackServerInterface and
StackAdminInterface that await _emulatorInitPromise, matching
the existing pattern in the client app. Prevents race conditions
where requests use placeholder credentials before the emulator
credentials are fetched.
2026-03-19 14:11:16 -07:00
mantrakp04
298062a895 Enhance local emulator configuration handling and file management
- Added functionality to write an empty configuration file if none exists when processing a project in `route.tsx`.
- Updated `readConfigFromFile` in `local-emulator.ts` to support reading configuration from an environment variable, improving flexibility in configuration management.
- Ensured the directory structure is created when writing configuration files, enhancing file handling robustness.

These changes improve the local emulator's configuration management and usability for developers.
2026-03-19 13:26:52 -07:00
mantrakp04
8336d4821d Refactor local emulator type handling and architecture detection
- Updated `local-emulator.ts` to explicitly cast the module evaluation result to `Record<string, unknown>`, improving type safety.
- Enhanced `emulator.ts` architecture detection with clearer case structures for better readability and maintainability.

These changes improve code clarity and type management in the local emulator setup.
2026-03-19 12:55:44 -07:00
mantrakp04
3321e5c466 Update QEMU emulator scripts to improve KVM detection and service status reporting
- Modified `build-image.sh` and `run-emulator.sh` to check for write permissions on `/dev/kvm` instead of existence, enhancing compatibility with various environments.
- Added status tracking for services in `run-emulator.sh`, allowing for better error handling and reporting during emulator status checks.

These changes enhance the reliability and usability of the QEMU emulator setup.
2026-03-19 12:52:41 -07:00
mantrakp04
5d98b44c34 Remove deprecated configuration files and streamline emulator CLI commands
- Deleted `stack.config.ts` and `CLAUDE-KNOWLEDGE.md` as they are no longer needed.
- Refactored the `local-emulator.ts` to improve error handling and type definitions.
- Updated the `header.tsx` component to remove the Emulator Status link, simplifying the navigation.
- Enhanced the `emulator.ts` CLI commands for better readability and maintainability.

These changes improve the overall structure and usability of the emulator and related components.
2026-03-19 12:51:57 -07:00
Mantra
fe16a717d8
Merge branch 'dev' into emu-with-a-q 2026-03-19 12:27:29 -07:00
mantrakp04
4a43a88bf4 Update emulator configuration and enhance CLI functionality
- Modified `stack.config.ts` to adjust authentication settings, enabling OTP and passkey sign-ins while disabling password sign-in.
- Updated the GitHub Actions workflow for the QEMU emulator to improve the start and stop commands, enhancing clarity in the process.
- Refactored the CLI commands for the emulator, removing snapshot options and streamlining the pull command for image downloads.
- Added new tests for the emulator CLI to validate help and argument parsing, ensuring a better developer experience.

These changes improve the configuration management and usability of the QEMU emulator for developers.
2026-03-19 12:26:54 -07:00
mantrakp04
0496cd2c4d Add QEMU emulator build workflow and emulator command integration
- Introduced a new GitHub Actions workflow for building and publishing QEMU emulator images, triggered on pushes to main and dev branches, as well as pull requests.
- Added a new `emulator` command in the Stack CLI to manage QEMU emulator operations, including pulling images, starting, stopping, and checking status.
- Implemented functionality for downloading emulator images from GitHub Releases and managing snapshots, enhancing the local development experience.

These changes significantly improve the automation and usability of the QEMU emulator for developers.
2026-03-19 11:29:22 -07:00
mantrakp04
c1a15ff470 Enhance local emulator configuration and file management
- Updated `stack.config.ts` to enable password sign-in for authentication.
- Refactored `config.tsx` to include functionality for writing configuration changes back to the local emulator's config file.
- Introduced `writeConfigToFile` and `getLocalEmulatorFilePath` functions in `local-emulator.ts` to improve file handling and path resolution.
- Enhanced `run-emulator.sh` to support mounting the host filesystem, facilitating better integration with the local environment.

These changes improve the local emulator's configuration management and usability for developers.
2026-03-18 21:11:04 -07:00
mantrakp04
5a729ec89d Enhance configuration and permissions in local emulator setup
- Updated `stack.config.ts` to enable various application features including authentication, emails, teams, RBAC, API keys, webhooks, and launch checklist.
- Modified `seed.ts` to grant team permissions for the local emulator admin user, improving access control.
- Adjusted `run-emulator.sh` to allow auto-detection of the configuration file, enhancing usability.
- Updated `.gitignore` to include the new `run/` directory, ensuring cleaner repository management.

These changes improve the local emulator's configuration management and user experience for developers.
2026-03-18 19:40:27 -07:00
mantrakp04
e3592bb9f5 Add base image fingerprinting for QEMU snapshots
- Introduced a new function to generate a fingerprint of the base QEMU image, allowing for detection of changes since the last snapshot.
- Updated snapshot handling logic to discard stale snapshots if the base image has changed, improving reliability and efficiency.
- Enhanced the `run-emulator.sh` script to save the fingerprint after a snapshot is created, ensuring accurate tracking of image state.

These changes enhance the snapshot management process in the QEMU emulator, providing better consistency and performance for developers.
2026-03-18 18:37:16 -07:00
mantrakp04
580ff10b9f Refactor local emulator setup and consolidate services
- Renamed and restructured the Docker Compose configuration to unify the local emulator services into a single `stack-local` service, simplifying the architecture.
- Updated the Dockerfile to include a multi-stage build process for the local emulator, integrating the backend and dashboard into a single image.
- Introduced a new `start-app.sh` script to manage service initialization and health checks, ensuring all dependencies are ready before starting the application.
- Enhanced the cloud-init user-data script to streamline the setup process and improve service management.
- Removed obsolete service definitions and scripts, reducing complexity and improving maintainability.

These changes significantly enhance the local emulator's usability and performance for developers.
2026-03-18 18:24:29 -07:00
mantrakp04
dec62a0c26 Refactor QEMU emulator build and snapshot handling
- Updated the `build-image.sh` script to simplify the Docker image list, focusing on the main emulator image.
- Enhanced the image compression process by adding progress logging during the conversion to qcow2 format.
- Improved the `run-emulator.sh` script to provide real-time feedback while saving snapshots, enhancing user experience.

These changes streamline the build process and improve the usability of the emulator's snapshot functionality.
2026-03-18 18:10:21 -07:00
mantrakp04
4508f24d3c Enhance Dockerfile for local emulator and server setup
- Updated the local emulator Dockerfile to include a multi-stage build process, improving dependency management and reducing image size.
- Added Node.js build stages and integrated pnpm for package management, enhancing build efficiency.
- Implemented a migration-pruner stage to remove unnecessary node_modules, optimizing runtime performance.
- Refined the server Dockerfile to utilize pruned node_modules for runtime, ensuring a leaner image.
- Enhanced entrypoint and initialization scripts for better service startup processes.
- Updated exposed ports to include backend and dashboard services, improving accessibility.

These changes significantly improve the Docker setup for both local emulator and server, enhancing performance and maintainability.
2026-03-18 18:09:36 -07:00
mantrakp04
c2e4698dfc Refactor local emulator configuration management and remove obsolete file bridge
- Removed the `readConfigFileContentIfExists` and `writeConfigToFile` functions from the local emulator module, simplifying file handling.
- Updated the `readConfigFromFile` function to utilize environment variables for configuration content, enhancing flexibility.
- Refactored tests to align with the new configuration management approach, ensuring accurate validation of file reading and handling.
- Consolidated Docker environment variables into a new `base.env` file for improved organization and maintainability.
- Removed the host file bridge script and related logic, streamlining the emulator's architecture and reducing complexity.

These changes significantly enhance the local emulator's usability and maintainability for developers.
2026-03-18 15:33:44 -07:00
mantrakp04
00106429ad Refactor QEMU emulator setup and consolidate cloud-init configurations
- Unified the QEMU emulator setup by consolidating the previously separate VM roles (deps and dev-server) into a single VM, simplifying the architecture and reducing complexity.
- Updated the `build-image.sh` script to adjust resource allocations and streamline image building processes.
- Enhanced the `prepare-image-bundle.sh` script to support multiple Docker images, improving the packaging of emulator components.
- Refactored cloud-init configurations to use a single definition for the emulator, improving maintainability and clarity.
- Updated documentation in CLAUDE-KNOWLEDGE.md to reflect changes in the emulator's architecture and cloud-init usage.

These changes significantly enhance the QEMU emulator's usability and performance for developers.
2026-03-18 13:46:27 -07:00
mantrakp04
f8fcf9dd8a Squashed commit of the following:
commit 5d43722575b826a8ed8dbb6b828f48eae4bca02c
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Wed Mar 18 12:27:01 2026 -0700

    Add QEMU emulator snapshot functionality and reset command

    - Introduced a new `emulator-qemu:reset` command in package.json to clear snapshots and force a fresh boot of the emulator.
    - Enhanced the `run-emulator.sh` script to support saving and restoring snapshots, significantly reducing restart time from ~62s to ~4s.
    - Implemented logic to check for existing snapshots and restore them during startup, improving the emulator's efficiency.
    - Updated documentation in CLAUDE-KNOWLEDGE.md to explain the new snapshot restore process and its benefits.

    These changes enhance the QEMU emulator's performance and usability for developers, providing a more efficient workflow during development.

commit 3877445bdd83cb8690da18c8520bf260d2795172
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Wed Mar 18 11:55:18 2026 -0700

    Enhance QEMU emulator performance and configuration management

    - Added optimizations to the QEMU emulator's app container startup process, reducing startup time from ~92s to ~62s by using qcow2 backing files and setting the working directory to /app.
    - Updated the build-image.sh script to conditionally wait for background processes, improving robustness.
    - Modified the run-emulator.sh script to create the disk image using qcow2 format instead of copying, enhancing efficiency.
    - Adjusted the cloud-init user-data to set STACK_RUNTIME_WORK_DIR to /app, streamlining file operations during container initialization.
    - Improved the entrypoint script to avoid unnecessary file copying when the working directory is set to /app.

    These changes significantly enhance the performance and usability of the QEMU emulator for developers.

commit e0b86d3f1d5c08e46d0d343bc632e2a8c5777845
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Wed Mar 18 11:07:55 2026 -0700

    Refactor local emulator configuration management and enhance Docker setup

    - Removed redundant comments and improved code clarity in the local emulator's route handling.
    - Streamlined the Dockerfile and docker-compose.yaml for better readability and maintenance.
    - Updated entrypoint and initialization scripts to enhance service startup processes.
    - Introduced a new common script for QEMU emulator to centralize architecture detection and firmware handling.
    - Enhanced error handling in the host file bridge for improved robustness.
    - Removed obsolete country code utilities to clean up the codebase.

    These changes significantly improve the local emulator's configuration management and overall setup experience for developers.

commit 4fb0f93c6cc4f749a14acf0228c261e180875609
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Wed Mar 18 10:24:53 2026 -0700

    Implement local emulator file bridge for enhanced configuration management

    - Introduced a new host file bridge to facilitate reading and writing configuration files between the local emulator and the host system.
    - Refactored the local-emulator module to utilize the file bridge for file operations, improving error handling and response validation.
    - Added tests to ensure the file bridge functionality works as expected, including handling of non-existent files and writing configurations.
    - Updated the run-emulator script to start the file bridge automatically, ensuring seamless integration during emulator startup.
    - Enhanced documentation to reflect the new file bridge capabilities and usage instructions.

    These changes significantly improve the local emulator's ability to manage configuration files, enhancing the development experience.

commit 3d18a7ce5bbf00a62a40a3f48f27856e79ecc62f
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Tue Mar 17 22:36:46 2026 -0700

    Refactor QEMU local emulator setup and enhance app bundle handling

    - Introduced a new script for packaging Docker images into a compressed app bundle, improving the emulator's deployment process.
    - Updated build-image.sh to create a runtime configuration ISO, ensuring better management of environment settings.
    - Enhanced cloud-init user-data scripts for both dev-server and deps guests, streamlining service setup and configuration.
    - Improved the run-emulator.sh script to facilitate better handling of runtime configurations and dependencies.
    - Adjusted the .gitignore to include .DS_Store and removed obsolete entries, cleaning up the repository.

    These changes significantly enhance the local emulator's functionality and reliability for developers.

commit 8a35fb1ce79898d73e2259e256c11b6fd9b0a584
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Tue Mar 17 21:52:24 2026 -0700

    Enhance local emulator functionality and configuration

    - Updated package.json to improve the start-emulator command, providing clearer dashboard and backend URLs.
    - Added a new wait-until-emulator-is-ready command to ensure the emulator is fully operational before proceeding.
    - Refactored the local-emulator project route to streamline file existence checks and default config creation.
    - Enhanced user guidance in the dashboard for local Stack config file handling.
    - Updated tests to reflect changes in config file handling, ensuring non-existent files are created with default settings.
    - Improved Docker configurations for the local emulator, including new environment variables and service dependencies.

    These changes significantly enhance the local development experience and emulator reliability.

commit 3910ed4bc40bbb37340c1c316c24c2826ba372bd
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Tue Mar 17 19:59:36 2026 -0700

    Remove unused stash-0.patch file to clean up the repository.

commit 74146d974458037a7a9590120a524629a1a6a162
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Tue Mar 17 19:58:46 2026 -0700

    Enhance QEMU local emulator with app bundle support and runtime configuration

    - Introduced a new script to package the backend and dashboard assets into a standalone app bundle for the QEMU emulator.
    - Updated the build-image.sh script to create an ISO containing the app bundle, ensuring the guest image includes the full runtime.
    - Modified cloud-init user-data to handle the new app bundle and runtime configuration, improving the setup process for local development.
    - Enhanced the run-emulator.sh script to prepare and mount the runtime configuration ISO, facilitating better environment management for the emulator.
    - Updated the user-data to include necessary environment variables for the stack application, ensuring seamless integration during startup.

    These changes significantly improve the local emulator's functionality and ease of use for developers.

commit 9e865a1cf524398bc58f00e0836278775c4ae936
Author: mantrakp04 <mantrakp@gmail.com>
Date:   Tue Mar 17 16:50:45 2026 -0700

    Enhance local emulator setup with new services and configurations

    - Added Docker support for a local emulator, integrating PostgreSQL, Redis, Inbucket, Svix, ClickHouse, MinIO, and QStash.
    - Introduced new scripts for managing the emulator lifecycle, including build and run commands.
    - Implemented cloud-init provisioning for automatic service setup on first boot.
    - Updated package.json with new commands for emulator management and added dotenv-cli for environment variable management.
    - Added tests for OAuth authorization flow to return JSON responses.
    - Included configuration files for ClickHouse and user management.

    This commit significantly improves the local development experience by providing a comprehensive emulator environment.
2026-03-18 12:31:32 -07:00