diff --git a/.env b/.env index 811b080..c3d849b 100644 --- a/.env +++ b/.env @@ -1,4 +1,6 @@ -TAG=latest +BROKER_TAG=latest +SDR_SCANNER_TAG=latest +MONITOR_TAG=latest TZ=Europe/London MQTT_HOST=sdr-broker diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 544f0eb..68fce6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,8 +20,6 @@ jobs: key: ${{ runner.os }}-ccache - name: Checkout uses: actions/checkout@v3 - - name: Docker info - run: docker info - name: Build sdr-scanner run: | echo "constexpr auto GIT_COMMIT = \"$(git rev-parse HEAD)\";" > sources/version.h @@ -31,14 +29,14 @@ jobs: - name: Test sdr-scanner run: docker run --rm sdr-scanner-test - name: Deploy sdr-scanner branch - if: github.ref_type == 'branch' && github.event_name != 'pull_request' + if: ${{ github.ref_type == 'branch' && github.ref_name == vars.CI_BRANCH && github.event_name != 'pull_request' }} run: | TAG=${GITHUB_REF_NAME} docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io docker buildx create --use || true docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t docker.io/shajen/sdr-scanner:$TAG --push . - name: Deploy sdr-scanner tag - if: github.ref_type == 'tag' + if: ${{ github.ref_type == 'tag' }} run: | TAG=${GITHUB_REF_NAME/v/} docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io diff --git a/Dockerfile b/Dockerfile index efbbcc3..5f52950 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,4 +28,4 @@ FROM run COPY ./config.json /config/config.json COPY --from=build /root/auto-sdr/build/auto_sdr /usr/bin/auto_sdr COPY entrypoint/run.sh /entrypoint/run.sh -ENTRYPOINT ["/entrypoint/run.sh"] +CMD ["/entrypoint/run.sh"] diff --git a/README.md b/README.md index cd5e916..c1a9362 100644 --- a/README.md +++ b/README.md @@ -40,15 +40,14 @@ Sdr scanner use [SoapySDR](https://github.com/pothosware/SoapySDR) library to ge ## Install docker -If you do not have `docker` installed, follow the instructions available at [https://docs.docker.com/desktop/](https://docs.docker.com/desktop/) to install `docker` and `docker compose`. +If you do not have `docker` installed, follow the instructions [here](https://docs.docker.com/desktop/) to install `docker` and `docker compose`. ## Run -Download `docker-compose.yml` and run it. ``` -mkdir -p ~/sdr +git clone https://github.com/shajen/rtl-sdr-scanner-cpp.git ~/sdr cd ~/sdr -wget https://github.com/shajen/rtl-sdr-scanner-cpp/raw/master/docker-compose.yml +nano .env # customize settings if you want: timezone, admin account and other docker compose up -d ``` @@ -59,26 +58,21 @@ cd ~/sdr docker compose down ``` -## Configuration - -Open [http://localhost:8000/sdr/config/](http://localhost:8000/sdr/config/) and follow instruction [here](https://github.com/shajen/rtl-sdr-scanner-cpp/wiki/Configuration). - -## Panel +## Web panel -Open [http://localhost:8000/sdr/spectrograms/](http://localhost:8000/sdr/spectrograms/) or [http://localhost:8000/sdr/transmissions/](http://localhost:8000/sdr/transmissions/) and wait for data to collect. +Web panel [here](http://localhost:8000/). Default login: `admin`, password: `password`. Configuration [here](http://localhost:8000/sdr/config/), configuration manual [here](https://github.com/shajen/rtl-sdr-scanner-cpp/wiki/Configuration), admin panel [here](http://localhost:8000/admin/). -Admin panel available at [http://localhost:8000/admin/](http://localhost:8000/admin/). Username: `admin`, password: `password`. +Open [spectrograms](http://localhost:8000/sdr/spectrograms/) or [transmissions](http://localhost:8000/sdr/transmissions/) and wait for data to collect. Sources of panel [here](https://github.com/shajen/monitor). ## Update -To update to latest version just update `docker-compose.yml`, images and run it. +To update to latest version just update git, images and run it. ``` cd ~/sdr docker compose down -rm docker-compose.yml -wget https://github.com/shajen/rtl-sdr-scanner-cpp/raw/master/docker-compose.yml +git pull docker compose pull docker compose up -d ``` diff --git a/docker-compose.yml b/docker-compose.yml index 07465ac..19592cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,37 +1,37 @@ services: - sdr-broker: - image: shajen/sdr-broker:${TAG:-latest} + broker: + image: shajen/broker:${BROKER_TAG:-latest} env_file: .define.env restart: on-failure ports: - ${MQTT_PORT_TCP:-1883}:${MQTT_PORT_TCP:-1883} - ${MQTT_PORT_WS:-9001}:${MQTT_PORT_WS:-9001} sdr-scanner: - image: shajen/sdr-scanner:${TAG:-latest} + image: shajen/sdr-scanner:${SDR_SCANNER_TAG:-latest} env_file: .define.env restart: on-failure depends_on: - - sdr-broker + - broker volumes: - - scanner_config:/config + - sdr_config:/config devices: - /dev/bus/usb:/dev/bus/usb - sdr-monitor-setup: - image: shajen/sdr-monitor:${TAG:-latest} + monitor-setup: + image: shajen/monitor:${MONITOR_TAG:-latest} env_file: .define.env restart: on-failure depends_on: - - sdr-broker + - broker volumes: - monitor_db:/usr/src/sdr-panel/db - monitor_data:/usr/src/sdr-panel/public/media command: /entrypoint/setup.sh - sdr-monitor-server: - image: shajen/sdr-monitor:${TAG:-latest} + monitor-server: + image: shajen/monitor:${MONITOR_TAG:-latest} env_file: .define.env restart: on-failure depends_on: - sdr-monitor-setup: + monitor-setup: condition: service_completed_successfully volumes: - monitor_db:/usr/src/sdr-panel/db @@ -39,18 +39,18 @@ services: command: /entrypoint/server.sh ports: - ${HTTP_PORT:-8000}:8000 - sdr-monitor-worker: - image: shajen/sdr-monitor:${TAG:-latest} + monitor-worker: + image: shajen/monitor:${MONITOR_TAG:-latest} env_file: .define.env restart: on-failure depends_on: - sdr-monitor-setup: + monitor-setup: condition: service_completed_successfully volumes: - monitor_db:/usr/src/sdr-panel/db - monitor_data:/usr/src/sdr-panel/public/media command: /entrypoint/worker.sh volumes: - scanner_config: + sdr_config: monitor_db: monitor_data: