Skip to content

Configuring the Hyvä composer repository

There are two ways to install Hyvä:

Do not use ssh-key authentication in CI/CD

We do not guarantee uptime for gitlab, so always use packagist.com for build pipelines and for production.

If the composer configuration setup is not complete, you might encounter one the following error message when installing Hyvä:

The project you are looking for could not be found or you don't have permissions to view it

There are two possible reasons for this.
Either you have not configured a Hyvä composer repository, or you might have configured the packagist.com repository, but did not configure the authentication key in the auth.json file.

To find out what is the case, open your composer.json file and look for the repositories section.
If there is no record similar to this

    "repositories": {
        "private-packagist": {
            "type": "composer",
            "url": "https://hyva-themes.repo.packagist.com/yourProjectName/"
        },
follow the steps described in the getting started documentation.

If you find the private-packagist record in your configuration, you are missing only the authentication key.
Run the following command, replacing yourLicenseAuthentificationKey with your own key sent to you together with the packagist.com repository URL:

composer config --auth http-basic.hyva-themes.repo.packagist.com token yourLicenseAuthentificationKey

Composer asks for a GitLab password or shows "git@gitlab.hyva.io: Permission denied"

There are several possible reasons:

The private SSH key is not loaded

In this case gitlab.hyva.io is configured as a composer repository, but your private SSH key is not available to composer.json for authentication.

Solution: run ssh-add before running the composer command to add your ssh key to the ssh-agent.

The public SSH key is not set on the GitLab profile

In this case gitlab.hyva.io is configured as a composer repository and your private SSH key is loaded, but your public key is missing from your hyva.gitlab.io account settings.
Copy your public key and add it to your GitLab profile using the web user interface.

The composer.lock file still references hyva.gitlab.io

This can happen when Hyvä was initially installed using hyva.gitlab.io as a composer repository, and then later the repository configuration is replaced with a packagist.com configuration.
Even though hyva.gitlab.io is no longer referenced in the composer.json, composer will still try to access the gitlab repository.

To fix, delete the composer.lock file and run composer install

Permission denied when installing inside a docker container

In this case you either didn't add the private ssh-key on the host system, or ssh-agent forwarding is disabled, so the ssh-key is not available from inside the docker container.
To fix, first try to run ssh-add on the host system before starting the terminal session in the container.
If that does not help, you can try to mount your ~/.ssh directory into the container or set up ssh-agent forwarding, which both are outside the scope of this document because they depend on your individual system.

Moving from gitlab.hyva.io to packagist.com

First, remove all reference to gitlab.hyva.io git repositories from the composer.json configuration.
Here is one example, but there will be more, as each repository has to be listed individually:

        "hyva-themes/magento2-theme-module": {
            "type": "git",
            "url": "git@gitlab.hyva.io:hyva-themes/magento2-theme-module.git"
        },

Next, remove the composer.lock file.

Then follow the getting started instructions for licensees.