fixes
Build And Push Image / docker (push) Successful in 3m34s Details

This commit is contained in:
Matt 2025-08-12 13:07:43 +02:00
parent 85e8a20f40
commit 122d6fdd26
1 changed files with 40 additions and 10 deletions

View File

@ -210,25 +210,55 @@ export const setGlobalNocoDBConfig = (config: any) => {
};
export const getNocoDbConfiguration = () => {
let configToUse: any = null;
// Try to use the global configuration first
if (globalNocoDBConfig) {
console.log('[nocodb] Using global configuration - URL:', globalNocoDBConfig.url);
return {
configToUse = {
url: globalNocoDBConfig.url,
token: globalNocoDBConfig.token,
baseId: globalNocoDBConfig.baseId
};
} else {
// Fallback to runtime config
console.log('[nocodb] Global config not available, using runtime config');
const config = useRuntimeConfig().nocodb;
configToUse = {
...config,
url: config.url || 'https://database.monacousa.org'
};
console.log('[nocodb] Fallback configuration URL:', configToUse.url);
}
// Fallback to runtime config
console.log('[nocodb] Global config not available, using runtime config');
const config = useRuntimeConfig().nocodb;
const fallbackConfig = {
...config,
url: config.url || 'https://database.monacousa.org'
};
console.log('[nocodb] Fallback configuration URL:', fallbackConfig.url);
return fallbackConfig;
// Validate API token before using it
if (configToUse.token) {
const token = configToUse.token.trim();
// Check for non-ASCII characters that would cause ByteString errors
if (!/^[\x00-\xFF]*$/.test(token)) {
console.error('[nocodb] ❌ CRITICAL ERROR: API token contains invalid Unicode characters!');
console.error('[nocodb] This will cause ByteString conversion errors in HTTP headers.');
console.error('[nocodb] Please update the API token in the admin configuration.');
throw createError({
statusCode: 500,
statusMessage: 'NocoDB API token contains invalid characters. Please reconfigure the database connection in the admin panel with a valid API token.'
});
}
// Additional validation for common token issues
if (token.includes('•') || token.includes('…') || token.includes('"') || token.includes('"')) {
console.error('[nocodb] ❌ CRITICAL ERROR: API token contains formatting characters!');
console.error('[nocodb] Found characters like bullets (•), quotes, etc. that break HTTP headers.');
console.error('[nocodb] Please copy the raw API token from NocoDB without any formatting.');
throw createError({
statusCode: 500,
statusMessage: 'NocoDB API token contains formatting characters (bullets, quotes, etc.). Please reconfigure with the raw token from NocoDB.'
});
}
}
return configToUse;
};
export const createTableUrl = (table: Table | string) => {