Authorization service and frontend for Docker registry (v2)
Clone or download
vitoravelino Merge pull request #2064 from vitoravelino/improve-repositories-perfo…
…rmance-2

entity (repositories): reduced amount of rendered data
Latest commit 51d7aab Dec 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github github: add documentation in the exemptLabels Sep 3, 2018
app Merge pull request #2064 from vitoravelino/improve-repositories-perfo… Dec 14, 2018
bin integration: test that the portus service is up Nov 8, 2018
config Allow automatic creation of unknown namespaces Dec 5, 2018
db db: added index on scan_result Dec 13, 2018
deploy rubocop: bring it closer to upstream Dec 12, 2017
doc doc: removed unneeded files Oct 3, 2018
docker Upgrade to Rails 5 Nov 8, 2018
examples add how to create self-signed certificates Nov 2, 2018
lib Merge pull request #2064 from vitoravelino/improve-repositories-perfo… Dec 14, 2018
packaging/suse packaging: get public_activity from a forked gem Dec 14, 2018
public change the default robots.txt so that Portus cannot be crawled by search Feb 15, 2018
spec Merge pull request #2064 from vitoravelino/improve-repositories-perfo… Dec 14, 2018
vendor/assets js: splitted into bundles and chunks Aug 3, 2018
.babelrc js: upgraded dev packages Jul 17, 2018
.dockerignore Implemented from scratch integration tests Mar 13, 2018
.editorconfig added .editorconfig Mar 5, 2017
.env Added an examples directory Jul 10, 2017
.erdconfig Integrated rails-erd into development Apr 11, 2016
.eslintignore Moved from Coffeescript to Javascript Feb 26, 2017
.eslintrc Introducing Vue.js for the frontend Jul 18, 2017
.gitignore Upgrade to Rails 5 Nov 8, 2018
.rspec Added the .rspec file Jun 15, 2015
.rubocop.yml Upgrade to Rails 5 Nov 8, 2018
.ruby-version Upgraded to ruby 2.5 Jan 16, 2018
.travis.yml Upgrade to Rails 5 Nov 8, 2018
CHANGELOG.md Updated changelog file for the 2.4 release Oct 1, 2018
CONTRIBUTING.md github: added templates for issues and PRs Feb 20, 2018
Dockerfile spec: added chrome headless as default js runner Jun 29, 2018
Gemfile packaging: get public_activity from a forked gem Dec 14, 2018
Gemfile.lock packaging: get public_activity from a forked gem Dec 14, 2018
Guardfile rubocop: bring it closer to upstream Dec 12, 2017
LICENSE Add licensing details Apr 22, 2015
README.md Updated README Nov 20, 2018
Rakefile Updated rubocop to 0.53.0 Mar 13, 2018
VERSION Preparing for the next version Oct 2, 2018
Vagrantfile Upgrade to Rails 5 Nov 8, 2018
config.ru rubocop: bring it closer to upstream Dec 12, 2017
docker-compose.yml dev: update the webpack image to be used Jul 20, 2018
package.json ui: improved namespace transfer workflow Nov 30, 2018
yarn.lock ui: improved namespace transfer workflow Nov 30, 2018

README.md

Portus

Portus is an authorization server and a user interface for the next generation of the Docker registry. Portus targets version 2 of the Docker Registry API. The minimum required version of Registry is 2.1, which is the first version supporting soft deletes of blobs.

master v2.4 Code Climate
Build Status Build Status Code Climate Test Coverage

Features

Fine-grained control of permissions

Portus supports the concept of users and teams. Users have their own personal Docker namespace where they have both read (aka docker pull) and write (aka docker push) access. A team is a group of users that have read and write access to a certain namespace. You can read more about this in our documentation page about it.

Portus implements the token based authentication system described by the new version of the Docker registry. This can be used to have full control over the images served by an instance of the Docker registry.

Web interface for Docker registry

Portus provides quick access to all the images available on your private instance of Docker registry. User's privileges are taken into account to make sure private images (the ones requiring special rights also for docker pull) are not shown to unauthorized personnel.

Self-hosted

Portus allows you to host everything on your servers, on your own infrastructure. You don't have to trust a third-party service, just own everything yourself. Take a look at our documentation to read the different setups in which you can deploy Portus.

And more!

Some highlights:

Take a tour by our documentation site to read more about this.

Contributing

There are multiple ways of setting up a development environment. We recommend using docker-compose, so you only need to perform:

$ docker-compose up

You can read more about this environment here.

Also, make sure to understand our contribution guidelines, as explained in this document.

Testing

Unit tests

Unit tests are located in the spec directory. To run them, simply:

$ bundle exec rspec spec

Make sure to install phantomjs from your Linux distribution before running unit tests, since feature tests rely on PhantomJS being installed. All the other ruby dependencies are already covered by our Gemfile.

We also have tests in the frontend. For this, you have to install yarn from your Linux distribution and run:

$ yarn test

Integration tests

Check this document in order to better understand how integration tests work. For development, though, if you have already installed Docker, docker-composer and bats, running the following should just work:

$ chmod +x bin/test-integration.sh
$ ./bin/test-integration.sh

Other checks

A common pitfall for developers is to forget about code style. For that, make sure to run rubocop:

$ bundle exec rubocop -a

Note that the command above includes the -a flag. This flag will automatically fix small issues for you. We also run a code style check for the frontend code:

$ yarn eslint

We also run brakeman in order to detect security vulnerabilities:

$ bundle exec brakeman

Last but not least, make sure that your git commit follows a proper style. To ensure this, you can run the following task:

$ bundle exec rake test:git

Continuous Integration

We use Travis CI for continuous integration. You can run what we run in Travis locally:

$ chmod +x bin/ci.sh
$ ./bin/ci.sh

This script simply executes all the tests and checks that we have presented above.

Licensing

Portus is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.