From 6163d07bc3b2bb925bf716ec3095016fa0f633ba Mon Sep 17 00:00:00 2001 From: broisnischal Date: Sat, 21 Nov 2026 11:20:23 +0545 Subject: [PATCH] Public beta label, secrets backup tooling, README refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - App: 'BETA' badge + note in Settings › About and 'beta' beside the version while major < 1 (AppStage, tested) - Website: Beta pill beside the logo, 'Public beta' in the hero line - scripts/secrets.sh: encrypted iCloud backup/restore of apps/web/.env + apps/macos/.env, push to Cloudflare/GitHub (always re-backs up), check for remote secrets with no local copy - Release env template moves to apps/macos/.env.example; set-github-secrets.sh defers to secrets.sh - README: beta notice, features page, AI agents (MCP), feed on ewiz.app, secrets workflow --- .changeset/public-beta.md | 5 + README.md | 61 +++++- .env.example => apps/macos/.env.example | 15 +- apps/macos/Sources/EWizKit/AppStage.swift | 10 + apps/macos/Sources/eWiz/SettingsView.swift | 30 ++- apps/macos/Sources/eWiz/UpdaterManager.swift | 4 + .../Tests/EWizKitTests/AppStageTests.swift | 19 ++ apps/macos/scripts/set-github-secrets.sh | 50 +---- .../src/components/landing/landing-page.tsx | 2 +- apps/web/src/components/site/site-shell.tsx | 7 +- package.json | 12 +- scripts/secrets.sh | 194 ++++++++++++++++++ 12 files changed, 343 insertions(+), 66 deletions(-) create mode 100644 .changeset/public-beta.md rename .env.example => apps/macos/.env.example (59%) create mode 100644 apps/macos/Sources/EWizKit/AppStage.swift create mode 100644 apps/macos/Tests/EWizKitTests/AppStageTests.swift create mode 100755 scripts/secrets.sh diff --git a/.changeset/public-beta.md b/.changeset/public-beta.md new file mode 100644 index 0000000..e2b5c2d --- /dev/null +++ b/.changeset/public-beta.md @@ -0,0 +1,5 @@ +--- +"ewiz": patch +--- + +**eWiz is now labelled as a public beta.** Settings › About shows a Beta badge and a line on what that means, and the version under Updates reads "beta" too. The label goes away by itself at 1.0. Until then, **Report a Bug** in About is the most helpful thing you can do; it attaches the diagnostics for you. diff --git a/README.md b/README.md index cea4537..0159779 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,14 @@ Charge limiting, heat-aware charging, sleep-safe enforcement, and one-tap save modes — all from your menu bar, built for Apple Silicon. Website · +Features · Buy · Releases · -Feedback +Feedback · +Donate +![Status](https://img.shields.io/badge/status-public%20beta-orange) +![Release](https://img.shields.io/github/v/release/stroke-app/ewiz?label=release) ![Platform](https://img.shields.io/badge/macOS-14%2B-blue) ![Arch](https://img.shields.io/badge/Apple%20Silicon-arm64-black) ![Price](https://img.shields.io/badge/price-%242.99-green) @@ -19,6 +23,11 @@ modes — all from your menu bar, built for Apple Silicon. +> **eWiz is in public beta.** It's stable enough to run every day and is updated +> often. Until 1.0, expect rough edges and please +> [report anything odd](https://github.com/stroke-app/ewiz/issues/new); the app's +> **Report a Bug** button attaches the diagnostics for you. + ## Why eWiz exists Lithium batteries wear out fastest when they sit at a high charge and when they @@ -33,6 +42,10 @@ of the time. ## What it does +New to it? [ewiz.app/features](https://ewiz.app/features) walks through every setting +in plain language. In the app, Settings shows the everyday options first; switch on +**Advanced settings** at the bottom of the sidebar for the rest. + **Charging & longevity** - **Charge limit** — cap charging anywhere from 50–100%. eWiz holds the level @@ -146,6 +159,11 @@ change is never a mystery. *Settings → Shortcuts*, defaults sit on ⌃⌥⌘, and anything disruptive (sleep, force discharge) ships unbound. No Accessibility permission needed: eWiz claims only the combinations you assign and never sees anything else you type. +- **AI agents (MCP)** — eWiz ships an MCP server inside the app. Connect Claude + Desktop or Cursor in one click from *Settings → Automation* (or copy the command for + Claude Code and other clients), and an agent can keep the Mac awake through a long + job and release it after, read battery status, and, only if you allow it, change the + charge limit, pause charging, save mode, Low Power Mode and sleep settings. - **Launch at login** and **in-app auto-update**, and it'll tell you if the helper ever falls out of date so features don't silently stop working. @@ -248,15 +266,18 @@ This is a monorepo ([Bun](https://bun.sh) workspaces + [Turborepo](https://turbo | [`apps/web`](apps/web) | [ewiz.app](https://ewiz.app): website, checkout and licensing (TanStack Start on Cloudflare) | | `packages/` | Shared code (empty for now) | -The in-app update feed (`appcast.xml` / `appcast.json`) and the Homebrew cask still -live in [`stroke-app/ewiz-releases`](https://github.com/stroke-app/ewiz-releases): -installed copies read the feed from that URL, and the release workflow publishes to it. +The in-app update feed is `https://ewiz.app/appcast.xml`, which serves the +`appcast.xml` attached to the latest GitHub release. Copies up to 0.19.10 still read +the legacy feed in [`stroke-app/ewiz-releases`](https://github.com/stroke-app/ewiz-releases), +which the release workflow keeps updating. The Homebrew cask lives in +[`stroke-app/homebrew-ewiz`](https://github.com/stroke-app/homebrew-ewiz). ```bash bun install -bun run dev:web # the website -bun run build # build everything (turbo) -bun run test # Swift tests +bun run secrets:restore # maintainers: the .env files, from the encrypted backup +bun run dev:web # the website (needs apps/web/.env) +bun run build # build everything (turbo) +bun run test # Swift tests ``` ## Build from source @@ -293,8 +314,30 @@ bun run changeset # describe your change (patch / minor / major) ``` Commit the generated `.changeset/*.md`. Merging the auto-opened "Version Packages" -PR bumps the version in `apps/macos/package.json` and [`CHANGELOG.md`](apps/macos/CHANGELOG.md); pushing that version tag triggers the -release build. +PR bumps the version in `apps/macos/package.json` and +[`CHANGELOG.md`](apps/macos/CHANGELOG.md), tags it, and starts the release build. The +release builds and signs the DMG, publishes the GitHub release, and updates the update +feeds and the Homebrew cask. Deploy the website (`bun run deploy` in `apps/web`) +separately. + +### Secrets (maintainers) + +GitHub Actions and Cloudflare never show a secret again once it's set, so the only +readable copies are two gitignored files: `apps/web/.env` (website) and +`apps/macos/.env` (release signing). [`scripts/secrets.sh`](scripts/secrets.sh) keeps +an AES-256 encrypted backup of both in iCloud Drive and is the only way secrets should +change: + +```bash +bun run secrets:check # anything set remotely but missing locally? +bun run secrets:push:web # after editing apps/web/.env → Cloudflare + backup +bun run secrets:push:release # after editing apps/macos/.env → GitHub + backup +bun run secrets:restore # new Mac: put both files back from the backup +``` + +The update signing key and the license signing key are irreplaceable: lose the first +and installed copies can never update again; lose the second and every license stops +verifying. The app and helper speak a small versioned protocol over their socket. When you change what the daemon does, bump `ControlProtocol.version` — the app compares it to diff --git a/.env.example b/apps/macos/.env.example similarity index 59% rename from .env.example rename to apps/macos/.env.example index c1b3bd2..9eec9b3 100644 --- a/.env.example +++ b/apps/macos/.env.example @@ -1,9 +1,20 @@ -# eWiz release secrets — template. -# Copy to .env (gitignored), fill in, then run: ./scripts/set-github-secrets.sh +# eWiz release secrets — template for apps/macos/.env (gitignored). +# The real file is backed up, restored and pushed to GitHub with the repo-root script: +# ./scripts/secrets.sh restore # get it back from the encrypted iCloud backup +# ./scripts/secrets.sh push release # upload to GitHub Actions + back up again # # These feed the GitHub Actions "Release" workflow for Developer-ID signing and # notarization. Until the Apple ones are filled, releases build UNSIGNED. +# Ed25519 seed that signs every update. Irreplaceable: installed copies only accept +# updates signed with it (UpdateSignature.publicKeyBase64 is its public half). +UPDATE_SIGNING_PRIVATE_KEY= + +# The "eWiz Code Signing" self-signed identity as .p12, base64, and its password. +# Irreplaceable in practice: a new certificate makes macOS forget eWiz's permissions. +SELF_SIGNED_CERT_P12_BASE64= +SELF_SIGNED_CERT_PASSWORD= + # Ephemeral CI keychain password — any random string. (Auto-generated in .env.) KEYCHAIN_PASSWORD= diff --git a/apps/macos/Sources/EWizKit/AppStage.swift b/apps/macos/Sources/EWizKit/AppStage.swift new file mode 100644 index 0000000..0e4f4fd --- /dev/null +++ b/apps/macos/Sources/EWizKit/AppStage.swift @@ -0,0 +1,10 @@ +import Foundation + +/// eWiz is in beta until 1.0. Derived from the version rather than a flag, so the label +/// can't outlive the beta: shipping 1.0.0 is what takes it away. +public enum AppStage { + public static func isBeta(version: String) -> Bool { + let major = version.split(separator: ".").first.flatMap { Int($0) } ?? 0 + return major < 1 + } +} diff --git a/apps/macos/Sources/eWiz/SettingsView.swift b/apps/macos/Sources/eWiz/SettingsView.swift index 021117d..be75f4b 100644 --- a/apps/macos/Sources/eWiz/SettingsView.swift +++ b/apps/macos/Sources/eWiz/SettingsView.swift @@ -257,10 +257,20 @@ struct SettingsView: View { VStack(spacing: 0) { VStack(spacing: 8) { AppIconView(size: 96) - Text("eWiz") - .font(.title2.weight(.semibold)) + HStack(spacing: 6) { + Text("eWiz") + .font(.title2.weight(.semibold)) + if updater.isBeta { BetaBadge() } + } Text("Version \(updater.currentVersion)") .font(.callout).foregroundStyle(.secondary) + if updater.isBeta { + Text("eWiz is in beta: it works, and it's still getting better. Spotted something odd? Report a Bug below helps most.") + .font(.caption).foregroundStyle(.secondary) + .multilineTextAlignment(.center) + .frame(maxWidth: 320) + .padding(.top, 2) + } Text("Created by Nischal Dahal") .font(.callout).foregroundStyle(.secondary) } @@ -1629,7 +1639,7 @@ struct SettingsView: View { Button("Check for Updates…") { updater.checkForUpdates() } .disabled(!updater.canCheckForUpdates) Spacer() - Text("v\(updater.currentVersion)") + Text("v\(updater.currentVersion)\(updater.isBeta ? " beta" : "")") .font(.callout).foregroundStyle(.secondary).monospacedDigit() } .padding(.horizontal, rowInset).padding(.vertical, DS.Space.s + 2) @@ -2189,3 +2199,17 @@ struct BatteryStylePicker: View { // Show a representative level so the styles are easy to tell apart even at 0%. private var previewPct: Int { max(35, min(100, percentage)) } } + +/// The small "BETA" capsule beside the app name while eWiz is below 1.0. +struct BetaBadge: View { + var body: some View { + Text("BETA") + .font(.caption2.weight(.semibold)) + .tracking(0.6) + .foregroundStyle(Color.accentColor) + .padding(.horizontal, 6) + .padding(.vertical, 2) + .background(Capsule().fill(Color.accentColor.opacity(0.15))) + .accessibilityLabel("Beta") + } +} diff --git a/apps/macos/Sources/eWiz/UpdaterManager.swift b/apps/macos/Sources/eWiz/UpdaterManager.swift index d08db9a..58a2ddf 100644 --- a/apps/macos/Sources/eWiz/UpdaterManager.swift +++ b/apps/macos/Sources/eWiz/UpdaterManager.swift @@ -1,5 +1,6 @@ import Combine import Foundation +import EWizKit import Sparkle /// In-app updates, through Sparkle: a check on launch and daily, or on demand; then its @@ -23,6 +24,9 @@ final class UpdaterManager: ObservableObject { let currentVersion: String = (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "0.0.0" + /// True until 1.0; shown as "Beta" beside the version. + var isBeta: Bool { AppStage.isBeta(version: currentVersion) } + private let controller: SPUStandardUpdaterController private let observer = UpdateObserver() diff --git a/apps/macos/Tests/EWizKitTests/AppStageTests.swift b/apps/macos/Tests/EWizKitTests/AppStageTests.swift new file mode 100644 index 0000000..33a9845 --- /dev/null +++ b/apps/macos/Tests/EWizKitTests/AppStageTests.swift @@ -0,0 +1,19 @@ +import Testing +@testable import EWizKit + +struct AppStageTests { + @Test func zeroMajorIsBeta() { + #expect(AppStage.isBeta(version: "0.20.1")) + #expect(AppStage.isBeta(version: "0.1.0")) + } + + @Test func oneAndAboveIsNotBeta() { + #expect(!AppStage.isBeta(version: "1.0.0")) + #expect(!AppStage.isBeta(version: "2.3.4")) + } + + @Test func unreadableVersionCountsAsBeta() { + #expect(AppStage.isBeta(version: "")) + #expect(AppStage.isBeta(version: "dev")) + } +} diff --git a/apps/macos/scripts/set-github-secrets.sh b/apps/macos/scripts/set-github-secrets.sh index e4b8bce..11e2c89 100755 --- a/apps/macos/scripts/set-github-secrets.sh +++ b/apps/macos/scripts/set-github-secrets.sh @@ -1,48 +1,4 @@ #!/bin/bash -# Reads .env and uploads each non-empty value as a GitHub Actions secret via gh. -# Empty values are skipped (so you can run it now and again after filling Apple keys). -# ./scripts/set-github-secrets.sh -set -euo pipefail - -REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -ENV_FILE="$REPO_DIR/.env" -REPO="${GH_REPO:-stroke-app/ewiz}" - -if [[ ! -f "$ENV_FILE" ]]; then - echo "error: $ENV_FILE not found. Copy .env.example to .env and fill it." >&2 - exit 1 -fi - -# Load .env without exporting comments/blank lines. -set -a -# shellcheck disable=SC1090 -source "$ENV_FILE" -set +a - -SECRETS=( - KEYCHAIN_PASSWORD - DEVELOPER_ID_CERT_P12_BASE64 - DEVELOPER_ID_CERT_PASSWORD - NOTARY_KEY_ID - NOTARY_ISSUER_ID - NOTARY_KEY_P8_BASE64 - RELEASES_TOKEN -) - -echo "Setting secrets on $REPO …" -set_count=0 -for name in "${SECRETS[@]}"; do - value="${!name:-}" - if [[ -z "$value" ]]; then - echo " - $name: empty, skipped" - continue - fi - gh secret set "$name" --repo "$REPO" --body "$value" - echo " ✓ $name set" - set_count=$((set_count + 1)) -done - -echo "Done. $set_count secret(s) set." -[[ $set_count -lt ${#SECRETS[@]} ]] && \ - echo "Fill the remaining Apple values in .env and re-run to enable signed releases." -exit 0 +# Superseded by the repo-root secrets script, which also backs the values up so they +# can't be lost (GitHub never shows a secret again once it's set). +exec "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)/scripts/secrets.sh" push release diff --git a/apps/web/src/components/landing/landing-page.tsx b/apps/web/src/components/landing/landing-page.tsx index e565ef1..c5190fd 100644 --- a/apps/web/src/components/landing/landing-page.tsx +++ b/apps/web/src/components/landing/landing-page.tsx @@ -138,7 +138,7 @@ function Hero({ Buy · {PRICE}

- Free for 30 days · macOS 14+ · Apple Silicon + Public beta · Free for 30 days · macOS 14+ · Apple Silicon

diff --git a/apps/web/src/components/site/site-shell.tsx b/apps/web/src/components/site/site-shell.tsx index e837225..7a4a2c1 100644 --- a/apps/web/src/components/site/site-shell.tsx +++ b/apps/web/src/components/site/site-shell.tsx @@ -38,10 +38,13 @@ export function SiteHeader() { + + Beta +