/magento-tool-module

Primary LanguagePHPOpen Software License 3.0OSL-3.0

NOT FOR PRODUCTION USAGE

Magento tool integration

This tool provides an API for remote command execution.

Installation

  1. Install as regular Magento 2 module
  2. Open your Nginx configuration and replace:
    # PHP entry point for main application
    location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {

with

    # PHP entry point for main application
    location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check|remote)\.php$ {
  1. Copy dist/remote.php to pub directory
  2. Enable module
./bin/magento module:enable --all

Authentication

There is no authentication available.

Usage

  1. Retrieve a list of available commands:
curl -X GET "http://magento2.docker/remote.php"

Example response:

{"admin:user:create":{"description":"Creates an administrator","help":"","usages":[],"definition":[]}}

Note: The list response for all comands is large

  1. Run a specific command
curl -X GET "http://magento2.docker/remote.php?type=run&name=maintenance:status"

Example response:

Status: maintenance mode is not active
List of exempt IP-addresses: none