这是indexloc提供的服务,不要输入任何密码
Skip to content

dokku_client.sh extracts wrong app name from remote URL when using custom ssh port #8093

@brennerm

Description

@brennerm

Description of problem

I've configured the following remote URL with a custom SSH port ssh://dokku@pipescan.shipit.dev:2222/pipescan.

When running dokku_client.sh locally the script tries to determine the app name from this remote URL and comes up with the following:

$ dokku remote --trace
...
++ git remote -v
++ grep -Ei '^dokku\s'
++ grep -Ei dokku@pipescan.shipit.dev
++ head -n 1
++ cut -f2 -d@
++ cut -f1 '-d '
++ cut -f2 -d:
+ APP=2222/pipescan
...

As you can see the APP variable includes the custom SSH port because the script assumes everything after the : character is the app name.

This leads to every command failing with this error:

$ dokku config
 !     App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores

Happy to provide a fix if the issue is accepted. 🙂

Steps to reproduce

  1. Configure a remote with a custom SSH port, e.g. like ssh://dokku@pipescan.shipit.dev:2222/pipescan.
  2. Run any dokku command, e.g. dokku config

dokku report $APP_NAME

Not relevant for this issue imo.

Additional information

No response

Output of failing commands after running: dokku trace:off

Output of failing commands after running: dokku trace:on

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions