Or host a private composer repo with a laravel/lumen endpoint to download the zips and using auth tokens per user. It's a bit involved but I for one prefer no 3rd party if I can prevent it.
Sell commercial package
Hi,
do you know some way to distribute / sell a commercial package?
I found this https://gitstore.app/ but not sure if there is another better way.
If you have experience with https://gitstore.app/, please to share.
Thanks
Actually I used to use lumen to download packages via composer - now it's just based on basic auth
This is on my laravel composer
"repositories": [
{
"type": "composer",
"url": "https://adomain.com/packages"
}
]
packages.json on "adomain.com" example
{
"packages": {
"everserve/account": {
"1.0.0": {
"name": "everserve/account",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"dist": {
"url": "https://adomain/packages/everserve-account-v100.zip",
"type": "zip"
},
"require": {
"everserve/core": "^1.0",
"everserve/database": "^1.0",
"everserve/localization": "^1.0"
},
"autoload": {
"psr-4": {
"EverServe\Account\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"EverServe\Account\ServiceProvider"
]
}
},
"time": "2019-12-13 00:00:00",
"type": "library"
}
},{...another package}
}
Using basic auth via htaccess inside /packages folder
AuthType Basic
AuthName "Restricted Content"
AuthUserFile "/var/www/html/adomain/public_html/packages/.htpasswd"
require valid-user
this will match the one in the .htpasswd of course.
When you do "composer require everserve/account" as example it will ask for credentials but you can also add a auth.json next to composer.json with something like
{
"http-basic": {
"client-2": {
"username": "user",
"password": "pass"
},
"client-1": {
"username": "user",
"password": "pass"
}
}
}
Hope it helps and I didn't forget a step, it took me a couple of days spitting through the composer docs to figure it out. But works a charm and zero dependencies - no pun intended :)
Please or to participate in this conversation.