fix: Gitea Traefik routing and connection pool optimization
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled

- Remove middleware reference from Gitea Traefik labels (caused routing issues)
- Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s)
- Add explicit service reference in Traefik labels
- Fix intermittent 504 timeouts by improving PostgreSQL connection handling

Fixes Gitea unreachability via git.michaelschiemer.de
This commit is contained in:
2025-11-09 14:46:15 +01:00
parent 85c369e846
commit 36ef2a1e2c
1366 changed files with 104925 additions and 28719 deletions

View File

@@ -10,6 +10,9 @@ export class SPARouter {
enableTransitions: true,
transitionDuration: 100, // Beschleunigt von 300ms auf 100ms
skeletonTemplate: this.createSkeletonTemplate(),
// LiveComponent integration options
enableLiveComponentIntegration: options.enableLiveComponentIntegration ?? true,
preserveLiveComponentState: options.preserveLiveComponentState ?? false,
...options
};
@@ -17,6 +20,7 @@ export class SPARouter {
this.isLoading = false;
this.currentUrl = window.location.href;
this.abortController = null;
this.liveComponentManager = null;
// Bind event handlers to preserve context for removal
this.handleLinkClick = this.handleLinkClick.bind(this);
@@ -38,13 +42,44 @@ export class SPARouter {
return;
}
// Initialize LiveComponent integration if enabled
if (this.options.enableLiveComponentIntegration) {
this.initLiveComponentIntegration();
}
this.bindEvents();
this.setupStyles();
// Handle initial page load for history
this.updateHistoryState(window.location.href, document.title);
Logger.info('[SPARouter] Initialized');
Logger.info('[SPARouter] Initialized', {
liveComponentIntegration: this.options.enableLiveComponentIntegration
});
}
/**
* Initialize LiveComponent integration
*/
initLiveComponentIntegration() {
// Try to get LiveComponent instance
// Check if it's available globally or via module system
if (typeof window !== 'undefined' && window.LiveComponent) {
this.liveComponentManager = window.LiveComponent;
} else {
// Try to import dynamically
import('../livecomponent/index.js').then(module => {
if (module.LiveComponent) {
this.liveComponentManager = module.LiveComponent;
} else if (module.default) {
this.liveComponentManager = module.default;
}
}).catch(error => {
Logger.warn('[SPARouter] LiveComponent not available', error);
});
}
Logger.debug('[SPARouter] LiveComponent integration initialized');
}
bindEvents() {
@@ -231,6 +266,12 @@ export class SPARouter {
}
async updateContent(newContent, newTitle) {
// Save LiveComponent state before navigation if enabled
let savedComponentStates = null;
if (this.options.enableLiveComponentIntegration && this.options.preserveLiveComponentState && this.liveComponentManager) {
savedComponentStates = this.saveLiveComponentStates();
}
// Update page title
if (newTitle) {
document.title = newTitle;
@@ -247,6 +288,11 @@ export class SPARouter {
// Re-initialize modules for new content
this.reinitializeModules();
// Initialize LiveComponents in new content
if (this.options.enableLiveComponentIntegration) {
await this.initializeLiveComponents(savedComponentStates);
}
// Smooth transition in
if (this.options.enableTransitions) {
await this.transitionIn();
@@ -260,6 +306,89 @@ export class SPARouter {
// Trigger custom event
this.triggerNavigationEvent();
}
/**
* Save LiveComponent states before navigation
*/
saveLiveComponentStates() {
if (!this.liveComponentManager) {
return null;
}
const states = {};
const components = this.container.querySelectorAll('[data-live-component]');
components.forEach(element => {
const componentId = element.getAttribute('data-live-component');
if (componentId && this.liveComponentManager.components) {
const component = this.liveComponentManager.components.get(componentId);
if (component) {
// Get state from element's dataset
const stateJson = element.dataset.state;
if (stateJson) {
try {
states[componentId] = JSON.parse(stateJson);
} catch (e) {
Logger.warn(`[SPARouter] Failed to parse state for ${componentId}`, e);
}
}
}
}
});
Logger.debug('[SPARouter] Saved LiveComponent states', Object.keys(states));
return states;
}
/**
* Initialize LiveComponents in new content
*/
async initializeLiveComponents(savedStates = null) {
if (!this.liveComponentManager) {
// Try to get LiveComponentManager again
this.initLiveComponentIntegration();
// Wait a bit for async initialization
await new Promise(resolve => setTimeout(resolve, 100));
if (!this.liveComponentManager) {
Logger.warn('[SPARouter] LiveComponentManager not available, skipping initialization');
return;
}
}
// Find all LiveComponent elements in new content
const componentElements = this.container.querySelectorAll('[data-live-component]');
if (componentElements.length === 0) {
return;
}
Logger.info(`[SPARouter] Initializing ${componentElements.length} LiveComponents`);
// Initialize each component
for (const element of componentElements) {
try {
// Restore state if available
if (savedStates) {
const componentId = element.getAttribute('data-live-component');
if (componentId && savedStates[componentId]) {
const stateJson = JSON.stringify(savedStates[componentId]);
element.dataset.state = stateJson;
}
}
// Initialize component using LiveComponent instance
if (this.liveComponentManager && typeof this.liveComponentManager.init === 'function') {
this.liveComponentManager.init(element);
}
} catch (error) {
Logger.error('[SPARouter] Failed to initialize LiveComponent', error);
}
}
Logger.debug('[SPARouter] LiveComponents initialized');
}
showLoadingState() {
document.body.classList.add(this.options.loadingClass);
@@ -326,6 +455,12 @@ export class SPARouter {
moduleElements.forEach(element => {
const moduleName = element.dataset.module;
// Skip LiveComponent initialization here (handled separately)
if (moduleName === 'livecomponent') {
return;
}
Logger.info(`[SPARouter] Re-initializing module "${moduleName}" on new content`);
// Trigger module initialization (would need access to module system)