CLI Commands
A list of CLI commands with descriptions to streamline panel management and configuration.
The Commands section serves as a detailed reference for administrators and advanced users to efficiently manage and configure the PteroCA panel through the command-line interface (CLI). Each command is designed to perform a specific action, such as managing configurations, resetting settings, or troubleshooting issues.
⚙️ Configuration Commands
Database Configuration
The app: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.
Example Usage:
php bin/console app:configure-databaseThis command is a crucial part of the setup process and should be completed before any further configuration.
System Configuration
The app:configure-system 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.
Example Usage:
php bin/console app:configure-systemThis command is an essential step in preparing the panel environment and must be run as part of the initial configuration process.
👤 User Management Commands
Create New User
The app:create-new-user command is used to create a new user in the system by specifying an email, password, and an optional role. While this command is automatically executed during the app:configure-system process to create the initial administrator account, it can also be run separately to create additional users at any time.
Example Usage: To create a user with the default ROLE_USER:
php bin/console app:create-new-user [email protected] securePasswordChange User Password
The app:change-user-password command is used to update the password of an existing user in the system. Like other commands, it integrates with Pterodactyl if an API connection is established, ensuring that the user's password is updated on both the panel and Pterodactyl simultaneously.
Example Usage:
php bin/console app:change-user-password [email protected] securePassword🌌 System Commands
Cleanup Expired Purchase Tokens
The app:cleanup-purchase-tokens command is a maintenance utility designed to remove expired one-time purchase tokens from the system.
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 can be run manually or scheduled as part of your routine maintenance tasks. It is already included by default in the app:cron-job-schedule command with an hourly execution interval, so in most cases no additional configuration is required.
Example usage:
php bin/console app:cleanup-purchase-tokensCron Job Schedule
The app:cron-job-schedule command is a critical system command designed to execute other scheduled commands at defined intervals. It serves as a facade, running specific system maintenance commands that ensure the smooth operation of the panel. This command is intended to be added to a crontab (or a crontab alternative) to automate recurring tasks.
Example usage:
php bin/console app:cron-job-scheduleAutomating with Crontab
To ensure this command runs automatically, add it to your crontab (or an alternative scheduling system). For example, to run this command every hour, use the following crontab configuration:
* * * * * php /var/www/pteroca/bin/console app:cron-job-schedule >> /dev/null 2>&1Refer to the Crontab Configuration section for more details.
Migrate Pterodactyl Servers
The pterodactyl:migrate-servers command is a maintenance utility responsible for migrating servers from a remote Pterodactyl panel into your PteroCA instance and associating them with existing user accounts. It walks through each server it finds, skips those already imported or whose owner is not yet registered in PteroCA, and interactively guides you through migration.
Example usage:
php bin/console pterodactyl:migrate-servers --limit=200Delete Inactive Servers
The app:delete-inactive-servers command is a maintenance utility responsible for removing servers that have been suspended due to non-payment or inactivity for a prolonged period. This ensures that resources are not wasted on servers that are no longer in use.
When executed, this command permanently deletes suspended servers both from the PteroCA panel and the linked Pterodactyl instance (if the API connection to Pterodactyl is configured). It is typically part of the scheduled tasks executed by the app:cron-job-schedule command but can also be run independently when necessary.
Example usage:
php bin/console app:delete-inactive-serversDelete Old Logs
The app:delete-old-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.
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 app:cron-job-schedule command, so in most cases no additional configuration is required.
Example usage:
php bin/console app:delete-old-logsShow Missing Translations
The app:show-missing-translations command is a developer-oriented tool designed to compare two YAML translation files and identify any missing keys in the target file. It is particularly useful in ensuring consistency between translation files during development.
Example usage:
php bin/console app:show-missing-translations src/Core/Resources/translations/messages.en.yaml src/Core/Resources/translations/messages.pl.yamlSuspend Unpaid Servers
The app:suspend-unpaid-servers command is a critical maintenance utility that automatically suspends servers whose payment obligations have not been met. This ensures proper billing compliance and prevents unpaid servers from utilizing resources.
When a server is suspended, it is flagged as inactive in the PteroCA panel and also suspended in the connected Pterodactyl instance (if the API connection is configured). Suspended servers can be reactivated if the client completes the payment. However, servers that remain suspended for an extended period may eventually be deleted by the app:delete-inactive-servers command.
Example usage:
php bin/console app:suspend-unpaid-serversSynchronize Data
The app:synchronize-data command is a utility designed to ensure data consistency between the PteroCA panel and the connected Pterodactyl instance. It is primarily used to synchronize critical data, such as API keys, ensuring seamless integration and communication between the two systems.
At present, this command specifically handles the synchronization of Pterodactyl API keys for users in the PteroCA panel. However, its scope can be extended in the future to include additional synchronization processes as required.
Example usage:
php bin/console app:synchronize-dataSync Pterodactyl Servers
The pteroca:sync-servers command is a maintenance utility designed to synchronize server records between your Pterodactyl panel and PteroCA.
Its primary function is to detect and remove orphaned servers - those that exist in PteroCA but no longer exist in Pterodactyl.
It iterates over the servers in batches, checks their existence, and removes the missing ones. You can run it interactively, with confirmation prompts for each deletion, or in automatic mode for cron-based cleanups.
Example usage:
php bin/console pteroca:sync-servers --limit=500Update system
The app:update-system 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.
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.
Example usage:
php bin/console app:update-systemLast updated