Setting up a private composer remote repository in Artifactory - composer-php

our team is currently in the process of setting up a local Artifactory instance which is suppose to connect to a private remote repository containing ELTS releases of TYPO3.
The official manual specifies, that you have to include the private repository and set up HTTP basic authentication:
Modify composer.json:
"repositories": [
{"type": "composer", "url": "https://elts.typo3.com"}
]
Call composer config --auth http-basic.elts.typo3.com [YOUR-USER-NAME] [AUTH-TOKEN] to add the credentials to the auth.json file.
When performing these steps locally, composer can fetch packages from the private repository without any issues and writes the follwing to composer.lock:
{
"name": "typo3/cms",
"version": "v8.7.34",
"source": {
"type": "git",
"url": "git#github.com:TYPO3GmbH/elts-8.7-release.git",
"reference": "****************redacted****************"
},
"dist": {
"type": "zip",
"url": "https://elts.typo3.com/dist/typo3/cms/typo3-cms-****************redacted****************-zip-******.zip",
"reference": "****************redacted****************",
"shasum": "****************redacted****************"
},
However, when we mirror the same configuration on our Artifactory server (version 7.5.x) clients are unable to fetch packages, as API calls requesting the specific package version result in an HTTP 404 error.
Unfortunately, the Artifactory logs are not of much help either, as they don't explain why the client requests are met with an HTTP 404 error.
This is our current configuration:
It would be greatly appreciated if someone could point us in the right direction!
Thanks!

Related

composer install composer/package-versions-deprecated : Could not resolve hostname github.com: Name or service not known

I am trying to deploy a symfony4 app in cloudfoundry. I got an error with "composer/package-versions-deprecated":
Auto deploy(with gitlab-ci): I get this error below:
The same Error with cli local deploy(cf push)
composer.json:
"minimum-stability": "beta",
"prefer-stable": true,
"repositories": [
.......
{
"packagist": false
},
...
],
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.10",
...
PHP version: 7.2; Symfony: 4.4.9; Composer Version: 1.7.2
That is a network problem. It's saying that Composer cannot resolve the DNS address for github.com.
This could be a temporary problem, like if Github is having issues, but that's unlikely. What's more probable is that your Cloud Foundry operators have restricted access to the Internet. Perhaps through Application Security Groups, which is something that only an Operator with "admin" permissions can adjust.
https://docs.cloudfoundry.org/concepts/asg.html
The other possibility is that you can access the Internet but you must do so through a proxy. You would need to confirm with your Operators if this is true and if so, what proxy information you'd need to use. If, and it is solely up to your Platform Operations team, you can access the Internet through a proxy then your Ops team would need to configure it. They can do that globally with these instructions.
https://docs.cloudfoundry.org/buildpacks/proxy-usage.html
or you can do the same thing with cf set-env on a per-application basis.
It caused by dist-Url(not authorized directly) in composer-lock.json
it fixed by changing the URL: private repository under api.github:
"dist": {
"type": "zip",
"url": "https://privateRepo... /api/composer/php-proxy-official/vcs-dists/zip/doctrine/reflection/55e71912dfcd824b2fdd16f2d9afe15684cfce79",
"reference": "55e71912dfcd824b2fdd16f2d9afe15684cfce79",
"shasum": ""
},

Cloudfoundry & composer with basic auth protected repositories

I would like to deploy my app onto a Cloudfoundry node. Using composer for dependency management.
Now there is one repository with private packages, which is secured by basic auth (Example https://composer.example.com).
"repositories": [{
"type": "composer",
"url": "https://composer.example.com"
}]
By default, i'm using a auth.json with the needed credentials, and composer would use it.
{
"http-basic": {
"composer.example.com": {
"username": "max",
"password": "mustermann"
}
}
}
But, pushing my app to a Cloudfoundry node, composer gets executed and will fail when it comes to include the private packages.
The 'https://composer.example.com/the/package-1.7.3.zip' URL required authentication. You must be using the interactive console to authenticate
Updating my dependencies locally works like a charm, deploying my app with capistrano for exmple, works as well. But cloudfoundry in some way does not recognize the auth.json.
Any hint or help would be much appreciated.

How to describe the dependencies?

Used in the project Slim + Slim/Extras + Twig.
I need to use it https://github.com/codeguy/Slim-Extras/pull/87 ,
but at the moment pull-request not accepted.
How do I properly configure the Composer?
So far, so as not to inhibit the development, fix the code in folder vendor, but this is absolutely the wrong approach.
If I understand this correctly, you need to add your own repository.
There might be problem in the same name of branch (origin: master, yours: master). Try changing your branch name if this happens.
"require": {
"slim/extras": "master"
},
"repositories": [
{ "type": "git", "url": "https://github.com/mvader/Slim-Extras.git" }
]

Composer custom repositories local AND remote

We are using custom repositories that are not held on Packagist, and thus need to use composer's "repositories" key:
{
"type": "vcs",
"url": "https://github.com/name/repo"
},
However we also want to develop these locally before pushing them to GitHub
{
"type": "vcs",
"url": "/path/to/repo"
},
{
"type": "vcs",
"url": "https://github.com/name/repo"
}
However if a new user downloads the repo and just wants to use from GitHub (maybe they won't be developing locally) they get a big red error:
[InvalidArgumentException]
No driver found to handle VCS repository /path/to/dir
Is there a way that composer can tolerate this and just move down to the next line where it will find the repo?
That this is possible right now, as far as I know. The defined "/path/to/dir" needs to exist, it needs to be a repo and the repo needs to contain a composer.json file, otherwise Composer will fail.
Sounds like a valid point for a PR to ignore an invalid repository definition but not sure what Jordie thinks of this ;)
As an alternative: You could set-up your own Satis repo and pull the package from there.

How to run a file of google ranking in node.js

I am newbie to Node.js and I have downloaded the google ranking from github. When i try to run a file example.js, its giving me the error "Cannot find module 'jscrape'".
I even tried to install the jscrape module but its giving me error.
I found dependencies in package.json file as follows
{
"author": "Ben Buckman <ben#newleafdigital.com> (http://newleafdigital.com/)",
"name": "google-ranking",
"description": "Fetch the Google search ranking for a phrase",
"version": "0.0.1",
"homepage": "https://github.com/newleafdigital/nodejs-google-ranking",
"repository": {
"url": "git#github.com:newleafdigital/nodejs-google-ranking.git"
},
"main": "google-ranking.js",
"dependencies": {
"jscrape": "0.0.4",
"async": "~0.1.22"
},
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "*"
}
"scripts": {
"preinstall": "npm install jscrape"
}
}
As i am very new to node.js, Can anyone please help me in doing this.
I'd recommend visiting the actual page http://nodejs.org/ as this provides a lot of information on downloading, installing and general how to use. Along with a vast amount of documentation.
Also I am sure jScrape is a piece of software built to be used by Node. With this kind of software (Other examples include WebSockets.IO, Express) they have to be downloaded and installed using Node.

Resources