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

76
resources/js/types/analytics.d.ts vendored Normal file
View File

@@ -0,0 +1,76 @@
/**
* TypeScript definitions for Analytics Module
*/
export interface AnalyticsConfig {
enabled?: boolean;
providers?: Array<string | AnalyticsProviderConfig | AnalyticsProvider>;
gdprCompliant?: boolean;
requireConsent?: boolean;
consentGiven?: boolean;
anonymizeIp?: boolean;
}
export interface AnalyticsProviderConfig {
type: 'google-analytics' | 'ga' | 'custom';
enabled?: boolean;
measurementId?: string;
gaId?: string;
endpoint?: string;
[key: string]: any;
}
export interface AnalyticsEvent {
name: string;
properties: Record<string, any>;
timestamp: number;
userId?: string | null;
}
export interface PageViewData {
path: string;
title: string;
properties: Record<string, any>;
timestamp: number;
}
export declare class AnalyticsProvider {
constructor(config?: AnalyticsProviderConfig);
enabled: boolean;
track(eventName: string, properties?: Record<string, any>): Promise<void>;
pageView(path: string, properties?: Record<string, any>): Promise<void>;
identify(userId: string, traits?: Record<string, any>): Promise<void>;
}
export declare class GoogleAnalyticsProvider extends AnalyticsProvider {
constructor(config?: AnalyticsProviderConfig);
measurementId?: string;
}
export declare class CustomProvider extends AnalyticsProvider {
constructor(config?: AnalyticsProviderConfig);
endpoint: string;
}
export declare class Analytics {
constructor(config?: AnalyticsConfig);
static create(config?: AnalyticsConfig): Analytics;
track(eventName: string, properties?: Record<string, any>): Promise<void>;
trackPageView(path?: string | null, properties?: Record<string, any>): Promise<void>;
identify(userId: string, traits?: Record<string, any>): Promise<void>;
trackBehavior(action: string, target: string, properties?: Record<string, any>): Promise<void>;
giveConsent(): void;
revokeConsent(): void;
hasConsent(): boolean;
enable(): void;
disable(): void;
destroy(): void;
}

View File

@@ -0,0 +1,67 @@
/**
* TypeScript definitions for Animation System Module
*/
export interface AnimationConfig {
type: 'fade-in' | 'zoom-in' | 'parallax' | 'timeline' | 'sticky-fade' | 'sticky-steps';
offset?: number;
delay?: number;
once?: boolean;
speed?: number;
fadeStart?: number;
fadeEnd?: number;
steps?: number;
triggerPoint?: number;
loop?: boolean;
}
export interface AnimationSystemConfig {
enabled?: boolean;
useIntersectionObserver?: boolean;
throttleDelay?: number;
}
export declare class ScrollAnimation {
constructor(element: HTMLElement, config: AnimationConfig);
element: HTMLElement;
config: AnimationConfig;
triggered: boolean;
needsUpdate: boolean;
init(): void;
enter(): void;
exit(): void;
update(): void;
destroy(): void;
}
export declare class TimelineAnimation {
constructor(element: HTMLElement, config: AnimationConfig);
element: HTMLElement;
config: AnimationConfig;
currentStep: number;
triggered: boolean;
init(): void;
enter(): void;
exit(): void;
update(): void;
setStep(step: number): void;
setProgress(progress: number): void;
destroy(): void;
}
export declare class AnimationSystem {
constructor(config?: AnimationSystemConfig);
static create(config?: AnimationSystemConfig): AnimationSystem;
init(): void;
registerAnimation(element: HTMLElement, config: AnimationConfig): void;
removeAnimation(element: HTMLElement): void;
updateAnimations(): void;
destroy(): void;
}

70
resources/js/types/cache-manager.d.ts vendored Normal file
View File

@@ -0,0 +1,70 @@
/**
* TypeScript definitions for Cache Manager Module
*/
export declare const CacheStrategy: {
readonly NO_CACHE: 'no-cache';
readonly CACHE_FIRST: 'cache-first';
readonly NETWORK_FIRST: 'network-first';
readonly STALE_WHILE_REVALIDATE: 'stale-while-revalidate';
readonly NETWORK_ONLY: 'network-only';
readonly CACHE_ONLY: 'cache-only';
};
export interface CacheManagerConfig {
defaultStrategy?: keyof typeof CacheStrategy;
defaultTTL?: number;
maxMemorySize?: number;
enableIndexedDB?: boolean;
indexedDBName?: string;
indexedDBVersion?: number;
enableAnalytics?: boolean;
}
export interface CacheOptions {
strategy?: keyof typeof CacheStrategy;
ttl?: number;
}
export interface CacheEntry {
key: string;
value: any;
timestamp: number;
ttl: number;
strategy: string;
}
export interface CacheAnalytics {
hits: number;
misses: number;
sets: number;
deletes: number;
total: number;
hitRate: number;
memorySize: number;
memoryMaxSize: number;
}
export type CachePattern = string | RegExp | ((key: string) => boolean);
export type CacheComputeFn = () => Promise<any> | any;
export declare class CacheManager {
constructor(config?: CacheManagerConfig);
static create(config?: CacheManagerConfig): CacheManager;
init(): Promise<void>;
get(key: string, options?: CacheOptions): Promise<any>;
set(key: string, value: any, options?: CacheOptions): Promise<void>;
getOrSet(key: string, computeFn: CacheComputeFn, options?: CacheOptions): Promise<any>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
invalidate(pattern: CachePattern): Promise<void>;
warm(keys: string[], computeFn: (key: string) => Promise<any> | any): Promise<void>;
getAnalytics(): CacheAnalytics;
resetAnalytics(): void;
destroy(): void;
}
export declare function getStrategyForUseCase(useCase: string): keyof typeof CacheStrategy;

70
resources/js/types/error-tracking.d.ts vendored Normal file
View File

@@ -0,0 +1,70 @@
/**
* TypeScript definitions for Error Tracking Module
*/
export interface ErrorTrackerConfig {
endpoint?: string;
enabled?: boolean;
sampleRate?: number; // 0.0 to 1.0
maxErrors?: number;
groupingWindow?: number; // milliseconds
includeStack?: boolean;
includeContext?: boolean;
includeUserAgent?: boolean;
includeUrl?: boolean;
filters?: Array<((error: any, context: ErrorContext) => boolean) | RegExp>;
beforeSend?: (errorData: ErrorData) => ErrorData | null | false | void;
}
export interface ErrorContext {
type?: string;
filename?: string;
lineno?: number;
colno?: number;
userAgent?: string;
url?: string;
referrer?: string;
viewport?: {
width: number;
height: number;
};
[key: string]: any;
}
export interface ErrorData {
message: string;
name: string;
stack?: string;
timestamp: number;
type: string;
context?: ErrorContext;
[key: string]: any;
}
export interface ErrorGroup {
fingerprint: string;
count: number;
firstSeen: number;
lastSeen: number;
errors: ErrorData[];
}
export declare class ErrorTracker {
constructor(config?: ErrorTrackerConfig);
static create(config?: ErrorTrackerConfig): ErrorTracker;
init(): void;
captureException(error: any, context?: ErrorContext): void;
flushReports(): Promise<void>;
report(): Promise<void>;
getErrorGroups(): ErrorGroup[];
getErrors(): ErrorData[];
clearErrors(): void;
destroy(): void;
}
export declare function getGlobalErrorTracker(config?: ErrorTrackerConfig): ErrorTracker;

51
resources/js/types/event-bus.d.ts vendored Normal file
View File

@@ -0,0 +1,51 @@
/**
* TypeScript definitions for Event Bus Module
*/
export interface EventBusConfig {
enableHistory?: boolean;
maxHistorySize?: number;
enableWildcards?: boolean;
}
export interface EventOptions {
once?: boolean;
priority?: number;
filter?: (data: any, options?: EventOptions) => boolean;
}
export interface EventHistoryItem {
eventName: string;
data: any;
options: EventOptions;
timestamp: number;
}
export type EventCallback = (data: any, eventName?: string, options?: EventOptions) => void;
export type EventMiddleware = (eventName: string, data: any, options?: EventOptions) => any | null | false | void;
export type EventFilter = (item: EventHistoryItem) => boolean;
export declare class EventBus {
constructor(config?: EventBusConfig);
static create(config?: EventBusConfig): EventBus;
on(eventName: string, callback: EventCallback, options?: EventOptions): () => void;
once(eventName: string, callback: EventCallback, options?: EventOptions): () => void;
off(eventName: string, callback: EventCallback): void;
emit(eventName: string, data?: any, options?: EventOptions): void;
use(middleware: EventMiddleware): void;
getHistory(filter?: string | EventFilter): EventHistoryItem[];
clearHistory(): void;
getEventNames(): string[];
getSubscriberCount(eventName: string): number;
removeAllListeners(eventName?: string): void;
destroy(): void;
}
export declare function getGlobalEventBus(config?: EventBusConfig): EventBus;

