@realtimex/folio 0.1.3 → 0.1.5

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.
@@ -65,8 +65,8 @@ export const config = {
65
65
  packageRoot,
66
66
  port: cliArgs.port || (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 3006),
67
67
  noUi: cliArgs.noUi,
68
- nodeEnv: process.env.NODE_ENV || "development",
69
- isProduction: process.env.NODE_ENV === "production",
68
+ nodeEnv: process.env.NODE_ENV || "production",
69
+ isProduction: (process.env.NODE_ENV || "production") === "production",
70
70
  rootDir: packageRoot,
71
71
  scriptsDir: join(packageRoot, "scripts"),
72
72
 
@@ -89,12 +89,16 @@ export const config = {
89
89
  export function validateConfig(): { valid: boolean; errors: string[] } {
90
90
  const errors: string[] = [];
91
91
 
92
- if (config.isProduction && config.security.jwtSecret === "dev-secret-change-in-production") {
93
- errors.push("JWT_SECRET must be set in production");
94
- }
92
+ const isHostedCloud = process.env.IS_HOSTED_CLOUD === "true";
93
+
94
+ if (config.isProduction && isHostedCloud) {
95
+ if (config.security.jwtSecret === "dev-secret-change-in-production") {
96
+ errors.push("JWT_SECRET must be set in cloud production");
97
+ }
95
98
 
96
- if (config.isProduction && !config.security.encryptionKey) {
97
- errors.push("TOKEN_ENCRYPTION_KEY must be set in production");
99
+ if (!config.security.encryptionKey) {
100
+ errors.push("TOKEN_ENCRYPTION_KEY must be set in cloud production");
101
+ }
98
102
  }
99
103
 
100
104
  return {
@@ -57,8 +57,8 @@ export const config = {
57
57
  packageRoot,
58
58
  port: cliArgs.port || (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 3006),
59
59
  noUi: cliArgs.noUi,
60
- nodeEnv: process.env.NODE_ENV || "development",
61
- isProduction: process.env.NODE_ENV === "production",
60
+ nodeEnv: process.env.NODE_ENV || "production",
61
+ isProduction: (process.env.NODE_ENV || "production") === "production",
62
62
  rootDir: packageRoot,
63
63
  scriptsDir: join(packageRoot, "scripts"),
64
64
  supabase: {
@@ -77,11 +77,14 @@ export const config = {
77
77
  };
78
78
  export function validateConfig() {
79
79
  const errors = [];
80
- if (config.isProduction && config.security.jwtSecret === "dev-secret-change-in-production") {
81
- errors.push("JWT_SECRET must be set in production");
82
- }
83
- if (config.isProduction && !config.security.encryptionKey) {
84
- errors.push("TOKEN_ENCRYPTION_KEY must be set in production");
80
+ const isHostedCloud = process.env.IS_HOSTED_CLOUD === "true";
81
+ if (config.isProduction && isHostedCloud) {
82
+ if (config.security.jwtSecret === "dev-secret-change-in-production") {
83
+ errors.push("JWT_SECRET must be set in cloud production");
84
+ }
85
+ if (!config.security.encryptionKey) {
86
+ errors.push("TOKEN_ENCRYPTION_KEY must be set in cloud production");
87
+ }
85
88
  }
86
89
  return {
87
90
  valid: errors.length === 0,