Closed johanhelsing-attensi closed 3 years ago
It looks like the docker image verdaccio/verdaccio:latest
still uses version 4 of verdaccio, so you'll need to use version 2.x of the plugin. Could you verify this?
It looks like the docker image verdaccio/verdaccio:latest still uses version 4 of verdaccio
@n4bb12 Are you sure a bout that? Maybe you didn't pull first?
$ docker pull verdaccio/verdaccio && docker run --rm verdaccio/verdaccio /opt/verdaccio/bin/verdaccio --version
Using default tag: latest
latest: Pulling from verdaccio/verdaccio
Digest: sha256:5cd19a46453f7217a5e83bba77060fa541d8a218bb4ac233bef72a981ae25b22
Status: Image is up to date for verdaccio/verdaccio:latest
docker.io/verdaccio/verdaccio:latest
v5.0.4
Thanks for the tip, though, will try v4. Hope it doesn't break the rest of my config 🤞
@n4bb12 Are you sure a bout that? Maybe you didn't pull first?
I'm not sure, I only had a look at the image page where it says "Verdaccio 4". 🤷♂️ https://hub.docker.com/r/verdaccio/verdaccio/
Will have a look at what's up with that. Thanks for reporting.
It might also be related to yarn berry which now seems to be used. Maybe this makes it so that plugins are no longer found? Are you able to install other plugins? Specifically, are you able to install other third-party plugins that are NOT shipped with verdaccio?
I was able to install verdaccio-auth-memory, but only by using the workaround I described.
EDIT: (It's part of the verdaccio project, but not part of the image)
Verdaccio v4 and github-oauth-ui 2.4.0 seems to still work, though:
FROM verdaccio/verdaccio:4
USER root
RUN yarn add verdaccio-github-oauth-ui@2.4.0
COPY config.yaml /verdaccio/conf/config.yaml
USER verdaccio
~/dev/verdaccio-github-oauth-ui master ~1 docker build . -t verdaccio-github-image && docker run -it verdaccio-github-image
[+] Building 123.3s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 185B 0.0s
=> [internal] load .dockerignore 0.2s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/verdaccio/verdaccio:4 1.3s
=> CACHED [1/3] FROM docker.io/verdaccio/verdaccio:4@sha256:20a33a60f898628d2535f10dfec1a86806b5e9ed029cacaedcc9102a8aab4b37 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 33B 0.0s
=> [2/3] RUN yarn add verdaccio-github-oauth-ui@2.4.0 110.5s
=> [3/3] COPY config.yaml /verdaccio/conf/config.yaml 0.2s
=> exporting to image 10.9s
=> => exporting layers 10.8s
=> => writing image sha256:68cd14d35e0fdd3b3dbf2cbf34a2a0edfa0cd3677b09db8f45aac59e8d3e1453 0.0s
=> => naming to docker.io/library/verdaccio-github-image 0.0s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
warn --- config file - /verdaccio/conf/config.yaml
warn --- Verdaccio started
[github-oauth-ui] Version: verdaccio-github-oauth-ui@2.4.0
[github-oauth-ui] Proxy config: {"HTTP_PROXY":null,"HTTPS_PROXY":null,"NO_PROXY":null}
warn --- Plugin successfully loaded: verdaccio-github-oauth-ui
warn --- Plugin successfully loaded: verdaccio-htpasswd
[github-oauth-ui] Proxy config: {"HTTP_PROXY":null,"HTTPS_PROXY":null,"NO_PROXY":null}
warn --- Plugin successfully loaded: verdaccio-github-oauth-ui
warn --- http address - http://0.0.0.0:4873/ - verdaccio/4.12.0
I guess maybe plugin loading on docker setups kind of broke with verdaccio v5?
So in a way perhaps it's blocked by https://github.com/verdaccio/verdaccio/issues/1677 ? At least I have no idea what the official way to install a plugin is now... yarn? npm? pnpm? --global, or not?
Thanks for collecting all the info.
What's strange is that it does print this line
[github-oauth-ui] Version: verdaccio-github-oauth-ui@3.0.0
I think I found the reason. When logging the require calls verdaccio makes, and the errors it catches, I get this
{ path: 'verdaccio-github-oauth-ui' }
[github-oauth-ui] Version: verdaccio-github-oauth-ui@3.0.0
{
err: Error: Cannot find module 'verdaccio/build/lib/utils'
I think the above import isn't working because in the verdaccio docker image verdaccio is not installed as a dependency but copied to the workdir root. Hence node cannot resolve verdaccio itself.
This works:
FROM node:alpine
RUN yarn add verdaccio@5
RUN yarn add verdaccio-github-oauth-ui@3
COPY config.yaml .
CMD yarn verdaccio --config config.yaml --listen http://0.0.0.0:4873
@juanpicado
I am currently doing import { getPublicUrl } from "verdaccio/build/lib/utils"
. Unfortunately this doesn't work with using the verdaccoio docker base image.
Do you know if verdaccio/build/lib/utils#getPublicUrl
is also available in one of the Verdaccio libraries?
Or, what would be the correct approach to re-using verdaccio code?
Thanks in advance for any help & insights 🙏
Do you know if
verdaccio/build/lib/utils#getPublicUrl
is also available in one of the Verdaccio libraries? Or, what would be the correct approach to re-using verdaccio code?
I can expose those methods if you like, here https://github.com/verdaccio/verdaccio/blob/5.x/src/index.ts
would that would work for you?
fyi: In verdaccio 6 (currently master branch) you might use directly eg: @verdaccio/utils-xx
so no need to require the whole project, but feedback is welcome.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@n4bb12
I'm using the latest verdaccio@5 and verdaccio-github-oauth-ui@6 and running into this issue. Would the solution suggested above by @juanpicado above solve this, or is there a work around I'm missing?
@n4bb12, @juanpicado,
Can we reopen this issue? It seems that both of you have acknowledged that there is indeed an issue, but stopped short of working out a solution.
I cannot get any version of verdaccio-github-oauth-ui to work with verdaccio@5+, no matter how it's installed. I cannot get the configuration mentioned in https://github.com/n4bb12/verdaccio-github-oauth-ui/issues/129#issuecomment-832860047 as working, to work. Verdaccio finds the plugin and loads, and can be used outside of verdaccio-github-oauth-ui, but as soon as I try to login, I get an error regarding the getPublicUrl() function. I also can't use verdaccio-github-oauth-ui@3+ with verdaccio@4 due to incompatibilities.
@jantoine1 I'm afraid I can't do much with the information you provided. I would suggest you open a new issue and describe your problem in detail.
Bug Report
I wanted to use verdaccio with docker-compose, but couldn't load the plugin, so I searched the issues here and found #119 . I tried building the docker image, and that's all fine, but when I start the image using the
config.yaml
in this repo, it fails to load the plugin.Versions
this repo 3.0.0 (26b85e4854fc)
In the dockerfile, it just starts from
verdaccio/verdaccio:latest
I also tried specifying a tag for the verdaccio image:Expected behavior
verdaccio doesn't complain about the plugin not being found.
Observed behaviour
Steps to reproduce
clone this repo
Additional info
I also tried a hacky way of instlaling plugins in docker that works for the "auth-memory" plugin: https://github.com/verdaccio/verdaccio/issues/1677#issuecomment-828573206 . Unfortunately, that didn't do the trick here, I get slightly different logs then:
So one shows a line with
[github-oauth-ui] Version: verdaccio-github-oauth-ui@3.0.0
, but the other doesn't. I don't understand enough npm, yarn plugin loading etc. to debug this further.