learnhouse 1.4.2 → 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.
@@ -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.2";
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";
@@ -5713,6 +5713,12 @@ import crypto2 from "crypto";
5713
5713
  function generateSecret() {
5714
5714
  return crypto2.randomBytes(32).toString("base64");
5715
5715
  }
5716
+ function quoteEnvValue(value) {
5717
+ if (/[\s#$'"\\`!]/.test(value)) {
5718
+ return `'${value.replace(/'/g, "'\\''")}'`;
5719
+ }
5720
+ return value;
5721
+ }
5716
5722
  function generateEnvFile(config) {
5717
5723
  const protocol = config.useHttps ? "https" : "http";
5718
5724
  const portSuffix = config.useHttps && config.httpPort === 443 || !config.useHttps && config.httpPort === 80 ? "" : `:${config.httpPort}`;
@@ -5747,7 +5753,7 @@ function generateEnvFile(config) {
5747
5753
  `NEXT_PUBLIC_LEARNHOUSE_HTTPS=${config.useHttps ? "True" : "False"}`
5748
5754
  ];
5749
5755
  if (config.unsplashEnabled && config.unsplashAccessKey) {
5750
- lines.push(`NEXT_PUBLIC_UNSPLASH_ACCESS_KEY=${config.unsplashAccessKey}`);
5756
+ lines.push(`NEXT_PUBLIC_UNSPLASH_ACCESS_KEY=${quoteEnvValue(config.unsplashAccessKey)}`);
5751
5757
  }
5752
5758
  lines.push(
5753
5759
  "",
@@ -5760,8 +5766,8 @@ function generateEnvFile(config) {
5760
5766
  );
5761
5767
  if (config.googleOAuthEnabled && config.googleClientId && config.googleClientSecret) {
5762
5768
  lines.push(
5763
- `LEARNHOUSE_GOOGLE_CLIENT_ID=${config.googleClientId}`,
5764
- `LEARNHOUSE_GOOGLE_CLIENT_SECRET=${config.googleClientSecret}`
5769
+ `LEARNHOUSE_GOOGLE_CLIENT_ID=${quoteEnvValue(config.googleClientId)}`,
5770
+ `LEARNHOUSE_GOOGLE_CLIENT_SECRET=${quoteEnvValue(config.googleClientSecret)}`
5765
5771
  );
5766
5772
  }
5767
5773
  lines.push(
@@ -5770,8 +5776,8 @@ function generateEnvFile(config) {
5770
5776
  "# Backend Configuration",
5771
5777
  "# =============================================================================",
5772
5778
  "",
5773
- `LEARNHOUSE_SQL_CONNECTION_STRING=${config.useExternalDb ? config.externalDbConnectionString : `postgresql://learnhouse:${config.dbPassword}@db:5432/learnhouse`}`,
5774
- `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"}`,
5775
5781
  `LEARNHOUSE_COOKIE_DOMAIN=${cookieDomain}`,
5776
5782
  "LEARNHOUSE_PORT=9000",
5777
5783
  "",
@@ -5780,8 +5786,8 @@ function generateEnvFile(config) {
5780
5786
  "# =============================================================================",
5781
5787
  "",
5782
5788
  `LEARNHOUSE_AUTH_JWT_SECRET_KEY=${jwtSecret}`,
5783
- `LEARNHOUSE_INITIAL_ADMIN_EMAIL=${config.adminEmail}`,
5784
- `LEARNHOUSE_INITIAL_ADMIN_PASSWORD=${config.adminPassword}`,
5789
+ `LEARNHOUSE_INITIAL_ADMIN_EMAIL=${quoteEnvValue(config.adminEmail)}`,
5790
+ `LEARNHOUSE_INITIAL_ADMIN_PASSWORD=${quoteEnvValue(config.adminPassword)}`,
5785
5791
  "",
5786
5792
  "# =============================================================================",
5787
5793
  "# Collaboration Server",
@@ -7490,10 +7496,11 @@ function spawnService(command, args, cwd, label, color) {
7490
7496
  const child = spawn2(command, args, {
7491
7497
  cwd,
7492
7498
  stdio: ["ignore", "pipe", "pipe"],
7499
+ shell: process.platform === "win32",
7493
7500
  env: {
7494
7501
  ...process.env,
7495
7502
  ...serviceEnv,
7496
- PATH: `${localBin}:${process.env.PATH ?? ""}`
7503
+ PATH: `${localBin}${path7.delimiter}${process.env.PATH ?? ""}`
7497
7504
  }
7498
7505
  });
7499
7506
  prefixStream(child, label, color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "learnhouse",
3
- "version": "1.4.2",
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": {
@@ -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": {