Getting satispress to work

Hi there,

I have a problem that I’ve tried to debug for a while. (It might not be a Trellis issue.) The problem is that installation of private packages from my satispress repository during deploys fails.

The error message is The 'https://example.com/satispress/package/x.x.x' URL required authentication (HTTP 401). You must be using the interactive console to authenticate.

I do have the credentials in auth.json next to composer.json.

When I ssh into production (ssh web@production-url.com), go into the release directory and run composer update manually, it executes successfully, without requesting an interactive console.

If I then exit the ssh shell and re-run trellis deploy production, the deploy goes through fine.

What may be causing this?

Thank you,

Gunnar

You need to add the following to your vault.yml-file for each env:

vault_wordpress_sites:
  example.com:
    admin_password: xxx
    env:
      db_password: xxx
      auth_key: xxx
      secure_auth_key: xxx
      logged_in_key: xxx
      nonce_key: xxx
      auth_salt: xxx
      secure_auth_salt: xxx
      logged_in_salt: xxx
      nonce_salt: xxx
    composer_authentications:
      - { hostname: satispress-host.com, username: xxx, password: satispress }

Let me know if that works out for you…

1 Like

Sorry for not getting back to you earlier.

I thought my vault.yml files looked exactly like the example above. Closer inspection revealed a tiny but important difference: instead of satispress-host.com, I had indicated the hostname as satispress-host.com/satispress (that’s the repository’s composer url, according to the satispress plugin).

So, problem solved by changing satispress-host.com/satispress to simply satispress-host.com.

Thank you!

@swalkinshaw I would love to contribute a small page for the documentation, where would I start?

Probably this page? Composer HTTP Basic Authentication | Trellis Docs | Roots

You can contribute to https://github.com/roots/docs/edit/docs/trellis/composer-http-basic-authentication.md