fixes
Build And Push Image / docker (push) Successful in 3m34s
Details
Build And Push Image / docker (push) Successful in 3m34s
Details
This commit is contained in:
parent
85e8a20f40
commit
122d6fdd26
|
|
@ -210,25 +210,55 @@ export const setGlobalNocoDBConfig = (config: any) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getNocoDbConfiguration = () => {
|
export const getNocoDbConfiguration = () => {
|
||||||
|
let configToUse: any = null;
|
||||||
|
|
||||||
// Try to use the global configuration first
|
// Try to use the global configuration first
|
||||||
if (globalNocoDBConfig) {
|
if (globalNocoDBConfig) {
|
||||||
console.log('[nocodb] Using global configuration - URL:', globalNocoDBConfig.url);
|
console.log('[nocodb] Using global configuration - URL:', globalNocoDBConfig.url);
|
||||||
return {
|
configToUse = {
|
||||||
url: globalNocoDBConfig.url,
|
url: globalNocoDBConfig.url,
|
||||||
token: globalNocoDBConfig.token,
|
token: globalNocoDBConfig.token,
|
||||||
baseId: globalNocoDBConfig.baseId
|
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
|
// Validate API token before using it
|
||||||
console.log('[nocodb] Global config not available, using runtime config');
|
if (configToUse.token) {
|
||||||
const config = useRuntimeConfig().nocodb;
|
const token = configToUse.token.trim();
|
||||||
const fallbackConfig = {
|
|
||||||
...config,
|
// Check for non-ASCII characters that would cause ByteString errors
|
||||||
url: config.url || 'https://database.monacousa.org'
|
if (!/^[\x00-\xFF]*$/.test(token)) {
|
||||||
};
|
console.error('[nocodb] ❌ CRITICAL ERROR: API token contains invalid Unicode characters!');
|
||||||
console.log('[nocodb] Fallback configuration URL:', fallbackConfig.url);
|
console.error('[nocodb] This will cause ByteString conversion errors in HTTP headers.');
|
||||||
return fallbackConfig;
|
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) => {
|
export const createTableUrl = (table: Table | string) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue