Giter VIP home page Giter VIP logo

bow's Introduction

Bow

As simple as possible docker registry frontend/UI

Pictures

Features

  • V2 registries support only (secure, self-signed and insecure, DNS and IP:PORT)
  • internal DB (BoltBD) gives it the ability to store info, and as the result, it responses much faster than after direct API call, and can provide more data
  • the app can pars, store and show info from registry such as:
  • image layers info:
    • name / tag
    • image size and a number of pushes
    • upload and push dates
  • an image creating commands history
  • it is possible to set multiple repositories and watch all registries in one place
  • show statistics pretty, draw curves of uploads number and image sizes for a tag with respects to dates
  • find a parent of an image, in case, the parent in the same repo (it is clickable!)
  • show tree-graph of parents for image
  • enabled image deletion (registry --version >= 2.4.0)
  • (new) API compatibility checks
  • (the newest) Bearer token auth support (secure and self-signed auth servers)
  • (killerfeature) Namespace layer and parents graph filters

Image deletion

To enable image deletion you need to:

  1. Run your registry with the flag -e REGISTRY_STORAGE_DELETE_ENABLED=true
    Example:
docker run -d -p 5000:5000 --restart=always --name registry \
  -v ./auth:/auth \
  -e "REGISTRY_AUTH=htpasswd" \
  -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
  -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
  -e REGISTRY_STORAGE_DELETE_ENABLED=true \
  registry:2
  1. Set up cron to run garbage collection
    Example:
    10 * * * * docker exec registry bin/registry garbage-collect /etc/docker/registry/config.yml
  2. Also be aware, that there is a known issue in docker registry 2.6.2 and earlier. It means, that if you delete an image from a repository, you will not able to push the exactly same image in that repository. To fix it, you will need to perform rebuilding of image with --no-cache mode each time or restarting the registry docker restart registry once after deletion.

See more:
docker-archive/docker-registry#988 (comment)
https://docs.docker.com/registry/configuration/#delete
https://docs.docker.com/registry/garbage-collection/#/how-garbage-collection-works

Bearer token auth

What is it and how it works see docker documentation.
Bow was tested to work with cesanta/docker_auth in this configuration.

Prospects

I can say that this app almost fit my needs, so in all likelihood, soon, I will not improve it hardly, but this is the list of ideas just for case:

  • info for the whole repository: size, number of pushes so on so on soon
  • add button 'Don't Track', to store repo data but not update it
  • add tests for bearer token and image deletion

How to start to use Bow

docker run -d \
   --name=Bow \
   -e BS_LOG_SILENT=yes \
   -e BS_TIME_WATCH=no \
   -v ~/db/bow:/var/lib/bow \
   -p 5001:19808 \
   evedel/bow

There are some parameters, that can be set only as environment variables. Short descriptions with default value:

  • BS_LOG_SILENT="" -- logging level, default is full logging
  • BS_DB_PATH="/var/lib/bow" -- path to store your db
  • BS_DB_NAME="asapdrf.db" -- name of db and db file
  • BS_SERVE_ADD="19808" -- port address to serve
  • BS_CHECKER_TIMEOUT="300" -- seconds, time to renew data
  • BS_TIME_WATCH="yes" -- print time of execution for qurl queries and page-renderers

The full list of available tags can be found at hub.docker.com.

evedel/bow:latest -- the last build based on debian:jessie image (68MB)
evedel/bow:debian-latest -- the same last build based on debian image (68MB)
evedel/bow:alpine-latest -- the last alpine based build (4.7MB)
evedel/bow:debian-$(buildNumber) -- tagged previously released versions based on debian (68MB).
evedel/bow:alpine-$(buildNumber) -- tagged previously released versions based on alpine (4.7MB).
evedel/bow:$(buildNumber) -- tagged previously released versions based on debian.

How to start contribute to Bow

If you have interest, you can easily start with

git clone https://github.com/evedel/bow.git
cd bow && git clone https://github.com/fperucic/treant-js project/resources/treant-js
docker-compose -f develop/devcompose.yml up -d
docker exec -it develop_golang_1 go get
docker exec -it develop_golang_1 go test -v qurl -repo='https://UsErNaMe:[email protected]'
docker exec -it develop_golang_1 go run main.go

Code and packages

