Haiilo provides some managing endpoints to help you perform operations like elastic search index refreshes and maintenance messages. All endpoints are protected with the basic auth credentials of the corresponding platform.
The credentials can be found in your .env configuration.
COYO_MANAGEMENT_USER and COYO_MANAGEMENT_PASSWORD
As of v32, all /manage/* endpoints change to /manage/backend/*
cURL Examples
To give you some practical skills we will show you how to set a maintenance message and activate the maintenance mode.
Maintenance message
Besides the maintenance mode you can activate an orange banner with maintenance information at the bottom of your Haiilo page with the management endpoint maintenance. To remove the banner the users have to click on the X or the duration needs to run out. Also it's possible to send a DELETE or POST a new message.
The message is the message displayed as you may expect. When the duration (in seconds) is up the message disappears by itself. OnlyAdmins sets the visibility to all when set to false.
curl -X POST \\\n https://<COYO_BACKEND_URL>/manage/maintenance/message/all \\\n -u '<COYO_MANAGEMENT_USER>':'<COYO_MANAGEMENT_PASSWORD>' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"message\" : \"Planned COYO update at 20:00 pm. We expect a downtime of about 30 minutes.\",\n \"duration\" : 5400,\n \"onlyAdmins\" : false\n}'\n
Maintenance mode
To restrict all access to an up and running Haiilo you can set the maintenance mode with the management endpoint maintenance. When you only want to restrict access for \"normal\" users you can go into Haiilo's administration and activate the management mode in the general settings, then only users with the permission manage maintenance mode can login.
Activate maintenance mode with headline and message:
curl -X POST \\\n https://<COYO_BACKEND_URL>/manage/maintenance \\\n -u '<COYO_MANAGEMENT_USER>':'<COYO_MANAGEMENT_PASSWORD>' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headline\": \"Upgrading to a new RELEASE\",\n \"message\": \"Don'\\''t panic!\"\n \n}'\n
Deactivate maintenance mode:
curl -X DELETE \\\n https://<COYO_BACKEND_URL>/manage/maintenance \\\n -u '<COYO_MANAGEMENT_USER>':'<COYO_MANAGEMENT_PASSWORD>'