From 75554487af90d65f02e6ff9431b1b62852825cd1 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Thu, 22 Jun 2023 20:06:31 -0700 Subject: [PATCH] Update image description from docker/README.md if needed. --- .github/workflows/dockerhub.yml | 7 +++++-- docker/README.md | 30 ++++++++++++++++++++++++++++++ docker/build.sh | 2 +- docker/update_description.sh | 30 ++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 docker/README.md create mode 100644 docker/update_description.sh diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index dec25b9bf..15cf713a4 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -2,6 +2,7 @@ name: Push to DockerHub on: [push, pull_request] env: + DOCKER_REPO: sippylabs/rtpproxy PLATFORMS: linux/amd64,linux/i386,linux/arm/v7,linux/arm64 jobs: @@ -40,7 +41,7 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: sippylabs/rtpproxy + images: ${{ env.DOCKER_REPO }} tags: | type=schedule type=ref,event=branch @@ -65,7 +66,6 @@ jobs: file: ./docker/Dockerfile tags: | ${{ steps.meta.outputs.tags }} - sippylabs/rtpproxy:${{ github.sha }} labels: ${{ steps.meta.outputs.labels }} platforms: ${{ env.PLATFORMS }} outputs: type=tar,dest=/tmp/ccache_export.tar @@ -80,6 +80,9 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: ${{ env.PLATFORMS }} + - name: Update ${{ env.DOCKER_REPO }} description + run: sh -x docker/update_description.sh docker/README.md + - name: Extract ccaches run: | rm -rf ccache diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..8c08062f9 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,30 @@ +# Official images of the RTPproxy Project + +[![Clean Build@GitHub](https://github.com/sippy/rtpproxy/actions/workflows/cleanbuild.yml/badge.svg?branch=master)](https://github.com/sippy/rtpproxy/actions/workflows/cleanbuild.yml?query=branch%3Amaster++) +[![All-inclusive Build@GitHub](https://github.com/sippy/rtpproxy/actions/workflows/depsbuild.yml/badge.svg?branch=master)](https://github.com/sippy/rtpproxy/actions/workflows/depsbuild.yml?query=branch%3Amaster++) +[![Functional Testing@GitHub](https://github.com/sippy/rtpproxy/actions/workflows/functesting.yml/badge.svg?branch=master)](https://github.com/sippy/rtpproxy/actions/workflows/functesting.yml?query=branch%3Amaster++) +[![Glitching@GitHub](https://github.com/sippy/rtpproxy/actions/workflows/glitching.yml/badge.svg?branch=master)](https://github.com/sippy/rtpproxy/actions/workflows/glitching.yml?query=branch%3Amaster++) +[![OSSFuzz@GitHub](https://github.com/sippy/rtpproxy/actions/workflows/cifuzz.yml/badge.svg?branch=master)](https://github.com/sippy/rtpproxy/actions/workflows/cifuzz.yml?query=branch%3Amaster++) +[![Coverage Status](https://coveralls.io/repos/github/sippy/rtpproxy/badge.svg?branch=master)](https://coveralls.io/github/sippy/rtpproxy?branch=master) +[![Coverity](https://scan.coverity.com/projects/8841/badge.svg)](https://scan.coverity.com/projects/sippy-rtpproxy) + +## About + +The RTPproxy is a extremely reliable and reasonably high-performance software +proxy for RTP streams that can work together with [OpenSIPS](https://opensips.org), +[Kamailio](https://kamailio.org) or [Sippy B2BUA](https://github.com/sippy/b2bua). + +Originally created for handling NAT scenarios, back in 2004-2005, it can also act +as a generic real time datagram relay as well as gateway Real-Time Protocol (RTP) +sessions between IPv4 and IPv6 networks. + +The RTPproxy supports many advanced features and is controllable over +multitude of Layer 4 protocols, including Unix Domain, UDP, UDPv6, TCP and TCPv6. + +The software allows building scalable distributed SIP networks. The rtpproxy module +included into the OpenSIPS or Kamailio SIP Proxy software allows using multiple +RTPproxy instances running on remote machines for fault-tolerance and +load-balancing purposes. + +The image is updated on every commit to the https://github.com/sippy/rtpproxy/ +repository. diff --git a/docker/build.sh b/docker/build.sh index 63e462406..98fc09251 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -8,7 +8,7 @@ RTPDIR="`dirname "${MYPATH}"`/.." LIB_DEPS="libsrtp2-1 libbcg729-0 libgsm1 libsndfile1 libunwind8 libssl3" -BUILD_DEPS="file pkg-config clang-15 ccache git make \ +BUILD_DEPS="file pkg-config clang-15 ccache git make jq \ libsrtp2-dev libbcg729-dev libgsm1-dev libsndfile1-dev \ libunwind-dev libssl-dev" diff --git a/docker/update_description.sh b/docker/update_description.sh new file mode 100644 index 000000000..a35772c13 --- /dev/null +++ b/docker/update_description.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e +set -o pipefail + +# Variables +REPO_USER="sippylabs" +REPO_NAME="rtpproxy" +DOCKERHUB_USER="${DOCKERHUB_USER}" +DOCKERHUB_PASS="${DOCKERHUB_PASS}" + +# Get the JWT token +TOKEN="$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKERHUB_USER}'", "password": "'${DOCKERHUB_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)" + +OLDCSUM="`curl -s -H "Authorization: JWT ${TOKEN}" "https://hub.docker.com/v2/repositories/${DOCKER_REPO}/" | jq -r .full_description | md5sum -q`" +NEWCSUM="`md5sum -q "${1}"`" +if [ "${OLDCSUM}" = "${NEWCSUM}" ] +then + # description is up to date already + exit 0 +fi + +DESCRIPTION_FILE="`mktemp -t DESCRIPTION_FILE`" +echo '{"full_description": "' > "${DESCRIPTION_FILE}" +perl -0777 -p -e 's|\n\z||' "${1}" | perl -p -e 's|\n|\\n\n|' >> "${DESCRIPTION_FILE}" +echo '"}' >> "${DESCRIPTION_FILE}" + +# Update the description on DockerHub +curl -X PATCH -H "Content-Type: application/json" -H "Authorization: JWT ${TOKEN}" -d @"${DESCRIPTION_FILE}" https://hub.docker.com/v2/repositories/${REPO_USER}/${REPO_NAME}/ +#rm "${DESCRIPTION_FILE}"