This app is written on golang with use of standard packages and:
https://github.com/boltdb/bolt -- BoltDB
https://github.com/fatih/color -- to make cli shiny
https://github.com/wader/disable_sendfile_vbox_linux -- to develop on docker-machine
http://www.chartjs.org/ -- to draw best graphs ever
https://github.com/fperucic/treant-js -- to draw parents graphs

bow's People

Contributors

evedel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bow's Issues

space required from token service?

I've configured a secure authorization token service, but I found it that was needed to add a space in the service value.

working config:

auth:
  token:
    realm: {{AUTH_URL}}
    service: nmx registry
    issuer: nmx_registry
    rootcertbundle: /usr/registry/certs/registry-auth.crt

Note that the value nmx registry needed a space. The previous value nmx_registry produced this error on bow Update:

[ Fri, 18 Aug 2017 02:17:47 UTC ][ L1 ] Building parents tree for [ registry ]                                                            [0/1897]
[ Fri, 18 Aug 2017 02:17:47 UTC ][ L1 ] DB: GET BUCKET: open bucket for READ  [ registry->catalog ]
[ Fri, 18 Aug 2017 02:17:47 UTC ][ L1 ] DB: GET BUCKET: Done
[ Fri, 18 Aug 2017 02:17:47 UTC ][ L1 ] DB: CREATE BUCKET: open bucket for WRITE [ registry->_namesgraph ]
[ Fri, 18 Aug 2017 02:17:47 UTC ][ L1 ] DB: CREATE BUCKET: creating bucket [ _namesgraph ]
[ Fri, 18 Aug 2017 02:17:47 UTC ][ L1 ] MakeQuery: Code [401] : Bearer auth. Trying to get auth token.
panic: runtime error: slice bounds out of range

goroutine 18 [running]:
panic(0x800b60, 0xc82000a050)
        /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
qurl.getbearertoken(0xc820310080, 0x71, 0xc82000b660, 0x6, 0xc82000b638, 0x8, 0x1, 0x0, 0x0, 0xc820050900)
        /app/src/qurl/qurl.go:73 +0xa36
qurl.MakeQuery(0x8cb930, 0x15, 0x8823f8, 0x3, 0xc820013560, 0xc820013590, 0x7551c0, 0xc8203e80c0, 0xc8203e8060, 0x0)
        /app/src/qurl/qurl.go:118 +0xa17
checker.checkRepos(0xc82011a000)
        /app/src/checker/repository.go:17 +0x191
created by checker.DaemonManager
        /app/src/checker/checker.go:23 +0x395

qurl.go:73 is slicing a string on the Index of space that I didn't have. Knowing next to nothing about JWT, I can't be sure what an appropriate service value looks like.

My auth service works when a space is added, so I'm not blocked at all by this; just thought it was curious.

Wrong permissions when creating /var/lib/bow/

conf/conf.go:29: os.Mkdir(Env["dbpath"], 0600) should be os.Mkdir(Env["dbpath"], 0700)
When running as non-root user with permissions to create the directory, then bow fails to create the db file in the directory.

Daemons error out when they encounter an empty repository

Recently, I had deleted all of the tags out of some given repository that I had set up for a test. The repository still shows up when calling /v2/_catalog. If you were to call /v2/REPONAME/tags/list, you'd get a 404 because there are no tags for this repo.

This 404 causes the checker daemon to stop working. It'll read the tags in each repo until it gets to the empty one. In my case, I removed the repository and the checker was able to continue, but the checker shouldn't choke on a 404 like that. It should be expected that some repos are empty.

panic: interface conversion:

запускаю скрипт ~/scripts/docker/Bowship/0run.sh

docker pull evedel/bow;
docker rm -vf Bowship;
docker run -d
--name=Bowship
-e BS_LOG_SILENT=yes
-v /home/root/db/bow:/var/lib/bow
-p 5001:19808
evedel/bow;

контейнер сразу крашится
docker logs --tail=100 Bowship выдаёт вот это

[ Tue, 04 Oct 2016 04:53:19 UTC ][ L2 ] Server listening at [:19808]
[ Tue, 04 Oct 2016 04:53:19 UTC ][ L2 ] DaemonManager: Sleep time is : 300 seconds
panic: interface conversion: interface is nil, not []interface {}

