System Commands
Commands for configuring and maintaining your PteroCA system.
Configure Database
The pteroca:system:configure-database command is executed during the initial installation of the panel. It sets up the database connection and configures the necessary settings to enable the panel's functionality.
Command:
pteroca:system:configure-databaseAlias:
app:configure-database(deprecated, removed in v1.0.0)
For a detailed step-by-step guide on database setup, refer to the Database Setup section of the documentation.
Examples
# Recommended (v0.6+)
docker exec pteroca_web_dev php bin/console pteroca:system:configure-database
# Deprecated (still works until v1.0.0)
docker exec pteroca_web_dev php bin/console app:configure-databaseThis command is a crucial part of the setup process and should be completed before any further configuration.
Configure System
The pteroca:system:configure command is used during the initial setup of the panel. It configures key system settings required for the panel to operate seamlessly, such as paths, environment variables, and other foundational options.
Command:
pteroca:system:configureAlias:
app:configure-system(deprecated, removed in v1.0.0)
For a detailed walkthrough of this command's execution, please refer to the System Configuration section of the documentation.
Examples
This command is an essential step in preparing the panel environment and must be run as part of the initial configuration process.
Update System
The pteroca:system:update command is a comprehensive utility that streamlines the process of keeping your PteroCA installation up to date. It automates key steps, such as pulling the latest version of the code, installing/updating dependencies, running any required database migrations, and adjusting file permissions—all in one go.
Command:
pteroca:system:updateAlias:
app:update-system(deprecated, removed in v1.0.0)
At present, this command specifically handles updates to your existing PteroCA project, ensuring it has everything needed to run smoothly. Future updates may expand its responsibilities to cover more complex deployment or configuration tasks.
Options
--force-composer: Force composer install with --ignore-platform-reqs--dry-run: Show what would be done without making changes--skip-backup: Skip database backup (DANGEROUS)--backup-retention[=DAYS]: Days to retain backups (default: 7)--timeout[=SECONDS]: Timeout in seconds (default: 600)
Examples
Enhanced Safety Features
Pre-flight validation
Automatic database backup
Rollback on failure
Update locking to prevent concurrent updates
Timeout management
Cleanup Logs
The pteroca:system:cleanup-logs command is a maintenance utility designed to remove outdated log entries from the system. It helps keep the database clean and efficient by automatically deleting standard logs, server logs, and email logs that are older than a defined threshold.
Command:
pteroca:system:cleanup-logsAlias:
app:delete-old-logs(deprecated, removed in v1.0.0)
The retention period is controlled by the LOG_CLEANUP_DAYS_AFTER system setting. If this value is missing or invalid, the command will not execute.
This command can be run manually or scheduled as part of your routine maintenance tasks. It is already included by default in the pteroca:cron:schedule command, so in most cases no additional configuration is required.
Examples
Command Details
System setting:
LOG_CLEANUP_DAYS_AFTER– number of days after which logs should be purgedIncluded in:
pteroca:cron:schedule(runs automatically as part of scheduled tasks)Deletes: Regular logs, server logs, and email logs
Dispatches: Cleanup events for plugin integration
Cleanup Purchase Tokens
The pteroca:system:cleanup-tokens command is a maintenance utility designed to remove expired one-time purchase tokens from the system.
Command:
pteroca:system:cleanup-tokensAlias:
app:cleanup-purchase-tokens(deprecated, removed in v1.0.0)
It helps maintain database hygiene by automatically deleting purchase tokens that are older than their time-to-live (TTL) period. These tokens are generated during the checkout process to prevent double-submit vulnerabilities and back button exploits.
Purchase tokens have a default TTL of 1 hour. Once expired, they are no longer valid for use and can be safely removed from the database.
This command is already included by default in the pteroca:cron:schedule command with an hourly execution interval, so in most cases no additional configuration is required.
Examples
Automation
Maintenance commands are typically automated via the cron scheduler:
pteroca:system:cleanup-logs- Runs daily (if enabled)pteroca:system:cleanup-tokens- Runs hourly
See Cron Scheduler Command for more details on automation.
Related Guides
CLI Commands Overview - Command reference home
Cron Scheduler - Automate maintenance tasks
System Configuration - Initial setup
Updating - Update guide
Last updated