mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-22 23:01:48 +00:00
Merge branch 'dev' into test
This commit is contained in:
@@ -10,6 +10,9 @@ metadata:
|
|||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
|
{{- if .Values.ingress.className }}
|
||||||
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.ingress.tls }}
|
{{- if .Values.ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
{{- toYaml .Values.ingress.tls | nindent 4 }}
|
{{- toYaml .Values.ingress.tls | nindent 4 }}
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ resources:
|
|||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
className: ""
|
||||||
annotations: {}
|
annotations: {}
|
||||||
hosts:
|
hosts:
|
||||||
- host: chart-example.local
|
- host: chart-example.local
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ export default function TripPlannerPage(): React.ReactElement | null {
|
|||||||
reservations={reservations}
|
reservations={reservations}
|
||||||
lat={geoPlace?.lat}
|
lat={geoPlace?.lat}
|
||||||
lng={geoPlace?.lng}
|
lng={geoPlace?.lng}
|
||||||
onClose={() => setShowDayDetail(null)}
|
onClose={() => { setShowDayDetail(null); handleSelectDay(null) }}
|
||||||
onAccommodationChange={loadAccommodations}
|
onAccommodationChange={loadAccommodations}
|
||||||
leftWidth={isMobile ? 0 : (leftCollapsed ? 0 : leftWidth)}
|
leftWidth={isMobile ? 0 : (leftCollapsed ? 0 : leftWidth)}
|
||||||
rightWidth={isMobile ? 0 : (rightCollapsed ? 0 : rightWidth)}
|
rightWidth={isMobile ? 0 : (rightCollapsed ? 0 : rightWidth)}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export async function saveImmichSettings(
|
|||||||
export async function testConnection(
|
export async function testConnection(
|
||||||
immichUrl: string,
|
immichUrl: string,
|
||||||
immichApiKey: string
|
immichApiKey: string
|
||||||
): Promise<{ connected: boolean; error?: string; user?: { name?: string; email?: string } }> {
|
): Promise<{ connected: boolean; error?: string; user?: { name?: string; email?: string }; canonicalUrl?: string }> {
|
||||||
const ssrf = await checkSsrf(immichUrl);
|
const ssrf = await checkSsrf(immichUrl);
|
||||||
if (!ssrf.allowed) return { connected: false, error: ssrf.error ?? 'Invalid Immich URL' };
|
if (!ssrf.allowed) return { connected: false, error: ssrf.error ?? 'Invalid Immich URL' };
|
||||||
try {
|
try {
|
||||||
@@ -79,7 +79,23 @@ export async function testConnection(
|
|||||||
});
|
});
|
||||||
if (!resp.ok) return { connected: false, error: `HTTP ${resp.status}` };
|
if (!resp.ok) return { connected: false, error: `HTTP ${resp.status}` };
|
||||||
const data = await resp.json() as { name?: string; email?: string };
|
const data = await resp.json() as { name?: string; email?: string };
|
||||||
return { connected: true, user: { name: data.name, email: data.email } };
|
|
||||||
|
// Detect http → https upgrade only: same host/port, protocol changed to https
|
||||||
|
let canonicalUrl: string | undefined;
|
||||||
|
if (resp.url) {
|
||||||
|
const finalUrl = new URL(resp.url);
|
||||||
|
const inputUrl = new URL(immichUrl);
|
||||||
|
if (
|
||||||
|
inputUrl.protocol === 'http:' &&
|
||||||
|
finalUrl.protocol === 'https:' &&
|
||||||
|
finalUrl.hostname === inputUrl.hostname &&
|
||||||
|
finalUrl.port === inputUrl.port
|
||||||
|
) {
|
||||||
|
canonicalUrl = finalUrl.origin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { connected: true, user: { name: data.name, email: data.email }, canonicalUrl };
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
return { connected: false, error: err instanceof Error ? err.message : 'Connection failed' };
|
return { connected: false, error: err instanceof Error ? err.message : 'Connection failed' };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user