• This repository has been archived on 13/Nov/2019
  • Stars
    star
    115
  • Rank 304,135 (Top 7 %)
  • Language
    Java
  • License
    GNU General Publi...
  • Created about 12 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Server to host and manage yum repositories via REST API

yum-repo-server Build Status

The yum-repo-server is a server that allows you to host and manage YUM repositories using a RESTful API.

Main features

  • RESTful api for repository management (including creation, metadata generation, RPM upload, RPM propagation,...)
  • Configurable scheduling system for periodic metadata generation on repositories with high activity
  • Repository cleanup routines
  • Graphical web interface to browse repositories and their contents
  • Link system to create virtual repositories that can dynamically point to other repositories
  • Easily extensible due to good test coverage
  • Propagation of RPMs from one staging repository to the next
  • Command line wrapper for more comfort
  • Simple scaling even across several data centers, by using mongodb as storage backend

Aim

The aim of this project is to provide a simple, straightforward and extensible implementation of a server that is able to manage YUM repositories. While creating a standalone YUM repository is easy, there was no easy way to manage many such repositories at the time of writing.

Intent

Our company is migrating towards a CLD-friendly deployment solution. Our solution involves release repositories that need to be dynamically referenceable in order to update hosts or entire host groups without changing the host's repositories. This is done like so :

Image of intended usage of the yum-repo-server

Benefits

  • The yum-repo-server enables you to access repository management operations from other routines or automations, such as build servers or delivery chains.
    • For instance you can dynamically create a repository when needed (e.G. after compiling sources), upload RPMs into it, generate metadata and then use it right away!
  • The virtual repository system provides an additional layer of abstraction over repositories and allows you to create "fake" (virtual) repositories that forward any requests they obtain to a real repository.
    • Since consumers cannot differentiate between virtual and regular repositories, it is possible to change the repositories used by hosts dynamically in one simple operation (instead of fiddling on the file system level in /etc/yum/repos.d/ for instance).
      • As a consequence, the virtual repository system enables you to use one (virtual) repository for a group of hosts, and change the link as needed, e.G. when updating packages.
  • The yum-repo-server comes with built-in cleanup and metadata generation routines, meaning you do not need to use other tools (like CRON jobs) to manage repositories

License

The yum-repo-server is licensed under the GPLv3

Getting started using Vagrant

You can use Jan Collijs' Vagrant Yum Repo Server recipe to start a local server in a Vagrant box.

Getting started locally

  • Checkout the Repository:
git clone https://github.com/ImmobilienScout24/yum-repo-server
cd yum-repo-server
  • Make sure you have Maven installed, a standard Java build tool.
  • Start a local and Yum Repo Server in development mode (using a temporary MongoDB):