goroutine 7 [running]:
panic(0x8012a0, 0xc820048e00)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
checker.CheckTags()
/app/src/checker/checker.go:96 +0x667
created by checker.DaemonManager
/app/src/checker/checker.go:21 +0x1a4

подскажи куда копать?

repos maxed at 100?

Our registry has 500 or more images, and a couple of features seem to fall apart at that scale.

The left-side repo list appears to top out at 100 images. It'd be neat if there was a namespace level instead of one list of everything.

To illustrate, and hoping that formatting works, it'd go from:

registry     namespace/app1    {tags}
             namespace/app2

to:

registry     namespace    app1    {tags}
                          app2

Likewise with the Graph, it looks to print everything (well, 100) and in no particular order. It'd be great if the left-hand drill-down worked for the graphs view; limiting drawn hierarchies to those include the selected image or tag if one if chosen.

bow is looking good. Keep it up!

chosen "link" width 4.05 pixels?

Hi,

alpine-latest image configured with my local registry (with 1 image pushed) looks like this:
Screenshot 2020-06-19 at 00 47 12

I'm using Firefox Nightly, and Developer tools shows this:
Screenshot 2020-06-19 at 00 49 47

My css-fu is weak, it can't grok 90% vs 4.05px result :)

Can't authenticate when using a password with percent symbol

Hey, first of all, thank you for writing this! The supply of bearer-auth supporting registry UIs is pretty lacking...

Okay, so I use the docker-auth project to handle token generation for me and the password for one of my users happens to have a "%" symbol in it. I found that I get an error when fetching things from this registry using the supplied password.

In this example my username/ password was testuser examplepassword!%#$#$%

Seems like usernames and passwords might just need to be URL encoded before sending the request. Alternatively, an even better solution would be to base64 encode the <username>:<password> and throw it into a header like so:

Authorization: Basic <base 64 encoded username password string>

[ Tue, 14 Feb 2017 22:05:40 UTC ][ L1 ] CheckManifests Daemon: started work
[ Tue, 14 Feb 2017 22:05:40 UTC ][ L3 ] parse https://testuser:examplepassword!%: invalid URL escape "%"
[ Tue, 14 Feb 2017 22:05:40 UTC ][ L3 ] CheckRepos Daemon: cannot recieve response from registry, stopping work

panic: checkparents

Hi,

I am getting a panic when the repository is first indexed:

panic: interface conversion: interface is nil, not []interface {}

goroutine 21 [running]:
panic(0x8041e0, 0xc820302100)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
checker.checkParents(0xc82011e150)
/app/src/checker/parents.go:37 +0x1a05
created by checker.DaemonManager
/app/src/checker/checker.go:26 +0x4d0
[ Fri, 03 Feb 2017 19:23:15 UTC ][ L2 ] DB: INIT: Start
[ Fri, 03 Feb 2017 19:23:15 UTC ][ L2 ] DB: INIT: DB Upgrade: Version: 2
[ Fri, 03 Feb 2017 19:23:15 UTC ][ L2 ] DB: INIT: DB Upgrade: Actual version
[ Fri, 03 Feb 2017 19:23:15 UTC ][ L2 ] DB: INIT: Done
[ Fri, 03 Feb 2017 19:23:15 UTC ][ L2 ] Server listening at [:19808]
[ Fri, 03 Feb 2017 19:23:15 UTC ][ L2 ] DaemonManager: Sleep time is : 300 seconds
panic: interface conversion: interface is nil, not []interface {}

goroutine 21 [running]:
panic(0x8041e0, 0xc820281f80)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
checker.checkParents(0xc82011e150)
/app/src/checker/parents.go:37 +0x1a05
created by checker.DaemonManager
/app/src/checker/checker.go:26 +0x4d0

I tried restarting the docker registry and ran a registry garbage-collect.

Thank you for the great work (the bearer token is really a great feature) !

Really works with private registry?

I'm getting this error in my Bow container logs:
[ Wed, 06 Feb 2019 12:04:40 UTC ][ L2 ] DaemonManager: Started all checkers manually [ Wed, 06 Feb 2019 12:04:41 UTC ][ L3 ] MakeQuery: Code [401] : Unauthorized response is returned (credentials problem, check user/pass pair) [ Wed, 06 Feb 2019 12:04:41 UTC ][ L3 ] CheckRepos Daemon: cannot recieve response from registry, stopping work

Config:
bbb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.