Download the PHP package okvpn/packeton without Composer
On this page you can find all versions of the php package okvpn/packeton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download okvpn/packeton
More information about okvpn/packeton
Files in okvpn/packeton
Package packeton
Short Description Private PHP package repository for vendors
License MIT
Homepage https://github.com/vtsykun/packeton
Informations about the package packeton
Packeton - Private PHP package repository for vendors
Fork of Packagist. The Open Source alternative of Private Packagist for vendors, that based on Satis and Packagist.
Full documentation docs.packeton.org
Features
- Compatible with Composer API v2, bases on Symfony 6.
- Support update webhook for GitHub, Gitea, Bitbucket and GitLab or custom format.
- Customers user and ACL groups and limit access by vendor and versions.
- Composer Proxies and Mirroring.
- Generic Packeton webhooks
- Allow to freeze updates for the new releases after expire a customers license.
- Mirroring for packages zip files and downloads it's from your host.
- Credentials and Authentication http-basic config or ssh keys.
- Support monolithic repositories, like
symfony/symfony
- Pull Request
composer.lock
change review. - OAuth2 GitHub, Bitbucket, GitLab/Gitea and Other Integrations.
- Security Monitoring.
- Milty sub repositories.
What was changed in this fork?
- Disable anonymously access, registrations, spam/antispam, added ACL permissions.
- Support MySQL, PostgresSQL or SQLite.
- Removed HWIOBundle, Algolia, GoogleAnalytics and other not used dependencies and other metrics collectors.
Table of content
- Run as Docker container
- Demo
- Installation from code
- Using a reverse proxy
- Outgoing Webhook
- Intro
- Examples
- Telegram notification
- Slack notification
- JIRA issue fix version
- Gitlab setup auto webhook
- Ssh key access
- Configuration
- LDAP Authenticating
- Import from Packagist.com
- OAuth2 GitHub, GitLab Integrations
- Pull Request review
- GitHub Setup
- Update Webhooks
- Github
- GitLab
- GitLab Organization
- Bitbucket
- Manual hook
- Custom webhook format
- Mirroring Composer repos
- S3 Storage Provider
- Security Monitoring
- Compare Private Packagist with Packeton
- Usage
- Create admin user
Demo
See our Administration Demo. Username/password (admin/123456)
Install and Run in Docker
You can use packeton/packeton image or GitHub container registry ghcr.io/vtsykun/packeton:latest
image
After container is running, you may wish to create an admin user via command packagist:user:manager
Or build and run docker container with docker-compose:
-
docker-compose.yml Single container example, here the container runs supervisor that to start other jobs: nginx, redis, php-fpm, cron, worker. However, it does not follow the docker best-practises where 1 service must be per container. But it is very easy to use and KISS principle
- docker-compose-split.yml - multiple containers, where 1 service per container
Docker Environment variables
APP_SECRET
- Must be static, used for encrypt SSH keys in database. The value is generated automatically, see.env
in the data volume.APP_COMPOSER_HOME
- composer home, default /data/composerDATABASE_URL
- Database DSN, default sqlite:////data/app.db. Example for postgres "postgresql://app:[email protected]:5432/app?serverVersion=14&charset=utf8"PACKAGIST_DIST_PATH
- Default /data/zipball, path to storage zipped versionsREDIS_URL
- Redis DB, default redis://localhostPACKAGIST_DIST_HOST
- Hostname, (auto) default use the current host header in the request.TRUSTED_PROXIES
- Ips for Reverse Proxy. See Symfony docsTRUSTED_HOSTS
- Trusted host, set if you've enabled public access and your nginx configuration uses withoutserver_name
. Otherwise, possible the DDoS attack with generated a big cache size for each host.PUBLIC_ACCESS
- Allow anonymous users access to read packages metadata, default:false
MAILER_DSN
- Mailer for reset password, default disabledMAILER_FROM
- Mailer from
Installation
Requirements
- PHP 8.1+
- Redis for some functionality (favorites, download statistics, worker queue).
- git/svn/hg depending on which repositories you want to support.
- Supervisor to run a background job worker
- (optional) MySQL or PostgresSQL for the main data store, default SQLite
- Clone the repository
- Install dependencies:
composer install
- Create .env.local and copy needed environment variables into it, see docker Environment variables section
- Run
bin/console doctrine:schema:update --force --complete
to set up the DB -
Create admin user via console.
-
(optional) If you changed the configuration files, then you need to clear the cache
rm -rf var/cache/*
orphp bin/console cache:clear
- Enable cron tabs and background jobs.
Enable crontab
crontab -e -u www-data
or use Docker friendly build-in cron demand runner.
Example, run cron as background process without crontab. Can use with supervisor.
Setup Supervisor to run worker.
Create a new supervisor configuration.
Add the following lines to the file.
- IMPORTANT Make sure that web-server, cron and supervisor run under the same user, that should have an ssh key
that gives it read (clone) access to your git/svn/hg repositories. If you run application under
www-data
you can add your ssh keys to /var/www/.ssh/
You should now be able to access the site, create a user, etc.
- Make a VirtualHost with DocumentRoot pointing to public/
Ssh key access and composer oauth token.
Packagist uses the Composer global config and global ssh-key to get read access to your repositories, so
the supervisor worker packagist:run-workers
and web-server must run under the user,
that have ssh key or composer config that gives it read (clone) access to your git/svn/hg repositories.
For example, if your application runs under www-data
and have home directory /var/www
, directory
structure must be like this.
Example ssh config for multiple SSH Keys for different github account/repos, see here for details
If you have the error inserting your ssh in admin panel is because the ssh key was generated with newer OpenSSH. New keys with OpenSSH private key format can be converted using ssh-keygen utility to the old PEM format.
You can add GitHub/GitLab access token to auth.json
of composer home dir
(default APP_COMPOSER_HOME="%kernel.project_dir%/var/.composer"
) or use UI credentials,
see here
Allow connections to http
You can create config.json
in the composer home (see APP_COMPOSER_HOME
env var) or add this option
in the UI credentials form.
Don't use GitHub Api.
We disable usage GitHub API by default to force use ssh key or clone the repository via https as
it would with any other git repository. You can enable it again with env option GITHUB_NO_API
see here.
Configuration
In order to add a configuration add a file with any name to the folder config/packages/*
.
The config will merge with default values in priority sorted by filename.
The configuration for Docker installation is available at /data/config.yaml
.
Also, you can use docker volume to add config directly at path config/packages/ldap.yaml
.
Where /var/www/packagist/
default ROOT for docker installation.
Full example of configuration.
Metadata format.
Packeton support metadata for Composer 1 and 2. For performance reasons, for Composer 1 uses metadata
depending on the user-agent header: providers-lazy-url
if ua != 1; provider-includes
if ua == 1;
Format strategy | UA 1 | UA 2 | UA is NULL |
---|---|---|---|
auto | provider-includes metadata-url | providers-lazy-url metadata-url | providers-lazy-url metadata-url |
only_v1 | provider-includes | provider-includes | provider-includes |
only_v2 | metadata-url | metadata-url | metadata-url |
full | provider-includes metadata-url | provider-includes metadata-url | provider-includes metadata-url |
Where UA 1
- Composer User-Agent = 1. UA 2
- Composer User-Agent = 2.
Update Webhooks
You can use GitLab, Gitea, GitHub, and Bitbucket project post-receive hook to keep your packages up to date every time you push code. More simple way use group webhooks, to prevent from being added it per each repository manually.
Provider | Group webhook support | Target Path |
---|---|---|
GitHub | Yes | https://example.org/api/github?token= |
GitLab | Only paid plan | https://example.org/api/update-package?token= |
Gitea | Yes | https://example.org/api/update-package?token= |
Bitbucket | Yes | https://example.org/api/bitbucket?token= |
Custom | - | https://example.org/api/update-package/{packnam}?token= |
Bitbucket Webhooks
To enable the Bitbucket web hook, go to your BitBucket repository,
open the settings and select "Webhooks" in the menu. Add a new hook. Y
ou have to enter the Packagist endpoint, containing both your username and API token.
Enter https://<app>/api/bitbucket?token=user:token
as URL. Save your changes and you're done.
GitLab Service
To enable the GitLab service integration, go to your GitLab repository, open
the Settings > Integrations page from the menu.
Search for Packagist in the list of Project Services. Check the "Active" box,
enter your packeton.org
username and API token. Save your changes and you're done.
GitLab Group Hooks
Group webhooks will apply to all projects in a group and allow to sync all projects.
To enable the Group GitLab webhook you must have the paid plan.
Go to your GitLab Group > Settings > Webhooks.
Enter https://<app>/api/update-package?token=user:token
as URL.
GitHub Webhooks
To enable the GitHub webhook go to your GitHub repository. Click the "Settings" button, click "Webhooks".
Add a new hook. Enter https://<app>/api/github?token=user:token
as URL.
Manual or other hook setup
If you do not use Bitbucket or GitHub there is a generic endpoint you can call manually
from a git post-receive hook or similar. You have to do a POST request to
https://example.org/api/update-package?token=user:api_token
with a request body looking like this:
It will be works with Gitea by default.
Also, you can use package name in path parameter, see ApiController
You can do this using curl for example:
Instead of using repo url you can use directly composer package name. You have to do a POST request with a request body.
Custom webhook format transformer
You can create a proxy middleware to transform JSON payload to the applicable inner format. In the first you need create a new Rest Endpoint to accept external request.
Go to Settings > Webhooks
and click Add webhook
. Fill the form:
- url -
https://<app>/api/update-package?token=user:token
- More options > Name restriction -
#your-unique-name#
(must be a valid regex) - Trigger > By HTTP requests to https://APP_URL/api/webhook-invoke/{name} - select checkbox
- Payload - Write a script using twig expression to transform external request to POST request from previous example.
For example, if the input request has a format, the twig payload may look like this:
See twig expression syntax for details.
Click the "Save button"
Now if you call the url https://APP_URL/api/webhook-invoke/your-unique-name?token=<user>:<token>
request will be forward to https://APP_URL/api/update-package?token=user:token
with converted POST
payload according to your rules.
Usage and Authentication
By default, admin user have access to all repositories and able to submit packages, create users, view statistics. The customer users can only see related packages and own profile with instruction how to use api token.
To authenticate composer access to repository needs add credentials globally into auth.json, for example:
API Token you can found in your Profile.
Configure this private repository in your composer.json
.
Create admin and maintainer users.
Application Roles
ROLE_USER
- minimal access level, these users only can read metadata only for selected packages.ROLE_FULL_CUSTOMER
- Can read all packages metadata.ROLE_MAINTAINER
- Can submit a new package and read all metadata.ROLE_ADMIN
- Can create a new customer users, management webhooks and credentials.
You can create a user and then promote to admin or maintainer via console using fos user bundle commands.
LICENSE
MIT
All versions of packeton with dependencies
ext-redis Version *
babdev/pagerfanta-bundle Version ^4.4
cebe/markdown Version ^1.1
composer/composer Version ^2.6
doctrine/common Version ^3
doctrine/dbal Version ^3.7
doctrine/doctrine-bundle Version ^2.9
doctrine/orm Version ^2.15
ezyang/htmlpurifier Version ^4.16 || dev-master
firebase/php-jwt Version ^6.5
friendsofphp/proxy-manager-lts Version ^1.0
knplabs/knp-menu-bundle Version ^3.2
laminas/laminas-feed Version ^2.20
league/flysystem-async-aws-s3 Version ^3.15
league/flysystem-bundle Version ^3.1
nelmio/cors-bundle Version ^2.2
nelmio/security-bundle Version ^3.0
okvpn/cron-bundle Version ^1.1
okvpn/expression-language Version ^1.0
oro/doctrine-extensions Version ^2.0
pagerfanta/core Version ^4.2
pagerfanta/doctrine-orm-adapter Version ^4.2
pagerfanta/twig Version ^4.2
snc/redis-bundle Version ^4.4
symfony/asset Version ^6.4 || ^7.0
symfony/console Version ^6.4 || ^7.0
symfony/debug-bundle Version ^6.4 || ^7.0
symfony/dotenv Version ^6.4 || ^7.0
symfony/expression-language Version ^6.4 || ^7.0
symfony/flex Version ^2
symfony/form Version ^6.4 || ^7.0
symfony/framework-bundle Version ^6.4 || ^7.0
symfony/http-client Version ^6.4 || ^7.0
symfony/ldap Version ^6.4 || ^7.0
symfony/lock Version ^6.4 || ^7.0
symfony/mailer Version ^6.4 || ^7.0
symfony/mime Version ^6.4 || ^7.0
symfony/monolog-bundle Version ^3.8
symfony/process Version ^6.4 || ^7.0
symfony/property-access Version ^6.4 || ^7.0
symfony/property-info Version ^6.4 || ^7.0
symfony/runtime Version ^6.4 || ^7.0
symfony/security-bundle Version ^6.4 || ^7.0
symfony/serializer Version ^6.4 || ^7.0
symfony/translation Version ^6.4 || ^7.0
symfony/twig-bundle Version ^6.4 || ^7.0
symfony/validator Version ^6.4 || ^7.0
symfony/var-exporter Version ^6.4 || ^7.0
symfony/web-link Version ^6.4 || ^7.0
symfony/yaml Version ^6.4 || ^7.0
twig/extra-bundle Version ^3.4
twig/string-extra Version ^3.4
twig/twig Version ^3.0