Configuration

Settings live in the control panel, or in config/nuke.php if you would rather they were in version control. Nothing is required — Nuke works on a fresh install without touching any of it.

Guardrails

SettingDefaultWhat it does
requireConfirmationtrueWhether a strike must be armed by typing a phrase.
confirmationPhrase'{scope}'What has to be typed. {scope} becomes the source’s handle. An empty phrase is rejected while confirmation is on — it would arm every strike on a stray Enter.
backupBeforeStriketrueThe default for new strikes. A failed backup stops the run whatever this is set to.
hardDeleteByDefaultfalseWhether the permanent-delete switch starts on. Worth leaving off.
deleteRelationsfalseThe default for the relations switch. Only affects non-permanent deletes; a permanent one always clears them.
runGcAfterStriketrueWhether Craft’s garbage collector runs when a strike finishes.
maxElementsPerStrike10000The ceiling. 0 removes it.
batchSize100Elements per transaction. Lower on a site with heavy afterDelete handlers.
protectedScopes[]Handles that may never be targeted. Matched case-insensitively.
allowUserStrikesfalseWhether users may be deleted at all.
allowConsoleStrikestrueSet to false to make the control panel the only route.

Sweepers

sweeperConfig is a map of sweeper handle to that sweeper’s settings, and it holds overrides only. Anything absent falls back to the task’s own defaults, which is what lets a task added in a later release arrive switched on with sensible settings.

'sweeperConfig' => [
    'backups' => ['enabled' => true, 'olderThanDays' => 90, 'keepNewest' => 10],
    'unusedAssets' => ['enabled' => true, 'mode' => 'trash', 'olderThanDays' => 365],
    'emptyFolders' => ['enabled' => false],
],

Every key is documented in the sweeper reference.

Scheduling and notifications

Pro only; the settings can be filled in on Lite and start working the moment the edition changes.

SettingDefaultWhat it does
scheduleEnabledfalseWhether sweeps run on a schedule.
scheduleFrequency'weekly'daily, weekly or monthly.
scheduleHour30–23, in the system timezone.
scheduleWeekday71 (Monday) to 7 (Sunday), ISO-8601.
scheduleDayOfMonth11–28. Capped deliberately.
scheduleTrigger'cron'cron or web. See scheduling.
notifyEnabledfalseWhether to email reports.
notifyRecipients[]Addresses, one per line. Environment variables are supported and are not validated as email addresses.
notifyOn'changes'always, changes or problems.
notifyOnStriketrueWhether a strike emails too, not just a sweep.

Housekeeping

SettingDefaultWhat it does
retainRuns100How many ledger rows to keep.
logLevel'info'Minimum level for storage/logs/nuke.log. Higher than the read-only plugins in this family, because a successful deletion is the thing worth recording.

A config file

<?php
// config/nuke.php

return [
    'confirmationPhrase' => '{scope}',
    'maxElementsPerStrike' => 2500,
    'protectedScopes' => ['homepage', 'globalSettings', 'legal'],
    'allowConsoleStrikes' => false,
    'retainRuns' => 500,
];

Settings in a config file are locked in the control panel, which is a reasonable way to stop the guardrails being relaxed on a whim.