SUSE / Portus

Authorization service and frontend for Docker registry (v2)

Home Page:http://port.us.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove popup confirmation doesn't work

kuviman opened this issue · comments

Description

Can't remove anything (token, user, namespace) with remove buttons. The popup shows up but pressing yes is same as pressing no.

Steps to reproduce

  1. Go to profile and create token.
  2. Try to remove token from web ui
  • Expected behavior: token removed
  • Actual behavior: nothing happened (no http request either)

Deployment information

Deployment method: Used insecure example.

hi @kuviman I don't have a solution for you out of the box, but :

  • I can tell you will find many examples of other people having problems with the provided docker-compose examples.
  • Most of theses examples have bugs that will not be fixed by the OpenSUSE team, I believe, since many users reported them, and there are no answers given yet.
  • Many of us just managed to exhange with each other, help each other find bugs etc...
  • I will provide more soon, but it's on my personal work time, so you know, we all work a lot, and it takes time. But well, until then I can save you going through many know bugs, with this ports build from source that I recently released : https://github.com/pokusio/portus-build-from-source/releases/tag/0.0.1
  • Now all you have to do, is to bring up a valid docker-compose.yml . I'll give you two tips there, the TLS certficates are very important , you must provide them, and from any machine myMachine12254, that tries and connect with https, to you have to configure myMachine12254 to trust the TLS certificate of the CA which singed the TLS certificate of ServerABC :
  • portus connects to the registry, so you have to configure the portus container, to trust a the registry's TLS cert CA cert. If you use self-signed cert, you simply have to configure the portus container, to trust the registry 's TLS cert (which you generated).
  • registry has to trust the portus TLS cert CA cert, (portus TLS cert directly, if self-signed), because registry connects to portus : for webhook notifications.
  • background should not need any TLS CA cert trust, since it connects only to the database, which does not happen through https I think. Not sure, there, so you'll maybe have to check, anyway I personnal did not configure postgres to use https, and did not give any TLS cert. So.

those are the main points you have to be very careful with, check / test everything :

  • curl, inside containers, will tell you if the container trusts a CA or not.
  • example of a curl test I used to check CA trust. I make portus believe I am the registry telling him "hey I deleted the docker image tagged registry.mycompany.io/mousquetaire/aramitz:7.3.1", or hey, a new image was pushed tagged registry.mycompany.io/maroilles/saintnectaire:0.4.5"_
    :
#!/bin/bash

export WEBHK_CALL_BCK_URL=https://registry.mycompany.io/u/svendowideit/testhook/hook/2141b5bi5i5b02bec211i4eeih0242eg11000a/
# ---
# [jblasselle] is the username of the portus user I created using Portus WebUI.
# Still using Portus Web UI, I could :
#   => create a token I will use to docker 'login docker.mycompany.io' (and docker push)
#   => but I did not do that, because I want to make portus believe I docker pushed an image to 'docker.mycompany.io', though I never did.
#  The portus user just needs to exist, to deceive portus.
# --- so replace with your own existing portus user username
export PUSHER_PORTUS_AUTHENTICATED_USER_ID=jblasselle

sed -i "s#PUSHER_PORTUS_AUTHENTICATED_USER_ID_JINJA2_VAR#${PUSHER_PORTUS_AUTHENTICATED_USER_ID}#g" path/to/webhook-payload.json
sed -i "s#WEBHK_CALL_BCK_URL_JINJA2_VAR#${WEBHK_CALL_BCK_URL}#g" path/to/webhook-payload.json

# very, very, very verbose simulated call of the portus webhook
curl -vvv -X --data-binary "@path/to/webhook-payload.json" POST https://portus.pegasusio.io:3000/v2/webhooks/events

content of path/to/webhook-payload.json :

{
  "callback_url": "WEBHK_CALL_BCK_URL_JINJA2_VAR",
  "push_data": {
    "images": [
        "27d47432a69bca5f2700e4dff7de0388ed65f9d3fb1ec645e2bc24c223dc1cc3",
        "51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c"
    ],
    "pushed_at": 1.417566161e+09,
    "pusher": "PUSHER_PORTUS_AUTHENTICATED_USER_ID_JINJA2_VAR",
    "tag": "latest"
  },
  "repository": {
    "comment_count": 0,
    "date_created": 1.417494799e+09,
    "description": "",
    "dockerfile": "#\n# BUILD\u0009\u0009docker build -t svendowideit/apt-cacher .\n# RUN\u0009\u0009docker run -d -p 3142:3142 -name apt-cacher-run apt-cacher\n#\n# and then you can run containers with:\n# \u0009\u0009docker run -t -i -rm -e http_proxy http://192.168.1.2:3142/ debian bash\n#\nFROM\u0009\u0009ubuntu\n\n\nVOLUME\u0009\u0009[/var/cache/apt-cacher-ng]\nRUN\u0009\u0009apt-get update ; apt-get install -yq apt-cacher-ng\n\nEXPOSE \u0009\u00093142\nCMD\u0009\u0009chmod 777 /var/cache/apt-cacher-ng ; /etc/init.d/apt-cacher-ng start ; tail -f /var/log/apt-cacher-ng/*\n",
    "full_description": "Docker Hub based automated build from a GitHub repo",
    "is_official": false,
    "is_private": true,
    "is_trusted": true,
    "name": "testhook",
    "namespace": "svendowideit",
    "owner": "svendowideit",
    "repo_name": "svendowideit/testhook",
    "repo_url": "https://registry.mycompany.io/u/svendowideit/testhook/",
    "star_count": 0,
    "status": "Active"
  }
}

@kuviman also, You did not provide which version of Portus you are using : tha tis very important.

There is a reason why I am asking you the version number, because of this : make sure you are in 2.5 first, and run your tests again

In your case, after you upgraded to 2.5, do as I suggested, to have a proper docker-compose.yml

Here is an example docker-compose that should work, from @Ashtonian :

https://github.com/Ashtonian/server-setup/blob/master/portus/docker-compose.yml

all you have to do is use the 2.5 version instead of 2.4.3 which ash uses in his compose

commented

Thanks for all your contributions!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.