learnhouse 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # LearnHouse CLI
2
2
 
3
- The official LearnHouse CLI — deploy, manage, and operate your LearnHouse instance.
3
+ The official [LearnHouse](https://learnhouse.app) CLI — deploy, manage, and operate your LearnHouse instance.
4
+
5
+ [Website](https://learnhouse.app) | [Documentation](https://docs.learnhouse.app) | [GitHub](https://github.com/learnhouse/learnhouse)
4
6
 
5
7
  <img width="915" height="871" alt="image" src="https://github.com/user-attachments/assets/957c6cea-3efb-4cab-a643-55df3ac4c6aa" />
6
8
 
@@ -3616,7 +3616,7 @@ var {
3616
3616
  var import_picocolors23 = __toESM(require_picocolors(), 1);
3617
3617
 
3618
3618
  // src/constants.ts
3619
- var VERSION = "1.4.1";
3619
+ var VERSION = "1.4.3";
3620
3620
  var APP_IMAGE = "ghcr.io/learnhouse/app:latest";
3621
3621
  var DEV_IMAGE = "ghcr.io/learnhouse/app:dev";
3622
3622
  var POSTGRES_IMAGE = "pgvector/pgvector:pg16";
@@ -4850,7 +4850,13 @@ function isDockerRunning() {
4850
4850
  try {
4851
4851
  execSync("docker info", { stdio: "pipe" });
4852
4852
  return true;
4853
- } catch {
4853
+ } catch (err) {
4854
+ const stderr = err instanceof Error && "stderr" in err ? err.stderr?.toString() ?? "" : "";
4855
+ if (stderr.includes("permission denied")) {
4856
+ throw new Error(
4857
+ "Docker permission denied. Run: sudo usermod -aG docker $USER && newgrp docker"
4858
+ );
4859
+ }
4854
4860
  return false;
4855
4861
  }
4856
4862
  }
@@ -5020,8 +5026,13 @@ async function checkPrerequisites() {
5020
5026
  ];
5021
5027
  const failed = [];
5022
5028
  for (const { name, check, failMsg } of checks) {
5023
- if (!check()) {
5024
- failed.push(`${import_picocolors6.default.red("x")} ${name}: ${failMsg}`);
5029
+ try {
5030
+ if (!check()) {
5031
+ failed.push(`${import_picocolors6.default.red("x")} ${name}: ${failMsg}`);
5032
+ }
5033
+ } catch (err) {
5034
+ const msg = err instanceof Error ? err.message : failMsg;
5035
+ failed.push(`${import_picocolors6.default.red("x")} ${name}: ${msg}`);
5025
5036
  }
5026
5037
  }
5027
5038
  if (failed.length > 0) {
@@ -5702,6 +5713,12 @@ import crypto2 from "crypto";
5702
5713
  function generateSecret() {
5703
5714
  return crypto2.randomBytes(32).toString("base64");
5704
5715
  }
5716
+ function quoteEnvValue(value) {
5717
+ if (/[\s#$'"\\`!]/.test(value)) {
5718
+ return `'${value.replace(/'/g, "'\\''")}'`;
5719
+ }
5720
+ return value;
5721
+ }
5705
5722
  function generateEnvFile(config) {
5706
5723
  const protocol = config.useHttps ? "https" : "http";
5707
5724
  const portSuffix = config.useHttps && config.httpPort === 443 || !config.useHttps && config.httpPort === 80 ? "" : `:${config.httpPort}`;
@@ -5736,7 +5753,7 @@ function generateEnvFile(config) {
5736
5753
  `NEXT_PUBLIC_LEARNHOUSE_HTTPS=${config.useHttps ? "True" : "False"}`
5737
5754
  ];
5738
5755
  if (config.unsplashEnabled && config.unsplashAccessKey) {
5739
- lines.push(`NEXT_PUBLIC_UNSPLASH_ACCESS_KEY=${config.unsplashAccessKey}`);
5756
+ lines.push(`NEXT_PUBLIC_UNSPLASH_ACCESS_KEY=${quoteEnvValue(config.unsplashAccessKey)}`);
5740
5757
  }
5741
5758
  lines.push(
5742
5759
  "",
@@ -5749,8 +5766,8 @@ function generateEnvFile(config) {
5749
5766
  );
5750
5767
  if (config.googleOAuthEnabled && config.googleClientId && config.googleClientSecret) {
5751
5768
  lines.push(
5752
- `LEARNHOUSE_GOOGLE_CLIENT_ID=${config.googleClientId}`,
5753
- `LEARNHOUSE_GOOGLE_CLIENT_SECRET=${config.googleClientSecret}`
5769
+ `LEARNHOUSE_GOOGLE_CLIENT_ID=${quoteEnvValue(config.googleClientId)}`,
5770
+ `LEARNHOUSE_GOOGLE_CLIENT_SECRET=${quoteEnvValue(config.googleClientSecret)}`
5754
5771
  );
5755
5772
  }
5756
5773
  lines.push(
@@ -5759,8 +5776,8 @@ function generateEnvFile(config) {
5759
5776
  "# Backend Configuration",
5760
5777
  "# =============================================================================",
5761
5778
  "",
5762
- `LEARNHOUSE_SQL_CONNECTION_STRING=${config.useExternalDb ? config.externalDbConnectionString : `postgresql://learnhouse:${config.dbPassword}@db:5432/learnhouse`}`,
5763
- `LEARNHOUSE_REDIS_CONNECTION_STRING=${config.useExternalRedis ? config.externalRedisConnectionString : "redis://redis:6379/learnhouse"}`,
5779
+ `LEARNHOUSE_SQL_CONNECTION_STRING=${config.useExternalDb ? quoteEnvValue(config.externalDbConnectionString) : `postgresql://learnhouse:${config.dbPassword}@db:5432/learnhouse`}`,
5780
+ `LEARNHOUSE_REDIS_CONNECTION_STRING=${config.useExternalRedis ? quoteEnvValue(config.externalRedisConnectionString) : "redis://redis:6379/learnhouse"}`,
5764
5781
  `LEARNHOUSE_COOKIE_DOMAIN=${cookieDomain}`,
5765
5782
  "LEARNHOUSE_PORT=9000",
5766
5783
  "",
@@ -5769,8 +5786,8 @@ function generateEnvFile(config) {
5769
5786
  "# =============================================================================",
5770
5787
  "",
5771
5788
  `LEARNHOUSE_AUTH_JWT_SECRET_KEY=${jwtSecret}`,
5772
- `LEARNHOUSE_INITIAL_ADMIN_EMAIL=${config.adminEmail}`,
5773
- `LEARNHOUSE_INITIAL_ADMIN_PASSWORD=${config.adminPassword}`,
5789
+ `LEARNHOUSE_INITIAL_ADMIN_EMAIL=${quoteEnvValue(config.adminEmail)}`,
5790
+ `LEARNHOUSE_INITIAL_ADMIN_PASSWORD=${quoteEnvValue(config.adminPassword)}`,
5774
5791
  "",
5775
5792
  "# =============================================================================",
5776
5793
  "# Collaboration Server",
@@ -7479,10 +7496,11 @@ function spawnService(command, args, cwd, label, color) {
7479
7496
  const child = spawn2(command, args, {
7480
7497
  cwd,
7481
7498
  stdio: ["ignore", "pipe", "pipe"],
7499
+ shell: process.platform === "win32",
7482
7500
  env: {
7483
7501
  ...process.env,
7484
7502
  ...serviceEnv,
7485
- PATH: `${localBin}:${process.env.PATH ?? ""}`
7503
+ PATH: `${localBin}${path7.delimiter}${process.env.PATH ?? ""}`
7486
7504
  }
7487
7505
  });
7488
7506
  prefixStream(child, label, color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "learnhouse",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "The official LearnHouse CLI — deploy, manage, and operate your LearnHouse instance",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/learnhouse/learnhouse.git",
26
26
  "directory": "apps/cli"
27
27
  },
28
- "homepage": "https://github.com/learnhouse/learnhouse/tree/main/apps/cli",
28
+ "homepage": "https://learnhouse.app",
29
29
  "bugs": {
30
30
  "url": "https://github.com/learnhouse/learnhouse/issues"
31
31
  },
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@types/node": "^25.0.0",
44
44
  "tsup": "^8.0.1",
45
- "typescript": "^5.3.3",
45
+ "typescript": "^6.0.0",
46
46
  "vitest": "^4.1.1"
47
47
  },
48
48
  "dependencies": {