# Maintenance Mode

Sharey includes a maintenance mode feature that allows you to temporarily disable the service and show a maintenance page to users.

## How to Enable Maintenance Mode

```bash
python config_util.py maintenance enable
```

This will:
- Ask for a custom maintenance message (optional)
- Ask for an estimated return time (optional)
- Enable maintenance mode immediately

## How to Disable Maintenance Mode

```bash
python config_util.py maintenance disable
```

## Check Maintenance Status

```bash
python config_util.py maintenance status
```

## Manual Configuration

You can also manually edit `config.json` to enable/disable maintenance mode:

```json
{
  "maintenance": {
    "enabled": true,
    "message": "Sharey is currently under maintenance. Please check back later!",
    "estimated_return": "2025-08-22 15:00 UTC"
  }
}
```

## What Happens During Maintenance

When maintenance mode is enabled:

- ✅ **Health check endpoint** (`/health`) still works (for monitoring)
- ❌ **All other routes** show the maintenance page
- ❌ **API endpoints** return maintenance page with 503 status
- ❌ **File uploads** are disabled
- ❌ **File downloads** are disabled  
- ❌ **Paste creation** is disabled
- ❌ **Paste viewing** is disabled

## Maintenance Page Features

- 🎨 **Themed**: Respects user's light/dark theme preference
- 📱 **Responsive**: Works on mobile and desktop
- 🔄 **Refresh button**: Users can easily check if maintenance is over
- ⏰ **Estimated return time**: Shows when service is expected to return (optional)
- 💬 **Custom message**: Display custom maintenance information

## Use Cases

- **Server updates**: When updating the application
- **Database maintenance**: When performing B2 bucket operations
- **Security issues**: When temporarily disabling service for security reasons
- **Planned downtime**: When performing infrastructure maintenance