233
resources/js/types/livecomponent.d.ts vendored Normal file
View File

@@ -0,0 +1,233 @@
/**
* LiveComponent TypeScript Definitions
*
* Type-safe definitions for LiveComponent API communication between PHP and JavaScript
*/
/**
* Component ID format: "component-name:instance-id"
*/
export type ComponentId = string;
/**
* Component state structure
*/
export interface LiveComponentState {
id: ComponentId;
component: string;
data: Record<string, unknown>;
version: number;
}
/**
* Action parameters (key-value pairs)
*/
export type ActionParams = Record<string, unknown>;
/**
* Component event payload
*/
export interface EventPayload {
[key: string]: unknown;
}
/**
* Component event structure
*/
export interface ComponentEvent {
name: string;
payload: EventPayload;
target?: ComponentId | null;
}
/**
* Fragment map for partial rendering
*/
export interface FragmentMap {
[fragmentName: string]: string;
}
/**
* Action request payload
*/
export interface ActionRequest {
method: string;
params: ActionParams;
state: Record<string, unknown>;
_csrf_token: string;
fragments?: string[] | null;
}
/**
* Action response with full HTML
*/
export interface ActionResponseHtml {
html: string;
state: LiveComponentState;
events?: ComponentEvent[];
}
/**
* Action response with fragments (partial rendering)
*/
export interface ActionResponseFragments {
fragments: FragmentMap;
state: LiveComponentState;
events?: ComponentEvent[];
}
/**
* Union type for action responses
*/
export type ActionResponse = ActionResponseHtml | ActionResponseFragments;
/**
* Standardized error format
*/
export interface LiveComponentError {
code: string;
message: string;
details?: Record<string, unknown>;
componentId?: ComponentId;
action?: string;
timestamp?: number;
}
/**
* Error response structure
*/
export interface ErrorResponse {
success: false;
error: LiveComponentError;
}
/**
* Upload request payload
*/
export interface UploadRequest {
file: File;
state: Record<string, unknown>;
params?: ActionParams;
_csrf_token: string;
}
/**
* Upload response
*/
export interface UploadResponse {
success: true;
html?: string;
state?: LiveComponentState;
events?: ComponentEvent[];
file?: {
name: string;
size: number;
type: string;
url?: string;
};
}
/**
* Batch operation request
*/
export interface BatchOperation {
componentId: ComponentId;
method: string;
params?: ActionParams;
fragments?: string[] | null;
operationId?: string;
}
/**
* Batch request payload
*/
export interface BatchRequest {
operations: BatchOperation[];
}
/**
* Batch operation result
*/
export interface BatchOperationResult {
success: boolean;
componentId?: ComponentId;
operationId?: string;
html?: string;
fragments?: FragmentMap;
state?: LiveComponentState;
events?: ComponentEvent[];
error?: LiveComponentError;
}
/**
* Batch response
*/
export interface BatchResponse {
success_count: number;
failure_count: number;
results: BatchOperationResult[];
}
/**
* Component configuration
*/
export interface ComponentConfig {
id: ComponentId;
element: HTMLElement;
pollInterval?: number | null;
pollTimer?: number | null;
observer?: MutationObserver | null;
sseChannel?: string | null;
}
/**
* LiveComponent Manager interface
*/
export interface LiveComponentManager {
components: Map<ComponentId, ComponentConfig>;
init(element: HTMLElement): void;
executeAction(
componentId: ComponentId,
method: string,
params?: ActionParams,
fragments?: string[] | null
): Promise<ActionResponse>;
uploadFile(
componentId: ComponentId,
file: File,
params?: ActionParams
): Promise<UploadResponse>;
executeBatch(
operations: BatchOperation[],
options?: { autoApply?: boolean }
): Promise<BatchResponse>;
on(
componentId: ComponentId,
eventName: string,
callback: (payload: EventPayload) => void
): void;
broadcast(eventName: string, payload: EventPayload): void;
startPolling(componentId: ComponentId): void;
stopPolling(componentId: ComponentId): void;
destroy(componentId: ComponentId): void;
}
/**
* Global LiveComponent instance
*/
declare global {
interface Window {
LiveComponent: LiveComponentManager;
liveComponents?: LiveComponentManager; // Legacy support
}
}
export {};

110
resources/js/types/router.d.ts vendored Normal file
View File

