Composer repository implementation for ZIPs.

Overview

Release Belt — Composer repo for ZIPs

Scrutinizer Code Quality Build Status Code Coverage Latest Stable Version PHP from Packagist PDS Skeleton

Release Belt is a Composer repository, which serves to quickly integrate third–party non–Composer releases into Composer workflow. Once Release Belt is installed and you upload your zip files with their respective version number, Release Belt does the rest.

Given the following folder tree:

releases/wordpress-plugin/rarst/plugin.1.0.zip

It will serve the following Composer repository at /packages.json automagically:

{
    "packages": {
        "rarst/plugin": {
            "1.0": {
                "name": "rarst/plugin",
                "version": "1.0",
                "dist": {
                    "url": "http://example.com/rarst/plugin.1.0.zip",
                    "type": "zip"
                },
                "type": "wordpress-plugin",
                "require": {
                    "composer/installers": "^1.5"
                }
            }
        }
    }
}

Installation

1. Install the project

Release Belt is a project type Composer package. It is recommended to use Git checkout to keep up with updates more easily.

There is a helper Composer script provided that tries to fetch latest stable version and performs Composer install.

Install

git clone https://github.com/Rarst/release-belt
cd release-belt
composer belt-update

Update

composer belt-update

2. Place release ZIPs into releases/ directory

The directory structure should be: releases/[type]/[vendor name]/[release zip file].

A [type] could be:

3. Configure a web server

The public/ directory should be used as web root and index.php in it as the file to handle requests.

Please refer to web server configuration in Slim documentation and/or your web hosting’s resources for setup specifics.

Visit home page and /packages.json in a web browser to check if it is working.

Use

Once Release Belt is installed you can add the repository to the composer.json of your projects.

Release Belt home page will automatically generate some composer.json boilerplate for you to use.

Configuration

You can configure Release Belt by creating a config/config.php file, which returns an array of options to override.

See config/configExample.php for the annotated example.

Authentication & permissions

Release Belt implements HTTP authentication to password protect your repository and control access to specific packages. You can configure it via users configuration option.

There is a bin/encodePassword.php command line helper included for hashing passwords:

>php bin/encodePassword.php foo
$2y$10$3i9/lVd8UOFIJ6PAMFt8gu3/r5g0qeCJvoSlLCsvMTythye19F77a

If authentication is enabled, Release Belt home page will automatically generate auth.json boilerplate for you to use.

F.A.Q.

Why not Packagist/Satis?

Composer infrastructure is awesome, but it expects vendors that are willing to play nice with it.

Release Belt is a solution for unwilling vendors and it was faster and easier to build a dedicated solution from scratch.

Why not artifacts?

Composer artifacts require composer.json in them. This is for releases that don't even have that.

But is it web scale?

No.

License

MIT

