branding: default to clawdis paths and launchd label

This commit is contained in:
Peter Steinberger
2025-12-04 18:01:30 +00:00
parent 9797a9993a
commit 916a41ed60
12 changed files with 36 additions and 27 deletions

View File

@@ -9,8 +9,9 @@ const HOME = path.join(realOs.tmpdir(), "warelay-home-redirect");
const mockRequest = vi.fn();
vi.doMock("node:os", () => ({
default: { homedir: () => HOME },
default: { homedir: () => HOME, tmpdir: () => realOs.tmpdir() },
homedir: () => HOME,
tmpdir: () => realOs.tmpdir(),
}));
vi.doMock("node:https", () => ({

View File

@@ -7,8 +7,9 @@ const realOs = await vi.importActual<typeof import("node:os")>("node:os");
const HOME = path.join(realOs.tmpdir(), "warelay-home-test");
vi.mock("node:os", () => ({
default: { homedir: () => HOME },
default: { homedir: () => HOME, tmpdir: () => realOs.tmpdir() },
homedir: () => HOME,
tmpdir: () => realOs.tmpdir(),
}));
const store = await import("./store.js");

View File

@@ -2,13 +2,13 @@ import crypto from "node:crypto";
import { createWriteStream } from "node:fs";
import fs from "node:fs/promises";
import { request } from "node:https";
import os from "node:os";
import path from "node:path";
import { pipeline } from "node:stream/promises";
import { detectMime, extensionForMime } from "./mime.js";
import { CONFIG_DIR } from "../utils.js";
const MEDIA_DIR = path.join(os.homedir(), ".warelay", "media");
const MEDIA_DIR = path.join(CONFIG_DIR, "media");
const MAX_BYTES = 5 * 1024 * 1024; // 5MB
const DEFAULT_TTL_MS = 2 * 60 * 1000; // 2 minutes