fix: update docker-compose network to external and enhance avatar URL resolution logic
This commit is contained in:
3
backend/pytest.ini
Normal file
3
backend/pytest.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[pytest]
|
||||||
|
testpaths = tests
|
||||||
|
python_files = test_*.py
|
||||||
@@ -313,5 +313,5 @@ networks:
|
|||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
hub-net:
|
hub-net:
|
||||||
external: false
|
external: true
|
||||||
name: aduanasoft-hub_default
|
name: aduanasoft-hub_default
|
||||||
|
|||||||
1
frontend/.gitignore
vendored
1
frontend/.gitignore
vendored
@@ -26,6 +26,7 @@ Thumbs.db
|
|||||||
!.env.test
|
!.env.test
|
||||||
|
|
||||||
# Vite
|
# Vite
|
||||||
|
.vite/
|
||||||
vite.config.js.timestamp-*
|
vite.config.js.timestamp-*
|
||||||
vite.config.ts.timestamp-*
|
vite.config.ts.timestamp-*
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint": "prettier --check . && eslint .",
|
"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": "npm run test:unit -- --run && npm run test:e2e",
|
||||||
"test:e2e": "playwright test"
|
"test:e2e": "playwright test"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,18 +43,23 @@ function parseAbsoluteLikeUrl(value: string): URL | null {
|
|||||||
if (!trimmed) return null;
|
if (!trimmed) return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new URL(trimmed);
|
const parsed = new URL(trimmed);
|
||||||
} catch {
|
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
|
||||||
// Soporta formato host:puerto/ruta sin protocolo.
|
return parsed;
|
||||||
if (/^[a-z0-9.-]+:\d+\//i.test(trimmed)) {
|
|
||||||
try {
|
|
||||||
return new URL(`http://${trimmed}`);
|
|
||||||
} catch {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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 {
|
function rewriteInternalHostToPublicUrl(value: string): string {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const vitestClientProject = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
cacheDir: '.vite',
|
||||||
server: {
|
server: {
|
||||||
port: 5173, // fija el puerto
|
port: 5173, // fija el puerto
|
||||||
host: true, // escucha en 0.0.0.0
|
host: true, // escucha en 0.0.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user