# 🚧 Maintenance

It supports global maintenance, scoped maintenance, countdowns, whitelists, MOTD changes, server icons, and bypass permissions.

***

### What It Does

The Maintenance module helps you temporarily restrict access to your network or specific server groups.

It can be used for:

* Global maintenance mode
* Scoped maintenance mode
* Maintenance countdowns
* Maintenance whitelist
* Bypass permissions
* Maintenance MOTD
* Maintenance server icon
* Server group targeting
* Controlled maintenance start and stop workflow

***

### When To Enable It

Enable this module if you want NexusProxy to manage maintenance mode from the proxy.

This module is recommended for most production networks.

It is useful when you need to:

* Update your network safely
* Restrict access during maintenance
* Allow only staff or whitelisted players to join
* Show a maintenance MOTD in the server list
* Run countdowns before enabling maintenance
* Put only specific server groups into maintenance

***

### Requirements

The Maintenance module does not require external dependencies.

| Dependency     | Required | Purpose       |
| -------------- | -------- | ------------- |
| Redis          | No       | Not required. |
| MySQL          | No       | Not required. |
| MongoDB        | No       | Not required. |
| PacketEvents   | No       | Not required. |
| Discord        | No       | Not required. |
| PlaceholderAPI | No       | Not required. |

***

### Configuration File

The Maintenance module configuration file is located at:

```
plugins/NexusProxy/modules/maintenance/maintenance.yml
```

This file can contain settings for:

* Module status
* Command names
* Command aliases
* Permissions
* Maintenance messages
* Kick messages
* Whitelist settings
* Countdown settings
* Maintenance MOTD
* Maintenance icons
* Global maintenance behavior
* Scoped maintenance behavior
* Server group scopes
* Bypass permissions

{% hint style="warning" %}
Command names and aliases may be configurable in the module file.

The commands shown here are the default commands.
{% endhint %}

***

### Default Commands

| Command                  | Description                                                        |
| ------------------------ | ------------------------------------------------------------------ |
| `/maintenance status`    | Shows the current maintenance status.                              |
| `/maintenance on`        | Enables maintenance mode.                                          |
| `/maintenance off`       | Disables maintenance mode.                                         |
| `/maintenance countdown` | Starts a maintenance countdown.                                    |
| `/maintenance abort`     | Aborts an active maintenance countdown.                            |
| `/maintenance whitelist` | Manages the maintenance whitelist.                                 |
| `/maintenance scopes`    | Shows available maintenance scopes.                                |
| `/maintenance scope`     | Manages or toggles scoped maintenance, depending on configuration. |

***

### Permissions

| Permission                       | Description                                                                |
| -------------------------------- | -------------------------------------------------------------------------- |
| `nexusproxy.command.maintenance` | Allows usage of maintenance commands.                                      |
| `nexusproxy.maintenance.bypass`  | Allows bypassing global maintenance mode.                                  |
| Per-scope bypass permission      | Allows bypassing a specific maintenance scope, depending on configuration. |

{% hint style="info" %}
Scoped maintenance can use custom bypass permissions defined in the module configuration.
{% endhint %}

***

### Recommended LuckPerms Setup

#### Staff

```
/lp group staff permission set nexusproxy.maintenance.bypass true
```

#### Admin

```
/lp group admin permission set nexusproxy.command.maintenance true
/lp group admin permission set nexusproxy.maintenance.bypass true
```

#### Example scoped bypass

```
/lp group staff permission set nexusproxy.maintenance.bypass.survival true
```

{% hint style="warning" %}
The exact per-scope bypass permission depends on your `maintenance.yml` configuration.
{% endhint %}

***

### Global Maintenance

Global maintenance affects the entire network.

When global maintenance is enabled, players without bypass permission may be blocked from joining or may be disconnected, depending on your configuration.

Default permission for bypass:

```
nexusproxy.maintenance.bypass
```

Enable global maintenance:

```
/maintenance on
```

Disable global maintenance:

```
/maintenance off
```

Check status:

```
/maintenance status
```

***

### Scoped Maintenance

Scoped maintenance allows you to put only specific parts of the network into maintenance.

This is useful if you want to maintain one server group without closing the entire network.

Example use cases:

