Update Controller Documentation

The CheckForUpdateUpdateController provides two endpoints for checking for updates and updating Melon. It calls GitHub to check for the latest release and triggers an update process if required.

For more details on how Melon managing updates, refer to the MelonInstaller Architecture.

This is apart of the Settings Endpoints, which are scattered across a couple of controllers that group them by similarity.

Controller Route: /api/settings

All routes within the CheckForUpdateUpdateController are prefixed by /api/settings.


Summary of Endpoints

Endpoint Method Description Authorization
/api/settings/check-for-updates GET Checks if a newer version of the Melon server is available. Admin, User
/api/settings/update-melon POST Initiates the process of updating the Melon server. Admin

Check for Updates

This endpoint checks if a new version of the Melon server is available by comparing the current version of the server with the latest release available on GitHub.

Details:

Responses:

Example Request (using curl):

curl -X GET "https://your-melon-server.com/api/settings/check-for-updates" \
             -H "Authorization: Bearer <Admin-or-User-JWT>"
        

Example Response:

{
            "UpdateAvailable": true,
            "CurrentVersion": "1.0.0",
            "LatestVersion": "1.1.0",
            "ReleaseNotes": "Bug fixes and performance improvements."
        }
        

Update Melon

This endpoint triggers the update process for the Melon server. It downloads the latest version and initiates the update process using MelonInstaller.exe.

Details:

Responses:

Example Request (using curl):

curl -X POST "https://your-melon-server.com/api/settings/update-melon" \
             -H "Authorization: Bearer <Admin-JWT>"
        

Notes