@@ -0,0 +1,110 @@
/**
* TypeScript definitions for Router Enhancement Module
*/
export interface RouteConfig {
path: string;
component: string | Function | HTMLElement;
name?: string;
title?: string;
meta?: Record<string, any>;
guards?: string[];
middleware?: (RouteMiddleware | string)[];
lazy?: boolean;
}
export interface Route {
path: string;
component: string | Function | HTMLElement;
name: string;
title: string | null;
meta: Record<string, any>;
guards: string[];
middleware: RouteMiddleware[];
lazy: boolean;
}
export interface RouterConfig {
mode?: 'history' | 'hash';
base?: string;
enableAnalytics?: boolean;
}
export interface NavigationContext {
[key: string]: any;
}
export type GuardFunction = (to: Route, from: Route | null, context?: NavigationContext) => Promise<boolean | string | { allowed: boolean; redirect?: string; reason?: string }>;
export type MiddlewareFunction = (to: Route, from: Route | null, next: (allowed?: boolean) => void, context?: NavigationContext) => Promise<void> | void;
export type BeforeEachHook = (to: Route, from: Route | null) => Promise<boolean | string | void> | boolean | string | void;
export type AfterEachHook = (to: Route, from: Route | null) => Promise<void> | void;
export interface GuardResult {
allowed: boolean;
redirect: string | null;
reason: string | null;
}
export interface RouterAnalytics {
navigations: Array<{
to: string;
from: string | null;
timestamp: number;
duration: number;
}>;
errors: any[];
totalNavigations: number;
totalErrors: number;
}
export declare class RouteGuard {
constructor(name: string, guardFn: GuardFunction);
static create(name: string, guardFn: GuardFunction): RouteGuard;
execute(to: Route, from: Route | null, context?: NavigationContext): Promise<GuardResult>;
}
export declare class RouteMiddleware {
constructor(name: string, middlewareFn: MiddlewareFunction);
static create(name: string, middlewareFn: MiddlewareFunction): RouteMiddleware;
execute(to: Route, from: Route | null, next: (allowed?: boolean) => void, context?: NavigationContext): Promise<void>;
}
export declare class Router {
constructor(config?: RouterConfig);
static create(config?: RouterConfig): Router;
route(path: string, config: RouteConfig): Router;
routes(routesConfig: RouteConfig[]): Router;
guard(name: string, guardFn: GuardFunction): Router;
use(middleware: RouteMiddleware | MiddlewareFunction | string): Router;
beforeEach(hook: BeforeEachHook): Router;
afterEach(hook: AfterEachHook): Router;
navigate(path: string, options?: { container?: HTMLElement; updateHistory?: boolean }): Promise<boolean>;
getCurrentRoute(): Route | null;
getAnalytics(): RouterAnalytics;
destroy(): void;
}
export declare const BuiltInGuards: {
auth: RouteGuard;
guest: RouteGuard;
role: (requiredRole: string) => RouteGuard;
permission: (requiredPermission: string) => RouteGuard;
};
export declare const BuiltInMiddleware: {
analytics: RouteMiddleware;
loading: RouteMiddleware;
scrollToTop: RouteMiddleware;
};

64
resources/js/types/security.d.ts vendored Normal file
View File

@@ -0,0 +1,64 @@
/**
* TypeScript definitions for Security Module
*/
export interface CsrfManagerConfig {
tokenName?: string;
headerName?: string;
refreshInterval?: number;
autoRefresh?: boolean;
endpoint?: string;
}
export interface XssConfig {
enabled?: boolean;
sanitizeOnInput?: boolean;
}
export interface CspConfig {
enabled?: boolean;
reportOnly?: boolean;
}
export interface SecurityManagerConfig {
csrf?: CsrfManagerConfig;
xss?: XssConfig;
csp?: CspConfig;
}
export interface SecurityHeadersValidation {
valid: boolean;
issues: string[];
}
export declare class CsrfManager {
constructor(config?: CsrfManagerConfig);
static create(config?: CsrfManagerConfig): CsrfManager;
init(): void;
getToken(): string | null;
refreshToken(): Promise<void>;
updateAllTokens(): void;
startAutoRefresh(): void;
stopAutoRefresh(): void;
getTokenHeader(): Record<string, string>;
destroy(): void;
}
export declare class SecurityManager {
constructor(config?: SecurityManagerConfig);
static create(config?: SecurityManagerConfig): SecurityManager;
init(): void;
getCsrfToken(): string | null;
getCsrfTokenHeader(): Record<string, string>;
refreshCsrfToken(): Promise<void>;
validateSecurityHeaders(): SecurityHeadersValidation;
escapeHtml(text: string): string;
validateUrl(url: string): boolean;
sanitizeHtml(html: string): string;
destroy(): void;
}