mvn -Plocal-dev com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:start org.codehaus.cargo:cargo-maven2-plugin:run
  • Open [http://localhost:8080]

Production usage

For production usage we recommend to build a WAR and to deploy these WAR to your favorite Java application container (Tomcat, Jetty, etc.).

Build a WAR file

Build a standard Java WAR file:

mvn package

Now copy the WAR file to your application container e.g. Tomcat:

cp -v target/yum-repo-server.war <tomcat-dir>/webapps/ROOT.war

and start your application container.

Configuration

Yum Repo Server can be configured by a configuration file called configuration.properties in the Java classpath, by providing Java system properties like -Dlog4j.configuration=file:///path/to/log4j.xml or a combination of both property file and system properties, where system properties have a higher priority.

Following properties are available:

  • mongodb.serverlist

    Required: Comma separated list of MongoDB server host names.

  • mongodb.db.name

    Name of the database on the MongoDB instance.

    Default: rpm_db

  • mongodb.db.user

    MongoDB username for authentication. null means no authentication will be used.

    Default: null

  • mongodb.db.user

    MongoDB password for authentication.

    Default: null

  • mongodb.port

    Port used to connect to the MongoDB instances.

    Default: 27017

  • graphite.host

    Host name of a Graphite monitoring server. null means no Graphite monitoring.

    Default: null

  • graphite.port

    Port of a Graphite monitoring server.

    Default: 2003

  • statsd.host

    Host name of a Statsd aggregation server. null means no Statsd monitoring

    Default: null

  • statsd.port

    Port of a Statsd aggregation server.

    Default: 8125

  • typ

    Server type used as a monitoring prefix.

    Default: null

  • scheduler.poolSize

    Size of the thread pool used for scheduling tasks. Should be at least 2 or greater depending on your CPU resources.

    Default: 10

  • metadata.tmp.dir

    Directory for temporary files during metadata generation. null means use Java standard temp dir.

    Default: null

  • metdata.outdated.survival.time

    Time in minutes that indicates how long old Yum metadata should be keep to serve client that have already downloaded an old repomd.xml with references to old database files.

    Default: 5

  • scheduler.delay

    Time in seconds of the interval between two repository updates for scheduled repositories.

    Default: 10

  • scheduler.delete.files.delay.minuets

    Time in minuets to wait until files are actually removed, when there are marked as deleted

    Default: 10

  • scheduler.delete.files.cron

    Cron expression to check for files to delete

    Default: every 15min

  • pam.service.name

    Name of the PAM service used for local authentication.

    Default: password-auth

  • security.whitelist.hosts

    Comma separated host list of hosts that are allowed to perform write operations via REST API without authentication. Wildcards are possible like : devxyz*.bla.blu.

  • loadbalancer.ips

    Comma separated list of proxy server IPs (e.g. load balancers) that sets the X-Forwarded-For http header. If the requests comes from such an IP the application will try to determine the source IP by the header field and check if this is an white listed IP (see security.whitelist.hosts).

How it works

Repository usage

In a nutshell, when yum checks for updates it sends HTTP GET requests to repositories it is aware of (usually through repository files in /etc/yum/repos.d/) and queries repository metadata. If it decides a package has to be updated (or installed) it will then directly download the RPM package through a HTTP request.

Virtual repositories

A virtual repository does look exactly like a regular repository for consumers, but it is actually an empty repository that contains a YAML file named repo.yaml. The file contains an entry with a relative path to a regular repository, and requests to the virtual repository are rerouted to the regular one.

Periodic metadata generation

TODO

API requests

API requests are handled by Yum Repo Server and use a REST like format. For maximal comfort, use the yum-repo-client. The examples below should give you a good understanding of how the requests look like.

Repository creation

Creating a new repository involves sending a POST request with the name of the repository in the body to $host/$repo_base. This will create a new resource (the new repository) underneath the repository base, which means you can access your new repository at $host/$repo_base/$new_repo_name

Repository deletion

A static repository can be deleted when sending a DELETE request to the repository (/repo/repo-to-delete). It can be protected from deletion when its name is listed within the /etc/yum-repo-server/non-deletable-repositories file. Virtual repositories that were linked to the deleted static repository, will not be deleted or changed. The virtual repositories will deliver HTTP 404 sites as long as the static repository does not exist again or the link is changed manually.

Upload to an existing repository

As a consequence, uploading a RPM to an existing repository involves sending a POST request containing the RPM file in a form element called rpmFile. The request is send to $host/$repo_base/$repo_name It creates a new resource underneath $repo_name. The RPM can then be retrieved with a GET request sent to $host/$repo_base/$repo_name/$rpm_architecture/$rpm_filename.

Generating repository metadata

Generating metadata involves a POST request to $host/$repo_base/$repo_name/repodata since it creates a new resource (the actual metadata files) underneath repodata/.

Propagate a RPM from one repository to another

You can propagate a RPM from a source repository to a destination repository on the same host by sending a POST request to $host/propagation/ with parameter source and destination. source must be $source-repo-name/$architecture/artifact-name.rpm. destination is just name of the target repository. Propagation does not work with virtual repositories. For example: curl -F "source=test-repo/noarch/ test-artifact&destination=test-repo2" http://myyum-repo-server/propagation/ will search for the latest test-artifact-XX-X.noarch.rpm and propagate the rpm from test-repo repository to test-repo2.

List static or virtual repositories

You can retrieve a list of static or virtual repositories for static repos via http://myyum-repo-server/repo.txt for virtual repos: http://myyum-repo-server/repo/virtual.txt Optionally you can get the destination for virtual repositories with the showDestination parameter. If set to true the list will contain entries with the following pattern: repo_name:destination. The destination is the path to the static repository or it could also be a url to an external repository.

To filter the list you have several url parameters:

All filters are concatable and are combined via and, so http://myyum-repo-server/repo.txt?older=10&newer=30 will retrieve all repositories older then 10 days and newer then 30 days.

Contribution

More Repositories

1

scout24-engineering-values-and-principles

Scout24 Engineering Values and Principles
145
star
2

restapi-php-sdk

SDK fรผr PHP-Entwickler um die Arbeit mit der API von ImmobilienScout24 zu vereinfachen. รœber die API erhรคlt man Ergebnislisten, Objektdaten, uvm. von ImmobilienScout und kann diese Daten inhherhalb seines Webservice integrieren. Die Dokumentation zum SDK findet man unter https://github.com/Immocaster/php-sdk/wiki.
PHP
63
star
3

yamlreader

Read all YAML files in a directory and merge them
Python
45
star
4

kiosk-browser

Debian package to set up a system as a kiosk browser
Shell
33
star
5

deadcode4j

deadcode4j helps you find code that is no longer used by your application. It is especially useful for cleaning up legacy code.
Java
27
star
6

aws-cf-verified-ssl-certificate

Cloudformation template to get a verified SSL certificate
Python
25
star
7

illegal-transitive-dependency-check

An additional rule for the maven-enforcer-plugin that checks for classes referenced via transitive Maven dependencies.
Java
25
star
8

aws-monocyte

A Python-bot for detecting AWS resources in non-Europe regions. Especially useful for companies that are bound to European privacy laws.
Python
22
star
9

rpi-image-creator

Automatically download Raspbian and create customized SD card
Shell
19
star
10

python-icinga-jira-plugin

Connector plugin for Icinga to automatically create alert tickets in Jira
Python
16
star
11

emr-autoscaling

Python
16
star
12

spring-boot-rpm-maven-plugin

Maven plugin that builds an RPM with upstart service job for your executable jar or war (read: Spring Boot) artifact
Java
15
star
13

docker-service-rpm

Wrap a Docker container as a Linux service in RPM
Shell
15
star
14

afp-cli

CLI for the AWS Federation Proxy
Python
13
star
15

monitoring-config-generator

Generates configuration files for Nagios and Icinga
Python
12
star
16

restapi-java-sdk

Java
11
star
17

snakepit

Package Python software as an RPM including all dependencies (even the interpreter).
Python
11
star
18

pybuilder_aws_plugin

PyBuilder plugin to handle packaging and uploading Python AWS Lambda code.
Python
11
star
19

livestatus_service

Expose MK livestatus to the outside world over HTTP.
Python
11
star
20

succubus

Lightweight Python module for daemonizing
Python
10
star
21

python-cloudwatchlogs-logging

Logging Handler for easy logging to AWS CloudWatchLogs.
Python
10
star
22

lab-manager-light

Self-service Virtualization and Data Center Management
Perl
8
star
23

afp-core

AWS Federation Proxy Backend
Python
8
star
24

scala-school

examples used in the scala school sessions
JavaScript
8
star
25

afp-alppaca

A(mazing) Local Prefetch Proxy for Amazon CredentiAls
Python
8
star
26

ic-levels-and-titles

Scout24 Individual Contributor Levels and Titles
HTML
7
star
27

appmon4j

Appmon4j a lightweight Java Framework for logging performance metrics
Java
7
star
28

is24-api-android-sdk

Android development kit for accessing ImmobilienScout24 API
Java
7
star
29

shmock

Shell Command Mock
Python
6
star
30

c-bastion

Jump-host functionality, in the cloud.
Python
6
star
31

aws-ha-updater

update an aws stack and its asgs in a high-available manner
Python
6
star
32

afp-web

Web frontend for afp (aws federation proxy)
JavaScript
6
star
33

modularized-linux-training

Materials about Bash
Makefile
6
star
34

lambda-cloudformation-stack-updater

Cross-account stack updates through a minimalistic interface and without "permit everything" policies
Scala
5
star
35

svn2rpm

Create RPM packages from SVN repo
Makefile
5
star
36

play-orientdb-client

A play client to use the orient db http api.
Scala
5
star
37

CheckABox

a jQuery plugin to replace html checkboxes and radio-buttons
JavaScript
5
star
38

hiring

AutoScout24 engineering positions
HTML
5
star
39

tomcat-stdout-accesslog

Implementation of the Tomcat Valve interface that generates a web server access log to Standard Out
Java
4
star
40

yum-repo-client

Command Line Interface for Yum Repo Server
Python
4
star
41

aws-lambda-configurer

Module for dynamic configuration of AWS Lambda functions
Python
3
star
42

cbas

Command line interface to the c-bastion
Python
3
star
43

update-s3-yum-repo

Maintain a YUM Repository in a S3 bucket
Shell
3
star
44

kickstart-debugger

Debug tool for kickstart installations
Python
3
star
45

ultimate-source-of-aws-accounts

Ultimate source of IS24 AWS accounts
Python
3
star
46

overpass-api-installation

collection of installation scripts in /bin/bash to install required components: overpass-api (7.58), its init.d service and an nginx integration
Shell
2
star
47

girls-day

Girls'Day 2016
CSS
2
star
48

cgroup-metrics-reporter

Go
2
star
49

pyspark-core-utils

PySpark Core utils library
Python
2
star
50

rds-log-cat

Shipping AWS RDS logs from s3 into a kinesis stream
Python
2
star
51

rds-log-dog

Fetches Amazon RDS logfiles
Python
2
star
52

icinga-hubot-plugin

Plugin for Icinga which automatically sends information to hubot
Python
2
star
53

mail-validator

Tool to validate sending of Mails with dkim or TLS
Python
2
star
54

spring-base64-url-decoder

Adds a MVC parameter annotation and a HandlerMethodArgumentResolver to enable decoding Base64 encoded URL parameters.
Java
2
star
55

dns-web-scanner

Scan a list of DNS domains for active HTTP services and redirects
Python
2
star
56

aws-deployment-notifier

A Python tool for triggering AWS stack updates via SNS and consuming its results via SQS.
Python
2
star
57

hackathon-management-system

We developed this tool during our annually happening Hackweek at Scout24. It is meant to help us preparing, organzing and running our Hackweeks. Since we are not the only ones running those Hackathons we thought we make it public for anyone to use...
JavaScript
2
star
58

oauth1-flow-doc-example

Java
1
star
59

yaml-server

Export a directory of YAML files via HTTP
Python
1
star
60

jest4s

Jest scala wrapper for 100% more fun!
Scala
1
star
61

s24-data-tech-radar

Tech Radar for the Scout24 Data Teams
1
star
62

check_remote_json

Simple Nagios/Icinga check for remote query with JSON output
Perl
1
star
63

afp-resource-maker

Python
1
star
64

kinesis-tools

Tools for working with AWS Kinesis streams
Ruby
1
star
65

cakeToGraphite

Push data from statuscake to graphite
Python
1
star
66

turtorial

Python tutorial using the "turtle" module
Python
1
star
67

afp-git-log

aggregate git log over all afp projects
Shell
1
star
68

diversity-dashboard

HTML
1
star
69

spotnik

Python
1
star
70

aws-certificate-management

tool for automated certification setup process
Python
1
star
71

hystrix-codahale-metrics-publisher

This is an implementation of HystrixMetricsPublisher that publishes metrics using Codahale Metrics Version 3
Java
1
star