Added fluid skills support
This commit is contained in:
Vendored
+1
-1
@@ -43,7 +43,7 @@ function checkValue(rule: EnvRule, value: string): null | string {
|
||||
|
||||
switch (kind) {
|
||||
case 'boolean':
|
||||
if (!/^(true|false|1|0|yes|no)$/i.test(value)) {
|
||||
if (!/^(?:true|false|1|0|yes|no)$/i.test(value)) {
|
||||
return `${name} must be a boolean (true/false/1/0/yes/no, got "${value}")`
|
||||
}
|
||||
break
|
||||
|
||||
Vendored
+15
-6
@@ -53,11 +53,7 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
|
||||
const rules: EnvRule[] = [
|
||||
{ name: databaseVar, description: 'Database connection string (e.g. MongoDB URI)' },
|
||||
{ name: secretVar, description: 'Payload secret used to sign tokens' },
|
||||
{
|
||||
name: serverUrlVar,
|
||||
description: 'Public site origin, e.g. https://example.com',
|
||||
kind: 'url',
|
||||
},
|
||||
{ name: serverUrlVar, description: 'Public site origin, e.g. https://example.com', kind: 'url' },
|
||||
{
|
||||
name: 'NODE_ENV',
|
||||
description: 'Node environment',
|
||||
@@ -72,7 +68,20 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
|
||||
{ name: 'R2_ACCESS_KEY_ID', description: 'R2 access key id' },
|
||||
{ name: 'R2_SECRET_ACCESS_KEY', description: 'R2 secret access key' },
|
||||
{ name: 'R2_ENDPOINT', description: 'R2 S3 API endpoint URL', kind: 'url' },
|
||||
{ name: 'R2_PUBLIC_URL', description: 'Public base URL media is served from', kind: 'url' },
|
||||
{
|
||||
name: 'R2_PUBLIC_URL',
|
||||
description: 'Public base URL media is served from (custom domain of the bucket)',
|
||||
// Production: absolute URL (https://media.example.com). Outside production a
|
||||
// site-relative path ('/media') is accepted — buildR2Storage prefixes it with
|
||||
// NEXT_PUBLIC_SERVER_URL (e.g. a dev rewrite /media → bucket).
|
||||
validate: (v) => {
|
||||
if (/^https?:\/\/[^/\s]+/i.test(v)) {return true}
|
||||
if (v.startsWith('/') && process.env.NODE_ENV !== 'production') {return true}
|
||||
return v.startsWith('/')
|
||||
? `R2_PUBLIC_URL must be an absolute URL in production (got "${v}") — e.g. https://media.example.com`
|
||||
: `R2_PUBLIC_URL must be an absolute URL (https://…) or, outside production, a path starting with "/" (got "${v}")`
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user