64
resources/js/types/state-manager.d.ts vendored Normal file
View File

@@ -0,0 +1,64 @@
/**
* TypeScript definitions for State Manager Module
*/
export interface StateManagerConfig {
initialState?: Record<string, any>;
maxHistorySize?: number;
enableHistory?: boolean;
persistence?: {
enabled?: boolean;
storage?: 'localStorage' | 'sessionStorage';
key?: string;
paths?: string[];
};
sync?: {
enabled?: boolean;
};
}
export interface StateAction {
type: string;
path?: string;
value?: any;
oldValue?: any;
[key: string]: any;
}
export interface HistoryPoint {
action: StateAction;
state: Record<string, any>;
timestamp: number;
}
export type StateSubscriber = (newValue: any, oldValue?: any, path?: string) => void;
export type StateMiddleware = (action: StateAction, getState: () => Record<string, any>) => StateAction | null;
export type StateReducer = (state: Record<string, any>, action: StateAction) => Record<string, any>;
export type StateThunk = (dispatch: (action: StateAction | StateThunk) => void, getState: () => Record<string, any>) => any;
export declare class StateManager {
constructor(config?: StateManagerConfig);
static create(config?: StateManagerConfig): StateManager;
getState(): Record<string, any>;
get(path: string, defaultValue?: any): any;
set(path: string, value: any): void;
dispatch(action: StateAction | StateThunk): void;
reducer(state: Record<string, any>, action: StateAction): Record<string, any>;
subscribe(path: string, callback: StateSubscriber): () => void;
subscribeAll(callback: StateSubscriber): () => void;
use(middleware: StateMiddleware): void;
getHistory(): HistoryPoint[];
timeTravel(index: number): void;
reset(): void;
destroy(): void;
}
export declare function getGlobalStateManager(config?: StateManagerConfig): StateManager;
export declare function createScopedStateManager(config?: StateManagerConfig): StateManager;

76
resources/js/types/validation.d.ts vendored Normal file
View File

@@ -0,0 +1,76 @@
/**
* TypeScript definitions for Validation Module
*/
export interface ValidationSchema {
[fieldName: string]: ValidationRuleConfig | ValidationRuleConfig[];
}
export type ValidationRuleConfig =
| string
| ValidationRuleObject
| ValidationRuleFunction;
export interface ValidationRuleObject {
rule?: string;
type?: string;
options?: ValidationRuleOptions;
async?: boolean;
validator?: (value: any, options?: ValidationRuleOptions) => boolean | string | Promise<boolean | string>;
message?: string;
[key: string]: any;
}
export interface ValidationRuleOptions {
value?: any;
message?: string;
country?: string;
validator?: (value: any, options?: ValidationRuleOptions) => boolean | string | Promise<boolean | string>;
[key: string]: any;
}
export type ValidationRuleFunction = (value: any) => boolean | string | Promise<boolean | string>;
export interface ValidationResult {
valid: boolean;
errors: string[];
}
export interface ValidationResults {
valid: boolean;
errors: Record<string, string[]>;
results: Record<string, ValidationResult>;
}
export declare class Validator {
constructor(schema?: ValidationSchema);
static create(schema?: ValidationSchema): Validator;
static fromForm(form: HTMLFormElement): Validator;
registerRule(name: string, rule: ValidationRuleFunction): void;
validateField(fieldName: string, value: any, schema?: ValidationRuleConfig | ValidationRuleConfig[]): Promise<ValidationResult>;
validate(data: Record<string, any>): Promise<ValidationResults>;
validateFields(data: Record<string, any>, fieldNames: string[]): Promise<ValidationResults>;
getFieldErrors(fieldName: string): string[];
getErrors(): Record<string, string[]>;
isFieldValid(fieldName: string): boolean;
isValid(): boolean;
clearErrors(fieldName?: string): void;
reset(): void;
}
export declare class ValidationRule {
constructor(name: string, validator: ValidationRuleFunction, options?: ValidationRuleOptions);
static create(name: string, validator: ValidationRuleFunction, options?: ValidationRuleOptions): ValidationRule;
validate(value: any): Promise<boolean | string>;
getName(): string;
getOptions(): ValidationRuleOptions;
}