# Complications with Composer, Private Plugin and Gitlab

**URL:** https://discourse.roots.io/t/complications-with-composer-private-plugin-and-gitlab/10432
**Category:** bedrock
**Created:** 2017-09-15T04:50:20Z
**Posts:** 3

## Post 1 by @s3w47m88 — 2017-09-15T04:50:20Z

I have a private Gitlab server. And I am working with a premium third party WordPress Plugin that does not have a Composer.json file.

I’ve successfully added it, committed to my Gitlab server and installed it via Composer.

The problem is I had to make the Plugin public on my Gitlab server. Which I’m pretty sure is a violation of the license.

But when I switch it to “Internal” - which means I can download it it if I authenticate, then the Composer update fails.

So I’m trying to figure out a way to pass the login credentials somehow or if there is maybe another method.

I understand this question looks more like I’m asking about Gitlab, but I imagine there are other users looking for a solution to this as well and on other systems like Github / BitBucket / etc… so I’m hoping the community has a solution even if it’s not something with Gitlab.

Thank you all for your time!

---

## Post 2 by @fullyint — 2017-09-15T05:25:16Z

Assuming you can access your “internal” plugin repo on your gitlab server via SSH (i.e., without password), I’m guessing you need to add your gitlab server’s hostkey to your [`known_hosts`](https://github.com/roots/trellis/blob/765f4cabd454254ff52d133751d51b3330ef3364/group_vars/all/known_hosts.yml#L6-L14).

> [@Known_hosts.yml headaches](https://discourse.roots.io/t/known-hosts-yml-headaches/8867/4):
>
> If the deploy’s composer install process reaches out to a host not already in your server’s `known_hosts`, the composer install will fail. Before [roots/trellis#751](https://github.com/roots/trellis/pull/751) you would have had to SSH into your server and add those `known_hosts` entries manually. The new Trellis `known_hosts` allows you to specify those host keys right in your config, automating the process.
> 
> …
> 
> **What should the host key entry look like?** Find examples of how host keys should look by checking your local machine `known_hosts`, either by opening and looking, or by using this command:  
> `ssh-keyscan -H gitlab.mydomain.com`

The thread above has a lot more conceptual info that may be helpful.

Also be sure your ssh-agent has your keys loaded. If relevant ssh keys to connect to your gitlab server don’t appear in output of `ssh-add -l`, you must `ssh-add`.

> [@Ansible Fails at Copy project template](https://discourse.roots.io/t/ansible-fails-at-copy-project-template/9803/17):
>
> if you’re on MacOS Sierra, be sure your ssh agent isn’t “forgetting” your keys:
> 
> - [more info](https://apple.stackexchange.com/a/264974)
> - [and more info](https://developer.apple.com/library/content/technotes/tn2449/_index.html)

---

## Post 3 by @s3w47m88 — 2017-09-19T02:58:21Z

Awesome! Thank you. I will try this and if I get a solution I will report here and attempt to provide a pre-packaged solution that others can use.
