:package: 私有、自主托管的 Packagist/Composer/Satis 仓库,具有无限的私有仓库。
Fork of Packagist. The Open Source alternative of Private Packagist for vendors, that based on Satis and Packagist.
Full documentation docs.packeton.org
symfony/symfonycomposer.lock change review.You can use packeton/packeton image or GitHub container registry ghcr.io/vtsykun/packeton:latest image
docker run -d --name packeton \
--mount type=volume,src=packeton-data,dst=/data \
-p 8080:80 \
packeton/packeton:latestAfter container is running, you may wish to create an admin user via command packagist:user:manager
docker exec -it packeton bin/console packagist:user:manager admin --password=123456 --adminOr 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-compose build
docker-compose up -d # Run with single supervisor container
docker-compose up -f docker-compose-split.yml -d # Or split 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 without server_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: falseMAILER_DSN - Mailer for reset password, default disabledMAILER_FROM - Mailer fromcomposer installbin/console doctrine:schema:update --force --complete to set up the DBphp bin/console packagist:user:manager username [email protected] --password=123456 --admin (optional) If you changed the configuration files, then you need to clear the cache rm -rf var/cache/* or php 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.
* * * * * /var/www/packagist/bin/console okvpn:cron >> /dev/nullExample, run cron as background process without crontab. Can use with supervisor.
bin/console okvpn:cron --demandSetup Supervisor to run worker.
sudo apt -y --no-install-recommends install supervisorCreate a new supervisor configuration.
sudo vim /etc/supervisor/conf.d/packagist.confAdd the following lines to the file.
[program:packagist-workers]
environment =
HOME=/var/www/
command=/var/www/packagist/bin/console packagist:run-workers --env=prod --no-debug
directory=/var/www/packagist/
process_name=%(program_name)s_%(process_num)02d
numprocs=1
autostart=true
autorestart=true
startsecs=0
redirect_stderr=true
priority=1
user=www-datawww-data
you can add your ssh keys to /var/www/.ssh/You should now be able to access the site, create a user, etc.
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.
└── /var/www/
└── .ssh/ # ssh keys directory
├── config
├── id_rsa # main ssh key
├── private_key_2 # additional ssh key
└── private_key_3
Example ssh config for multiple SSH Keys for different github account/repos, see here for details
# .ssh/config - example
Host github-oroinc
HostName github.com
User git
IdentityFile /var/www/.ssh/private_key_2
IdentitiesOnly yes
Host github-org2
HostName github.com
User git
IdentityFile /var/www/.ssh/private_key_3
IdentitiesOnly yes
If you have the error This private key is not valid 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.
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
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
{
"github-oauth": {
"github.com": "xxxxxxxxxxxxx"
}
}You can create config.json in the composer home (see APP_COMPOSER_HOME env var) or add this option
in the UI credentials form.
{
"secure-http": false
}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.
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.
...
volumes:
- .docker:/data
- ${PWD}/ldap.yaml:/var/www/packagist/config/packages/ldap.yamlWhere /var/www/packagist/ default ROOT for docker installation.
Full example of configuration.
…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.
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 | |-----------|----------
暂无开放 Issues,或尚未同步最近议题。