Skip to main content

Can I schedule my site to display a maintenance page at a specific time?

You can achieve this by preparing maintenance static files and sending a deploy request at the specified time.

note

If the maintenance timing is flexible and you can perform a frontend deployment when the IP restriction needs to be applied, you can also use kuroco_front.json settings to enable maintenance mode. Refer to How to display maintenance page except for specific IP addresses? for details.

tip

If you need more advanced control such as scheduled maintenance windows or path-specific access restrictions, consider using KurocoEdge. KurocoEdge supports switching maintenance page display based on schedule settings.

The following explains how to achieve this using the KurocoFront deployment feature.

Preparation

1. Create a ZIP file for deployment

Create a ZIP file containing the maintenance HTML file(s) along with kuroco_front.json.

maintenance_deploy.zip
├── index.html (maintenance page)
└── kuroco_front.json

2. Upload the ZIP file

Upload the created ZIP file to KurocoFiles or a similar storage service.

3. Confirm the required deployment information

Refer to "Can I Deploy KurocoFront Without Using GitHub?" and confirm the following information:

  • API endpoint (e.g., https://sitekey.g.kuroco.app)
  • KurocoFront domain (e.g., sitekey.g.kuroco-front.app)
  • SHA1 hash of the frontend domain
  • Download URL of the ZIP file
  • KurocoFront settings token

Sending the deploy request

At the specified time, send a deploy request using a curl command like the following:

endpoint="https://sitekey.g.kuroco.app"
domain="sitekey.g.kuroco-front.app"
hash="****************************************"
storage_url="https://sitekey.g.kuroco-img.app/files/user/deploy_file/maintenance_deploy.zip"
token="************************************"

curl -X POST "${endpoint}/direct/menu/github/" \
-H 'Content-Type: application/json;charset=utf-8' \
-H "X-Kuroco-Auth: token ${token}" \
-d "{\"data\":{\"domain\":\"${domain}\", \"hash\":\"${hash}\",\"storage_url\":\"${storage_url}\"}}"
tip

To restore the site, run GitHub Actions and deploy the linked GitHub artifacts. Alternatively, you may prepare a ZIP file of the standard build artifacts separately and send a deployment request in the same manner.

Using Kuroco batch processing to execute the deploy request

You can also use Kuroco batch processing to execute the deploy request. Create a batch process, set the execution timing to "daily", and use the date Smarty plugin to check the date/time, allowing the deployment to be executed automatically at the specified time.

Example: Display maintenance page on a specific date

{* Skip except on the specified date *}
{date var='today' time='now' format='Y-m-d'}
{if $today != '2026-03-15'}
{return}
{/if}

{* Configure variables *}
{assign var="endpoint" value="https://sitekey.g.kuroco.app"}
{assign var="domain" value="sitekey.g.kuroco-front.app"}
{rcms_hash var='hash' data='domain' algo='SHA1'}
{assign var="storage_url" value="https://sitekey.g.kuroco-img.app/files/user/deploy_file/maintenance_deploy.zip"}
{assign var="token" value="****************************************************************"}

{* Configure headers *}
{assign_array var="headers" values=""}
{append var="headers" value="Content-Type: application/json;charset=utf-8"}
{append var="headers" value="X-Kuroco-Auth: token `$token`"}

{* Configure the request body *}
{assign_array var="body" values=""}
{assign_array var="body.data" values=""}
{assign var="body.data.domain" value=$domain}
{assign var="body.data.hash" value=$hash}
{assign var="body.data.storage_url" value=$storage_url}

{* Execute the API request *}
{api
endpoint="`$endpoint`/direct/menu/github/"
method="POST"
headers=$headers
body=$body
var="response"
status_var="status"
}
info

For detailed instructions on configuring batch execution timing, refer to "Can I schedule batch processing to run at specific dates or weekly?".


Support

If you have any other questions, please contact us or check out Our Slack Community.