Skip to content

Conversation

@Xytronix
Copy link
Contributor

This is an optional maintenance mode that can run manually or automatically depending on .env

Following settings are supported:

  • Manual Maintenance Toggle in .env
  • Activate and stop maintenance mode automatically by defining timestamps
  • Custom Maintenance message

These are supported in .env

# Set to "true" to force maintenance splash screen regardless of dates
PUBLIC_MAINTENANCE_MODE=false

# ISO-8601 timestamps (UTC) defining the maintenance window
PUBLIC_MAINTENANCE_START="2025-07-20T00:00:00Z"
PUBLIC_MAINTENANCE_END="2025-07-20T14:00:00Z"

# Set to "true" to automatically enter/exit maintenance mode based on timestamps
PUBLIC_MAINTENANCE_AUTO=false

# Optional maintenance message shown to users
PUBLIC_MAINTENANCE_MESSAGE="" 

Comment on lines +64 to +70
// Post-maintenance loading stages
const postMaintenanceStages = [
'Finalizing updates...',
'Restarting services...',
'Loading application...',
'Almost ready...'
];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be localized in en.json

<div class="mx-auto mb-4 h-24 w-24">
{#if theme.current === 'dark'}
<!-- Dark theme logo -->
<svg width="100%" height="100%" viewBox="0 0 146 162" class="h-full w-full" class:animate-bounce={!isMaintenanceComplete} class:brightness-75={false} class:sepia={false} class:hue-rotate-[320deg]={false} class:saturate-150={false}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this svg is duplicated/should be external, not hardcoded like this in the HTML.

{#if isMaintenanceComplete}
<div class="mt-4 text-center">
<p class="text-green-600 dark:text-green-400 font-medium">
Systems are back online
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more strings that need i18n

isActive,
status,
progress,
timeRemaining,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to send this timeRemaining string in the API, clients can just build this themselves.

);
// Minimal maintenance gating derived from server-provided flags and PUBLIC env
const maintenanceActive = $derived.by(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why we are deriving things again from public env, when we do this in the server.ts? we should do it in a single place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants