Composer Repository Manager for selling Magento 2 extension and offering composer installation for ordered packages.

Overview

Magento 2 Composer Repository

Credits

Composer  Repository for Magento 2

  • This extension works as a Magento 2 private storage manager for extension developers who sell Magento 2 extensions and want to provide easy installation of the composer. Extension was originally implemented for Magento 1 by Genmato, but we adapted the code and made it available to Magento 2. The logic is very similar to the M1 module but we actually re created the extension.

Requirements:

  • Magento 2.x
  • Composer
  • Satis

How does it work

The extension  is using Satis, composer.json and packages (stored on the server). For each package ordered through the web shop it checks if the ordered products are M2 packages (based on product_id) and inserts this into the customer_packages table so that the user will have access to the purchased package. If there is no customer_auth key available one will be generated.

Here's how the extension works in the 3 steps outlined below:

  1. With the auth key and secret the customer can install the package from the command file with Composer. For this Composer will request the packages.json from the repository. Based on the used key and secret the customer_id is checked for available packages and the output is built.

  2. When a download is requested it requests /composer/download/file/ with the parameters (m/[package_name]/h/[package_hash]/v/[normalized_version, again based on the used key and secret access to the file and version is checked, if allowed file is send from the [satis archive directory] to the user.

  3. Thru the notify-batch URL the installation of a package is recorded for the user (stores IP, Package, Version and User ID).

Configuration:

Satis installation

Install Satis outside of Magento Webroot, but accessible from the Magento web user. To install it, run the following command in your console:

php bin/magento eadesign:composerrepo

[path] → The place where you want to install the Satis directory.

NOTE !!!

The Satis installation folder should not be accessible from the web. It is only used to collect composer's json files and to generate downloaded files.

Repository Configuration

After installation of the extension go to: Stores => Configuration => EADESIGN SETTINGS  =>  Composer Repo  and complete the following fields:

[Configuration]

  • Repository name: This name is used for the composer config repositories (for example: Eadesign's repositories),

  • Repository URL: The url that serves the Repository (for example: [  your domain ]/composer/packagist/index ),

  • Include dev-master: Optionally enable the option to allow access to the dev-master package (disabled by default),

  • Update period: The period in months that user can get free updates to a newer release, when the period ends the user only has access to the versions release before. Not possible when dev-master is enabled, leave empty for unlimited updates,

  • Email Active: Yes or No.(By enabling this option, you can set when someone purchases a product from your store, also send installation instructions to the composer using the generated keys).

[Satis Configuration]

  • Satis command path: Path to the Satis executable (for example:  [ your project ]/satis/bin/satis ),

  • Satis config path: Path to the satis.json configuration file (for example: [ your project ]/satis/satis.json ),

  • Name: Repository name (used for satis.json),

  • Homepage URL: Repository URL (used for satis.json, example: [ your domain ]/composer/packagist/index ),

  • Output directory: Path the the Satis web directory (for example:  [ your project]/satis/web ),

[Satis Archive]

  • Format: Export format (zip or tar) of the packages (for example: zip)

  • Absolute Directory: Path to where the downloaded packages should be places (for example: [your project]/satis/packages/)

M2 Package configuration:

The Magento 2 package/extensions should be stored in a repository, it is important that the account where Satis is running from has access to download from this repository.

Adding M2 packages:

To add a Magento 2 package go to: Eadesign =>  Composer Repository => Packages => Add new Package

[Package Information]

  • Package Name: composer package name (for example: eadesign/composerrepo),

  • Status: Enabled,

  • Package Type: Normal / Bundled (Bundled packages will always be available in the packages.json, this can be useful for required library packages.),

  • Package Title: Used to describe the package in the customer menu,

  • Magento Product ID: Matching product entity_id for the ordered item,

  • Repository URL: Git URL to the repository (for example: [email protected]:EaDesgin/m2-ComposerRepo.git)

  • Repository options: json format of options available for the repository in the satis.json (see https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md for details).

Building the repository data

When the configuration and packages are ready the configration can be build with:

php bin/magento eadesign:composerrepo

This command can also be scheduled to run daily (or any frequency you prefer) and automatically update the repository data.

Todo's:

  • add email template;
  • add statistics;
  • code improvement.
You might also like...
Magento-composer-installer - Composer installer for Magento modules
Magento-composer-installer - Composer installer for Magento modules

!!! support the maintainer of this project via Patreon: https://www.patreon.com/Flyingmana Magento Composer Installer The purpose of this project is t

Magento 2 Extension to cleanup admin menu and Store > Configuration area by arranging third party extension items.
Magento 2 Extension to cleanup admin menu and Store Configuration area by arranging third party extension items.

Clean Admin Menu - Magento 2 Extension It will merge all 3rd party extension's menu items in backend's primary menu to a common menu item named "Exten

In order to use the Korean Language on your Magento 2 store, it is time to start with Magento 2 Korean Language Pack in the set of informative documentations by Mageplaza. Magento 2 Korean Language Package is published by Magento 2 Translation Project at Crowdin, so all phrases will be replaced by the Korean language according to the contribution to that project. Please following up the guides in this post to convert the language with ease!
An amazing Rank and Permissions Manager. The best ranks manager for PocketMine-MP.

👑 RankSystem 🔧 An amazing Rank and Permissions Manager Description: An amazing Rank and Permissions Manager. The best ranks manager for PocketMine-M

Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3+ that enables you to manage RSS feeds for your favorite podcasts and listen to the episodes in a seamless UI.
Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3+ that enables you to manage RSS feeds for your favorite podcasts and listen to the episodes in a seamless UI.

laravelpodcast | A Laravel podcast manager package - v0.0.8 Introduction Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3

This Magento 2 extension integrates EasyTranslate into Magento 2.
This Magento 2 extension integrates EasyTranslate into Magento 2.

EasyTranslate Magento 2 Connector This Magento 2 extension integrates EasyTranslate into Magento 2. Mind that you need to have an account with EasyTra

This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

The Phar Installation and Verification Environment (PHIVE)

The Phar Installation and Verification Environment (PHIVE) Installation and verification of phar distributed PHP applications has never been this easy

Secure package for WP CLI, built to provide an easier way of securing your WordPress installation

wp-cli/secure-command Official website: Hackthewp.com Manages common security aspects of WordPress. Supports nginx and Apache. Basic Usage This packag

Comments
  • Two products assigned to one composer packages?

    Two products assigned to one composer packages?

    Can 2 different products be assigned to a single composer package? When I click "Update Composer Package" in admin, it says "Updated successfully", but database is not updated.

    opened by alfredsgenkins 0
Releases(1.1.9)
Owner
EAdesign
Magento development company from Iasi, Romania.
EAdesign
Repman - PHP Repository Manager: packagist proxy and host for private packages

Repman - PHP Repository Manager Repman is a PHP repository manager. Main features: free and open source works as a proxy for packagist.org (speeds up

Repman 438 Jan 2, 2023
Composer registry manager that help to easily switch to the composer repository you want

CRM - Composer Registry Manager Composer Registry Manager can help you easily and quickly switch between different composer repositories. 简体中文 Install

Tao 500 Dec 29, 2022
Private, self-hosted Composer/Satis repository with unlimited private and open-source packages and support for Git, Mercurial, and Subversion.

Private, self-hosted Composer/Satis repository with unlimited private and open-source packages and support for Git, Mercurial, and Subversion. HTTP API, HTTPs support, webhook handler, scheduled builds, Slack and HipChat integration.

Łukasz Lach 112 Nov 24, 2022
A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products.

A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products. Comes with a SDK and command-line tool. Works anywhere that PHP runs.

CubicleSoft 32 Dec 5, 2022
Magento 2 Blog Extension is a better blog extension for Magento 2 platform. These include all useful features of Wordpress CMS

Magento 2 Blog extension FREE Magento 2 Better Blog by Mageplaza is integrated right into the Magento backend so you can manage your blog and your e-c

Mageplaza 113 Dec 14, 2022
Laragon MultiPHP per App + PECL Module + Extension manager + Ini Manager

LMPA Laragon MultiPHP per App This tools allow you to run multiple PHP version per app with Laragon, so you can have multiple site running different p

Gilbert Paquin 8 Oct 10, 2022
Checks prefer-lowest installation for actually defined min versions in composer.json

Composer Prefer Lowest Validator This validator will strictly compare the specified minimum versions of your composer.json with the ones actually used

Mark Scherer 17 Aug 7, 2022
This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

PHPCSStandards 393 Feb 25, 2022
Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.

Imposter Plugin Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins. Built with ♥ by Typ

Typist Tech 127 Dec 17, 2022
Composer plugin for Repman - PHP Repository Manager

Repman Composer Plugin Composer plugin for Repman - PHP Repository Manager. Adds a mirror url for all your dependencies without need to update compose

Repman 9 Mar 14, 2022