-
Notifications
You must be signed in to change notification settings - Fork 168
refactor(desktop): remove restic bridge #1012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ import fs from "node:fs/promises"; | |
| import net from "node:net"; | ||
| import path from "node:path"; | ||
| import { toMessage } from "@zerobyte/core/utils"; | ||
| import { startResticBridge } from "./restic/bridge"; | ||
|
|
||
| type DesktopDirs = { | ||
| dataDir: string; | ||
|
|
@@ -155,27 +154,20 @@ export const startDesktopRuntime = async ( | |
| const url = `http://127.0.0.1:${port}`; | ||
| const launchSecret = crypto.randomBytes(32).toString("hex"); | ||
| let stopped = false; | ||
| let stopResticBridge: (() => void) | null = null; | ||
| let command = "bunx"; | ||
| let args = ["--bun", "vite", "--host", "127.0.0.1", "--port", String(port), "--strictPort"]; | ||
| let cwd = process.env.ZEROBYTE_REPO_ROOT ?? path.resolve(process.cwd(), "../.."); | ||
| const env = { ...createServerEnv(port, dirs, url, launchSecret), NODE_ENV: "development" }; | ||
|
|
||
| if (app.isPackaged) { | ||
| const binDir = path.join(dirs.resourcesDir, "bin"); | ||
| const resticBridge = await startResticBridge({ | ||
| realResticCommand: path.join(binDir, "restic"), | ||
| launchSecret, | ||
| }); | ||
| stopResticBridge = resticBridge.stop; | ||
| command = path.join(binDir, "bun"); | ||
| args = [path.join(dirs.resourcesDir, ".output", "server", "index.mjs")]; | ||
| cwd = dirs.resourcesDir; | ||
| Object.assign(env, { | ||
| NODE_ENV: "production", | ||
| MIGRATIONS_PATH: path.join(dirs.resourcesDir, "assets", "migrations"), | ||
| RESTIC_COMMAND: path.join(binDir, "zerobyte-restic.ts"), | ||
| ZEROBYTE_DESKTOP_RESTIC_BRIDGE_URL: resticBridge.url, | ||
| RESTIC_COMMAND: path.join(binDir, "restic"), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After packaged desktop builds run restic directly from the Bun server, Useful? React with 👍 / 👎. |
||
| PATH: `${binDir}${path.delimiter}${process.env.PATH ?? ""}`, | ||
| }); | ||
| } | ||
|
|
@@ -204,14 +196,12 @@ export const startDesktopRuntime = async ( | |
| launchSecret, | ||
| stop: () => { | ||
| stopped = true; | ||
| stopResticBridge?.(); | ||
| serverProcess.kill("SIGTERM"); | ||
| }, | ||
| }; | ||
| } catch (error) { | ||
| stopped = true; | ||
| serverProcess.off("exit", handleServerExit); | ||
| stopResticBridge?.(); | ||
| serverProcess.kill("SIGTERM"); | ||
| throw error; | ||
| } | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| fastlane documentation | ||
| ---- | ||
|
|
||
| # Installation | ||
|
|
||
| Make sure you have the latest version of the Xcode command line tools installed: | ||
|
|
||
| ```sh | ||
| xcode-select --install | ||
| ``` | ||
|
|
||
| For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) | ||
|
|
||
| # Available Actions | ||
|
|
||
| ## Mac | ||
|
|
||
| ### mac build_mas | ||
|
|
||
| ```sh | ||
| [bundle exec] fastlane mac build_mas | ||
| ``` | ||
|
|
||
| Build the signed Mac App Store package | ||
|
|
||
| ### mac upload_testflight | ||
|
|
||
| ```sh | ||
| [bundle exec] fastlane mac upload_testflight | ||
| ``` | ||
|
|
||
| Upload the latest signed Mac App Store package to App Store Connect | ||
|
|
||
| ### mac beta | ||
|
|
||
| ```sh | ||
| [bundle exec] fastlane mac beta | ||
| ``` | ||
|
|
||
| Build and upload the Mac App Store package to App Store Connect | ||
|
|
||
| ---- | ||
|
|
||
| This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. | ||
|
|
||
| More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). | ||
|
|
||
| The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). |
Uh oh!
There was an error while loading. Please reload this page.