https://github.com/rexops/repositorio
Tool to administrate linux repositories
https://github.com/rexops/repositorio
Last synced: 10 months ago
JSON representation
Tool to administrate linux repositories
- Host: GitHub
- URL: https://github.com/rexops/repositorio
- Owner: RexOps
- Created: 2014-03-10T22:14:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T21:03:46.000Z (about 4 years ago)
- Last Synced: 2024-05-09T19:36:29.182Z (almost 2 years ago)
- Language: Perl
- Homepage: http://www.repositor.io/
- Size: 234 KB
- Stars: 55
- Watchers: 10
- Forks: 18
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
Awesome Lists containing this project
README
## repositorio - A tool to mirror and administrate linux repositories.
repositorio is a tool to mirror and administrate linux repositories and to tag them.
This is the master branch of the development repository. In this branch you'll find all the new stuff that is work-in-progress.
### Need help?
If you need help, feel free to join us on irc.freenode.net on channel #rex (this is the channel for all RexOps projects) or just post an issue in the tracker.
### Supported Repositories
Right now *yum*, *apt* and *yast (opensuse)* repositories are supported. It is also possible to query errata for packages if an errata database is present. See *errata* chapter for more information.
Currently we're working on *docker* support, so that it is possible to build a private docker registry with repositorio. See *docker* chapter for more information.
YaST (OpenSuSE) repository support is only for mirroring. If you want to create custom repositories for your SuSE systems, repositorio will create yum repositories. You can add those repositories with the following command:
```
zypper ar -t YUM http://my-repo-server.domain.tld/head/my-repo/ my-repo
```
### Configuration
To configure repositorio create a configuration file */etc/rex/repositorio.conf*. For an example file please see *repositorio.conf* file in this repository.
```
RepositoryRoot = /data/repositories
config = log4perl.conf
# this will create the repository inside
# /data/repositories/head/rex-centos-6-x86-64/CentOS/6/rex/x86_64
url = http://nightly.rex.linux-files.org/CentOS/6/rex/x86_64
local = rex-centos-6-x86-64/CentOS/6/rex/x86_64
type = Yum
```
You also need to create a Log4perl configuration file. You can set the location in repositorio.conf file.
```
log4perl.rootLogger = DEBUG, FileAppndr1
log4perl.appender.FileAppndr1 = Log::Log4perl::Appender::File
log4perl.appender.FileAppndr1.filename = /var/log/repositorio.log
log4perl.appender.FileAppndr1.layout = Log::Log4perl::Layout::SimpleLayout
```
### Mirror a repository
To mirror a defined repository you can use the following command:
```
repositorio --mirror --repo=rex-centos-6-x86-64
```
To mirror every configured directory, you can use the **all** keyword.
```
repositorio --mirror --repo=all
```
To reload the metadata of a repository there is the *--update-metadata* option.
```
repositorio --mirror --repo=rex-centos-6-x86-64 --update-metadata
```
To reload all package files of a repository there is the *--update-files* option.
```
repositorio --mirror --repo=rex-centos-6-x86-64 --update-files
```
### Managing a repository
If you need to create a custom repository, you can do this as well.
Just add the repository to your configuration file:
```
local = custom-centos-6-x86-64/CentOS/6/custom/x86_64/
type = Yum
url = http://ftp.hosteurope.de/mirror/centos.org/6/os/x86_64/
local = centos-6-x86-64/CentOS/6/rex/x86_64/
type = Yum
errata = CentOS-6
```
To query the errata database you can run the following command:
```
repositorio --repo=some-repo --errata --package=openssl --arch=x86_64 --version=1.0.0-20.el6_2.3
```
If you want to query the webinterface, this will return a json structure containing all available updates:
```
curl -XGET \
http://your-server:3000/head/centos-6-x86-64/errata?package=openssl&arch=x86_64&version=1.0.0-20.el6_2.3
```
To update the errata database you can use the following command:
```
repositorio --repo=centos-6-x86-64 --update-errata
```
The following errata types are available:
* CentOS-5
* CentOS-6
* CentOS-7
* epel-5
* epel-6
* epel-7
### Serving a directory
To serve a directory we advice you to use Apache or nginx. You can just point the document root to *RepositoryRoot* in your repositorio.conf file.
If you don't want to install a webserver, you can also use the build-in webserver to server repositories.
```
repositorio --repo=repo-name --server prefork
```
### Docker
If you also want to manage your private docker registry with repositorio you can do this as well. Currently this feature is in an early development stage. We welcome any feedback and patches.
Current development stage:
* upload images (docker push) - done
* download images (docker pull) - done
* authentication (docker login) - done
* user management - open
* permissions to repositories - open
* search for images (docker search) - done
#### Configuration
To create a docker repository you need the following snippet inside your repositorio.conf file.
```
local = docker-images
type = Docker
```
And then you can initialize this repository as usual with:
```
repositorio --repo=docker --init
```
This will create a new folder *docker-images* inside your *RepositoryRoot*/head directory.
For the docker images it is not possible to use apache (or another webserver) to serve the content, so you need to start a small server that is included with repositorio.
```
repositorio --repo=docker --server prefork
```
This will start a preforking webserver. The server part is done with Mojolicious. Mojolicious is an easy to use Perl Webframework.
Now you can use *repositorio* as a docker registry.
First you need to create a user:
```
docker login -e some@mail.tld -p 'some-save-password' -u 'some-user' http://localhost:3000/v1/
```
The user is enabled immediately.
Then you can push and pull images.
```
docker pull ubuntu
docker tag localhost:3000/ubuntu
docker push localhost:3000/ubuntu
```