fix: update docker-compose network to external and enhance avatar URL resolution logic

This commit is contained in:
2026-05-11 08:39:16 -05:00
parent 96fd14582d
commit c9d8bf666a
6 changed files with 23 additions and 12 deletions

3
backend/pytest.ini Normal file
View File

@@ -0,0 +1,3 @@
[pytest]
testpaths = tests
python_files = test_*.py

View File

@@ -313,5 +313,5 @@ networks:
driver: bridge
hub-net:
external: false
external: true
name: aduanasoft-hub_default

1
frontend/.gitignore vendored
View File

@@ -26,6 +26,7 @@ Thumbs.db
!.env.test
# Vite
.vite/
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@@ -14,7 +14,8 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"test:unit": "vitest",
"test:unit": "vitest --project server",
"test:unit:full": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test"
},

View File

@@ -43,18 +43,23 @@ function parseAbsoluteLikeUrl(value: string): URL | null {
if (!trimmed) return null;
try {
return new URL(trimmed);
} catch {
// Soporta formato host:puerto/ruta sin protocolo.
if (/^[a-z0-9.-]+:\d+\//i.test(trimmed)) {
try {
return new URL(`http://${trimmed}`);
} catch {
return null;
}
const parsed = new URL(trimmed);
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
return parsed;
}
return null;
} catch {
}
// Soporta formato host:puerto/ruta sin protocolo.
if (/^[a-z0-9.-]+:\d+\//i.test(trimmed)) {
try {
return new URL(`http://${trimmed}`);
} catch {
return null;
}
}
return null;
}
function rewriteInternalHostToPublicUrl(value: string): string {

View File

@@ -37,6 +37,7 @@ const vitestClientProject = {
};
export default defineConfig({
cacheDir: '.vite',
server: {
port: 5173, // fija el puerto
host: true, // escucha en 0.0.0.0