Comments
  • Issue to get packages with composer v2

    Issue to get packages with composer v2

    Hi, since I updated the project to composer v2, I got all release belt packages that go to 502 : release-belt-502 copie release-belt-502

    This is true on local and client server.

    Any idea on this? thx :)

    opened by MaximeCulea 14
  • Composer installs and creates two directories

    Composer installs and creates two directories

    Ok this might not be a issue with release-belt but I'm not sure.

    Composer installs and creates two directories and thus WordPress won't see or list the plugin installed from zip via release belt.

    Example: wordpress-plugin/awesome/my-hello-dolly.1.0.0.zip

    Composer installs into this path: plugins/my-hello-dolly/my-hello-dolly/

    but should be: plugins/my-hello-dolly/

    Am I missing something?

    question 
    opened by jlauding 10
  • Improve filename parsing

    Improve filename parsing

    At the moment the version regex is overly simplistic with regex (|((?:\d+\.*){1,3})|) matching sequence of 1 to 3 version–like parts (digit(s) with a dot).

    It needs to be more robust, but I do not want to force specific convention and renaming files on people. I want it to take wide (but reasonable) range of possibilities. See #4

    I would like to collect example names from the wild for starters and iterate on regex from there.

    If you provide or consume WP extensions in archives, please post example file names in this thread.

    Collected examples

    • backupbuddy-4.1.2.2.zip
    • contact-form-7.4.1.zip
    • facetwp-1.8.6.zip
    • ga-ecommerce-3.0.2.zip
    • google-analytics-premium-1.1.8.zip
    • gravityforms_1.8.22.zip
    • gravityformsmailchimp_3.2.zip
    • mailchimp-for-wp-pro-2.5.5.zip
    • nextgen-facebook.7.7.5.1.zip
    • ninja-forms-mailchimp-v1.3.2.zip
    • p3-profiler.1.5.3.6.zip
    • searchwp-2.4.9.zip
    • searchwp-term-highlight-1.8.7.zip
    • sitepress-multilingual-cms.3.1.8.4.zip
    • wp-retina-2x.2.4.0.zip
    • wp-lightbox-2.zip
    • wpml-translation-management.1.9.9.zip

    No version (poke authors?)

    • advanced-custom-fields-pro.zip
    • wpseo.zip
    enhancement 
    opened by Rarst 10
  • Packages.json missing

    Packages.json missing

    Hello, again I've updated by composer belt-update then I have an error  In RemoteFilesystem.php line 398:     The "https://[public url redacted]/packages.json" file could not be downloa   ded (HTTP/1.1 404 Not Found)   And no packages.json on public folder. :-/

    invalid 
    opened by sebastienserre 9
  • Failed to Download

    Failed to Download

    Hello, I updated to latest verison of release belt and have now an error on upgrade: DownloadinDownloading (failed)  In RemoteFilesystem.php line 515:     The "/js_composer/js_composer.5.5.5.zip" file could not be downloaded: fail   ed to open stream: No such file or directory   I have this zip file on my Release/wordpress-plugin directory. Do you have any idea of what's happened ?

    bug 
    opened by sebastienserre 8
  • Authentification not working

    Authentification not working

    I'm not able to pass the .htaccess. Without authentification it's working, but when uncommenting the users part in the config/config.php I can't reach the page with the boilerplate snippets anymore.

    Any idea what I'm doing wrong?

    'users'                    => [
            // User login.
            'foousername' => [
                // Provide password hash for HTTP authentication. See bin/encodePassword.php helper.
                'hash'     => '$2y$13$dz7N7JVEyMiDdmbLPqw0he9obf2/poDPLT02BRPHGlPm0UuLZ8kZ6', // test
    
                // Array of allowed package path matches.
                //'allow'    => ['advanced-custom-fields-pro'],
    
                // Array of disallowed package path matches.
                //'disallow' => [],
            ],
        ],
    
    question 
    opened by marcwieland95 8
  • Deal with Silex deprecation

    Deal with Silex deprecation

    Symfony had just announced that Silex (you know, the bit this whole project is made on top of) is deprecated in favor of Symfony 4. :sob:

    My knee jerk is that I didn't want to use Symfony before (that's why I use Silex) and don't want to use it now. Not because I dislike Symfony, but because it's enterprise framework that has way too much going on for my needs. I get that they say v4 is easier, but it still another thing to learn.

    I will need to take a look at v4 and their suggestions for migration process (which are not yet written).

    Regardless that will discard Pimple container with completely wrecking how services and configuration are currently handled. I much prefer Pimple to more "magical" containers and making sense of Symfony container specifically went zero well for me in the past.

    So the possibilities I roughly see at the moment:

    1. Full on Symfony 4 move.
    2. Move to a different Silex–type framework (oh hai, Lumen, guess who is overdue to play with Laravel components!)
    3. Move to a different framework that allows to keep Pimple container or use it via container PSR compat layer.
    enhancement 
    opened by Rarst 6
  • Support `composer/installers` 2.x, in addition to the 1.x.

    Support `composer/installers` 2.x, in addition to the 1.x.

    Similar to what has been done on WPackagist https://github.com/outlandishideas/wpackagist/pull/420

    https://github.com/composer/installers/releases/tag/v2.0.0

    opened by grappler 4
  • Per–user permissions rules for packages

    Per–user permissions rules for packages

    At the moment every user has access to every package in the repository. As usage scenarios get more complicated it makes sense that more granular permissions can be needed.

    My first thought on logic was whitelist with scenarios that are friendly to filesystem–centric mechanics:

    • all of a type wordpress-plugin/*
    • all of a vendor vendor-name/*
    • all versions of a package package-name*
    • arbitrary combination of the above

    However I imagine there would be scenarios that this doesn't fit conveniently. Say user A needs 99/100 packages and user B needs 1/100. Whitelist is convenient to configure for latter, but not former.

    From the implementation point of view I'd love if I could get this done just by throwing filters on Finder instance. However if it gets any elaborate I would likely need to introduce intermediary collection of releases for it.

    Another point of consideration is anonymous access. Currently enabling any users disables public access completely. With more granular permissions it would make sense that anonymous user could be also granted access to specific packages.

    Overall I'll note that my priority for authentication remains the same — keep it as clear and simple as possible. In my opinion anything elaborate would be realm of custom in–house solutions, probably with hard separation by multiple release dirs dynamically.

    enhancement 
    opened by Rarst 4
  • Add instructions when forcing https

    Add instructions when forcing https

    I spent over half an hour trying to work out why I was getting a 502 error when accessing the root folder after forcing https. Adding DirectoryIndex index.php solves it.

    enhancement 
    opened by grappler 4
  • Composer config fakes PHP version from the environnment

    Composer config fakes PHP version from the environnment

    Is there a reason to define a platform with a specific PHP version in composer.json?

    This removes the checks for the PHP version used by the environnement. If there's an error, the error will happend during runtime instead of being show during the installation of the packages.

    question 
    opened by benoitchantre 3
Owner
Andrey Savchenko
I believe in a Web of content sites that are a delight to discover, read, and navigate.
Andrey Savchenko
Tool to convert from composer.yml to composer.json.

composer-yaml This project allows you to convert a composer.yml file into composer.json format. It will use those exact filenames of your current work

Igor 56 Sep 28, 2022
Auto-generated Interface and Repository file via Repository pattern in Laravel

Auto-generated Repository Pattern in Laravel A repository is a separation between a domain and a persistent layer. The repository provides a collectio

Ngo Dinh Cuong 11 Aug 15, 2022
Repository Pattern implementation for Laravel

This is a Simple Repository Pattern implementation for Laravel Projects and an easily way to build Eloquent queries from API requests.

Ephraïm SEDDOR 1 Nov 22, 2021
Fast and simple implementation of a REST API based on the Laravel Framework, Repository Pattern, Eloquent Resources, Translatability, and Swagger.

Laravel Headless What about? This allows a fast and simple implementation of a REST API based on the Laravel Framework, Repository Pattern, Eloquent R

Julien SCHMITT 6 Dec 30, 2022
Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.

Stash View Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology. What is Russian Doll Caching ? It i

Bhushan Gaikwad 18 Nov 20, 2022
Composer package which adds support for HTML5 elements using Laravels Form interface (e.g. Form::date())

Laravel HTML 5 Inputs Composer package which adds support for HTML5 elements by extending Laravel's Form interface (e.g. Form::date()) Adds support fo

Small Dog Studios 11 Oct 13, 2020
A Composer script to lint a Travis CI configuration file.

composer-travis-lint composer-travis-lint is a Composer script that lints a project/micro-package its Travis CI configuration aka its .travis.yml file

Raphael Stolt 6 Jan 31, 2020
Bash/Shell autocompletion for Composer

Bash/Shell Autocompletion for Composer composer-autocomplete provides Bash/Shell autocompletion for Composer. Built by Bram(us) Van Damme (https://www

Bramus! 92 Sep 19, 2022
Slim Jam is a demo application to provide examples for composer package, PHPSpreadsheet, Shopify API etc. usages.

SLIM JAM Slim Jam is a demo application to provide examples for composer package, PHPSpreadsheet, Shopify API etc. usages. This project aims to take a

Uğur ARICI 2 Jan 9, 2022
A package that adds view-composer like feature to Inertia.js Laravel adapter

Kinetic A package that adds view-composer like feature to Inertia.js Laravel adapter. Use to be able to share props based on the Inertia component nam

Marvin Quezon 76 Dec 12, 2022
Composer plugin for cleaning up unused files from packages.

Composer Cleanup Plugin Remove tests & documentation from the vendor dir. Based on laravel-vendor-cleanup but implemented as a Composer Plugin instead

Barry vd. Heuvel 136 Dec 15, 2022
This is a Composer plugin that provides an automated version of Country Codes database.

Country Codes This is a Composer plugin that provides an automated version of Country Codes database. This database is include: country iso codes, cou

Robert Nicjoo 19 Sep 3, 2022
Per-user settings repository system for Laravel

Laraconfig Per-user settings repository system for Laravel. This package allows users to have settings that can be queried, changed and even updated,

Italo 170 Oct 26, 2022
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.

DevMakerLab/Laravel-Filters Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily. Insta

DevMakerLab 19 Feb 20, 2022
A simple package to manage the creation of a structure composed of the service and repository layers in a Laravel application

Chapolim Este projeto tem como objetivo fornecer alguns comandos adicionais à interface de linha de comando do Laravel, o Artisan, para manipular a es

Eliezer Alves 51 Dec 11, 2022
A package to implement repository pattern for laravel models

Laravel Model UUID A simple package to use Repository Pattern approach for laravel models . Repository pattern Repositories are classes or components

null 26 Dec 21, 2022
Laravel basic repository integration

WekodeRepository This is a package to easely integrate a repository pattern with the needed service provider and all the necessary basic functions Ins

ZakariaDehaba 3 Oct 11, 2022
🖖Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any kind of filters.

Repository Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any

Awes.io 160 Dec 26, 2022
Github repository dedicated for my YT tutorial which shows how to use testing in Laravel

Testing in Laravel The following documentation is based on my Laravel Testing for Beginners tutorial we’re going to cover the basics of unit tests, fe

Code With Dary 17 Oct 24, 2022