* Put only Survival in maintenance
* Put only SkyBlock in maintenance
* Keep the lobby open while game servers are closed
* Test updates on one backend group

Scopes are configured in:

```
plugins/NexusProxy/modules/maintenance/maintenance.yml
```

{% hint style="info" %}
Scopes can target specific server groups and can have their own bypass permissions.
{% endhint %}

***

### Maintenance Countdown

The countdown system allows you to warn players before maintenance starts.

Example:

```
/maintenance countdown 5m
```

Depending on your configuration, the countdown may send chat messages, titles, actionbars, sounds, or other warnings.

Abort an active countdown:

```
/maintenance abort
```

***

### Maintenance Whitelist

The whitelist system allows specific players to join during maintenance.

Whitelist commands are handled through:

```
/maintenance whitelist
```

Depending on your configuration, this may allow you to:

* Add players to the whitelist
* Remove players from the whitelist
* List whitelisted players
* Clear the whitelist

{% hint style="info" %}
Use whitelist for temporary individual access.

Use bypass permissions for staff groups or permanent access.
{% endhint %}

***

### Maintenance MOTD

The Maintenance module can change the server list MOTD while maintenance is active.

This is useful to clearly tell players that the network is temporarily unavailable.

Example concept:

```yaml
motd:
  enabled: true
  line1: "&c&lMaintenance"
  line2: "&7We will be back soon."
```

{% hint style="info" %}
If you also use the MOTD module, review both configurations to avoid conflicts.
{% endhint %}

***

### Maintenance Icon

The Maintenance module can also change the server icon while maintenance is active, depending on configuration.

This can be used for:

* Maintenance branding
* Warning icon
* Event maintenance icon
* Temporary server list styling

Make sure your icon file matches Minecraft server icon requirements.

***

### Common Use Cases

#### Enable maintenance

```
/maintenance on
```

***

#### Disable maintenance

```
/maintenance off
```

***

#### Check maintenance status

```
/maintenance status
```

***

#### Start a countdown

```
/maintenance countdown 10m
```

***

#### Abort a countdown

```
/maintenance abort
```

***

#### Manage whitelist

```
/maintenance whitelist
```

***

### Setup Tips

* Give maintenance command access only to administrators.
* Give bypass permission to trusted staff.
* Use scoped maintenance if you do not want to close the entire network.
* Configure a clear maintenance MOTD.
* Use countdowns before enabling maintenance on public networks.
* Check whitelist settings before enabling maintenance.
* Review scope bypass permissions carefully.
* Restart or reload NexusProxy after editing maintenance settings.

***

### Common Issues

#### Players can still join during maintenance

Check that:

* Maintenance mode is actually enabled.
* The player does not have `nexusproxy.maintenance.bypass`.
* The player is not whitelisted.
* The correct scope is enabled if using scoped maintenance.
* The backend server is covered by the active maintenance scope.

***

#### Staff cannot join during maintenance

Check that:

* The staff member has `nexusproxy.maintenance.bypass`.
* The permission is assigned correctly in LuckPerms.
* If using scoped maintenance, the staff member has the correct per-scope bypass permission.
* The player is not blocked by another plugin.

***

#### Maintenance MOTD does not show

Check that:

* Maintenance mode is enabled.
* Maintenance MOTD is enabled in `maintenance.yml`.
* NexusProxy was restarted or reloaded.
* Another plugin is not overriding the proxy ping response.
* The MOTD module is not overriding the maintenance MOTD unexpectedly.

***

#### Countdown does not start

Check that:

* The Maintenance module is enabled.
* The command sender has `nexusproxy.command.maintenance`.
* The countdown format is valid.
* Another countdown is not already running.

***

#### Scoped maintenance does not affect the expected server

Check that:

* The scope exists in `maintenance.yml`.
* The backend server is included in the correct scope.
* The scope is enabled.
* The player does not have the per-scope bypass permission.

***

### Summary

The Maintenance module provides a complete maintenance system for NexusProxy.

It is recommended for networks that need global maintenance, scoped maintenance, countdowns, whitelists, maintenance MOTD, maintenance icons, and bypass control from the proxy.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nexusproxy.nemesismc.net/modules/maintenance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
