skip to Main Content

I’ve created a few compontents that communicate over http. They share the same toplevel domain. mydomain.io. Now, on integration they run on the same virtual server / Plesk instance.

Problem: Wanting to create an automatic pull request from GitHub for a second subdomain (e.g. y.mydomain.io) fails because Plesk finds, that the same public key is already used for another subdomain (e.g. x.mydomain.io). Which is correct.

This is the error message from Plesk.

Deploying files to y.mydomain.io
Cloning into bare repository '/var/www/vhosts/mydomain.io/git/myapp-y.git'...
Public key for the server at 'github.com' is already known in '/var/www/vhosts/mydomain.io/.ssh/git_known_hosts'.
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Question: How can I enforce new public key for every new subdomain? I think it’s smart not to share the same public key.

I’m using: Plesk Obsidian 18.0.38 Update #3.

Any hint is appreciated.

thanks

2

Answers


  1. Unfortunately, Plesk does not support multiple keys at the moment, according to this. There have been feature requests (like this one), but nothing has changes since then.

    I think it’s smart not to share the same public key.

    This is okay, if you are using the same GitHub account. The problem is, however, that GitHub does not allow you to add the same key to multiple repositories.

    So, short answer is, No, that’s not possible.

    However, you may wish to add keys manually, if you are able to connect via SSH, by launching the standard ssh-keygen command. This did work on my Plesk instance some time ago, but I’m not able to tell, if this is still possible, considering latest Obsidian updates.

    If you decide to solve it this way, you won’t be able to use the default "Git" Plesk’s extension from your control panel and will have to launch the deploy sequence manually via SSH (some .sh scripts might help).

    Login or Signup to reply.
  2. The problem, I have a front project and a back apirest and how do I use a subdomain for the api. Plesk has one key per domain, but the projects are different, and github won’t let you add it multiple times

    The solution that I use
    I have added Plesk SSH public key as server-deply in my git SSH keys account, and I have access to all projects with one key. Instead of using a deployment key for each project

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search