Configuring the Hyvä Composer Repository
Install Hyvä using one of two methods:
- Via packagist.com with a license key,
- As a technology partner, using GitLab as a Composer source.
Do not use SSH-key authentication in CI/CD
We do not guarantee uptime for GitLab. Always use packagist.com for build pipelines and production environments.
If your Composer configuration is incomplete, you might encounter the following error during Hyvä installation:
Error: "The project you are looking for could not be found or you don't have permissions to view it"
This error typically indicates one of two issues:
- You haven't configured a Hyvä Composer repository.
- You've configured the packagist.com repository but are missing the authentication key in your
auth.jsonfile.
To diagnose, check your composer.json file for the repositories section.
If the `repositories` section does not contain a `private-packagist` entry like this:
"repositories": {
"private-packagist": {
"type": "composer",
"url": "https://hyva-themes.repo.packagist.com/yourProjectName/"
},
Follow the steps described in the getting started documentation.
If the private-packagist entry exists, you only need to configure the authentication key.
Run the following command, replacing yourLicenseAuthentificationKey with the key provided with your packagist.com repository URL:
composer config --auth http-basic.hyva-themes.repo.packagist.com token yourLicenseAuthentificationKey
Error: Composer asks for a GitLab password or shows "[email protected]: Permission denied"
This error can occur for several reasons:
Private SSH Key Not Loaded
Problem: Your private SSH key is not loaded or available for authentication, even though gitlab.hyva.io is configured as a repository.
Solution: Run ssh-add before your Composer command to add your SSH key to the ssh-agent.
Public SSH Key Not Set on GitLab Profile
Problem: Your private SSH key is loaded, but the corresponding public key is missing from your hyva.gitlab.io account settings.
Solution: Copy your public key and add it to your GitLab profile via the web interface.
Composer.lock Still References hyva.gitlab.io
Problem: Hyvä was initially installed using hyva.gitlab.io, and even after updating composer.json to Packagist.com, composer.lock still references the GitLab repository.
Solution: Delete composer.lock and run composer install.
Permission Denied in Docker Container
Problem: The private SSH key is not available inside the Docker container, either because it wasn't added on the host or ssh-agent forwarding is disabled.
Solution:
- First, run
ssh-addon the host system before starting your container session. - If the issue persists, consider mounting your
~/.sshdirectory into the container or setting up ssh-agent forwarding. (These advanced configurations are outside the scope of this document as they depend on your specific system setup.)
Moving from gitlab.hyva.io to packagist.com
To migrate from gitlab.hyva.io to packagist.com:
- Remove all
gitlab.hyva.iogit repository references from yourcomposer.jsonconfiguration. Each repository must be listed individually. Example:
"hyva-themes/magento2-theme-module": {
"type": "git",
"url": "[email protected]:hyva-themes/magento2-theme-module.git"
},
- Delete the
composer.lockfile. - Follow the getting started instructions for Packagist.com.