Skip to content

feat(happier): interactive daemon auth during install#4

Open
danljungstrom wants to merge 1 commit intohappier-dev:mainfrom
danljungstrom:danljungstrom/interactive-daemon-auth
Open

feat(happier): interactive daemon auth during install#4
danljungstrom wants to merge 1 commit intohappier-dev:mainfrom
danljungstrom:danljungstrom/interactive-daemon-auth

Conversation

@danljungstrom
Copy link

@danljungstrom danljungstrom commented Mar 4, 2026

Summary

  • Add a whiptail prompt during devbox installs (with UI enabled) offering to authenticate the daemon interactively
  • After setup completes, displays a QR code via hstack auth login that can be scanned with the Happier mobile app
  • On successful auth, restarts the service and updates post-install output to reflect the daemon is already connected

Details

  • New HAPPIER_PVE_DAEMON_AUTH variable flows from the whiptail UI through to the install script
  • Auth step runs after install is complete, with a 5-minute timeout and Ctrl+C to skip
  • Post-install instructions adapt based on whether auth was completed

Test plan

  • Fresh devbox install with UI enabled — verify whiptail prompt appears and "Yes" triggers QR code
  • Scan QR with mobile app — verify daemon authenticates and service restarts
  • Select "No" or Ctrl+C — verify install completes normally with manual auth instructions
  • Non-devbox install — verify no daemon auth prompt appears

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added daemon authentication flow for devbox installations with UI enabled, including prompts during the setup process
    • Implemented post-installation daemon authentication with success/failure messaging and optional service restart
    • Provides clear status indication when daemon is authenticated and running

Add a whiptail prompt (devbox + UI enabled) asking to authenticate the
daemon during install. Shows a QR code via hstack auth login that can
be scanned with the Happier mobile app. On success, restarts the
service and skips manual auth steps in post-install output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb95e20e-0e95-41f3-b476-c82a5daef385

📥 Commits

Reviewing files that changed from the base of the PR and between 2fade21 and fa89764.

📒 Files selected for processing (2)
  • ct/happier.sh
  • install/happier-install.sh

📝 Walkthrough

Walkthrough

Introduces a new daemon authentication flow for devbox installations with UI enabled. Adds configuration variables and prompts users to authenticate during install, then performs daemon login post-installation via a command-line tool, with conditional service restart on success.

Changes

Cohort / File(s) Summary
Environment & Configuration
ct/happier.sh
Declares and exports new HAPPIER_PVE_DAEMON_AUTH variable (default "0"), with prompt logic to set it to "1" during devbox installs with UI enabled.
Installation Flow & Daemon Auth
install/happier-install.sh
Implements daemon authentication workflow post-install: executes mobile auth via HSTACK_BIN when conditions met, handles success/failure outcomes, manages service restart on success, and adjusts post-install messaging to reflect daemon authentication status.

Sequence Diagram

sequenceDiagram
    participant User
    participant InstallScript as Install Script
    participant HSTACK as HSTACK_BIN
    participant Service as Stack Service
    participant UI as Post-Install UI

    User->>InstallScript: Trigger devbox install with UI
    InstallScript->>User: Prompt for daemon authentication
    User->>InstallScript: Confirm authentication
    InstallScript->>HSTACK: Execute mobile auth (300s timeout)
    alt Authentication Success
        HSTACK-->>InstallScript: Exit code 0
        InstallScript->>Service: Restart (if AUTOSTART=1)
        Service-->>InstallScript: Restart complete
        InstallScript->>UI: Display "Daemon authenticated & running"
    else Authentication Failure
        HSTACK-->>InstallScript: Non-zero exit code
        InstallScript->>UI: Display auth instructions
    end
    UI-->>User: Show final status message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A daemon wakes at install's call,
Through devbox gates, we authenticate all,
With mobile tokens and restarts so spry,
The stack springs to life—no question why! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description covers the key changes, test plan, and implementation details, but the template requires checkbox selections for prerequisites and type of change which are not completed. Complete the template by selecting the relevant checkboxes for prerequisites (self-review, testing, security) and type of change (e.g., 'New feature').
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: introducing interactive daemon authentication during installation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant