Our pure JavaScript Scheduler component


Post by RyanLim »

My company has a build server that uses Artifactory, and we have been attempting to set this up for the Bryntum packages.

Artifactory is able to retrieve the package.json, but after reading the package.json, it tries to pull the tar and it hits

{
  "errors" : [ {
    "status" : 404,
    "message" : "Unauthorized"
  } ]
}

I have set "Bypass Head Request" and it is still the same result.
The file is confirmed to exist in the remote NPM repository.

Artifactory only had this below one line in the log

artifactory-request.log:2021-05-12T06:44:34.765Z|4a809027853c5131|10.72.243.230|admin|GET|/api/npm/npm_bryntum/@bryntum/scheduler/-/scheduler-4.1.2.tgz|404|-1|0|2288|Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36

Is there any further way to troubleshoot this?


Post by sergey.maltsev »

Hi!

Currently we didn't test if Artifactory can work with our private repo.
This is the issue to check it:
https://github.com/bryntum/support/issues/2864

We have this https://www.bryntum.com/docs/scheduler/#guides/npm-repository.md guide for repo authentication with npm client.
Try to use it steps from the quide on the machine with Artifactory installed.
I hope it may use npm auth token from .npmrc file.

You may also ask Artifactory support how to use repositories with authentication.

Please share info here if you were able to solve it yourself.


Post by jashworth »


Post by RyanLim »

Thanks for the replies, we are still looking into it. Will share if we are able to solve it here, or if Artifactory support has a solution for us.


Post by RyanLim »

Hi, as a workaround we are attempting to copy the libraries from node_modules and upload it into the repo to use as a local library, however when we do so, on runtime we face a strange console bug as shown below:

weirdBug.PNG
weirdBug.PNG (22.07 KiB) Viewed 3403 times

The only change is that package.json points to the local uploaded @bryntum library which is copied from node_modules. This is to workaround the issue with Artifactory. Do you know why this is happening?


Post by striker »

I think you should download libs from customerzone and then add custom packages to artifactory manually.
Then you wouldn't need to authorize with bryntum npm


Post by RyanLim »

We have tried that, but we are missing the dependency libraries scheduler-lib and grid-lib which cannot be found


Post by sergey.maltsev »

Hi!

scheduler-lib and grid-lib can be found in node_modules/@bryntum folder after package installation.
Use npm pack to tgzip them or npm publish to publish to your server.


Post by sergey.maltsev »

Hi!

We've updated server to support username/password auth for Artifactory.
Tokens are yet not supported due to some issues from Artifactory side.

Could you please check if this instruction valid for serving packages.
These docs will be available online after update.
You might know of this already but this is here for someone who may search for the solution.

To use Bryntum NPM registry as a remote repository please follow this instruction.

Add Bryntum registry as a remote repository

In Artifactory admin console navigate to Administration - Repositories and click Add repositories - Remote
repository
.

Check Remote Repositories docs from Artifactory.

Configure repository with:

ParameterValue
Package Typenpm
Repository Keybryntum (or any other name you prefer)
URLhttps://npm.bryntum.com
UsernameUsername for Bryntum repository authentication
PasswordPassword for Bryntum repository authentication

Setup credentials for @bryntum package access

After creating remote repository click on wrench icon (Set Me Up) in the line with the repository to get credentials for
accessing repository.

Create .npmrc file in the project's folder and add credentials there for @bryntum scope packages:
For example if you use JFrog Platform for hosting your Artifactory registry (e.g. yourregistry.jfrog.io) for
Artifactory with the user name user@example.com than you will have similar config:

@bryntum:registry=https://yourregistry.jfrog.io/artifactory/api/npm/bryntum/
//yourregistry.jfrog.io/artifactory/api/npm/bryntum/:_password=<BASE64_PASSWORD>
//yourregistry.jfrog.io/artifactory/api/npm/bryntum/:username=user@example.com
//yourregistry.jfrog.io/artifactory/api/npm/bryntum/:email=user@example.com
//yourregistry.jfrog.io/artifactory/api/npm/bryntum/:always-auth=true

<BASE64_PASSWORD> will be generated for you in Artifactory console if you enter your credentials there.

After these actions you will be able to install @bryntum packages with your Artifactory login from .npmrc file.

Later you may add bryntum Artifactory remote repository to any virtual repository to have access to several
repositories with the same Artifactory credentials.

Check Virtual Repositories docs from Artifactory.

Note Artifactory may serve cached packages so it would be better if you recreate remote repository and may be with different name.

Please let us know if this helps.


Post Reply