Skip to content

[Bug] passport:keys --show doesn't exist, but the production setup tells you to run it #348

Description

@Tophhie

What happens

Following the production Docker guide, step 2 says to generate Passport keys with:

docker compose -f compose.prod.yaml run --rm app php artisan passport:keys --show

Laravel Passport's passport:keys command only accepts --force and --length, so this fails with:

The "--show" option does not exist.

It looks like it was modelled on key:generate --show, which does exist.

Where it appears

The same command is referenced in three places:

  • Docs: https://docs.trypost.it/self-hosting/docker (step 2)
  • compose.prod.yaml, comment in the Passport section (line 58 on main)
  • docker/entrypoint.sh, the error printed when PASSPORT_PRIVATE_KEY / PASSPORT_PUBLIC_KEY are unset in production (line 95 on main)

The entrypoint one is the most important, because it's what people see at the moment they're stuck.

Suggested fix

Replace the command with something that works in the published image, for example:

docker compose -f compose.prod.yaml run --rm app sh -c \
  'php artisan passport:keys --force >/dev/null && cat storage/oauth-private.key storage/oauth-public.key'

or with plain OpenSSL on the host, which needs nothing from the image:

openssl genrsa -out oauth-private.key 4096
openssl rsa -in oauth-private.key -pubout -out oauth-public.key

It would also help to document how to get the PEM into the env var. Passport already converts literal \n back into newlines, so this works:

awk 'NF {printf "%s\\n", $0}' oauth-private.key

Putting the keys in a .env next to compose.prod.yaml and referencing them as ${PASSPORT_PRIVATE_KEY} also keeps the private key out of the compose file itself.

Environment

  • Image: ghcr.io/trypostit/trypost:latest (v1.0.9)
  • compose.prod.yaml from main
  • Docker Compose v2 on Debian (Proxmox LXC)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions