diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46f46627424..32914f9e7a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - 'v*' jobs: - make_binaries: + binaries: runs-on: ubuntu-22.04 steps: @@ -20,7 +20,7 @@ jobs: path: binaries github: - needs: make_binaries + needs: binaries runs-on: ubuntu-22.04 steps: @@ -59,7 +59,7 @@ jobs: } dockerhub: - needs: make_binaries + needs: binaries runs-on: ubuntu-22.04 steps: @@ -75,8 +75,20 @@ jobs: DOCKER_USER: ${{ secrets.DOCKER_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + dockerhub_legacy: + needs: dockerhub + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + - run: make dockerhub-legacy + env: + DOCKER_USER_LEGACY: ${{ secrets.DOCKER_USER_LEGACY }} + DOCKER_PASSWORD_LEGACY: ${{ secrets.DOCKER_PASSWORD_LEGACY }} + apidocs: - needs: make_binaries + needs: binaries runs-on: ubuntu-22.04 steps: diff --git a/Makefile b/Makefile index a8459d3eddb..fdc9ddc509f 100644 --- a/Makefile +++ b/Makefile @@ -12,18 +12,19 @@ help: @echo "" @echo "available actions:" @echo "" - @echo " mod-tidy run go mod tidy" - @echo " format format source files" - @echo " test run tests" - @echo " test32 run tests on a 32-bit system" - @echo " test-highlevel run high-level tests" - @echo " lint run linters" - @echo " bench NAME=n run bench environment" - @echo " run run app" - @echo " apidocs-lint run api docs linters" - @echo " apidocs-gen generate api docs HTML" - @echo " binaries build binaries for all platforms" - @echo " dockerhub build and push images to Docker Hub" + @echo " mod-tidy run go mod tidy" + @echo " format format source files" + @echo " test run tests" + @echo " test32 run tests on a 32-bit system" + @echo " test-highlevel run high-level tests" + @echo " lint run linters" + @echo " bench NAME=n run bench environment" + @echo " run run app" + @echo " apidocs-lint run api docs linters" + @echo " apidocs-gen generate api docs HTML" + @echo " binaries build binaries for all platforms" + @echo " dockerhub build and push images to Docker Hub" + @echo " dockerhub-legacy build and push images to Docker Hub (legacy)" @echo "" blank := diff --git a/README.md b/README.md index 83e6442ec6b..b90bf34da70 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Features: [![Lint](https://github.com/bluenviron/mediamtx/workflows/lint/badge.svg)](https://github.com/bluenviron/mediamtx/actions?query=workflow:lint) [![CodeCov](https://codecov.io/gh/bluenviron/mediamtx/branch/main/graph/badge.svg)](https://app.codecov.io/gh/bluenviron/mediamtx/branch/main) [![Release](https://img.shields.io/github/v/release/bluenviron/mediamtx)](https://github.com/bluenviron/mediamtx/releases) -[![Docker Hub](https://img.shields.io/badge/docker-aler9/rtsp--simple--server-blue)](https://hub.docker.com/r/aler9/rtsp-simple-server) +[![Docker Hub](https://img.shields.io/badge/docker-bluenviron/mediamtx-blue)](https://hub.docker.com/r/bluenviron/mediamtx) [![API Documentation](https://img.shields.io/badge/api-documentation-blue)](https://bluenviron.github.io/mediamtx) ## Note about rtsp-simple-server @@ -130,22 +130,22 @@ There are several installation methods available: standalone binary, Docker imag Download and launch the image: ``` -docker run --rm -it --network=host aler9/rtsp-simple-server:latest +docker run --rm -it --network=host bluenviron/mediamtx:latest ``` Available images: |name|FFmpeg included|RPI Camera support| |----|---------------|------------------| -|aler9/rtsp-simple-server:latest|:x:|:x:| -|aler9/rtsp-simple-server:latest-ffmpeg|:heavy_check_mark:|:x:| -|aler9/rtsp-simple-server:latest-rpi|:x:|:heavy_check_mark:| -|aler9/rtsp-simple-server:latest-ffmpeg-rpi|:heavy_check_mark:|:heavy_check_mark: +|bluenviron/mediamtx:latest|:x:|:x:| +|bluenviron/mediamtx:latest-ffmpeg|:heavy_check_mark:|:x:| +|bluenviron/mediamtx:latest-rpi|:x:|:heavy_check_mark:| +|bluenviron/mediamtx:latest-ffmpeg-rpi|:heavy_check_mark:|:heavy_check_mark: The `--network=host` flag is mandatory since Docker can change the source port of UDP packets for routing reasons, and this doesn't allow the RTSP server to identify the senders of the packets. This issue can be avoided by disabling the UDP transport protocol: ``` -docker run --rm -it -e MTX_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 -p 8889:8889 aler9/rtsp-simple-server +docker run --rm -it -e MTX_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 -p 8889:8889 bluenviron/mediamtx ``` ### OpenWRT package @@ -228,7 +228,7 @@ There are 3 ways to change the configuration: * available in the root folder of the Docker image (`/mediamtx.yml`); it can be overridden in this way: ``` - docker run --rm -it --network=host -v $PWD/mediamtx.yml:/mediamtx.yml aler9/rtsp-simple-server + docker run --rm -it --network=host -v $PWD/mediamtx.yml:/mediamtx.yml bluenviron/mediamtx ``` The configuration can be changed dynamically when the server is running (hot reloading) by writing to the configuration file. Changes are detected and applied without disconnecting existing clients, whenever it's possible. @@ -253,7 +253,7 @@ There are 3 ways to change the configuration: This method is particularly useful when using Docker; any configuration parameter can be changed by passing environment variables with the `-e` flag: ``` - docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl aler9/rtsp-simple-server + docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl bluenviron/mediamtx ``` 3. By using the [HTTP API](#http-api). @@ -672,7 +672,7 @@ docker run --rm -it \ --tmpfs /dev/shm:exec \ -v /run/udev:/run/udev:ro \ -e MTX_PATHS_CAM_SOURCE=rpiCamera \ -aler9/rtsp-simple-server:latest-rpi +bluenviron/mediamtx:latest-rpi ``` After starting the server, the camera can be reached on `rtsp://raspberry-pi:8554/cam` or `http://raspberry-pi:8888/cam`. @@ -1164,7 +1164,7 @@ The NAT / container must then be configured in order to route all incoming UDP p docker run --rm -it \ -p 8189:8189/udp .... -aler9/rtsp-simple-server +bluenviron/mediamtx ``` If the UDP protocol is blocked by a firewall, all WebRTC/ICE connections can be forced to pass through a single TCP server port: @@ -1182,7 +1182,7 @@ The NAT / container must then be configured in order to redirect all incoming T docker run --rm -it \ -p 8189:8189 .... -aler9/rtsp-simple-server +bluenviron/mediamtx ``` Finally, if none of these methods work, you can force all WebRTC/ICE connections to pass through a TURN server, like [coturn](https://github.com/coturn/coturn), that must be configured externally. The server address and credentials must be set in the configuration file: diff --git a/scripts/dockerhub-legacy.mk b/scripts/dockerhub-legacy.mk new file mode 100644 index 00000000000..2ce38c1c69c --- /dev/null +++ b/scripts/dockerhub-legacy.mk @@ -0,0 +1,22 @@ +DOCKER_REPOSITORY_LEGACY = aler9/rtsp-simple-server + +dockerhub-legacy: + $(eval VERSION := $(shell git describe --tags | tr -d v)) + + docker login -u $(DOCKER_USER_LEGACY) -p $(DOCKER_PASSWORD_LEGACY) + + docker pull $(DOCKER_REPOSITORY):$(VERSION) + docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):v$(VERSION) + docker push $(DOCKER_REPOSITORY_LEGACY):v$(VERSION) + + docker pull $(DOCKER_REPOSITORY):$(VERSION)-rpi + docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):v$(VERSION)-rpi + docker push $(DOCKER_REPOSITORY_LEGACY):v$(VERSION)-rpi + + docker pull $(DOCKER_REPOSITORY):latest + docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):latest + docker push $(DOCKER_REPOSITORY_LEGACY):latest + + docker pull $(DOCKER_REPOSITORY):latest-rpi + docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):latest-rpi + docker push $(DOCKER_REPOSITORY_LEGACY):latest-rpi diff --git a/scripts/dockerhub.mk b/scripts/dockerhub.mk index 84a6f389c4f..7dee9d0ca5a 100644 --- a/scripts/dockerhub.mk +++ b/scripts/dockerhub.mk @@ -1,4 +1,4 @@ -REPOSITORY = aler9/rtsp-simple-server +DOCKER_REPOSITORY = bluenviron/mediamtx define DOCKERFILE_DOCKERHUB FROM scratch @@ -67,15 +67,15 @@ dockerhub: echo "$$DOCKERFILE_DOCKERHUB" | docker buildx build . -f - \ --provenance=false \ --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 \ - -t $(REPOSITORY):$(VERSION) \ - -t $(REPOSITORY):latest \ + -t $(DOCKER_REPOSITORY):$(VERSION) \ + -t $(DOCKER_REPOSITORY):latest \ --push echo "$$DOCKERFILE_DOCKERHUB_FFMPEG" | docker buildx build . -f - \ --provenance=false \ --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 \ - -t $(REPOSITORY):$(VERSION)-ffmpeg \ - -t $(REPOSITORY):latest-ffmpeg \ + -t $(DOCKER_REPOSITORY):$(VERSION)-ffmpeg \ + -t $(DOCKER_REPOSITORY):latest-ffmpeg \ --push echo "$$DOCKERFILE_DOCKERHUB_RPI_BASE_32" | docker buildx build . -f - \ @@ -96,15 +96,15 @@ dockerhub: echo "$$DOCKERFILE_DOCKERHUB_RPI" | docker buildx build . -f - \ --provenance=false \ --platform=linux/arm/v6,linux/arm/v7,linux/arm64/v8 \ - -t $(REPOSITORY):$(VERSION)-rpi \ - -t $(REPOSITORY):latest-rpi \ + -t $(DOCKER_REPOSITORY):$(VERSION)-rpi \ + -t $(DOCKER_REPOSITORY):latest-rpi \ --push echo "$$DOCKERFILE_DOCKERHUB_FFMPEG_RPI" | docker buildx build . -f - \ --provenance=false \ --platform=linux/arm/v6,linux/arm/v7,linux/arm64/v8 \ - -t $(REPOSITORY):$(VERSION)-ffmpeg-rpi \ - -t $(REPOSITORY):latest-ffmpeg-rpi \ + -t $(DOCKER_REPOSITORY):$(VERSION)-ffmpeg-rpi \ + -t $(DOCKER_REPOSITORY):latest-ffmpeg-rpi \ --push docker buildx rm builder